Reverting changes to Guerrilla Tactics as it works now

This commit is contained in:
magenoxx 2014-08-12 21:20:08 +04:00
parent 5ec0b656bb
commit 018498598c

View file

@ -27,9 +27,6 @@
*/ */
package mage.sets.ninthedition; package mage.sets.ninthedition;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -38,9 +35,10 @@ import mage.constants.Rarity;
import mage.constants.Zone; 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.stack.StackObject;
import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreatureOrPlayer;
import java.util.UUID;
/** /**
* *
* @author dustinconrad * @author dustinconrad
@ -88,16 +86,9 @@ class GuerrillaTacticsTriggeredAbility extends TriggeredAbilityImpl {
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (GameEvent.EventType.DISCARDED_CARD.equals(event.getType()) return GameEvent.EventType.DISCARDED_CARD.equals(event.getType()) &&
&& event.getSourceId() != null // can be null if e.g. discard down to hand limit game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) &&
&& event.getTargetId().equals(getSourceId()) getSourceId().equals(event.getTargetId());
&& event.getPlayerId().equals(getControllerId())) {
MageObject mageObject = game.getObject(event.getSourceId());
if (mageObject != null && (mageObject instanceof StackObject)) {
return game.getOpponents(this.getControllerId()).contains(((StackObject)mageObject).getControllerId());
}
}
return false;
} }
@Override @Override