mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Fix - target pointer should be set from wrapper effects.
This commit is contained in:
parent
c9ddaac961
commit
c8b6dde3d9
3 changed files with 7 additions and 0 deletions
|
@ -48,8 +48,10 @@ public class ConditionalContinousEffect extends ContinuousEffectImpl<Conditional
|
|||
@Override
|
||||
public boolean apply(Constants.Layer layer, Constants.SubLayer sublayer, Ability source, Game game) {
|
||||
if (condition.apply(game, source)) {
|
||||
effect.setTargetPointer(this.targetPointer);
|
||||
return effect.apply(layer, sublayer, source, game);
|
||||
} else if (otherwiseEffect != null) {
|
||||
otherwiseEffect.setTargetPointer(this.targetPointer);
|
||||
return otherwiseEffect.apply(layer, sublayer, source, game);
|
||||
}
|
||||
return false;
|
||||
|
@ -58,8 +60,10 @@ public class ConditionalContinousEffect extends ContinuousEffectImpl<Conditional
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (condition.apply(game, source)) {
|
||||
effect.setTargetPointer(this.targetPointer);
|
||||
return effect.apply(game, source);
|
||||
} else if (otherwiseEffect != null) {
|
||||
otherwiseEffect.setTargetPointer(this.targetPointer);
|
||||
return otherwiseEffect.apply(game, source);
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -67,8 +67,10 @@ public class ConditionalOneShotEffect extends OneShotEffect<ConditionalOneShotEf
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (condition.apply(game, source)) {
|
||||
effect.setTargetPointer(this.targetPointer);
|
||||
return effect.apply(game, source);
|
||||
} else if (otherwiseEffect != null) {
|
||||
otherwiseEffect.setTargetPointer(this.targetPointer);
|
||||
return otherwiseEffect.apply(game, source);
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -31,6 +31,7 @@ public class DoIfCostPaid extends OneShotEffect<DoIfCostPaid> {
|
|||
if (player.chooseUse(executingEffect.getOutcome(), "Pay " + cost.getText() + " and " + executingEffect.getText(source.getModes().getMode()), game)) {
|
||||
cost.clearPaid();
|
||||
if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) {
|
||||
executingEffect.setTargetPointer(this.targetPointer);
|
||||
return executingEffect.apply(game, source);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue