From b1fc28db0dd6e7551526835f6d6e972ece691054 Mon Sep 17 00:00:00 2001 From: yuexin Date: Wed, 23 Dec 2020 13:21:16 +0800 Subject: [PATCH] =?UTF-8?q?petinfo=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/logic/Handler/PetHandler.ts | 46 +++++++++++++-------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/src/rooms/logic/Handler/PetHandler.ts b/src/rooms/logic/Handler/PetHandler.ts index 4ed6f04..b795b84 100644 --- a/src/rooms/logic/Handler/PetHandler.ts +++ b/src/rooms/logic/Handler/PetHandler.ts @@ -56,6 +56,9 @@ export class PetHandler { _hasreborned: boolean = false; + _orignEffCnt: number = 0; + _orignCardPoint: number = 0; + public init(apet: Pet, owner: PlayerHandler, index: number){ this._pet = apet; this._owner = owner; @@ -72,6 +75,11 @@ export class PetHandler { this._exredhurt = this._cfg.defense / 100; this._enmagic = this._cfg.spell_power; + if(param){ + this._orignCardPoint = param.cardpoint; + this._orignEffCnt = param.edd_cnt; + } + if(!param || !param.cardpoint){ this._baseap = this._cfg.powernum; }else{ @@ -456,19 +464,7 @@ export class PetHandler { }; public exportInfoMsg(): PetInfoMsg{ - let obj = new PetInfoMsg({ - id: this._id, - isHero: this._isHero, - ap: this._I(this._baseap), - extAp: this._I(this.getEffHaloV()), - pos: this._idx, - player: this._owner.getId(), - harmReduce: this._exredhurt, - skills: this._selfskills, - extSkills: this.getExSkills(), - em: this._enmagic, - silence: this._silentCD - }); + let obj = new PetInfoMsg(this.exportInfo()); return obj; }; @@ -482,17 +478,19 @@ export class PetHandler { public exportInfo(): PetInfo{ let obj = new PetInfo(); - obj.id = this._id, - obj.isHero = this._isHero, - obj.ap = this._I(this._baseap), - obj.extAp = this._I(this.getEffHaloV()), - obj.pos = this._idx, - obj.player = this._owner.getId(), - obj.harmReduce = this._exredhurt, - obj.skills = this._selfskills, - obj.extSkills = this.getExSkills(), - obj.em = this._enmagic, - obj.silence = this._silentCD + obj.id = this._id; + obj.isHero = this._isHero; + obj.ap = this._I(this._baseap); + obj.extAp = this._I(this.getEffHaloV()); + obj.pos = this._idx; + obj.player = this._owner.getId(); + obj.harmReduce = this._exredhurt; + obj.skills = this._selfskills; + obj.extSkills = this.getExSkills(); + obj.em = this._enmagic; + obj.silence = this._silentCD; + obj.effectCount = this._orignEffCnt; + obj.point = this._orignCardPoint; return obj; };