mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
parent
f1cfc8ca5c
commit
2f9ece1a41
2 changed files with 6 additions and 10 deletions
|
|
@ -28,9 +28,8 @@
|
||||||
package mage.abilities.effects.common.combat;
|
package mage.abilities.effects.common.combat;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
@ -61,12 +60,9 @@ public class GoadAllEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) {
|
for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) {
|
||||||
if (!creature.getControllerId().equals(source.getControllerId())) {
|
if (!creature.getControllerId().equals(source.getControllerId())) {
|
||||||
ContinuousEffect effect = new AttacksIfAbleTargetEffect(Duration.UntilYourNextTurn);
|
Effect effect = new GoadTargetEffect();
|
||||||
effect.setTargetPointer(new FixedTarget(creature.getId()));
|
effect.setTargetPointer(new FixedTarget(creature, game));
|
||||||
game.addEffect(effect, source);
|
effect.apply(game, source);
|
||||||
effect = new CantAttackYouEffect(Duration.UntilYourNextTurn, true);
|
|
||||||
effect.setTargetPointer(new FixedTarget(creature.getId()));
|
|
||||||
game.addEffect(effect, source);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ public class GoadTargetEffect extends OneShotEffect {
|
||||||
ContinuousEffect effect = new AttacksIfAbleTargetEffect(Duration.UntilYourNextTurn);
|
ContinuousEffect effect = new AttacksIfAbleTargetEffect(Duration.UntilYourNextTurn);
|
||||||
effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
||||||
game.addEffect(effect, source);
|
game.addEffect(effect, source);
|
||||||
effect = new CantAttackYouEffect(Duration.UntilYourNextTurn, true);
|
effect = new CantAttackYouEffect(Duration.EndOfTurn, true);
|
||||||
effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
||||||
game.addEffect(effect, source);
|
game.addEffect(effect, source);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue