mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Tweaked Ashnod's Transmogrant, Time Vault, Stuffy Doll, Tradewind Rider, Elephant Graveyard, use of AbCost and Target
- Changed Stuffy Doll's damage interaction to use AllZone.GameAction.addDamage - Fixed AbilityFactory use of canPayAdditionalCost
This commit is contained in:
@@ -169,8 +169,7 @@ public class AbilityFactory {
|
||||
|
||||
@Override
|
||||
public boolean canPlay(){
|
||||
Cost_Payment pay = new Cost_Payment(abCost, this);
|
||||
return (pay.canPayAdditionalCosts(abCost, this) && CardFactoryUtil.canUseAbility(hostCard) && super.canPlay());
|
||||
return (Cost_Payment.canPayAdditionalCosts(abCost, this) && CardFactoryUtil.canUseAbility(hostCard) && super.canPlay());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8640,16 +8640,26 @@ public class CardFactory implements NewConstants {
|
||||
|
||||
//*************** START ************ START **************************
|
||||
else if(cardName.equals("Ashnod's Transmogrant")) {
|
||||
final Ability_Tap ability = new Ability_Tap(card) {
|
||||
final String[] Tgts = { "Creature.nonArtifact" };
|
||||
|
||||
Ability_Cost abCost = new Ability_Cost("T Sac<1/CARDNAME>", cardName, true);
|
||||
Target abTgt = new Target("TgtV", "Target a non-Artifact Creature to Transmogrify", Tgts);
|
||||
|
||||
final Ability_Activated ability = new Ability_Activated(card, abCost, abTgt){
|
||||
private static final long serialVersionUID = -401631574059431293L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
if(card.getController().equals(Constant.Player.Computer)) AllZone.GameAction.sacrifice(card);
|
||||
if(getTargetCard() == null || !getTargetCard().isCreature()) return;
|
||||
Card crd = getTargetCard();
|
||||
// if it's not a valid target on resolution, spell fizzles
|
||||
if (crd == null || !AllZone.GameAction.isCardInPlay(crd) || !crd.isValidCard(Tgts))
|
||||
return;
|
||||
crd.addCounter(Counters.P1P1, 1);
|
||||
if(!crd.getType().contains("Artifact")) crd.addType("Artifact");
|
||||
|
||||
// trick to get Artifact on the card type side of the type line
|
||||
ArrayList<String> types = crd.getType();
|
||||
types.add(0, "Artifact");
|
||||
crd.setType(types);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -8664,33 +8674,8 @@ public class CardFactory implements NewConstants {
|
||||
return (getTargetCard() != null);
|
||||
}
|
||||
};
|
||||
Input runtime = new Input() {
|
||||
private static final long serialVersionUID = 141164423096887945L;
|
||||
|
||||
@Override
|
||||
public void showMessage() {
|
||||
AllZone.Display.showMessage("Select target creature for " + card);
|
||||
ButtonUtil.enableOnlyCancel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectButtonCancel() {
|
||||
stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectCard(Card c, PlayerZone zone) {
|
||||
if(!CardFactoryUtil.canTarget(ability, c)) {
|
||||
AllZone.Display.showMessage("Cannot target this card (Shroud? Protection?).");
|
||||
} else if(c.isCreature() && !c.isArtifact() && zone.is(Constant.Zone.Play)) {
|
||||
ability.setTargetCard(c);
|
||||
AllZone.GameAction.sacrifice(card);
|
||||
stopSetNext(new Input_NoCost_TapAbility(ability));
|
||||
}
|
||||
}
|
||||
};
|
||||
ability.setBeforePayMana(runtime);
|
||||
ability.setDescription("tap, Sacrifice Ashnod's Transmogrant: put a +1/+1 counter on target nonartifact creature. That creature becomes an artifact in addition to its other types.");
|
||||
ability.setDescription(abCost.toString() + "Put a +1/+1 counter on target nonartifact creature. That creature becomes an artifact in addition to its other types.");
|
||||
card.addSpellAbility(ability);
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
@@ -9312,7 +9297,9 @@ public class CardFactory implements NewConstants {
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Time Vault")) {
|
||||
final Ability_Tap ability = new Ability_Tap(card) {
|
||||
final Ability_Cost abCost = new Ability_Cost("T", cardName, true);
|
||||
|
||||
final Ability_Activated ability = new Ability_Activated(card, abCost, null){
|
||||
private static final long serialVersionUID = 5784473766585071504L;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -394,18 +394,10 @@ public class CardFactory_Creatures {
|
||||
super.addDamage(n, source);
|
||||
final String opponent = AllZone.GameAction.getOpponent(card.getOwner());
|
||||
|
||||
SpellAbility ability = new Ability(card, "0") {
|
||||
SpellAbility ability = new Ability(c, "0") {
|
||||
@Override
|
||||
public void resolve() {
|
||||
AllZone.GameAction.getPlayerLife(opponent).subtractLife(n,card);
|
||||
|
||||
if(c.getKeyword().contains("Lifelink")) GameActionUtil.executeLifeLinkEffects(c, n);
|
||||
|
||||
CardList cl = CardFactoryUtil.getAurasEnchanting(c, "Guilty Conscience");
|
||||
for(Card crd:cl) {
|
||||
GameActionUtil.executeGuiltyConscienceEffects(c, crd, n);
|
||||
}
|
||||
|
||||
AllZone.GameAction.addDamage(opponent, c, n);
|
||||
}
|
||||
};
|
||||
ability.setStackDescription("Stuffy Doll - causes " + n + " damage to " + opponent);
|
||||
@@ -427,35 +419,25 @@ public class CardFactory_Creatures {
|
||||
|
||||
newCard.addIntrinsicKeyword("Indestructible");
|
||||
|
||||
final Ability_Tap ability = new Ability_Tap(newCard) {
|
||||
Ability_Cost abilCost = new Ability_Cost("T", cardName, true);
|
||||
|
||||
final Ability_Activated ability = new Ability_Activated(newCard, abilCost, null){
|
||||
private static final long serialVersionUID = 577739727089395613L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
newCard.addDamage(1, newCard);
|
||||
|
||||
if(newCard.getKeyword().contains("Lifelink")) GameActionUtil.executeLifeLinkEffects(newCard, 1);
|
||||
|
||||
CardList cl = CardFactoryUtil.getAurasEnchanting(newCard, "Guilty Conscience");
|
||||
for(Card crd:cl) {
|
||||
GameActionUtil.executeGuiltyConscienceEffects(newCard, crd, 1);
|
||||
}
|
||||
AllZone.GameAction.addDamage(newCard, newCard, 1);
|
||||
}
|
||||
};//SpellAbility
|
||||
ability.setDescription("tap: Stuffy Doll deals 1 damage to itself.");
|
||||
ability.setDescription(abilCost.toString() + "Stuffy Doll deals 1 damage to itself.");
|
||||
ability.setStackDescription("Stuffy Doll - deals 1 damage to itself.");
|
||||
ability.setBeforePayMana(new Input_NoCost_TapAbility(ability));
|
||||
|
||||
// card.addSpellAbility(ability);
|
||||
// return card;
|
||||
///*
|
||||
newCard.addSpellAbility(new Spell_Permanent(newCard));
|
||||
newCard.addSpellAbility(ability);
|
||||
|
||||
newCard.setSVars(card.getSVars());
|
||||
|
||||
return newCard;
|
||||
//*/
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
@@ -13452,10 +13434,9 @@ public class CardFactory_Creatures {
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Tradewind Rider")) {
|
||||
Target target = new Target("TgtV");
|
||||
target.setVTSelection("Select target permanent to return to owner's hand.");
|
||||
String select = "Select target permanent to return to owner's hand.";
|
||||
final String Tgts[] = {"Permanent"};
|
||||
target.setValidTgts(Tgts);
|
||||
Target target = new Target("TgtV", select, Tgts);
|
||||
|
||||
final Ability_Cost cost = new Ability_Cost("T tapXType<2/Creature>", card.getName(), true);
|
||||
|
||||
@@ -19316,10 +19297,8 @@ public class CardFactory_Creatures {
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Singing Tree")) {
|
||||
Target target = new Target("TgtV");
|
||||
target.setVTSelection("Select target attacking creature.");
|
||||
final String Tgts[] = {"Creature.attacking"};
|
||||
target.setValidTgts(Tgts);
|
||||
Target target = new Target("TgtV", "Select target attacking creature.", Tgts);
|
||||
|
||||
final Ability_Cost cost = new Ability_Cost("T", card.getName(), true);
|
||||
|
||||
|
||||
@@ -3734,10 +3734,8 @@ class CardFactory_Lands {
|
||||
|
||||
//*************** START ********** START *************************
|
||||
else if(cardName.equals("Elephant Graveyard")) {
|
||||
Target target = new Target("TgtV");
|
||||
target.setVTSelection("Select target Elephant.");
|
||||
final String Tgts[] = {"Creature.Elephant"};
|
||||
target.setValidTgts(Tgts);
|
||||
Target target = new Target("TgtV", "Select target Elephant to Regenerate.", Tgts);
|
||||
|
||||
final Ability_Cost cost = new Ability_Cost("T", card.getName(), true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user