forked from External/mage
Create common class for "when target dies this turn" delayed triggers (#9722)
Fixes #9716. Fixes #9719.
This commit is contained in:
parent
afb7d75007
commit
10d7acb4b5
74 changed files with 397 additions and 1628 deletions
|
|
@ -14,28 +14,28 @@ public class CreateDelayedTriggeredAbilityEffect extends OneShotEffect {
|
|||
|
||||
protected DelayedTriggeredAbility ability;
|
||||
protected boolean copyTargets;
|
||||
protected boolean initAbility;
|
||||
protected String rulePrefix;
|
||||
|
||||
public CreateDelayedTriggeredAbilityEffect(DelayedTriggeredAbility ability) {
|
||||
this(ability, true);
|
||||
}
|
||||
|
||||
public CreateDelayedTriggeredAbilityEffect(DelayedTriggeredAbility ability, boolean copyTargets) {
|
||||
this(ability, copyTargets, false);
|
||||
this(ability, copyTargets, "");
|
||||
}
|
||||
|
||||
public CreateDelayedTriggeredAbilityEffect(DelayedTriggeredAbility ability, boolean copyTargets, boolean initAbility) {
|
||||
public CreateDelayedTriggeredAbilityEffect(DelayedTriggeredAbility ability, boolean copyTargets, String rulePrefix) {
|
||||
super(ability.getEffects().getOutcome(ability));
|
||||
this.ability = ability;
|
||||
this.copyTargets = copyTargets;
|
||||
this.initAbility = initAbility;
|
||||
this.rulePrefix = rulePrefix;
|
||||
}
|
||||
|
||||
public CreateDelayedTriggeredAbilityEffect(final CreateDelayedTriggeredAbilityEffect effect) {
|
||||
super(effect);
|
||||
this.ability = effect.ability.copy();
|
||||
this.copyTargets = effect.copyTargets;
|
||||
this.initAbility = effect.initAbility;
|
||||
this.rulePrefix = effect.rulePrefix;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -56,9 +56,6 @@ public class CreateDelayedTriggeredAbilityEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (initAbility) {
|
||||
delayedAbility.init(game);
|
||||
}
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -69,7 +66,7 @@ public class CreateDelayedTriggeredAbilityEffect extends OneShotEffect {
|
|||
return staticText;
|
||||
}
|
||||
if (ability.getRuleVisible()) {
|
||||
return ability.getRule();
|
||||
return rulePrefix + ability.getRule();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue