From 1836361b5873e9d64c8efa5b74029c40519428c6 Mon Sep 17 00:00:00 2001 From: yuexin Date: Wed, 9 Dec 2020 21:20:30 +0800 Subject: [PATCH] =?UTF-8?q?ap=E5=8F=96=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/logic/Handler/PetHandler.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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();