diff --git a/res/cardsfolder/sprouting_phytohydra.txt b/res/cardsfolder/sprouting_phytohydra.txt index 8dfb73e0a7b..eb6d78ba124 100644 --- a/res/cardsfolder/sprouting_phytohydra.txt +++ b/res/cardsfolder/sprouting_phytohydra.txt @@ -1,7 +1,7 @@ Name:Sprouting Phytohydra ManaCost:4 G 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 K:Defender SVar:Rarity:Rare diff --git a/src/forge/card/cardFactory/CardFactory.java b/src/forge/card/cardFactory/CardFactory.java index f025bb515bb..a37dc862a09 100644 --- a/src/forge/card/cardFactory/CardFactory.java +++ b/src/forge/card/cardFactory/CardFactory.java @@ -42,6 +42,7 @@ import forge.card.spellability.Spell; import forge.card.spellability.SpellAbility; import forge.card.spellability.Spell_Permanent; import forge.card.spellability.Target; +import forge.card.trigger.Trigger; import forge.error.ErrorViewer; import forge.gui.GuiUtils; 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.setCopiedSpell(true); + for(Trigger t : out.getTriggers()) + { + AllZone.TriggerHandler.registerTrigger(t); + } CopiedList.add(out); return out; diff --git a/src/forge/card/cardFactory/CardFactory_Creatures.java b/src/forge/card/cardFactory/CardFactory_Creatures.java index cde9f3feae0..be1469e483d 100644 --- a/src/forge/card/cardFactory/CardFactory_Creatures.java +++ b/src/forge/card/cardFactory/CardFactory_Creatures.java @@ -4478,25 +4478,19 @@ public class CardFactory_Creatures { //*************** START *********** START ************************** else if(cardName.equals("Sprouting Phytohydra")) { - final Card newCard = new Card() { - @Override - public void addDamage(HashMap map) { - final HashMap m = map; - final Ability ability = new Ability(card, "0") { + 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); + + final Ability ability = new Ability(card, "0") { @Override 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()); CardList DoublingSeasons = new CardList(play.getCards()); DoublingSeasons = DoublingSeasons.getName("Doubling Season"); - PlayerZone_ComesIntoPlay.setSimultaneousEntry(true); + PlayerZone_ComesIntoPlay.setSimultaneousEntry(true); double Count = DoublingSeasons.size(); Count = Math.pow(2,Count); for(int i = 0; i < Count; i++) { - if(i + 1 == Count) PlayerZone_ComesIntoPlay.setSimultaneousEntry(false); + if(i + 1 == Count) PlayerZone_ComesIntoPlay.setSimultaneousEntry(false); Card Copy = AllZone.CardFactory.copyCardintoNew(getSourceCard()); Copy.setToken(true); Copy.setController(getSourceCard().getController()); @@ -4504,34 +4498,10 @@ public class CardFactory_Creatures { AllZone.GameAction.moveToPlay(Copy); } } - }; - ability.setStackDescription(toString() + " - you may put a token that's a copy of " + getName() + " onto the battlefield."); - AllZone.Stack.addSimultaneousStackEntry(ability); - - - for(Entry 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; + myTrig.setOverridingAbility(ability); + + card.addTrigger(myTrig); }//*************** END ************ END **************************