-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,087 additions
and
134 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
configs/* | ||
configs/* | ||
db-export |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
const Skill = require('./skill'); | ||
|
||
const SendingBehavior = require('./skill/attack-sending-behavior'); | ||
const ReceivingBehavior = require('./skill/attack-receiving-behavior'); | ||
|
||
/** | ||
* Skill action. | ||
*/ | ||
class LairTrick extends Skill | ||
{ | ||
/** | ||
* Get action ID. | ||
* @return {string} | ||
*/ | ||
getId() { | ||
return "lair-trick-skill"; | ||
} | ||
|
||
/** | ||
* Get action master name. | ||
* @return {string} | ||
*/ | ||
getNames() { | ||
return [ | ||
"lair-trick", | ||
"小白的騙術", | ||
"小白騙術", | ||
"騙術", | ||
"小白大騙子", | ||
"大騙子", | ||
]; | ||
} | ||
|
||
/** | ||
* Get skill name. (should same as skill class file name) | ||
* @return {string} standard name | ||
*/ | ||
getSkillName() { | ||
return "lair-trick" | ||
} | ||
|
||
/** | ||
* Get sending behavior. | ||
* @return {SendingBehavior} | ||
*/ | ||
getSendingBehavior() { | ||
return SendingBehavior; | ||
} | ||
|
||
/** | ||
* Get receiving behavior. | ||
* @return {ReceivingBehavior} | ||
*/ | ||
getReceivingBehavior() { | ||
return ReceivingBehavior | ||
} | ||
} | ||
|
||
module.exports = LairTrick; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const Skill = require('./skill'); | ||
|
||
const SendingBehavior = require('./skill/attack-sending-behavior'); | ||
const ReceivingBehavior = require('./skill/attack-receiving-behavior'); | ||
|
||
/** | ||
* Skill action. | ||
*/ | ||
class StickAttack extends Skill | ||
{ | ||
/** | ||
* Get action ID. | ||
* @return {string} | ||
*/ | ||
getId() { | ||
return "stick-attack-skill"; | ||
} | ||
|
||
/** | ||
* Get action master name. | ||
* @return {string} | ||
*/ | ||
getNames() { | ||
return [ | ||
"stick-attack", | ||
"木棒攻擊", | ||
"木棒敲", | ||
]; | ||
} | ||
|
||
/** | ||
* Get skill name. (should same as skill class file name) | ||
* @return {string} standard name | ||
*/ | ||
getSkillName() { | ||
return "stick-attack" | ||
} | ||
|
||
/** | ||
* Get sending behavior. | ||
* @return {SendingBehavior} | ||
*/ | ||
getSendingBehavior() { | ||
return SendingBehavior; | ||
} | ||
|
||
/** | ||
* Get receiving behavior. | ||
* @return {ReceivingBehavior} | ||
*/ | ||
getReceivingBehavior() { | ||
return ReceivingBehavior | ||
} | ||
} | ||
|
||
module.exports = StickAttack; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
const Action = require('./action'); | ||
|
||
/** | ||
* Summon action. | ||
*/ | ||
class Summon extends Action | ||
{ | ||
/** | ||
* Constructor | ||
* @param context | ||
*/ | ||
constructor(context) { | ||
super(context); | ||
} | ||
|
||
/** | ||
* Get action ID. | ||
* @return {string} | ||
*/ | ||
getId() { | ||
return "summon-old"; | ||
} | ||
|
||
/** | ||
* Get action master name. | ||
* @return {string} | ||
*/ | ||
getNames() { | ||
return [ | ||
// "summon", | ||
// "召喚", | ||
]; | ||
} | ||
|
||
/** | ||
* Execute action for child class implement | ||
* @param from | ||
* @param to | ||
* @param args | ||
*/ | ||
async handler(from, to, args) { | ||
const characterService = this.context.getService('character-service'); | ||
|
||
const player = await characterService.getById(from.characterId); | ||
if (!player) { | ||
this.writeMsg(`抓到了吼~你還沒加入!\n輸入 /join {角色名稱} 加入這個美好相殘的故事八`); | ||
return this; | ||
} | ||
|
||
// TODO refactor method, static value | ||
|
||
let level = args[0] || 15; | ||
if(isNaN(level)) { | ||
level = 15; | ||
} | ||
level = parseInt(level); | ||
if(level < 0 || level > 10000) { | ||
level = 15 | ||
} | ||
|
||
level -= 1; | ||
|
||
const monster = await characterService.new('monster', {level: level}); | ||
|
||
this.writeMsg(`${player.getName()} 成功召喚了一隻極為兇猛的怪物 !!`) | ||
.writeMsg(`其偉大的名字為...「${monster.getName()}」!!!`) | ||
.sendMsg() | ||
.writeMsg(`${monster.getId()}`) | ||
} | ||
} | ||
|
||
module.exports = Summon; |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Game base object. | ||
*/ | ||
class GameObject | ||
{ | ||
/** | ||
* Constructor | ||
* @param context {GameEngine} | ||
*/ | ||
constructor(context) { | ||
this.context = context; | ||
} | ||
|
||
} | ||
|
||
|
||
module.exports = GameObject; |
Empty file.
Empty file.
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
Oops, something went wrong.