mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Added support for creatures with an X mana cost and Apocalypse Hydra with it.
This commit is contained in:
@@ -38,6 +38,7 @@ snow_covered_mountain.jpg http://www.wizards.com/global/images/magic/gene
|
||||
snow_covered_mountain1.jpg http://www.wizards.com/global/images/magic/general/snow_covered_mountain.jpg
|
||||
snow_covered_mountain2.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg
|
||||
snow_covered_mountain3.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg
|
||||
apocalypse_hydra.jpg http://www.wizards.com/global/images/magic/general/apocalypse_hydra.jpg
|
||||
crossbow_ambush.jpg http://www.wizards.com/global/images/magic/general/crossbow_ambush.jpg
|
||||
magnetic_flux.jpg http://www.wizards.com/global/images/magic/general/magnetic_flux.jpg
|
||||
call_to_glory.jpg http://www.wizards.com/global/images/magic/general/call_to_glory.jpg
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
Apocalypse Hydra
|
||||
X G R
|
||||
Creature Hydra
|
||||
Apocalypse Hydra enters the battlefield with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it. 1 R, Remove a +1/+1 counter from Apocalypse Hydra: Apocalypse Hydra deals 1 damage to target creature or player.
|
||||
0/0
|
||||
|
||||
Haze of Rage
|
||||
1 R
|
||||
Sorcery
|
||||
|
||||
@@ -14699,6 +14699,112 @@ public class CardFactory_Creatures {
|
||||
card.addComesIntoPlayCommand(intoPlay);
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Apocalypse Hydra")) {
|
||||
SpellAbility spell = new Spell_Permanent(card) {
|
||||
private static final long serialVersionUID = -11489323313L;
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
return super.canPlay() && 5 <= ComputerUtil.getAvailableMana().size() - 2;
|
||||
}
|
||||
};
|
||||
card.clearSpellAbility();
|
||||
card.addSpellAbility(spell);
|
||||
|
||||
final Ability ability = new Ability(card, "1 R") {
|
||||
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
return card.getCounters(Counters.P1P1) > 0 && super.canPlay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
return getCreature().size() != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chooseTargetAI() {
|
||||
if(AllZone.Human_Life.getLife() < card.getCounters(Counters.P1P1)) setTargetPlayer(Constant.Player.Human);
|
||||
else {
|
||||
CardList list = getCreature();
|
||||
list.shuffle();
|
||||
setTargetCard(list.get(0));
|
||||
}
|
||||
card.subtractCounter(Counters.P1P1, 1);
|
||||
}//chooseTargetAI()
|
||||
|
||||
CardList getCreature() {
|
||||
//toughness of 1
|
||||
CardList list = CardFactoryUtil.AI_getHumanCreature(1, card, true);
|
||||
list = list.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return (1 == c.getKillDamage());
|
||||
}
|
||||
});
|
||||
return list;
|
||||
}//getCreature()
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
if(getTargetCard() != null) {
|
||||
if(AllZone.GameAction.isCardInPlay(getTargetCard())
|
||||
&& CardFactoryUtil.canTarget(card, getTargetCard())) getTargetCard().addDamage(1,
|
||||
card);
|
||||
} else AllZone.GameAction.getPlayerLife(getTargetPlayer()).subtractLife(1);
|
||||
}//resolve()
|
||||
|
||||
};//SpellAbility
|
||||
Input target = new Input() {
|
||||
|
||||
private static final long serialVersionUID = 4246601245231655L;
|
||||
|
||||
@Override
|
||||
public void showMessage() {
|
||||
AllZone.Display.showMessage("Select creature or player to target: ");
|
||||
ButtonUtil.enableOnlyCancel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectPlayer(String player) {
|
||||
ability.setTargetPlayer(player);
|
||||
card.subtractCounter(Counters.P1P1, 1);
|
||||
AllZone.Stack.add(ability);
|
||||
stopSetNext(new ComputerAI_StackNotEmpty());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectButtonCancel() {
|
||||
stop();
|
||||
}
|
||||
@Override
|
||||
public void selectCard(Card c, PlayerZone zone) {
|
||||
PlayerZone Hplay = AllZone.getZone(Constant.Zone.Play, Constant.Player.Human);
|
||||
PlayerZone Cplay = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer);
|
||||
if(AllZone.GameAction.isCardInZone(c, Hplay) || AllZone.GameAction.isCardInZone(c, Cplay)) {
|
||||
card.subtractCounter(Counters.P1P1, 1);
|
||||
ability.setTargetCard(c);
|
||||
AllZone.Stack.add(ability);
|
||||
stopSetNext(new ComputerAI_StackNotEmpty());
|
||||
}
|
||||
}//selectCard()
|
||||
};//Input
|
||||
card.addSpellAbility(ability);
|
||||
ability.setAfterPayMana(target);
|
||||
Command intoPlay = new Command() {
|
||||
|
||||
private static final long serialVersionUID = 255901529244894L;
|
||||
|
||||
public void execute() {
|
||||
int XCounters = card.getXManaCostPaid();
|
||||
if(XCounters >= 5) XCounters = 2 * XCounters;
|
||||
card.addCounter(Counters.P1P1, XCounters);
|
||||
}//execute()
|
||||
};//Command
|
||||
card.addComesIntoPlayCommand(intoPlay);
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Auramancer")) {
|
||||
final SpellAbility ability = new Ability(card, "0") {
|
||||
@@ -19056,6 +19162,17 @@ public class CardFactory_Creatures {
|
||||
}
|
||||
}//level up
|
||||
|
||||
if (card.getManaCost().contains("X"))
|
||||
{
|
||||
SpellAbility sa = card.getSpellAbility()[0];
|
||||
sa.setIsXCost(true);
|
||||
|
||||
if (card.getManaCost().startsWith("X X"))
|
||||
sa.setXManaCost("2");
|
||||
else if (card.getManaCost().startsWith("X"))
|
||||
sa.setXManaCost("1");
|
||||
}//X
|
||||
|
||||
return card;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user