add player to petinfomsg

This commit is contained in:
yuexin 2020-12-04 17:18:43 +08:00
parent 1008d2aa07
commit 4d4169c32d
3 changed files with 7 additions and 2 deletions

View File

@ -275,10 +275,10 @@ export class BattleHandler {
};
public onPlayerAddCard(aplayer: PlayerHandler, count: number, maxcount: number){
return this._room.addCard(aplayer._player.heroId + '', count, maxcount);
return this._room.addCard(aplayer.getId(), count, maxcount);
};
public onPlayerStealCard(srcplayer: PlayerHandler, dstplayer: PlayerHandler, count: number){
return this._room.drawCardFromPlayer(srcplayer._player.heroId + '', dstplayer._player.heroId + '', count);
return this._room.drawCardFromPlayer(srcplayer.getId(), dstplayer.getId(), count);
};
}

View File

@ -170,6 +170,7 @@ export class PetHandler {
ap: this._baseap,
extAp: this._exap,
pos: this._idx,
player: this._owner.getId(),
harmReduce: this._exredhurt,
skills: this._selfskills,
extSkills: this._exskills

View File

@ -49,6 +49,10 @@ export class PlayerHandler {
return 0;
};
public getId(): string{
return this._player.heroId + '';
};
public newPet(): PetHandler {
let res = null;
let pr = null;