mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
implement [MH3] Aether Revolt
This commit is contained in:
parent
66d215c9eb
commit
be72a5bba6
3 changed files with 147 additions and 0 deletions
136
Mage.Sets/src/mage/cards/a/AetherRevolt.java
Normal file
136
Mage.Sets/src/mage/cards/a/AetherRevolt.java
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.RevoltCondition;
|
||||
import mage.abilities.decorator.ConditionalReplacementEffect;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamageEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetAnyTarget;
|
||||
import mage.util.CardUtil;
|
||||
import mage.watchers.common.RevoltWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Susucr
|
||||
*/
|
||||
public final class AetherRevolt extends CardImpl {
|
||||
|
||||
public AetherRevolt(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}{R}");
|
||||
|
||||
// Revolt -- As long as a permanent you controlled left the battlefield this turn, if a source you control would deal noncombat damage to an opponent or a permanent an opponent controls, it deals that much damage plus 2 instead.
|
||||
this.addAbility(new SimpleStaticAbility(new ConditionalReplacementEffect(
|
||||
new AetherRevoltEffect(), RevoltCondition.instance
|
||||
).setText("As long as a permanent you controlled left the battlefield this turn, "
|
||||
+ "if a source you control would deal noncombat damage to an opponent or a permanent an opponent controls, "
|
||||
+ "it deals that much damage plus 2 instead")
|
||||
).setAbilityWord(AbilityWord.REVOLT).addHint(RevoltCondition.getHint()), new RevoltWatcher());
|
||||
|
||||
// Whenever you get one or more {E}, Aether Revolt deals that much damage to any target.
|
||||
this.addAbility(new AetherRevoltTriggeredAbility());
|
||||
}
|
||||
|
||||
private AetherRevolt(final AetherRevolt card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AetherRevolt copy() {
|
||||
return new AetherRevolt(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AetherRevoltEffect extends ReplacementEffectImpl {
|
||||
|
||||
AetherRevoltEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "if a source you control would deal noncombat damage to an opponent or a permanent an opponent controls, " +
|
||||
"it deals that much damage plus 2 instead";
|
||||
}
|
||||
|
||||
private AetherRevoltEffect(final AetherRevoltEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AetherRevoltEffect copy() {
|
||||
return new AetherRevoltEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT
|
||||
|| event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
return source.isControlledBy(game.getControllerId(event.getSourceId()))
|
||||
&& !((DamageEvent) event).isCombatDamage()
|
||||
&& (player.hasOpponent(event.getTargetId(), game)
|
||||
|| player.hasOpponent(game.getControllerId(event.getTargetId()), game));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
event.setAmount(CardUtil.overflowInc(event.getAmount(), 2));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class AetherRevoltTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
AetherRevoltTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, null, false);
|
||||
this.addTarget(new TargetAnyTarget());
|
||||
}
|
||||
|
||||
private AetherRevoltTriggeredAbility(final AetherRevoltTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AetherRevoltTriggeredAbility copy() {
|
||||
return new AetherRevoltTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.COUNTERS_ADDED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (!event.getData().equals(CounterType.ENERGY.getName())
|
||||
|| !getControllerId().equals(event.getTargetId())) {
|
||||
return false;
|
||||
}
|
||||
int amount = event.getAmount();
|
||||
if (amount <= 0) {
|
||||
return false;
|
||||
}
|
||||
this.getEffects().clear();
|
||||
this.getEffects().add(new DamageTargetEffect(amount));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever you get one or more {E}, {this} deals that much damage to any target.";
|
||||
}
|
||||
}
|
||||
|
|
@ -23,6 +23,7 @@ public final class ModernHorizons3 extends ExpansionSet {
|
|||
|
||||
cards.add(new SetCardInfo("Accursed Marauder", 80, Rarity.COMMON, mage.cards.a.AccursedMarauder.class));
|
||||
cards.add(new SetCardInfo("Aerie Auxiliary", 18, Rarity.COMMON, mage.cards.a.AerieAuxiliary.class));
|
||||
cards.add(new SetCardInfo("Aether Revolt", 113, Rarity.RARE, mage.cards.a.AetherRevolt.class));
|
||||
cards.add(new SetCardInfo("Aether Spike", 50, Rarity.COMMON, mage.cards.a.AetherSpike.class));
|
||||
cards.add(new SetCardInfo("Ajani Fells the Godsire", 19, Rarity.UNCOMMON, mage.cards.a.AjaniFellsTheGodsire.class));
|
||||
cards.add(new SetCardInfo("Ajani, Nacatl Avenger", 237, Rarity.MYTHIC, mage.cards.a.AjaniNacatlAvenger.class));
|
||||
|
|
|
|||
|
|
@ -3,16 +3,26 @@ package mage.abilities.condition.common;
|
|||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.hint.ConditionHint;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.game.Game;
|
||||
import mage.watchers.common.RevoltWatcher;
|
||||
|
||||
/**
|
||||
* Needs RevoltWatcher to work.
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
public enum RevoltCondition implements Condition {
|
||||
|
||||
instance;
|
||||
|
||||
private static final Hint hint = new ConditionHint(instance);
|
||||
|
||||
public static Hint getHint() {
|
||||
return hint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
RevoltWatcher watcher = game.getState().getWatcher(RevoltWatcher.class);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue