diff --git a/src/rooms/logic/Handler/PetHandler.ts b/src/rooms/logic/Handler/PetHandler.ts index dfc5757..8fb31cf 100644 --- a/src/rooms/logic/Handler/PetHandler.ts +++ b/src/rooms/logic/Handler/PetHandler.ts @@ -56,13 +56,15 @@ export class PetHandler { this._baseap = param.cardpoint; if(this._cfg.powernum_typeid == PowerValueType.RATIO){ this._baseap *= this._cfg.powernum; - this._baseap = Math.ceil(this._baseap); } } if(param && param.edd_cnt && this._isEnhancePower(this._cfg.edd_effid)){ this._baseap += CfgMan.calcEnhanceValue(this._cfg.edd_effid, this._cfg.edd_effnum, param.edd_cnt, this._baseap); } + + this._ceilBaseAP(); + this._skills.clear(); this.addSkill(this._cfg.base_skill1id); @@ -78,6 +80,10 @@ export class PetHandler { this.born(param); }; + private _ceilBaseAP(){ + this._baseap = Math.ceil(this._baseap); + }; + private _isEnhancePower(enid: number){ return enid == EnhanceEffectType.EN_POWER_BYCFG || enid == EnhanceEffectType.EN_POWER_BYAP; }; @@ -192,6 +198,7 @@ export class PetHandler { } if(n < 0){ this._baseap += n; + this._ceilBaseAP(); } this.dataChanged(); if(this._baseap < 0){ @@ -205,6 +212,7 @@ export class PetHandler { return 0; } this._baseap += value; + this._ceilBaseAP(); this.dataChanged(); if(this._baseap < 0){ this.die();