吸血处理
This commit is contained in:
parent
f1ddeb7b38
commit
74925e8768
@ -729,8 +729,7 @@ export class BattleHandler {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public onPlayerDropCardNotify(aplayer: PlayerHandler, count: number, from?: PlayerHandler): number{
|
public onPlayerDropCardNotify(aplayer: PlayerHandler, count: number, from?: PlayerHandler): number{
|
||||||
this._room.giveUpCard(aplayer.getId(), count);
|
return this._room.giveUpCard(aplayer.getId(), count);
|
||||||
return count;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public onSkillResultNotify(skillres: SkillTarget[]){
|
public onSkillResultNotify(skillres: SkillTarget[]){
|
||||||
|
@ -466,6 +466,14 @@ export class PetHandler {
|
|||||||
return this._isSilent;
|
return this._isSilent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public canHPS(){
|
||||||
|
return this._hps > 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
public HPS(value: number): number{
|
||||||
|
return this._hps * Math.abs(value);
|
||||||
|
};
|
||||||
|
|
||||||
public summonPet(petid: number, count: number = 1, exparam: SkillParam):number{
|
public summonPet(petid: number, count: number = 1, exparam: SkillParam):number{
|
||||||
return this._owner.summonPet(petid, count, exparam);
|
return this._owner.summonPet(petid, count, exparam);
|
||||||
};
|
};
|
||||||
|
@ -462,8 +462,14 @@ export class Skill {
|
|||||||
if(dthp != 0){
|
if(dthp != 0){
|
||||||
tgt.success(SkillEffectType.HURT_HP, dthp);
|
tgt.success(SkillEffectType.HURT_HP, dthp);
|
||||||
}
|
}
|
||||||
if(!this.canEM()){
|
let hv = n + dthp;
|
||||||
//todo: 吸血
|
let pet = tgt.srcPet();
|
||||||
|
if(!this.canEM() && hv != 0 && pet && pet.canHPS()){
|
||||||
|
//吸血
|
||||||
|
let sv = pet.HPS(hv);
|
||||||
|
if(sv != 0){
|
||||||
|
tgt.success(SkillEffectType.HURT_POWER, sv, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
tgt.fail(efftype, -1);
|
tgt.fail(efftype, -1);
|
||||||
@ -674,9 +680,9 @@ export class Skill {
|
|||||||
let obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer;
|
let obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer;
|
||||||
let v = effvalue;
|
let v = effvalue;
|
||||||
let oldhp = tgt.dst.getHP();
|
let oldhp = tgt.dst.getHP();
|
||||||
let res = obj.attack(this, (tgt.dst as PetHandler), param, v, isAtkBack);
|
let n = obj.attack(this, (tgt.dst as PetHandler), param, v, isAtkBack);
|
||||||
if(res <= 0){
|
if(n <= 0){
|
||||||
tgt.success(efftype, res);
|
tgt.success(efftype, n);
|
||||||
// if(this._data.quoteskillid){
|
// if(this._data.quoteskillid){
|
||||||
// let dp = this._data.skill_users? param.oppClone(): param;
|
// let dp = this._data.skill_users? param.oppClone(): param;
|
||||||
// let pet = tgt.srcpet;
|
// let pet = tgt.srcpet;
|
||||||
@ -689,8 +695,14 @@ export class Skill {
|
|||||||
if(dthp != 0){
|
if(dthp != 0){
|
||||||
tgt.success(SkillEffectType.HURT_HP, dthp);
|
tgt.success(SkillEffectType.HURT_HP, dthp);
|
||||||
}
|
}
|
||||||
if(!this.canEM()){
|
let hv = n + dthp;
|
||||||
//todo: 吸血
|
let pet = tgt.srcPet();
|
||||||
|
if(!this.canEM() && hv != 0 && pet && pet.canHPS()){
|
||||||
|
//吸血
|
||||||
|
let sv = pet.HPS(hv);
|
||||||
|
if(sv != 0){
|
||||||
|
tgt.success(SkillEffectType.HURT_POWER, sv, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
tgt.fail(efftype, -1);
|
tgt.fail(efftype, -1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user