增加更新英雄hp的命令
This commit is contained in:
parent
a7a988ca75
commit
016b71153a
@ -19,6 +19,9 @@ export class GMCommand extends Command<CardGameState, {client: Client, message:
|
|||||||
case 'draw':
|
case 'draw':
|
||||||
this.drawCard(arr[1]);
|
this.drawCard(arr[1]);
|
||||||
break;
|
break;
|
||||||
|
case 'herohp':
|
||||||
|
this.updateHeroHp(arr[1]);
|
||||||
|
break;
|
||||||
case 'help':
|
case 'help':
|
||||||
this.sendHelp(client, arr[1]);
|
this.sendHelp(client, arr[1]);
|
||||||
break;
|
break;
|
||||||
@ -34,6 +37,7 @@ export class GMCommand extends Command<CardGameState, {client: Client, message:
|
|||||||
str += '将一个玩家的手牌全变成指定的效果卡: changeeffect:玩家index|效果卡id 例: changeeffect:0|20011 \n';
|
str += '将一个玩家的手牌全变成指定的效果卡: changeeffect:玩家index|效果卡id 例: changeeffect:0|20011 \n';
|
||||||
str += '将牌组中的卡全部变成指定的效果卡: changequeue:效果卡id 例: changequeue:20011 \n';
|
str += '将牌组中的卡全部变成指定的效果卡: changequeue:效果卡id 例: changequeue:20011 \n';
|
||||||
str += '抽一定数量的卡, 注意类型和效果id的搭配: draw:玩家index|数量|类型|效果id|点数 例: draw:0|3 or draw:0|1|1|20011|2 \n';
|
str += '抽一定数量的卡, 注意类型和效果id的搭配: draw:玩家index|数量|类型|效果id|点数 例: draw:0|3 or draw:0|1|1|20011|2 \n';
|
||||||
|
str += '更新英雄血量: herohp:玩家index|血量 例: herohp:0|500 \n';
|
||||||
client.send('notice_msg', str);
|
client.send('notice_msg', str);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -102,6 +106,19 @@ export class GMCommand extends Command<CardGameState, {client: Client, message:
|
|||||||
extData.number = parseInt(arr[4]);
|
extData.number = parseInt(arr[4]);
|
||||||
}
|
}
|
||||||
this.room.addCard(player.id, count, 0, 2, null, extData);
|
this.room.addCard(player.id, count, 0, 2, null, extData);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新英雄血量
|
||||||
|
* @param msg
|
||||||
|
* herohp:玩家index|血量
|
||||||
|
* herohp:0|500
|
||||||
|
*/
|
||||||
|
updateHeroHp(msg: string) {
|
||||||
|
let arr = msg.split('|');
|
||||||
|
let playerIdx = parseInt(arr[0]);
|
||||||
|
let player = this.getPlayerByIdx(playerIdx);
|
||||||
|
let count = parseInt(arr[1]);
|
||||||
|
this.room.updateHp(player.id, count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user