mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
*Converted Sprouting Phytohydra to use Trigger objects. Fixed triggers not being registered for copy tokens.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
Name:Sprouting Phytohydra
|
Name:Sprouting Phytohydra
|
||||||
ManaCost:4 G
|
ManaCost:4 G
|
||||||
Types:Creature Plant Hydra
|
Types:Creature Plant Hydra
|
||||||
Text:Whenever Sprouting Phytohydra is dealt damage, you may put a token that's a copy of Sprouting Phytohydra onto the battlefield.
|
Text:no text
|
||||||
PT:0/2
|
PT:0/2
|
||||||
K:Defender
|
K:Defender
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import forge.card.spellability.Spell;
|
|||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.card.spellability.Spell_Permanent;
|
import forge.card.spellability.Spell_Permanent;
|
||||||
import forge.card.spellability.Target;
|
import forge.card.spellability.Target;
|
||||||
|
import forge.card.trigger.Trigger;
|
||||||
import forge.error.ErrorViewer;
|
import forge.error.ErrorViewer;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
import forge.gui.input.Input;
|
import forge.gui.input.Input;
|
||||||
@@ -215,6 +216,10 @@ public class CardFactory implements NewConstants {
|
|||||||
}
|
}
|
||||||
out.setUniqueNumber(Unumber + 4); // +4 because +1 didn't work lol.
|
out.setUniqueNumber(Unumber + 4); // +4 because +1 didn't work lol.
|
||||||
out.setCopiedSpell(true);
|
out.setCopiedSpell(true);
|
||||||
|
for(Trigger t : out.getTriggers())
|
||||||
|
{
|
||||||
|
AllZone.TriggerHandler.registerTrigger(t);
|
||||||
|
}
|
||||||
CopiedList.add(out);
|
CopiedList.add(out);
|
||||||
return out;
|
return out;
|
||||||
|
|
||||||
|
|||||||
@@ -4478,17 +4478,11 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Sprouting Phytohydra")) {
|
else if(cardName.equals("Sprouting Phytohydra")) {
|
||||||
final Card newCard = new Card() {
|
final Trigger myTrig = TriggerHandler.parseTrigger("Mode$ DamageDone | ValidTarget$ Card.Self | OptionalDecider$ You | TriggerDescription$ Whenever CARDNAME is dealt damage, you may put a token that's a copy of CARDNAME onto the battlefield.",card);
|
||||||
@Override
|
|
||||||
public void addDamage(HashMap<Card, Integer> map) {
|
|
||||||
final HashMap<Card, Integer> m = map;
|
|
||||||
final Ability ability = new Ability(card, "0") {
|
final Ability ability = new Ability(card, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(getController().isHuman() &&
|
|
||||||
GuiUtils.getChoice("Copy " + getSourceCard(),
|
|
||||||
new String[] {"Yes", "No"}).equals("No"))
|
|
||||||
return;
|
|
||||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, getSourceCard().getController());
|
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, getSourceCard().getController());
|
||||||
CardList DoublingSeasons = new CardList(play.getCards());
|
CardList DoublingSeasons = new CardList(play.getCards());
|
||||||
DoublingSeasons = DoublingSeasons.getName("Doubling Season");
|
DoublingSeasons = DoublingSeasons.getName("Doubling Season");
|
||||||
@@ -4505,33 +4499,9 @@ public class CardFactory_Creatures {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ability.setStackDescription(toString() + " - you may put a token that's a copy of " + getName() + " onto the battlefield.");
|
myTrig.setOverridingAbility(ability);
|
||||||
AllZone.Stack.addSimultaneousStackEntry(ability);
|
|
||||||
|
|
||||||
|
card.addTrigger(myTrig);
|
||||||
for(Entry<Card, Integer> entry : m.entrySet()) {
|
|
||||||
this.addDamage(entry.getValue(), entry.getKey());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
newCard.setOwner(card.getOwner());
|
|
||||||
newCard.setController(card.getController());
|
|
||||||
|
|
||||||
newCard.setManaCost(card.getManaCost());
|
|
||||||
newCard.setName(card.getName());
|
|
||||||
newCard.setType(card.getType());
|
|
||||||
newCard.setText(card.getSpellText());
|
|
||||||
newCard.setBaseAttack(card.getBaseAttack());
|
|
||||||
newCard.setBaseDefense(card.getBaseDefense());
|
|
||||||
|
|
||||||
newCard.addSpellAbility(new Spell_Permanent(newCard));
|
|
||||||
|
|
||||||
newCard.setSVars(card.getSVars());
|
|
||||||
newCard.setSets(card.getSets());
|
|
||||||
|
|
||||||
return newCard;
|
|
||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user