mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
* Transform abilities - fixed duplicated triggered abilities from transformed permanents;
* Accursed Witch // Infectious Curse - fixed wrong cost modification effect (#6684);
This commit is contained in:
parent
1045f352bc
commit
0824d2901a
6 changed files with 102 additions and 36 deletions
|
|
@ -30,7 +30,7 @@ public class ApplyCountersEffect extends ContinuousEffectImpl {
|
|||
if (layer == Layer.AbilityAddingRemovingEffects_6) {
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents()) {
|
||||
for (AbilityCounter counter : permanent.getCounters(game).getAbilityCounters()) {
|
||||
permanent.addAbility(counter.getAbility(), source == null ? null : source.getSourceId(), game);
|
||||
permanent.addAbility(counter.getAbility(), source == null ? permanent.getId() : source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,9 @@ public class TransformAbility extends SimpleStaticAbility {
|
|||
permanent.setExpansionSetCode(sourceCard.getExpansionSetCode());
|
||||
permanent.getAbilities().clear();
|
||||
for (Ability ability : sourceCard.getAbilities()) {
|
||||
permanent.addAbility(ability, source == null ? null : source.getSourceId(), game);
|
||||
// source == null -- call from init card (e.g. own abilities)
|
||||
// source != null -- from apply effect
|
||||
permanent.addAbility(ability, source == null ? permanent.getId() : source.getSourceId(), game);
|
||||
}
|
||||
permanent.getPower().modifyBaseValue(sourceCard.getPower().getValue());
|
||||
permanent.getToughness().modifyBaseValue(sourceCard.getToughness().getValue());
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ public class PermanentToken extends PermanentImpl {
|
|||
this.abilities.addAll(token.getAbilities());
|
||||
} else {
|
||||
// first time -> create ContinuousEffects only once
|
||||
// so sourceId must be null (keep triggered abilities forever?)
|
||||
for (Ability ability : token.getAbilities()) {
|
||||
this.addAbility(ability, null, game);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue