From add941c9ce665c6a92be0b50fd797e48ba835c47 Mon Sep 17 00:00:00 2001 From: yuexin Date: Tue, 5 Jan 2021 11:16:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=80=E8=83=BD=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/logic/skill/Skill.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/rooms/logic/skill/Skill.ts b/src/rooms/logic/skill/Skill.ts index 84d0d31..1399989 100644 --- a/src/rooms/logic/skill/Skill.ts +++ b/src/rooms/logic/skill/Skill.ts @@ -259,12 +259,12 @@ export class Skill { } }; - _triggerSubSkill(param: SkillParam, sts: SkillTarget[], cb?: any){ - if(this._data.quoteskillid && !this._subskill){ - this._subskill = this._owner.newSkill(this._data.quoteskillid); - this._subskill.setOrignParam(this._orign_effcnt, this._orign_cardpt, this._sender, this._petowner); + _triggerSubSkill(skillid: number, sk: Skill, param: SkillParam, sts: SkillTarget[], cb?: any){ + if(skillid && !sk){ + sk = this._owner.newSkill(this._data.quoteskillid); + sk.setOrignParam(this._orign_effcnt, this._orign_cardpt, this._sender, this._petowner); } - if(this._subskill){ + if(sk){ let pl = []; let bst = false; switch(this._data.skill_usersid){ @@ -311,7 +311,7 @@ export class Skill { for(let j = 0; j < pl.length; j++){ let sp = pl[j]; let st = bst? sts[j]: null; - this._subskill._trigger(sp, cb, st); + sk._trigger(sp, cb, st); } } } @@ -331,7 +331,7 @@ export class Skill { this._cb && this._cb(this, param, res); - this._triggerSubSkill(param, res, cb); + this._triggerSubSkill(this._data.quoteskillid, this._subskill, param, res, cb); }; trigger(param: SkillParam, cb?: any) { @@ -693,7 +693,7 @@ export class Skill { let v = effvalue; let oldhp = tgt.dst.getHP(); let n = obj.attack(this, (tgt.dst as PetHandler), param, v, isAtkBack); - if(n <= 0){ + { tgt.success(efftype, n); // if(this._data.quoteskillid){ // let dp = this._data.skill_users? param.oppClone(): param; @@ -716,8 +716,6 @@ export class Skill { tgt.success(SkillEffectType.HURT_POWER, sv, true); } } - }else{ - tgt.fail(efftype, -1); } }else{ tgt.fail(efftype, -1);