1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-02 03:18:09 -09:00
This commit is contained in:
jeffwadsworth 2020-01-03 14:26:30 -06:00
parent c39bfad63c
commit c876f6145f

View file

@ -18,7 +18,6 @@ import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.target.TargetPermanent;
import java.util.UUID;
@ -48,7 +47,8 @@ public final class GargosViciousWatcher extends CardImpl {
// Hydra spells you cast cost {4} less to cast.
this.addAbility(new SimpleStaticAbility(new SpellsCostReductionControllerEffect(filter, 4)));
// Whenever a creature you control becomes the target of a spell, Gargos, Vicious Watcher fights up to one target creature you don't control.
// Whenever a creature you control becomes the target of a spell, Gargos,
// Vicious Watcher fights up to one target creature you don't control.
this.addAbility(new GargosViciousWatcherTriggeredAbility());
}
@ -92,18 +92,20 @@ class GargosViciousWatcherTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent permanent = game.getPermanent(event.getTargetId());
MageObject object = game.getObject(event.getSourceId());
if (permanent == null
|| object == null
|| !permanent.isControlledBy(this.controllerId)
|| !permanent.isCreature()) {
return false;
}
MageObject object = game.getObject(event.getSourceId());
return object instanceof Spell;
return object.isInstantOrSorcery(); // must specify a type of spell
}
@Override
public String getRule() {
return "Whenever a creature you control becomes the target of a spell, " +
"{this} fights up to one target creature you don't control.";
return "Whenever a creature you control becomes the target of a spell, "
+ "{this} fights up to one target creature you don't control.";
}
}