修订光环不起效问题

This commit is contained in:
yuexin 2021-01-04 17:44:37 +08:00
parent 9a9b144580
commit e1cbcf3789
3 changed files with 20 additions and 10 deletions

View File

@ -544,13 +544,11 @@ export class BattleHandler {
return 0;
}
// this.beginFlow('onCardLinkReady');
this.beginFlow('onCardLinkReady');
ph.onCardLinkReady(fromph);
// return this.endFlow('onCardLinkReady');
return 0;
return this.endFlow('onCardLinkReady');
};
/**

View File

@ -517,7 +517,7 @@ export class PetHandler {
public addEffHalo(apet: PetHandler): boolean{
let bok = false;
this._halos.forEach((item: Skill)=>{
if(item.isEffSelfPet(this, apet)){
if(item.canEffect(this, apet)){
if(item.isAPHaloSkill()){
bok = true;
if(apet._addEffHalo(item)){

View File

@ -134,7 +134,7 @@ export class Skill {
return this._data.rangeid == SkillRangeUnitType.ALL;
};
isInRange(srcpet: PetHandler, dstpet: PetHandler){
isInRange(srcpet: PetHandler, dstpet: PetHandler, exself: boolean){
switch(this._data.rangeid){
case SkillRangeUnitType.SELF:
return srcpet == dstpet;
@ -145,28 +145,40 @@ export class Skill {
case SkillRangeUnitType.ALL:
return true;
case SkillRangeUnitType.ALL_EXSELF:
case SkillRangeUnitType.RANDOM_ONE_EXSELF:
return srcpet != dstpet;
case SkillRangeUnitType.RANDOM_ONE:
return !!dstpet;
case SkillRangeUnitType.OWNER:
return dstpet == this._petowner;
case SkillRangeUnitType.ALL_EXOWNER:
case SkillRangeUnitType.RANDOM_ONE_EXOWNER:
return dstpet != this._petowner;
case SkillRangeUnitType.MAXAP_ONE:
return dstpet == this._owner.getMaxAPPet(exself);
case SkillRangeUnitType.MINAP_ONE:
return dstpet == this._owner.getMinAPPet(exself);
default:
return false;
}
};
// 是否能影响自己
isEffSelfPet(srcpet: PetHandler, dstpet: PetHandler){
// 技能光环是否能影响dst
canEffect(srcpet: PetHandler, dstpet: PetHandler){
if(this._data.friendlyid != GameCampType.SELF){
return false;
}
let tgok = false;
switch(this._data.targetid){
case GameUnitType.BATTLEUNIT:
tgok = this.isInRange(srcpet, dstpet);
tgok = this.isInRange(srcpet, dstpet, false);
break;
case GameUnitType.HERO:
tgok = dstpet._isHero;
break;
case GameUnitType.PET:
if(!dstpet._isHero){
tgok = this.isInRange(srcpet, dstpet);
tgok = this.isInRange(srcpet, dstpet, true);
}
break;
default: