mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Expanded DoUnlessTargetPlayerOrTargetsControllerPaysEffect
This commit is contained in:
parent
5c48d54916
commit
aa7231bec0
1 changed files with 14 additions and 0 deletions
|
@ -50,6 +50,7 @@ import mage.util.CardUtil;
|
||||||
public class DoUnlessTargetPlayerOrTargetsControllerPaysEffect extends OneShotEffect {
|
public class DoUnlessTargetPlayerOrTargetsControllerPaysEffect extends OneShotEffect {
|
||||||
|
|
||||||
protected Effects executingEffects = new Effects();
|
protected Effects executingEffects = new Effects();
|
||||||
|
private Effect otherwiseEffect;
|
||||||
private Cost cost;
|
private Cost cost;
|
||||||
private DynamicValue genericMana;
|
private DynamicValue genericMana;
|
||||||
private String chooseUseText;
|
private String chooseUseText;
|
||||||
|
@ -59,8 +60,13 @@ public class DoUnlessTargetPlayerOrTargetsControllerPaysEffect extends OneShotEf
|
||||||
}
|
}
|
||||||
|
|
||||||
public DoUnlessTargetPlayerOrTargetsControllerPaysEffect(Effect effect, Cost cost, String chooseUseText) {
|
public DoUnlessTargetPlayerOrTargetsControllerPaysEffect(Effect effect, Cost cost, String chooseUseText) {
|
||||||
|
this(effect, null, cost, chooseUseText);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DoUnlessTargetPlayerOrTargetsControllerPaysEffect(Effect effect, Effect otherwiseEffect, Cost cost, String chooseUseText) {
|
||||||
super(Outcome.Detriment);
|
super(Outcome.Detriment);
|
||||||
this.executingEffects.add(effect);
|
this.executingEffects.add(effect);
|
||||||
|
this.otherwiseEffect = otherwiseEffect;
|
||||||
this.cost = cost;
|
this.cost = cost;
|
||||||
this.chooseUseText = chooseUseText;
|
this.chooseUseText = chooseUseText;
|
||||||
}
|
}
|
||||||
|
@ -74,6 +80,7 @@ public class DoUnlessTargetPlayerOrTargetsControllerPaysEffect extends OneShotEf
|
||||||
public DoUnlessTargetPlayerOrTargetsControllerPaysEffect(final DoUnlessTargetPlayerOrTargetsControllerPaysEffect effect) {
|
public DoUnlessTargetPlayerOrTargetsControllerPaysEffect(final DoUnlessTargetPlayerOrTargetsControllerPaysEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
this.executingEffects = effect.executingEffects.copy();
|
this.executingEffects = effect.executingEffects.copy();
|
||||||
|
this.otherwiseEffect = effect.otherwiseEffect;
|
||||||
if (effect.cost != null) {
|
if (effect.cost != null) {
|
||||||
this.cost = effect.cost.copy();
|
this.cost = effect.cost.copy();
|
||||||
}
|
}
|
||||||
|
@ -135,6 +142,13 @@ public class DoUnlessTargetPlayerOrTargetsControllerPaysEffect extends OneShotEf
|
||||||
game.addEffect((ContinuousEffect) effect, source);
|
game.addEffect((ContinuousEffect) effect, source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (otherwiseEffect != null) {
|
||||||
|
otherwiseEffect.setTargetPointer(this.targetPointer);
|
||||||
|
if (otherwiseEffect instanceof OneShotEffect) {
|
||||||
|
result &= otherwiseEffect.apply(game, source);
|
||||||
|
} else {
|
||||||
|
game.addEffect((ContinuousEffect) otherwiseEffect, source);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue