forked from External/mage
[Minor] Cleanup to some cards.
This commit is contained in:
parent
5881cbf665
commit
ab5638f2bb
3 changed files with 26 additions and 96 deletions
|
|
@ -28,20 +28,15 @@
|
|||
package mage.sets.betrayersofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.ZoneChangeAllTriggeredAbility;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -59,7 +54,9 @@ public class AkkiRaider extends CardImpl<AkkiRaider> {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever a land is put into a graveyard from the battlefield, Akki Raider gets +1/+0 until end of turn.
|
||||
this.addAbility(new AkkiRaiderTriggeredAbility(new BoostSourceEffect(1,0,Duration.EndOfTurn)));
|
||||
this.addAbility(new ZoneChangeAllTriggeredAbility(Zone.BATTLEFIELD, Zone.BATTLEFIELD, Zone.GRAVEYARD,
|
||||
new BoostSourceEffect(1,0,Duration.EndOfTurn), new FilterLandPermanent(),
|
||||
"Whenever a land is put into a graveyard from the battlefield, ", false));
|
||||
}
|
||||
|
||||
public AkkiRaider(final AkkiRaider card) {
|
||||
|
|
@ -71,42 +68,4 @@ public class AkkiRaider extends CardImpl<AkkiRaider> {
|
|||
return new AkkiRaider(this);
|
||||
}
|
||||
|
||||
private class AkkiRaiderTriggeredAbility extends TriggeredAbilityImpl<AkkiRaiderTriggeredAbility> {
|
||||
|
||||
public AkkiRaiderTriggeredAbility(Effect effect) {
|
||||
super(Zone.BATTLEFIELD, effect, false);
|
||||
}
|
||||
|
||||
public AkkiRaiderTriggeredAbility(final AkkiRaiderTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE
|
||||
&& ((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD
|
||||
&& ((ZoneChangeEvent)event).getFromZone() == Zone.BATTLEFIELD) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent == null) {
|
||||
permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
}
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.LAND)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a land is put into a graveyard from the battlefield, " + super.getRule();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AkkiRaiderTriggeredAbility copy() {
|
||||
return new AkkiRaiderTriggeredAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,17 +28,14 @@
|
|||
package mage.sets.mirrodinbesieged;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.ZoneChangeAllTriggeredAbility;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.filter.common.FilterArtifactPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -55,7 +52,10 @@ public class FangrenMarauder extends CardImpl<FangrenMarauder> {
|
|||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
this.addAbility(new FangrenMarauderTriggeredAbility());
|
||||
// Whenever an artifact is put into a graveyard from the battlefield, you may gain 5 life.
|
||||
this.addAbility(new ZoneChangeAllTriggeredAbility(Zone.BATTLEFIELD, Zone.BATTLEFIELD, Zone.GRAVEYARD,
|
||||
new GainLifeEffect(5), new FilterArtifactPermanent(),
|
||||
"Whenever an enchantment is put into a graveyard from the battlefield, ", true));
|
||||
}
|
||||
|
||||
public FangrenMarauder(final FangrenMarauder card) {
|
||||
|
|
@ -67,37 +67,3 @@ public class FangrenMarauder extends CardImpl<FangrenMarauder> {
|
|||
return new FangrenMarauder(this);
|
||||
}
|
||||
}
|
||||
|
||||
class FangrenMarauderTriggeredAbility extends TriggeredAbilityImpl<FangrenMarauderTriggeredAbility> {
|
||||
|
||||
public FangrenMarauderTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new GainLifeEffect(5), true);
|
||||
}
|
||||
|
||||
public FangrenMarauderTriggeredAbility(final FangrenMarauderTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == EventType.ZONE_CHANGE) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD
|
||||
&& zEvent.getToZone() == Zone.GRAVEYARD
|
||||
&& zEvent.getTarget().getCardType().contains(CardType.ARTIFACT)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever an artifact is put into a graveyard from the battlefield, you may gain 5 life.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public FangrenMarauderTriggeredAbility copy() {
|
||||
return new FangrenMarauderTriggeredAbility(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,10 @@ public class MyrBattlesphere extends CardImpl<MyrBattlesphere> {
|
|||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(7);
|
||||
|
||||
// When Myr Battlesphere enters the battlefield, put four 1/1 colorless Myr artifact creature tokens onto the battlefield.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new MyrToken(), 4), false));
|
||||
|
||||
// Whenever Myr Battlesphere attacks, you may tap X untapped Myr you control. If you do, Myr Battlesphere gets +X/+0 until end of turn and deals X damage to defending player.
|
||||
this.addAbility(new MyrBattlesphereAbility());
|
||||
}
|
||||
|
||||
|
|
@ -106,10 +109,12 @@ class MyrBattlesphereAbility extends TriggeredAbilityImpl<MyrBattlesphereAbility
|
|||
|
||||
@Override
|
||||
public boolean checkInterveningIfClause(Game game) {
|
||||
if (costs.isPaid())
|
||||
if (costs.isPaid()) {
|
||||
return true;
|
||||
if (costs.canPay(this.getId(), this.getControllerId(), game))
|
||||
}
|
||||
if (costs.canPay(this.getId(), this.getControllerId(), game)) {
|
||||
return costs.pay(this, game, this.getId(), this.getControllerId(), false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -124,7 +129,7 @@ class MyrBattlesphereAbility extends TriggeredAbilityImpl<MyrBattlesphereAbility
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "When {this} attacks, " + super.getRule();
|
||||
return "Whenever {this} attacks, " + super.getRule();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -164,4 +169,4 @@ class MyrBattlesphereEffect extends OneShotEffect<MyrBattlesphereEffect> {
|
|||
return new MyrBattlesphereEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue