This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Riddle { | |
static resRiddle() { | |
return [{ | |
type: 'text', | |
content: 'Having a sharp mind is not enough to be a jedi, you also need to prove your strength and bravery!', | |
}, { | |
type: 'text', | |
content: 'Master Yoda gets an old dusty map from his sleeve, with a location marking the nest of a terrible monster.', | |
}, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*you will use the class Combat to send the right message during the fight on Dagobah*/ | |
class Combat { | |
static winCombat() { | |
return [{ | |
type: 'text', | |
content: 'That last attack was a fatal blow... You can hear the scream of the monster', | |
}, { | |
type: 'text', | |
content: 'You just defeated one of the greatest creatures of all time! Well done Padawan', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Combat = require('../formatServices/Combat.js') | |
const Conversation = require('recastai').Conversation | |
const config = require('../../config') | |
/*this code will make all the rand to creat a dynamique fight and will call the memory of the bot to see if the battle is over*/ | |
function handleBattle(entities, myHp, monsterHp, senderID) { | |
return new Promise(resolve => { | |
const random = Math.round(Math.random() * (3 - 1) + 1) | |
let damage = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Space = require('../formatServices/Space.js') | |
const Conversation = require('recastai').Conversation | |
const config = require('../../config') | |
/* this code will make all the rand to creat a dynamique fight and will call the memory of the bot to see if the battle is over */ | |
function handeleSpaceBattle(entities, myHp, monsterHp, senderID, planet) { | |
return new Promise(resolve => { | |
const randome = Math.round(Math.random() * (3 - 1) + 1) | |
let damage = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*you will use the class Space to send the right message during the space fight*/ | |
class Space { | |
static initCombat() { | |
return [{ | |
type: 'text', | |
content: 'You just disobeyed your master, one step closer to the dark side you get...', | |
}, { | |
type: 'text', | |
content: 'On your way out of Coruscant, a head hunter starts taking you down 💥💥', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* send back text and quick reply*/ | |
function trainingMessage() { | |
return [{ | |
type: 'text', | |
content: 'After a two hours trip, you land on Dagobah, the swamp-covered planet, to meet one of the oldest jedi of the galaxy: master Yoda.', | |
}, { | |
type: 'picture', | |
content: 'http://www.phoenixisrisen.co.uk/wp-content/uploads/2015/04/dagobah.jpg', | |
}, { | |
type: 'text', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* send back the quick reply to make the good choose*/ | |
function choseTraing() { | |
return [{ | |
type: 'text', | |
content: 'Great choice! I just received a message from an old jedi living as a hermit on the planet Dagobah, looking for a new padawan!', | |
}, { | |
type: 'quickReplies', | |
content: { | |
title: 'Do you want to go on Dagobah to meet him? Or use your new ship to explore space?', | |
buttons: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Send back a carouselle of sapce ship*/ | |
function carouselSpaceShip() { | |
return [{ | |
type: 'text', | |
content: 'Nice!', | |
}, { | |
type: 'text', | |
content: 'To continue this space adventure, you need a spaceship! Which one would you like?', | |
}, { | |
type: 'carouselle', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*this function will return a array of message to send to bot-connector*/ | |
function initConversation() { | |
return [{ | |
type: 'text', | |
content: 'Welcome to Coruscant!', | |
}, { | |
type: 'text', | |
content: 'In this interactive adventure, each one of your answers will greatly impact your adventure.\nI will be your guide, so follow my instructions and everything will be fine', | |
}, { | |
type: 'audio', |