mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
- Added Outmaneuver and Antagonism.
This commit is contained in:
parent
9d8d623341
commit
27b2fed8ce
3 changed files with 162 additions and 0 deletions
64
Mage.Sets/src/mage/cards/a/Antagonism.java
Normal file
64
Mage.Sets/src/mage/cards/a/Antagonism.java
Normal file
|
@ -0,0 +1,64 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.Game;
|
||||
import mage.watchers.common.BloodthirstWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class Antagonism extends CardImpl {
|
||||
|
||||
private static final String rule = "{this} deals 2 damage to that player unless one of his or her opponents was dealt damage this turn";
|
||||
|
||||
public Antagonism(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}");
|
||||
|
||||
// At the beginning of each player's end step, Antagonism deals 2 damage to that player unless one of his or her opponents was dealt damage this turn.
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(new ConditionalOneShotEffect(new DamageTargetEffect(2),
|
||||
new OpponentWasNotDealtDamageCondition(), rule), TargetController.ANY, false));
|
||||
|
||||
}
|
||||
|
||||
public Antagonism(final Antagonism card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Antagonism copy() {
|
||||
return new Antagonism(this);
|
||||
}
|
||||
}
|
||||
|
||||
class OpponentWasNotDealtDamageCondition implements Condition {
|
||||
|
||||
public OpponentWasNotDealtDamageCondition() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
UUID activePlayer = game.getState().getActivePlayerId();
|
||||
if (activePlayer != null) {
|
||||
BloodthirstWatcher watcher = (BloodthirstWatcher) game.getState().getWatchers().get(BloodthirstWatcher.class.getSimpleName(), activePlayer);
|
||||
if (watcher != null) {
|
||||
return !watcher.conditionMet();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "if an opponent was dealt damage this turn";
|
||||
}
|
||||
}
|
96
Mage.Sets/src/mage/cards/o/Outmaneuver.java
Normal file
96
Mage.Sets/src/mage/cards/o/Outmaneuver.java
Normal file
|
@ -0,0 +1,96 @@
|
|||
package mage.cards.o;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.effects.AsThoughEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.BlockedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class Outmaneuver extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(new BlockedPredicate());
|
||||
}
|
||||
|
||||
public Outmaneuver(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{R}");
|
||||
|
||||
// X target blocked creatures assign their combat damage this turn as though they weren't blocked.
|
||||
this.getSpellAbility().addEffect(new OutmaneuverEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
|
||||
|
||||
}
|
||||
|
||||
public Outmaneuver(final Outmaneuver card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Outmaneuver copy() {
|
||||
return new Outmaneuver(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability instanceof SpellAbility) {
|
||||
ability.getTargets().clear();
|
||||
int numberOfTargets = ability.getManaCostsToPay().getX();
|
||||
numberOfTargets = Math.min(game.getBattlefield().getAllActivePermanents(filter,
|
||||
ability.getControllerId(), game).size(), numberOfTargets);
|
||||
ability.addTarget(new TargetCreaturePermanent(numberOfTargets,
|
||||
numberOfTargets, filter, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class OutmaneuverEffect extends AsThoughEffectImpl {
|
||||
|
||||
public OutmaneuverEffect() {
|
||||
super(AsThoughEffectType.DAMAGE_NOT_BLOCKED, Duration.EndOfTurn, Outcome.Damage);
|
||||
this.staticText = "X target blocked creatures assign their combat damage this turn as though they weren't blocked.";
|
||||
}
|
||||
|
||||
public OutmaneuverEffect(OutmaneuverEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
|
||||
Permanent blockedCreature = game.getPermanent(sourceId);
|
||||
if (blockedCreature != null) {
|
||||
Player controller = game.getPlayer(blockedCreature.getControllerId());
|
||||
if (controller != null) {
|
||||
return controller.chooseUse(Outcome.Damage, "Do you wish to assign combat damage for "
|
||||
+ blockedCreature.getLogName() + " as though it weren't blocked?", source, game);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OutmaneuverEffect copy() {
|
||||
return new OutmaneuverEffect(this);
|
||||
}
|
||||
}
|
|
@ -37,6 +37,7 @@ public final class UrzasSaga extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Angelic Chorus", 3, Rarity.RARE, mage.cards.a.AngelicChorus.class));
|
||||
cards.add(new SetCardInfo("Angelic Page", 4, Rarity.COMMON, mage.cards.a.AngelicPage.class));
|
||||
cards.add(new SetCardInfo("Annul", 59, Rarity.COMMON, mage.cards.a.Annul.class));
|
||||
cards.add(new SetCardInfo("Antagonism", 173, Rarity.RARE, mage.cards.a.Antagonism.class));
|
||||
cards.add(new SetCardInfo("Arcane Laboratory", 60, Rarity.UNCOMMON, mage.cards.a.ArcaneLaboratory.class));
|
||||
cards.add(new SetCardInfo("Arc Lightning", 174, Rarity.COMMON, mage.cards.a.ArcLightning.class));
|
||||
cards.add(new SetCardInfo("Argothian Elder", 233, Rarity.UNCOMMON, mage.cards.a.ArgothianElder.class));
|
||||
|
@ -214,6 +215,7 @@ public final class UrzasSaga extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Opal Titan", 26, Rarity.RARE, mage.cards.o.OpalTitan.class));
|
||||
cards.add(new SetCardInfo("Oppression", 143, Rarity.RARE, mage.cards.o.Oppression.class));
|
||||
cards.add(new SetCardInfo("Order of Yawgmoth", 144, Rarity.UNCOMMON, mage.cards.o.OrderOfYawgmoth.class));
|
||||
cards.add(new SetCardInfo("Outmaneuver", 205, Rarity.UNCOMMON, mage.cards.o.Outmaneuver.class));
|
||||
cards.add(new SetCardInfo("Pacifism", 27, Rarity.COMMON, mage.cards.p.Pacifism.class));
|
||||
cards.add(new SetCardInfo("Parasitic Bond", 145, Rarity.UNCOMMON, mage.cards.p.ParasiticBond.class));
|
||||
cards.add(new SetCardInfo("Pariah", 28, Rarity.RARE, mage.cards.p.Pariah.class));
|
||||
|
|
Loading…
Reference in a new issue