ap取整
This commit is contained in:
parent
9d5c16a377
commit
1836361b58
@ -56,13 +56,15 @@ export class PetHandler {
|
|||||||
this._baseap = param.cardpoint;
|
this._baseap = param.cardpoint;
|
||||||
if(this._cfg.powernum_typeid == PowerValueType.RATIO){
|
if(this._cfg.powernum_typeid == PowerValueType.RATIO){
|
||||||
this._baseap *= this._cfg.powernum;
|
this._baseap *= this._cfg.powernum;
|
||||||
this._baseap = Math.ceil(this._baseap);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(param && param.edd_cnt && this._isEnhancePower(this._cfg.edd_effid)){
|
if(param && param.edd_cnt && this._isEnhancePower(this._cfg.edd_effid)){
|
||||||
this._baseap += CfgMan.calcEnhanceValue(this._cfg.edd_effid, this._cfg.edd_effnum,
|
this._baseap += CfgMan.calcEnhanceValue(this._cfg.edd_effid, this._cfg.edd_effnum,
|
||||||
param.edd_cnt, this._baseap);
|
param.edd_cnt, this._baseap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._ceilBaseAP();
|
||||||
|
|
||||||
this._skills.clear();
|
this._skills.clear();
|
||||||
|
|
||||||
this.addSkill(this._cfg.base_skill1id);
|
this.addSkill(this._cfg.base_skill1id);
|
||||||
@ -78,6 +80,10 @@ export class PetHandler {
|
|||||||
this.born(param);
|
this.born(param);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private _ceilBaseAP(){
|
||||||
|
this._baseap = Math.ceil(this._baseap);
|
||||||
|
};
|
||||||
|
|
||||||
private _isEnhancePower(enid: number){
|
private _isEnhancePower(enid: number){
|
||||||
return enid == EnhanceEffectType.EN_POWER_BYCFG || enid == EnhanceEffectType.EN_POWER_BYAP;
|
return enid == EnhanceEffectType.EN_POWER_BYCFG || enid == EnhanceEffectType.EN_POWER_BYAP;
|
||||||
};
|
};
|
||||||
@ -192,6 +198,7 @@ export class PetHandler {
|
|||||||
}
|
}
|
||||||
if(n < 0){
|
if(n < 0){
|
||||||
this._baseap += n;
|
this._baseap += n;
|
||||||
|
this._ceilBaseAP();
|
||||||
}
|
}
|
||||||
this.dataChanged();
|
this.dataChanged();
|
||||||
if(this._baseap < 0){
|
if(this._baseap < 0){
|
||||||
@ -205,6 +212,7 @@ export class PetHandler {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
this._baseap += value;
|
this._baseap += value;
|
||||||
|
this._ceilBaseAP();
|
||||||
this.dataChanged();
|
this.dataChanged();
|
||||||
if(this._baseap < 0){
|
if(this._baseap < 0){
|
||||||
this.die();
|
this.die();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user