- Fixed Heat Shimmer

This commit is contained in:
swordshine
2014-03-17 04:41:30 +00:00
parent 3a40132ba3
commit 565cb20407
3 changed files with 26 additions and 1 deletions

View File

@@ -21,6 +21,8 @@ import forge.game.player.Player;
import forge.game.spellability.Ability; import forge.game.spellability.Ability;
import forge.game.spellability.SpellAbility; import forge.game.spellability.SpellAbility;
import forge.game.spellability.TargetRestrictions; import forge.game.spellability.TargetRestrictions;
import forge.game.trigger.Trigger;
import forge.game.trigger.TriggerHandler;
import forge.game.zone.ZoneType; import forge.game.zone.ZoneType;
import forge.item.PaperCard; import forge.item.PaperCard;
import forge.util.Aggregates; import forge.util.Aggregates;
@@ -55,6 +57,8 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
final Game game = hostCard.getGame(); final Game game = hostCard.getGame();
final ArrayList<String> keywords = new ArrayList<String>(); final ArrayList<String> keywords = new ArrayList<String>();
final List<String> types = new ArrayList<String>(); final List<String> types = new ArrayList<String>();
final List<String> svars = new ArrayList<String>();
final List<String> triggers = new ArrayList<String>();
if (sa.hasParam("Optional")) { if (sa.hasParam("Optional")) {
if (!sa.getActivatingPlayer().getController().confirmAction(sa, null, "Copy this permanent?")) { if (!sa.getActivatingPlayer().getController().confirmAction(sa, null, "Copy this permanent?")) {
return; return;
@@ -66,6 +70,12 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
if (sa.hasParam("AddTypes")) { if (sa.hasParam("AddTypes")) {
types.addAll(Arrays.asList(sa.getParam("AddTypes").split(" & "))); types.addAll(Arrays.asList(sa.getParam("AddTypes").split(" & ")));
} }
if (sa.hasParam("AddSVars")) {
svars.addAll(Arrays.asList(sa.getParam("AddSVars").split(" & ")));
}
if (sa.hasParam("Triggers")) {
triggers.addAll(Arrays.asList(sa.getParam("Triggers").split(" & ")));
}
final int numCopies = sa.hasParam("NumCopies") ? AbilityUtils.calculateAmount(hostCard, final int numCopies = sa.hasParam("NumCopies") ? AbilityUtils.calculateAmount(hostCard,
sa.getParam("NumCopies"), sa) : 1; sa.getParam("NumCopies"), sa) : 1;
@@ -241,6 +251,15 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
for (final String type : types) { for (final String type : types) {
copy.addType(type); copy.addType(type);
} }
for (final String svar : svars) {
final String actualsVar = hostCard.getSVar(svar);
copy.setSVar(svar, actualsVar);
}
for (final String s : triggers) {
final String actualTrigger = hostCard.getSVar(s);
final Trigger parsedTrigger = TriggerHandler.parseTrigger(actualTrigger, copy, false);
copy.addTrigger(parsedTrigger);
}
copy = game.getAction().moveToPlay(copy); copy = game.getAction().moveToPlay(copy);
copy.setCloneOrigin(hostCard); copy.setCloneOrigin(hostCard);

View File

@@ -4,6 +4,7 @@ import forge.game.Game;
import forge.game.ability.AbilityUtils; import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect; import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.card.CardLists;
import forge.game.player.Player; import forge.game.player.Player;
import forge.game.spellability.SpellAbility; import forge.game.spellability.SpellAbility;
import forge.game.zone.ZoneType; import forge.game.zone.ZoneType;
@@ -51,6 +52,9 @@ public class SacrificeAllEffect extends SpellAbilityEffect {
} else { } else {
list = AbilityUtils.filterListByType(game.getCardsIn(ZoneType.Battlefield), valid, sa); list = AbilityUtils.filterListByType(game.getCardsIn(ZoneType.Battlefield), valid, sa);
} }
if (sa.hasParam("Controller")) {
list = CardLists.filterControlledBy(list, AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("Controller"), sa));
}
final boolean remSacrificed = sa.hasParam("RememberSacrificed"); final boolean remSacrificed = sa.hasParam("RememberSacrificed");
if (remSacrificed) { if (remSacrificed) {

View File

@@ -1,6 +1,8 @@
Name:Heat Shimmer Name:Heat Shimmer
ManaCost:2 R ManaCost:2 R
Types:Sorcery Types:Sorcery
A:SP$CopyPermanent | Cost$ 2 R | ValidTgts$ Creature | TgtPrompt$ Select target creature | Keywords$ Haste | AtEOT$ Exile | SpellDescription$ Put a token that's a copy of target creature onto the battlefield. That token has haste and "At the beginning of the end step, exile this permanent." A:SP$CopyPermanent | Cost$ 2 R | ValidTgts$ Creature | TgtPrompt$ Select target creature | Keywords$ Haste | Triggers$ HeatShimmerTrig | AddSVars$ HearShimmerExile | SpellDescription$ Put a token that's a copy of target creature onto the battlefield. That token has haste and "At the beginning of the end step, exile this permanent."
SVar:HeatShimmerTrig:Mode$ Phase | Phase$ End of Turn | TriggerZones$ Battlefield | Execute$ HearShimmerExile | TriggerDescription$ At the beginning of the end step, exile CARDNAME.
SVar:HearShimmerExile:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | Defined$ Self
SVar:Picture:http://www.wizards.com/global/images/magic/general/heat_shimmer.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/heat_shimmer.jpg
Oracle:Put a token that's a copy of target creature onto the battlefield. That token has haste and "At the beginning of the end step, exile this permanent." Oracle:Put a token that's a copy of target creature onto the battlefield. That token has haste and "At the beginning of the end step, exile this permanent."