mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
convert Goblin Skycutter to Cost/Target system
This commit is contained in:
@@ -1800,7 +1800,11 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Goblin Skycutter")) {
|
else if(cardName.equals("Goblin Skycutter")) {
|
||||||
final Ability ability = new Ability(card, "0") {
|
Cost cost = new Cost("Sac<1/CARDNAME>", cardName, true);
|
||||||
|
Target target = new Target(card, "Select target creature with flying", "Creature.withFlying");
|
||||||
|
final SpellAbility ability = new Ability_Activated(card, cost, target) {
|
||||||
|
private static final long serialVersionUID = 200207345405088487L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
return getFlying().size() != 0;
|
return getFlying().size() != 0;
|
||||||
@@ -1808,18 +1812,16 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void chooseTargetAI() {
|
public void chooseTargetAI() {
|
||||||
AllZone.GameAction.sacrifice(card);
|
|
||||||
|
|
||||||
CardList flying = getFlying();
|
CardList flying = getFlying();
|
||||||
flying.shuffle();
|
flying.shuffle();
|
||||||
setTargetCard(flying.get(0));
|
setTargetCard(flying.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
CardList getFlying() {
|
private CardList getFlying() {
|
||||||
CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true);
|
CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true);
|
||||||
flying = flying.filter(new CardListFilter() {
|
flying = flying.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return c.getNetDefense() == 2;
|
return c.getNetDefense() <= 2;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return flying;
|
return flying;
|
||||||
@@ -1827,56 +1829,31 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(AllZoneUtil.isCardInPlay(getTargetCard())
|
final Card tgt = getTargetCard();
|
||||||
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
if(AllZoneUtil.isCardInPlay(tgt) && CardFactoryUtil.canTarget(card, tgt)) {
|
||||||
getTargetCard().addDamage(2, card);
|
tgt.addDamage(2, card);
|
||||||
getTargetCard().removeIntrinsicKeyword("Flying");
|
tgt.removeIntrinsicKeyword("Flying");
|
||||||
getTargetCard().removeExtrinsicKeyword("Flying");
|
tgt.removeExtrinsicKeyword("Flying");
|
||||||
}
|
}
|
||||||
|
|
||||||
AllZone.EndOfTurn.addUntil(new Command() {
|
AllZone.EndOfTurn.addUntil(new Command() {
|
||||||
private static final long serialVersionUID = -8889549737746466810L;
|
private static final long serialVersionUID = -8889549737746466810L;
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(AllZoneUtil.isCardInPlay(getTargetCard())) getTargetCard().addIntrinsicKeyword(
|
if(AllZoneUtil.isCardInPlay(tgt)){
|
||||||
"Flying");
|
tgt.addIntrinsicKeyword("Flying");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}//resolve()
|
}//resolve()
|
||||||
};//SpellAbility
|
};//SpellAbility
|
||||||
|
|
||||||
Input runtime = new Input() {
|
|
||||||
private static final long serialVersionUID = 8609211991425118222L;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void showMessage() {
|
|
||||||
CardList list = AllZoneUtil.getCreaturesInPlay();
|
|
||||||
list = list.filter(new CardListFilter() {
|
|
||||||
public boolean addCard(Card c) {
|
|
||||||
return c.getKeyword().contains("Flying")
|
|
||||||
&& CardFactoryUtil.canTarget(card, c);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
stopSetNext(CardFactoryUtil.input_targetSpecific(ability, list,
|
|
||||||
"Select a creature with flying to deal 2 damage to", new Command() {
|
|
||||||
private static final long serialVersionUID = -3287971244881855563L;
|
|
||||||
|
|
||||||
public void execute() {
|
|
||||||
AllZone.GameAction.sacrifice(card);
|
|
||||||
}
|
|
||||||
}, true, false));
|
|
||||||
}//showMessage()
|
|
||||||
};//Input
|
|
||||||
|
|
||||||
card.addSpellAbility(ability);
|
card.addSpellAbility(ability);
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("Sacrifice Goblin Skycutter: Goblin Skycutter deals 2 damage to target ");
|
sb.append(cost).append("CARDNAME deals 2 damage to target ");
|
||||||
sb.append("creature with flying. That creature loses flying until end of turn.");
|
sb.append("creature with flying. That creature loses flying until end of turn.");
|
||||||
ability.setDescription(sb.toString());
|
ability.setDescription(sb.toString());
|
||||||
|
|
||||||
ability.setBeforePayMana(runtime);
|
|
||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user