Merge branch 'second' of git.kingsome.cn:node/card_svr into second

This commit is contained in:
zhl 2021-01-08 19:56:56 +08:00
commit 631d352199
4 changed files with 12 additions and 1 deletions

View File

@ -467,6 +467,7 @@ export class BattleHandler {
this.checkPets(this._cachePets);
this._cachePets.length = 0;
}, nt);
nt += 100;
}else{
this.onUpdatePets(this._cachePets, null);
this.checkPets(this._cachePets);

View File

@ -403,6 +403,10 @@ export class PetHandler {
this._owner.onPetDied(this);
};
public canAttack(){
return this._bakTotalap? true: this.totalAP() > 0;
};
public attack(sk: Skill, apet: PetHandler, param: SkillParam, ev: number = 0, isAtkBack: boolean = false){
!isAtkBack && this._owner.onAttackBefore(this, param);

View File

@ -389,6 +389,10 @@ export class PlayerHandler {
this._self && this._self.taunt();
};
public canAttack(){
return this._self? this._self.canAttack(): false;
};
public canBeKill(subhp: number): boolean{
if(subhp >= 0){
return false;

View File

@ -348,7 +348,8 @@ export class Skill {
let ncount = this.getFinalValue(EnhanceCustomType.RELEASE_TIMES, this._data.release_times,
this._data.release_timesmax, param.edd_cnt, true);
let sp;
if(param.srcpet != this._petowner){
// if(param.srcpet != this._petowner){
if(false){
sp = param.clone();
sp.srcpet = this._petowner;
sp.srcplayer = sp.srcpet._owner;
@ -690,6 +691,7 @@ export class Skill {
let v = effvalue;
let oldhp = tgt.dst.getHP();
let dst = tgt.dsttype == GameUnitType.PLAYER? (tgt.dst as PlayerHandler)._self: (tgt.dst as PetHandler);
// let n = obj.canAttack()? obj.attack(this, dst, param, v, isAtkBack): 1;
let n = obj.attack(this, dst, param, v, isAtkBack);
if(n <= 0){
tgt.success(SkillEffectType.HURT_POWER, n);