mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Removed hardcoded stuff of Singing Tree.
This commit is contained in:
@@ -5141,73 +5141,6 @@ public class CardFactory_Creatures {
|
|||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
|
|
||||||
//*************** START *********** START **************************
|
|
||||||
else if(cardName.equals("Singing Tree")) {
|
|
||||||
final String Tgts[] = {"Creature.attacking"};
|
|
||||||
Target target = new Target(card,"Select target attacking creature.", Tgts);
|
|
||||||
|
|
||||||
final Cost cost = new Cost("T", card.getName(), true);
|
|
||||||
|
|
||||||
final SpellAbility ability = new Ability_Activated(card, cost, target) {
|
|
||||||
private static final long serialVersionUID = 3750045284339229395L;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canPlayAI() {
|
|
||||||
Card c = getCreature();
|
|
||||||
if(c == null) return false;
|
|
||||||
else {
|
|
||||||
setTargetCard(c);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}//canPlayAI()
|
|
||||||
|
|
||||||
//may return null
|
|
||||||
public Card getCreature() {
|
|
||||||
CardList attacking = AllZoneUtil.getCreaturesInPlay();
|
|
||||||
attacking = attacking.filter(new CardListFilter() {
|
|
||||||
public boolean addCard(Card c) {
|
|
||||||
return c.isAttacking() && c != card && CardFactoryUtil.canTarget(card, c);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if(attacking.isEmpty()) return null;
|
|
||||||
|
|
||||||
Card big = CardFactoryUtil.AI_getBestCreature(attacking);
|
|
||||||
return big;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canPlay() {
|
|
||||||
return Phase.canPlayDuringCombat();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resolve() {
|
|
||||||
if(AllZone.GameAction.isCardInPlay(getTargetCard())
|
|
||||||
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
|
||||||
final Card[] creature = new Card[1];
|
|
||||||
|
|
||||||
creature[0] = getTargetCard();
|
|
||||||
final int[] originalAttack = {creature[0].getBaseAttack()};
|
|
||||||
creature[0].setBaseAttack(0);
|
|
||||||
|
|
||||||
final Command EOT = new Command() {
|
|
||||||
private static final long serialVersionUID = -7188543458319933986L;
|
|
||||||
|
|
||||||
public void execute() {
|
|
||||||
if(AllZone.GameAction.isCardInPlay(creature[0])) {
|
|
||||||
creature[0].setBaseAttack(originalAttack[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
AllZone.EndOfTurn.addUntil(EOT);
|
|
||||||
}//is card in play?
|
|
||||||
}//resolve()
|
|
||||||
};//SpellAbility
|
|
||||||
|
|
||||||
card.addSpellAbility(ability);
|
|
||||||
}//*************** END ************ END **************************
|
|
||||||
|
|
||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Nameless Race")) {
|
else if(cardName.equals("Nameless Race")) {
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user