mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
[ORI] Added Kytheon, Hero of Akros.
This commit is contained in:
parent
9f7ce41679
commit
e717ad038b
35 changed files with 511 additions and 99 deletions
|
@ -31,6 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.EndOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition;
|
||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
|
@ -77,7 +78,7 @@ public class TheWretched extends CardImpl {
|
|||
this.toughness = new MageInt(5);
|
||||
|
||||
// At end of combat, gain control of all creatures blocking The Wretched for as long as you control The Wretched.
|
||||
this.addAbility(new EndOfAnyCombatTriggeredAbility(), new BlockedAttackerWatcher());
|
||||
this.addAbility(new EndOfCombatTriggeredAbility(new TheWretchedEffect(), false), new BlockedAttackerWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
@ -91,37 +92,6 @@ public class TheWretched extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class EndOfAnyCombatTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
EndOfAnyCombatTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new TheWretchedEffect(), false);
|
||||
}
|
||||
|
||||
EndOfAnyCombatTriggeredAbility(final EndOfAnyCombatTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EndOfAnyCombatTriggeredAbility copy() {
|
||||
return new EndOfAnyCombatTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.END_COMBAT_STEP_PRE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "At the end of combat, gain control of all creatures blocking {this} for as long as you control {this}.";
|
||||
}
|
||||
}
|
||||
|
||||
class TheWretchedEffect extends OneShotEffect {
|
||||
|
||||
TheWretchedEffect() {
|
||||
|
|
|
@ -37,7 +37,7 @@ public class CatacombSlug extends mage.sets.returntoravnica.CatacombSlug {
|
|||
|
||||
public CatacombSlug(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 998;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ChandrasFury extends mage.sets.magic2013.ChandrasFury {
|
|||
|
||||
public ChandrasFury(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 997;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ChargingGriffin extends mage.sets.magic2014.ChargingGriffin {
|
|||
|
||||
public ChargingGriffin(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 996;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class Claustrophobia extends mage.sets.innistrad.Claustrophobia {
|
|||
|
||||
public Claustrophobia(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 995;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class Cobblebrute extends mage.sets.returntoravnica.Cobblebrute {
|
|||
|
||||
public Cobblebrute(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 994;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class CruelRevival extends mage.sets.onslaught.CruelRevival {
|
|||
|
||||
public CruelRevival(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 993;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class Disperse extends mage.sets.scarsofmirrodin.Disperse {
|
|||
|
||||
public Disperse(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 992;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ElvishVisionary extends mage.sets.shardsofalara.ElvishVisionary {
|
|||
|
||||
public ElvishVisionary(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 991;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class FieryConclusion extends mage.sets.ravnica.FieryConclusion {
|
|||
|
||||
public FieryConclusion(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 990;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
194
Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java
Normal file
194
Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java
Normal file
|
@ -0,0 +1,194 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.magicorigins;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.RequirementEffect;
|
||||
import mage.abilities.effects.common.PreventAllDamageToSourceEffect;
|
||||
import mage.abilities.effects.common.UntapTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.TurnPhase;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class GideonBattleForged extends CardImpl {
|
||||
|
||||
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.OPPONENT));
|
||||
}
|
||||
|
||||
public GideonBattleForged(UUID ownerId) {
|
||||
super(ownerId, 23, "Gideon, Battle-Forged", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "");
|
||||
this.expansionSetCode = "ORI";
|
||||
this.subtype.add("Gideon");
|
||||
|
||||
this.color.setWhite(true);
|
||||
|
||||
this.nightCard = true;
|
||||
this.canTransform = true;
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
|
||||
// +2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able.
|
||||
LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new GideonBattleForgedAttacksIfAbleTargetEffect(Duration.Custom), 2);
|
||||
loyaltyAbility.addTarget(new TargetCreaturePermanent(0,1,filter, false));
|
||||
this.addAbility(loyaltyAbility);
|
||||
|
||||
// +1: Until your next turn, target creature gains indestructible. Untap that creature.
|
||||
Effect effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.UntilYourNextTurn);
|
||||
effect.setText("Until your next turn, target creature gains indestructible");
|
||||
loyaltyAbility = new LoyaltyAbility(effect, 1);
|
||||
effect = new UntapTargetEffect();
|
||||
effect.setText("Untap that creature");
|
||||
loyaltyAbility.addEffect(effect);
|
||||
this.addAbility(loyaltyAbility);
|
||||
|
||||
// 0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.
|
||||
LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonBattleForgedToken(), "planeswalker", Duration.EndOfTurn), 0);
|
||||
effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn);
|
||||
effect.setText("Prevent all damage that would be dealt to him this turn");
|
||||
ability3.addEffect(effect);
|
||||
this.addAbility(ability3);
|
||||
|
||||
}
|
||||
|
||||
public GideonBattleForged(final GideonBattleForged card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GideonBattleForged copy() {
|
||||
return new GideonBattleForged(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GideonBattleForgedToken extends Token {
|
||||
|
||||
public GideonBattleForgedToken() {
|
||||
super("", "4/4 Human Soldier creature with indestructible");
|
||||
cardType.add(CardType.CREATURE);
|
||||
subtype.add("Human");
|
||||
subtype.add("Soldier");
|
||||
power = new MageInt(4);
|
||||
toughness = new MageInt(4);
|
||||
this.addAbility(IndestructibleAbility.getInstance());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect {
|
||||
|
||||
int nextTurnTargetController = 0;
|
||||
protected MageObjectReference targetPermanentReference;
|
||||
|
||||
public GideonBattleForgedAttacksIfAbleTargetEffect(Duration duration) {
|
||||
super(duration);
|
||||
staticText = "Up to one target creature an opponent controls attacks {this} during its controller's next turn if able";
|
||||
}
|
||||
|
||||
public GideonBattleForgedAttacksIfAbleTargetEffect(final GideonBattleForgedAttacksIfAbleTargetEffect effect) {
|
||||
super(effect);
|
||||
this.nextTurnTargetController = effect.nextTurnTargetController;
|
||||
this.targetPermanentReference = effect.targetPermanentReference;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GideonBattleForgedAttacksIfAbleTargetEffect copy() {
|
||||
return new GideonBattleForgedAttacksIfAbleTargetEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInactive(Ability source, Game game) {
|
||||
Permanent targetPermanent = targetPermanentReference.getPermanent(game);
|
||||
if (targetPermanent == null) {
|
||||
return false;
|
||||
}
|
||||
if (nextTurnTargetController == 0 && startingTurn != game.getTurnNum() && game.getActivePlayerId().equals(targetPermanent.getControllerId())) {
|
||||
nextTurnTargetController = game.getTurnNum();
|
||||
}
|
||||
return game.getPhase().getType() == TurnPhase.END && game.getTurnNum() > nextTurnTargetController;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (permanent.getId().equals(getTargetPointer().getFirst(game, source))) {
|
||||
if (game.getActivePlayerId().equals(permanent.getControllerId())) {
|
||||
Permanent planeswalker = game.getPermanent(source.getSourceId());
|
||||
if (planeswalker != null) {
|
||||
if (planeswalker.getCardType().contains(CardType.CREATURE)) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
discard();
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID mustAttackDefender(Ability source, Game game) {
|
||||
return source.getSourceId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mustAttack(Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mustBlock(Game game) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -37,7 +37,7 @@ public class GoldForgedSentinel extends mage.sets.journeyintonyx.GoldForgedSenti
|
|||
|
||||
public GoldForgedSentinel(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 989;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ import mage.util.CardUtil;
|
|||
public class HixusPrisonWarden extends CardImpl {
|
||||
|
||||
public HixusPrisonWarden(UUID ownerId) {
|
||||
super(ownerId, 19, "Hixus, Prison Warden", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}{3}{W}{W}");
|
||||
super(ownerId, 19, "Hixus, Prison Warden", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}");
|
||||
this.expansionSetCode = "ORI";
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Human");
|
||||
|
|
|
@ -38,7 +38,7 @@ public class JayemdaeTome extends mage.sets.tenthedition.JayemdaeTome {
|
|||
|
||||
public JayemdaeTome(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 988;
|
||||
this.expansionSetCode = "ORI";
|
||||
this.rarity = Rarity.UNCOMMON;
|
||||
}
|
||||
|
|
120
Mage.Sets/src/mage/sets/magicorigins/KytheonHeroOfAkros.java
Normal file
120
Mage.Sets/src/mage/sets/magicorigins/KytheonHeroOfAkros.java
Normal file
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.magicorigins;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EndOfCombatTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect;
|
||||
import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect.Gender;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.watchers.common.AttackedThisCombatWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class KytheonHeroOfAkros extends CardImpl {
|
||||
|
||||
public KytheonHeroOfAkros(UUID ownerId) {
|
||||
super(ownerId, 23, "Kytheon, Hero of Akros", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{W}");
|
||||
this.expansionSetCode = "ORI";
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Soldier");
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
this.canTransform = true;
|
||||
this.secondSideCard = new GideonBattleForged(ownerId);
|
||||
|
||||
// At end of combat, if Kytheon, Hero of Akros and at least two other creatures attacked this combat, exile Kytheon,
|
||||
// then return him to the battlefield transformed under his owner's control.
|
||||
this.addAbility(new TransformAbility());
|
||||
this.addAbility(new ConditionalTriggeredAbility(new EndOfCombatTriggeredAbility(new ExileAndReturnTransformedSourceEffect(Gender.MALE), false),
|
||||
new KytheonHeroOfAkrosCondition(), "At end of combat, if {this} and at least two other creatures attacked this combat, exile {this}, " +
|
||||
"then return him to the battlefield transformed under his owner's control."), new AttackedThisCombatWatcher());
|
||||
|
||||
// {2}{W}: Kytheon gains indestructible until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl<>("{2}{W}")));
|
||||
|
||||
}
|
||||
|
||||
public KytheonHeroOfAkros(final KytheonHeroOfAkros card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KytheonHeroOfAkros copy() {
|
||||
return new KytheonHeroOfAkros(this);
|
||||
}
|
||||
}
|
||||
|
||||
class KytheonHeroOfAkrosCondition implements Condition {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
AttackedThisCombatWatcher watcher = (AttackedThisCombatWatcher) game.getState().getWatchers().get("AttackedThisCombat");
|
||||
if (watcher != null) {
|
||||
boolean sourceFound = false;
|
||||
int number = 0;
|
||||
for (MageObjectReference mor: watcher.getAttackedThisTurnCreatures()) {
|
||||
if (mor.refersTo(sourceObject, game)) {
|
||||
sourceFound = true;
|
||||
} else {
|
||||
number++;
|
||||
}
|
||||
}
|
||||
return sourceFound && number >= 2;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "if {this} and at least two other creatures attacked this combat";
|
||||
}
|
||||
}
|
|
@ -37,7 +37,7 @@ public class LeafGilder extends mage.sets.lorwyn.LeafGilder {
|
|||
|
||||
public LeafGilder(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 987;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class MaritimeGuard extends mage.sets.magic2011.MaritimeGuard {
|
|||
|
||||
public MaritimeGuard(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 986;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class Meteorite extends mage.sets.magic2015.Meteorite {
|
|||
|
||||
public Meteorite(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 985;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class MightyLeap extends mage.sets.magic2011.MightyLeap {
|
|||
|
||||
public MightyLeap(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 984;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -29,28 +29,22 @@ package mage.sets.magicorigins;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect;
|
||||
import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect.Gender;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
|
@ -83,7 +77,7 @@ public class NissaVastwoodSeer extends CardImpl {
|
|||
// Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.
|
||||
this.addAbility(new TransformAbility());
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new EntersBattlefieldControlledTriggeredAbility(new NissaVastwoodSeerTransformEffect(), new FilterLandPermanent()),
|
||||
new EntersBattlefieldControlledTriggeredAbility(new ExileAndReturnTransformedSourceEffect(Gender.FEMAL), new FilterLandPermanent()),
|
||||
new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), CountType.MORE_THAN, 6, true),
|
||||
"Whenever a land enters the battlefield under your control, if you control seven or more lands, exile {this}, then return her to the battlefield transformed under her owner's control."));
|
||||
}
|
||||
|
@ -97,34 +91,3 @@ public class NissaVastwoodSeer extends CardImpl {
|
|||
return new NissaVastwoodSeer(this);
|
||||
}
|
||||
}
|
||||
|
||||
class NissaVastwoodSeerTransformEffect extends OneShotEffect {
|
||||
|
||||
NissaVastwoodSeerTransformEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "exile {this}, then return her to the battlefield transformed under her owner's control";
|
||||
}
|
||||
|
||||
NissaVastwoodSeerTransformEffect(final NissaVastwoodSeerTransformEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NissaVastwoodSeerTransformEffect copy() {
|
||||
return new NissaVastwoodSeerTransformEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
MageObject sourceObject = source.getSourceObjectIfItStillExists(game);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (sourceObject != null && controller != null) {
|
||||
Card card = (Card) sourceObject;
|
||||
if (controller.moveCards(card, Zone.BATTLEFIELD, Zone.EXILED, source, game)) {
|
||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
||||
controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -37,7 +37,7 @@ public class RunedServitor extends mage.sets.riseoftheeldrazi.RunedServitor {
|
|||
|
||||
public RunedServitor(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 983;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ScrapskinDrake extends mage.sets.avacynrestored.ScrapskinDrake {
|
|||
|
||||
public ScrapskinDrake(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 982;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class TitanicGrowth extends mage.sets.magic2012.TitanicGrowth {
|
|||
|
||||
public TitanicGrowth(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 981;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class TitansStrength extends mage.sets.theros.TitansStrength {
|
|||
|
||||
public TitansStrength(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 980;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class TowerGeist extends mage.sets.darkascension.TowerGeist {
|
|||
|
||||
public TowerGeist(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 979;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class VastwoodGorger extends mage.sets.zendikar.VastwoodGorger {
|
|||
|
||||
public VastwoodGorger(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 978;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class WeightOfTheUnderworld extends mage.sets.bornofthegods.WeightOfTheUn
|
|||
|
||||
public WeightOfTheUnderworld(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 977;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class YevasForcemage extends mage.sets.magic2013.YevasForcemage {
|
|||
|
||||
public YevasForcemage(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 976;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class YokedOx extends mage.sets.theros.YokedOx {
|
|||
|
||||
public YokedOx(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 999;
|
||||
this.cardNumber = 975;
|
||||
this.expansionSetCode = "ORI";
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ import mage.MageObjectReference;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.RequirementEffect;
|
||||
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
|
@ -85,7 +86,9 @@ public class GideonJura extends CardImpl {
|
|||
|
||||
// 0: Until end of turn, Gideon Jura becomes a 6/6 Human Soldier creature that's still a planeswalker. Prevent all damage that would be dealt to him this turn.
|
||||
LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonJuraToken(), "planeswalker", Duration.EndOfTurn), 0);
|
||||
ability3.addEffect(new PreventAllDamageToSourceEffect(Duration.EndOfTurn));
|
||||
Effect effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn);
|
||||
effect.setText("Prevent all damage that would be dealt to him this turn");
|
||||
ability3.addEffect(effect);
|
||||
this.addAbility(ability3);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,11 @@ public class MantisEngine extends CardImpl {
|
|||
this.subtype.add("Insect");
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// {2}: Mantis Engine gains flying until end of turn. (It can't be blocked except by creatures with flying or reach.)
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(2)));
|
||||
|
||||
// {2}: Mantis Engine gains first strike until end of turn. (It deals combat damage before creatures without first strike.)
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(2)));
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class EndOfCombatTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public EndOfCombatTriggeredAbility(Effect effect, boolean optional) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
}
|
||||
|
||||
public EndOfCombatTriggeredAbility(final EndOfCombatTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EndOfCombatTriggeredAbility copy() {
|
||||
return new EndOfCombatTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.END_COMBAT_STEP_PRE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "At the end of combat, " + super.getRule();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class ExileAndReturnTransformedSourceEffect extends OneShotEffect {
|
||||
|
||||
public static enum Gender { MALE, FEMAL };
|
||||
|
||||
public ExileAndReturnTransformedSourceEffect(Gender gender) {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "exile {this}, then return " + (gender.equals(Gender.MALE) ? "him":"her")
|
||||
+ " to the battlefield transformed under" + (gender.equals(Gender.MALE) ? "his":"her")+ " owner's control";
|
||||
}
|
||||
|
||||
public ExileAndReturnTransformedSourceEffect(final ExileAndReturnTransformedSourceEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExileAndReturnTransformedSourceEffect copy() {
|
||||
return new ExileAndReturnTransformedSourceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
MageObject sourceObject = source.getSourceObjectIfItStillExists(game);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (sourceObject != null && controller != null) {
|
||||
Card card = (Card) sourceObject;
|
||||
if (controller.moveCards(card, Zone.BATTLEFIELD, Zone.EXILED, source, game)) {
|
||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
||||
controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -247,7 +247,9 @@ public class Combat implements Serializable, Copyable<Combat> {
|
|||
for (Ability ability : entry.getValue()) {
|
||||
UUID defenderId = effect.mustAttackDefender(ability, game);
|
||||
if (defenderId != null) {
|
||||
defendersForcedToAttack.add(defenderId);
|
||||
if (defenders.contains(defenderId)) {
|
||||
defendersForcedToAttack.add(defenderId);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
53
Mage/src/mage/watchers/common/AttackedThisCombatWatcher.java
Normal file
53
Mage/src/mage/watchers/common/AttackedThisCombatWatcher.java
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.watchers.common;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import mage.MageObjectReference;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class AttackedThisCombatWatcher extends Watcher {
|
||||
|
||||
public Set<MageObjectReference> attackedThisTurnCreatures = new HashSet<>();
|
||||
|
||||
public AttackedThisCombatWatcher() {
|
||||
super("AttackedThisCombat", WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public AttackedThisCombatWatcher(final AttackedThisCombatWatcher watcher) {
|
||||
super(watcher);
|
||||
this.attackedThisTurnCreatures.addAll(watcher.attackedThisTurnCreatures);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.BEGIN_COMBAT_STEP_PRE) {
|
||||
this.attackedThisTurnCreatures.clear();
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
|
||||
this.attackedThisTurnCreatures.add(new MageObjectReference(event.getSourceId(),game));
|
||||
}
|
||||
}
|
||||
|
||||
public Set<MageObjectReference> getAttackedThisTurnCreatures() {
|
||||
return this.attackedThisTurnCreatures;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttackedThisCombatWatcher copy() {
|
||||
return new AttackedThisCombatWatcher(this);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue