create an artificial layer for ability changing that depends on condition, fixes #447
parent
7ba64fda16
commit
86df942684
|
@ -498,6 +498,7 @@ public class MagicPermanent extends MagicObjectImpl implements MagicSource,Magic
|
|||
cachedColorFlags = mstatic.getColorFlags(this, cachedColorFlags);
|
||||
break;
|
||||
case Ability:
|
||||
case AbilityCond:
|
||||
mstatic.modAbilityFlags(source, this, cachedAbilityFlags);
|
||||
break;
|
||||
case SetPT:
|
||||
|
|
|
@ -10,6 +10,7 @@ public enum MagicLayer {
|
|||
CDAColor, //5a. CDA color
|
||||
Color, //5b. color changing
|
||||
Ability, //6. ability adding/removing
|
||||
AbilityCond, //6b. ability adding/removing that depends on condition
|
||||
CDAPT, //7a. CDA p/t
|
||||
SetPT, //7b. set p/t to specific value
|
||||
ModPT, //7c. modify p/t
|
||||
|
|
|
@ -174,7 +174,7 @@ public abstract class MagicStatic extends MagicDummyModifier implements MagicCha
|
|||
}
|
||||
|
||||
public static MagicStatic genABStatic(final MagicCondition condition, final MagicTargetFilter<MagicPermanent> filter, final MagicAbilityList abilityList) {
|
||||
return new MagicStatic(MagicLayer.Ability, filter) {
|
||||
return new MagicStatic(MagicLayer.AbilityCond, filter) {
|
||||
@Override
|
||||
public void modAbilityFlags(final MagicPermanent source, final MagicPermanent permanent, final Set<MagicAbility> flags) {
|
||||
abilityList.giveAbility(permanent, flags);
|
||||
|
@ -187,7 +187,7 @@ public abstract class MagicStatic extends MagicDummyModifier implements MagicCha
|
|||
}
|
||||
|
||||
public static MagicStatic genABStatic(final MagicCondition condition, final MagicAbilityList abilityList) {
|
||||
return new MagicStatic(MagicLayer.Ability) {
|
||||
return new MagicStatic(MagicLayer.AbilityCond) {
|
||||
@Override
|
||||
public void modAbilityFlags(final MagicPermanent source, final MagicPermanent permanent, final Set<MagicAbility> flags) {
|
||||
abilityList.giveAbility(permanent, flags);
|
||||
|
|
Loading…
Reference in New Issue