mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
more fixes! I'm almost done!
This commit is contained in:
parent
60ad447eeb
commit
8919d8a9d5
16 changed files with 108 additions and 132 deletions
|
@ -38,7 +38,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.common.TargetOpponent;
|
||||
import mage.target.common.TargetOpponentOrPlaneswalker;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -56,9 +56,9 @@ public class BurningSunsAvatar extends CardImpl {
|
|||
|
||||
// When Burning Sun's Avatar enters the battlefield, it deals 3 damage to target opponent and 3 damage to up to one target creature.
|
||||
Effect effect = new DamageTargetEffect(3);
|
||||
effect.setText("it deals 3 damage to target opponent and 3 damage to up to one target creature");
|
||||
effect.setText("it deals 3 damage to target opponent or planeswalker and 3 damage to up to one target creature");
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false);
|
||||
ability.addTarget(new TargetOpponent());
|
||||
ability.addTarget(new TargetOpponentOrPlaneswalker());
|
||||
ability.addTarget(new TargetCreaturePermanent(0, 1));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ import mage.game.events.GameEvent;
|
|||
public class DivinePresence extends CardImpl {
|
||||
|
||||
public DivinePresence(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
||||
|
||||
// If a source would deal 4 or more damage to a creature or player, that source deals 3 damage to that creature or player instead.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DivinePresenceEffect()));
|
||||
|
@ -67,7 +67,7 @@ class DivinePresenceEffect extends ReplacementEffectImpl {
|
|||
|
||||
public DivinePresenceEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Neutral);
|
||||
staticText = "If a source would deal 4 or more damage to a creature or player, that source deals 3 damage to that creature or player instead.";
|
||||
staticText = "If a source would deal 4 or more damage to a permanent or player, that source deals 3 damage to that permanent or player instead.";
|
||||
}
|
||||
|
||||
public DivinePresenceEffect(final DivinePresenceEffect effect) {
|
||||
|
@ -81,9 +81,10 @@ class DivinePresenceEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
switch(event.getType()) {
|
||||
switch (event.getType()) {
|
||||
case DAMAGE_CREATURE:
|
||||
case DAMAGE_PLAYER:
|
||||
case DAMAGE_PLANESWALKER:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -47,7 +46,7 @@ import mage.game.events.GameEvent;
|
|||
public class EqualTreatment extends CardImpl {
|
||||
|
||||
public EqualTreatment(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}");
|
||||
|
||||
// If any source would deal 1 or more damage to a creature or player this turn, it deals 2 damage to that creature or player instead.
|
||||
this.getSpellAbility().addEffect(new EqualTreatmentEffect());
|
||||
|
@ -70,7 +69,7 @@ class EqualTreatmentEffect extends ReplacementEffectImpl {
|
|||
|
||||
public EqualTreatmentEffect() {
|
||||
super(Duration.EndOfTurn, Outcome.PreventDamage);
|
||||
staticText = "If any source would deal 1 or more damage to a creature or player this turn, it deals 2 damage to that creature or player instead";
|
||||
staticText = "If any source would deal 1 or more damage to a permanent or player this turn, it deals 2 damage to that permanent or player instead";
|
||||
}
|
||||
|
||||
public EqualTreatmentEffect(final EqualTreatmentEffect effect) {
|
||||
|
@ -85,7 +84,8 @@ class EqualTreatmentEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLAYER
|
||||
|| event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,7 +32,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsTargetOpponentControlsCount;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
@ -43,7 +42,7 @@ import mage.filter.common.FilterControlledCreaturePermanent;
|
|||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetOpponent;
|
||||
import mage.target.common.TargetOpponentOrPlaneswalker;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -52,11 +51,11 @@ import mage.target.common.TargetOpponent;
|
|||
public class GoblinLyre extends CardImpl {
|
||||
|
||||
public GoblinLyre(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
|
||||
// Sacrifice Goblin Lyre: Flip a coin. If you win the flip, Goblin Lyre deals damage to target opponent equal to the number of creatures you control. If you lose the flip, Goblin Lyre deals damage to you equal to the number of creatures that opponent controls.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GoblinLyreEffect(), new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetOpponent());
|
||||
ability.addTarget(new TargetOpponentOrPlaneswalker());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
@ -74,7 +73,8 @@ class GoblinLyreEffect extends OneShotEffect {
|
|||
|
||||
public GoblinLyreEffect() {
|
||||
super(Outcome.Damage);
|
||||
this.staticText = "Flip a coin. If you win the flip, {this} deals damage to target opponent equal to the number of creatures you control. If you lose the flip, {this} deals damage to you equal to the number of creatures that opponent controls";
|
||||
this.staticText = "Flip a coin. If you win the flip, {this} deals damage to target opponent or planeswalker equal to the number of creatures you control. "
|
||||
+ "If you lose the flip, Goblin Lyre deals damage to you equal to the number of creatures that opponent or that planeswalker’s controller controls";
|
||||
}
|
||||
|
||||
public GoblinLyreEffect(final GoblinLyreEffect effect) {
|
||||
|
@ -89,16 +89,16 @@ class GoblinLyreEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
Player opponent = game.getPlayerOrPlaneswalkerController(getTargetPointer().getFirst(game, source));
|
||||
if (controller != null) {
|
||||
if (controller.flipCoin(game)) {
|
||||
int damage = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()).calculate(game, source, this);
|
||||
if (opponent != null) {
|
||||
opponent.damage(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()).calculate(game, source, this), source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
return game.damagePlayerOrPlaneswalker(source.getFirstTarget(), damage, source.getSourceId(), game, false, true) > 0;
|
||||
}
|
||||
} else {
|
||||
controller.damage(new PermanentsTargetOpponentControlsCount(new FilterCreaturePermanent()).calculate(game, source, this), source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
int damage = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), opponent.getId(), game).size();
|
||||
return controller.damage(damage, source.getSourceId(), game, false, true) > 0;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -45,7 +45,7 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetPlayerOrPlaneswalker;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -77,7 +77,7 @@ class HeartOfBogardanTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
HeartOfBogardanTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new HeartOfBogardanEffect(), false);
|
||||
this.addTarget(new TargetPlayer());
|
||||
this.addTarget(new TargetPlayerOrPlaneswalker());
|
||||
}
|
||||
|
||||
HeartOfBogardanTriggeredAbility(final HeartOfBogardanTriggeredAbility ability) {
|
||||
|
@ -101,7 +101,10 @@ class HeartOfBogardanTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "When a player doesn't pay {this}'s cumulative upkeep, {this} deals X damage to target player and each creature he or she controls, where X is twice the number of age counters on {this} minus 2.";
|
||||
return "When a player doesn't pay {this}'s cumulative upkeep, "
|
||||
+ "{this} deals X damage to target player or planeswalker "
|
||||
+ "and each creature that player or that planeswalker’s controller controls,"
|
||||
+ " where X is twice the number of age counters on {this} minus 2.";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,7 +112,9 @@ class HeartOfBogardanEffect extends OneShotEffect {
|
|||
|
||||
public HeartOfBogardanEffect() {
|
||||
super(Outcome.Damage);
|
||||
staticText = "{this} deals X damage to target player and each creature he or she controls, where X is twice the number of age counters on {this} minus 2";
|
||||
staticText = "{this} deals X damage to target player or planeswalker "
|
||||
+ "and each creature that player or that planeswalker’s controller controls, "
|
||||
+ "where X is twice the number of age counters on {this} minus 2";
|
||||
}
|
||||
|
||||
public HeartOfBogardanEffect(final HeartOfBogardanEffect effect) {
|
||||
|
@ -118,13 +123,13 @@ class HeartOfBogardanEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
Player player = game.getPlayerOrPlaneswalkerController(source.getFirstTarget());
|
||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (player != null && sourcePermanent != null) {
|
||||
int damage = sourcePermanent.getCounters(game).getCount(CounterType.AGE) * 2 - 2;
|
||||
if (damage > 0) {
|
||||
int damage = sourcePermanent.getCounters(game).getCount(CounterType.AGE) * 2 - 2;
|
||||
if (damage > 0) {
|
||||
player.damage(damage, source.getSourceId(), game, false, true);
|
||||
for (Permanent perm: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) {
|
||||
for (Permanent perm : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) {
|
||||
perm.damage(damage, source.getSourceId(), game, false, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,8 +39,7 @@ import mage.constants.SubType;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetOpponent;
|
||||
import mage.target.common.TargetOpponentOrPlaneswalker;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -56,7 +55,7 @@ public class MoggManiac extends CardImpl {
|
|||
|
||||
// Whenever Mogg Maniac is dealt damage, it deals that much damage to target opponent.
|
||||
Ability ability = new DealtDamageToSourceTriggeredAbility(Zone.BATTLEFIELD, new MoggManiacDealDamageEffect(), false, false, true);
|
||||
ability.addTarget(new TargetOpponent());
|
||||
ability.addTarget(new TargetOpponentOrPlaneswalker());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
@ -74,7 +73,7 @@ class MoggManiacDealDamageEffect extends OneShotEffect {
|
|||
|
||||
public MoggManiacDealDamageEffect() {
|
||||
super(Outcome.Damage);
|
||||
this.staticText = "it deals that much damage to target opponent";
|
||||
this.staticText = "it deals that much damage to target opponent or planeswalker";
|
||||
}
|
||||
|
||||
public MoggManiacDealDamageEffect(final MoggManiacDealDamageEffect effect) {
|
||||
|
@ -90,11 +89,8 @@ class MoggManiacDealDamageEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
int amount = (Integer) getValue("damage");
|
||||
if (amount > 0) {
|
||||
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (opponent != null) {
|
||||
opponent.damage(amount, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
game.damagePlayerOrPlaneswalker(targetPointer.getFirst(game, source), amount, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -34,24 +33,21 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.common.TargetPlayerOrPlaneswalker;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
|
||||
public class PunishTheEnemy extends CardImpl {
|
||||
|
||||
public PunishTheEnemy(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{R}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{R}");
|
||||
|
||||
// Punish the Enemy deals 3 damage to target player and 3 damage to target creature.
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(3, true, "target player and 3 damage to target creature"));
|
||||
Target target = new TargetPlayer();
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(3, true, "target player or planeswalker and 3 damage to target creature"));
|
||||
Target target = new TargetPlayerOrPlaneswalker();
|
||||
this.getSpellAbility().addTarget(target);
|
||||
target = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(target);
|
||||
|
|
|
@ -48,7 +48,7 @@ import mage.util.CardUtil;
|
|||
public class PyromancersSwath extends CardImpl {
|
||||
|
||||
public PyromancersSwath(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
|
||||
|
||||
// If an instant or sorcery source you control would deal damage to a creature or player, it deals that much damage plus 2 to that creature or player instead.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PyromancersSwathReplacementEffect()));
|
||||
|
@ -72,26 +72,27 @@ class PyromancersSwathReplacementEffect extends ReplacementEffectImpl {
|
|||
|
||||
PyromancersSwathReplacementEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "If an instant or sorcery source you control would deal damage to a creature or player, it deals that much damage plus 2 to that creature or player instead";
|
||||
staticText = "If an instant or sorcery source you control would deal damage to a permanent or player, it deals that much damage plus 2 to that permanent or player instead";
|
||||
}
|
||||
|
||||
PyromancersSwathReplacementEffect(final PyromancersSwathReplacementEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
switch(event.getType()) {
|
||||
switch (event.getType()) {
|
||||
case DAMAGE_CREATURE:
|
||||
case DAMAGE_PLAYER:
|
||||
case DAMAGE_PLANESWALKER:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (source.getControllerId().equals(game.getControllerId(event.getSourceId()))) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
return object != null && (object.isInstant() || object.isSorcery());
|
||||
|
|
|
@ -50,7 +50,7 @@ import mage.filter.predicate.permanent.CounterPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetPlayerOrPlaneswalker;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -60,16 +60,16 @@ public class RageForger extends CardImpl {
|
|||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("other Shaman creature you control");
|
||||
private static final FilterControlledCreaturePermanent filterAttack = new FilterControlledCreaturePermanent("creature you control with a +1/+1 counter on it");
|
||||
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate(SubType.SHAMAN));
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter.add(new AnotherPredicate());
|
||||
filterAttack.add(new CounterPredicate(CounterType.P1P1));
|
||||
}
|
||||
|
||||
|
||||
public RageForger(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
this.subtype.add(SubType.SHAMAN);
|
||||
|
||||
|
@ -80,9 +80,9 @@ public class RageForger extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter), false));
|
||||
// Whenever a creature you control with a +1/+1 counter on it attacks, you may have that creature deal 1 damage to target player.
|
||||
Ability ability = new AttacksCreatureYouControlTriggeredAbility(new RageForgerDamageEffect(), true, filterAttack, true);
|
||||
ability.addTarget(new TargetPlayer());
|
||||
ability.addTarget(new TargetPlayerOrPlaneswalker());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public RageForger(final RageForger card) {
|
||||
|
@ -96,28 +96,27 @@ public class RageForger extends CardImpl {
|
|||
}
|
||||
|
||||
class RageForgerDamageEffect extends OneShotEffect {
|
||||
|
||||
|
||||
public RageForgerDamageEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "you may have that creature deal 1 damage to target player";
|
||||
this.staticText = "you may have that creature deal 1 damage to target player or planeswalker";
|
||||
}
|
||||
|
||||
|
||||
public RageForgerDamageEffect(final RageForgerDamageEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RageForgerDamageEffect copy() {
|
||||
return new RageForgerDamageEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||
Permanent attackingCreature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
if (controller != null && targetPlayer != null && attackingCreature != null) {
|
||||
targetPlayer.damage(1, attackingCreature.getId(), game, false, true);
|
||||
if (controller != null && attackingCreature != null) {
|
||||
game.damagePlayerOrPlaneswalker(source.getFirstTarget(), 1, attackingCreature.getId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -47,8 +47,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public class RaidBombardment extends CardImpl {
|
||||
|
||||
public RaidBombardment(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
|
||||
|
||||
// Whenever a creature you control with power 2 or less attacks, Raid Bombardment deals 1 damage to defending player.
|
||||
this.addAbility(new RaidBombardmentTriggeredAbility());
|
||||
|
@ -86,11 +85,11 @@ class RaidBombardmentTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (game.getActivePlayerId().equals(this.controllerId) ) {
|
||||
if (game.getActivePlayerId().equals(this.controllerId)) {
|
||||
Permanent attacker = game.getPermanent(event.getSourceId());
|
||||
if (attacker != null) {
|
||||
if (attacker.getPower().getValue() <= 2) {
|
||||
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(attacker.getId(), game);
|
||||
UUID defendingPlayerId = game.getCombat().getDefenderId(attacker.getId());
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(defendingPlayerId));
|
||||
return true;
|
||||
}
|
||||
|
@ -101,8 +100,7 @@ class RaidBombardmentTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a creature you control with power 2 or less attacks, {this} deals 1 damage to defending player.";
|
||||
return "Whenever a creature you control with power 2 or less attacks, {this} deals 1 damage to the player or planeswalker that creature is attacking.";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -49,12 +49,11 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.DragonToken2;
|
||||
import mage.game.permanent.token.TokenImpl;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.common.TargetPlayerOrPlaneswalker;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -63,7 +62,7 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
public class SarkhanTheMad extends CardImpl {
|
||||
|
||||
public SarkhanTheMad(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{3}{B}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{3}{B}{R}");
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.SARKHAN);
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(7));
|
||||
|
@ -76,7 +75,7 @@ public class SarkhanTheMad extends CardImpl {
|
|||
this.addAbility(sacAbility);
|
||||
|
||||
Ability damageAbility = new LoyaltyAbility(new SarkhanTheMadDragonDamageEffect(), -4);
|
||||
damageAbility.addTarget(new TargetPlayer());
|
||||
damageAbility.addTarget(new TargetPlayerOrPlaneswalker());
|
||||
this.addAbility(damageAbility);
|
||||
}
|
||||
|
||||
|
@ -162,7 +161,7 @@ class SarkhanTheMadSacEffect extends OneShotEffect {
|
|||
|
||||
class SarkhanTheMadDragonDamageEffect extends OneShotEffect {
|
||||
|
||||
private static final String effectText = "Each Dragon creature you control deals damage equal to its power to target player";
|
||||
private static final String effectText = "Each Dragon creature you control deals damage equal to its power to target player or planeswalker";
|
||||
private static final FilterControlledPermanent filter;
|
||||
|
||||
static {
|
||||
|
@ -183,10 +182,9 @@ class SarkhanTheMadDragonDamageEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
List<Permanent> dragons = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
|
||||
Player player = game.getPlayer(source.getTargets().getFirstTarget());
|
||||
if (player != null && dragons != null && !dragons.isEmpty()) {
|
||||
if (dragons != null && !dragons.isEmpty()) {
|
||||
for (Permanent dragon : dragons) {
|
||||
player.damage(dragon.getPower().getValue(), dragon.getId(), game, false, true);
|
||||
game.damagePlayerOrPlaneswalker(source.getFirstTarget(), dragon.getPower().getValue(), dragon.getId(), game, false, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -40,8 +40,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetPlayerOrPlaneswalker;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
|
@ -49,12 +48,12 @@ import mage.target.TargetPlayer;
|
|||
public class ScepterOfEmpires extends CardImpl {
|
||||
|
||||
public ScepterOfEmpires(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
|
||||
// {tap}: Scepter of Empires deals 1 damage to target player. It deals 3 damage to that player instead if you control artifacts named Crown of Empires and Throne of Empires.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScepterOfEmpiresEffect(), new GenericManaCost(0));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addTarget(new TargetPlayer());
|
||||
ability.addTarget(new TargetPlayerOrPlaneswalker());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
@ -72,7 +71,7 @@ class ScepterOfEmpiresEffect extends OneShotEffect {
|
|||
|
||||
public ScepterOfEmpiresEffect() {
|
||||
super(Outcome.PutCreatureInPlay);
|
||||
staticText = "Scepter of Empires deals 1 damage to target player. It deals 3 damage to that player instead if you control artifacts named Crown of Empires and Throne of Empires";
|
||||
staticText = "Scepter of Empires deals 1 damage to target player or planeswalker. It deals 3 damage to that player or planeswalker instead if you control artifacts named Crown of Empires and Throne of Empires";
|
||||
}
|
||||
|
||||
public ScepterOfEmpiresEffect(ScepterOfEmpiresEffect effect) {
|
||||
|
@ -89,17 +88,12 @@ class ScepterOfEmpiresEffect extends OneShotEffect {
|
|||
} else if (permanent.getName().equals("Crown of Empires")) {
|
||||
crown = true;
|
||||
}
|
||||
if (throne && crown) break;
|
||||
if (throne && crown) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int amount = throne && crown ? 3 : 1;
|
||||
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (player != null) {
|
||||
player.damage(amount, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return game.damagePlayerOrPlaneswalker(source.getFirstTarget(), amount, source.getSourceId(), game, false, true) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -45,8 +45,7 @@ import mage.filter.predicate.permanent.AnotherPredicate;
|
|||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetPlayerOrPlaneswalker;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -55,13 +54,14 @@ import mage.target.TargetPlayer;
|
|||
public class StalkingVengeance extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature you control");
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter.add(new AnotherPredicate());
|
||||
}
|
||||
|
||||
public StalkingVengeance(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{R}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}{R}");
|
||||
this.subtype.add(SubType.AVATAR);
|
||||
|
||||
this.power = new MageInt(5);
|
||||
|
@ -71,7 +71,7 @@ public class StalkingVengeance extends CardImpl {
|
|||
this.addAbility(HasteAbility.getInstance());
|
||||
// Whenever another creature you control dies, it deals damage equal to its power to target player.
|
||||
Ability ability = new DiesCreatureTriggeredAbility(new StalkingVengeanceDamageEffect(), false, filter, true);
|
||||
ability.addTarget(new TargetPlayer());
|
||||
ability.addTarget(new TargetPlayerOrPlaneswalker());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ class StalkingVengeanceDamageEffect extends OneShotEffect {
|
|||
|
||||
public StalkingVengeanceDamageEffect() {
|
||||
super(Outcome.Damage);
|
||||
this.staticText = "it deals damage equal to its power to target player";
|
||||
this.staticText = "it deals damage equal to its power to target player or planeswalker";
|
||||
}
|
||||
|
||||
public StalkingVengeanceDamageEffect(final StalkingVengeanceDamageEffect effect) {
|
||||
|
@ -103,13 +103,10 @@ class StalkingVengeanceDamageEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player targetPlayer = game.getPlayer(source.getTargets().getFirstTarget());
|
||||
if (targetPlayer != null) {
|
||||
Permanent creature = (Permanent) game.getLastKnownInformation(this.getTargetPointer().getFirst(game, source), Zone.BATTLEFIELD);
|
||||
if (creature != null) {
|
||||
targetPlayer.damage(creature.getPower().getValue(), creature.getId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
Permanent creature = (Permanent) game.getLastKnownInformation(this.getTargetPointer().getFirst(game, source), Zone.BATTLEFIELD);
|
||||
if (creature != null) {
|
||||
game.damagePlayerOrPlaneswalker(source.getFirstTarget(), creature.getPower().getValue(), creature.getId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.abilities.effects.common.GainLifeEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.target.common.TargetOpponent;
|
||||
import mage.target.common.TargetOpponentOrPlaneswalker;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -43,16 +43,16 @@ import mage.target.common.TargetOpponent;
|
|||
public class VampiricTouch extends CardImpl {
|
||||
|
||||
public VampiricTouch(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}");
|
||||
|
||||
// Vampiric Touch deals 2 damage to target opponent and you gain 2 life.
|
||||
Effect effect = new DamageTargetEffect(2);
|
||||
effect.setText("{this} deals 2 damage to target opponent");
|
||||
effect.setText("{this} deals 2 damage to target opponent or planeswalker");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
effect = new GainLifeEffect(2);
|
||||
effect.setText("and you gain 2 life");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addTarget(new TargetOpponent());
|
||||
this.getSpellAbility().addTarget(new TargetOpponentOrPlaneswalker());
|
||||
}
|
||||
|
||||
public VampiricTouch(final VampiricTouch card) {
|
||||
|
|
|
@ -44,8 +44,7 @@ import mage.constants.Duration;
|
|||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetPlayerOrPlaneswalker;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -65,7 +64,7 @@ public class VengefulArchon extends CardImpl {
|
|||
|
||||
// {X}: Prevent the next X damage that would be dealt to you this turn. If damage is prevented this way, Vengeful Archon deals that much damage to target player.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new VengefulArchonEffect(), new ManaCostsImpl("{X}"));
|
||||
ability.addTarget(new TargetPlayer());
|
||||
ability.addTarget(new TargetPlayerOrPlaneswalker());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
@ -84,7 +83,7 @@ class VengefulArchonEffect extends PreventDamageToControllerEffect {
|
|||
|
||||
public VengefulArchonEffect() {
|
||||
super(Duration.EndOfTurn, false, true, new ManacostVariableValue());
|
||||
staticText = "Prevent the next X damage that would be dealt to you this turn. If damage is prevented this way, {this} deals that much damage to target player";
|
||||
staticText = "Prevent the next X damage that would be dealt to you this turn. If damage is prevented this way, {this} deals that much damage to target player or planeswalker";
|
||||
}
|
||||
|
||||
public VengefulArchonEffect(final VengefulArchonEffect effect) {
|
||||
|
@ -101,10 +100,7 @@ class VengefulArchonEffect extends PreventDamageToControllerEffect {
|
|||
PreventionEffectData preventionEffectData = super.preventDamageAction(event, source, game);
|
||||
int damage = preventionEffectData.getPreventedDamage();
|
||||
if (damage > 0) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null) {
|
||||
player.damage(damage, source.getSourceId(), game, false, true);
|
||||
}
|
||||
game.damagePlayerOrPlaneswalker(source.getFirstTarget(), damage, source.getSourceId(), game, false, true);
|
||||
}
|
||||
return preventionEffectData;
|
||||
}
|
||||
|
|
|
@ -43,8 +43,7 @@ import mage.game.Game;
|
|||
import mage.game.events.DamagedCreatureEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetOpponent;
|
||||
import mage.target.common.TargetOpponentOrPlaneswalker;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -53,17 +52,17 @@ import mage.target.common.TargetOpponent;
|
|||
public class WallOfSouls extends CardImpl {
|
||||
|
||||
public WallOfSouls(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
|
||||
this.subtype.add(SubType.WALL);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Defender
|
||||
this.addAbility(DefenderAbility.getInstance());
|
||||
|
||||
|
||||
// Whenever Wall of Souls is dealt combat damage, it deals that much damage to target opponent.
|
||||
Ability ability = new WallOfSoulsTriggeredAbility();
|
||||
ability.addTarget(new TargetOpponent());
|
||||
ability.addTarget(new TargetOpponentOrPlaneswalker());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
@ -99,9 +98,9 @@ class WallOfSoulsTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getTargetId().equals(this.sourceId) && ((DamagedCreatureEvent)event).isCombatDamage()) {
|
||||
this.getEffects().get(0).setValue("damage", event.getAmount());
|
||||
return true;
|
||||
if (event.getTargetId().equals(this.sourceId) && ((DamagedCreatureEvent) event).isCombatDamage()) {
|
||||
this.getEffects().get(0).setValue("damage", event.getAmount());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -116,7 +115,7 @@ class WallOfSoulsDealDamageEffect extends OneShotEffect {
|
|||
|
||||
public WallOfSoulsDealDamageEffect() {
|
||||
super(Outcome.Damage);
|
||||
this.staticText = "it deals that much damage to target opponent";
|
||||
this.staticText = "it deals that much damage to target opponent or planeswalker";
|
||||
}
|
||||
|
||||
public WallOfSoulsDealDamageEffect(final WallOfSoulsDealDamageEffect effect) {
|
||||
|
@ -132,12 +131,8 @@ class WallOfSoulsDealDamageEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
int amount = (Integer) getValue("damage");
|
||||
if (amount > 0) {
|
||||
Player targetOpponent = game.getPlayer(source.getTargets().getFirstTarget());
|
||||
if (targetOpponent != null) {
|
||||
targetOpponent.damage(amount, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
return game.damagePlayerOrPlaneswalker(source.getFirstTarget(), amount, source.getSourceId(), game, false, true) > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue