* Orim's Prayer - fixed that it accumulated effects instead one trigger;

* Frenzied Fugue - fixed that it accumulated effects instead one trigger;
This commit is contained in:
Oleg Agafonov 2019-05-19 23:00:54 +04:00
parent f1e204408f
commit 83df2dd75b
2 changed files with 13 additions and 16 deletions

View file

@ -1,7 +1,5 @@
package mage.cards.f; package mage.cards.f;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
@ -13,11 +11,7 @@ import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
@ -25,6 +19,8 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/** /**
* @author LevelX2 * @author LevelX2
*/ */
@ -77,8 +73,9 @@ class FrenziedFugueTriggeredAbility extends TriggeredAbilityImpl {
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
this.getEffects().clear();
boolean result; boolean result;
if (event.getType()==EventType.ENTERS_THE_BATTLEFIELD) { if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) {
result = event.getTargetId().equals(this.getSourceId()); result = event.getTargetId().equals(this.getSourceId());
} else { } else {
result = event.getPlayerId().equals(this.getControllerId()); result = event.getPlayerId().equals(this.getControllerId());
@ -88,13 +85,13 @@ class FrenziedFugueTriggeredAbility extends TriggeredAbilityImpl {
if (enchantment != null && enchantment.getAttachedTo() != null) { if (enchantment != null && enchantment.getAttachedTo() != null) {
Effect effect = new GainControlTargetEffect(Duration.EndOfTurn, true); Effect effect = new GainControlTargetEffect(Duration.EndOfTurn, true);
effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo(), game)); effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo(), game));
getEffects().add(effect); this.getEffects().add(effect);
effect = new UntapTargetEffect(); effect = new UntapTargetEffect();
effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo(), game)); effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo(), game));
getEffects().add(effect); this.getEffects().add(effect);
effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo(), game)); effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo(), game));
getEffects().add(effect); this.getEffects().add(effect);
} else { } else {
result = false; result = false;
} }

View file

@ -1,6 +1,5 @@
package mage.cards.o; package mage.cards.o;
import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -13,8 +12,9 @@ import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import java.util.UUID;
/** /**
*
* @author L_J * @author L_J
*/ */
public final class OrimsPrayer extends CardImpl { public final class OrimsPrayer extends CardImpl {
@ -73,8 +73,8 @@ class OrimsPrayerTriggeredAbility extends TriggeredAbilityImpl {
applied = true; applied = true;
} }
} }
if (applied if (applied && numberAttackingController > 0) {
&& numberAttackingController > 0) { this.getEffects().clear();
this.getEffects().add(new GainLifeEffect(numberAttackingController)); this.getEffects().add(new GainLifeEffect(numberAttackingController));
} }
return applied; return applied;