- Added Halfdane

This commit is contained in:
swordshine
2014-05-31 01:53:13 +00:00
parent 9405b8022e
commit 76c6812355
5 changed files with 52 additions and 1 deletions

1
.gitattributes vendored
View File

@@ -6379,6 +6379,7 @@ forge-gui/res/cardsfolder/h/hakim_loreweaver.txt -text
forge-gui/res/cardsfolder/h/halam_djinn.txt -text
forge-gui/res/cardsfolder/h/halberdier.txt svneol=native#text/plain
forge-gui/res/cardsfolder/h/halcyon_glaze.txt svneol=native#text/plain
forge-gui/res/cardsfolder/h/halfdane.txt -text
forge-gui/res/cardsfolder/h/halimar_depths.txt svneol=native#text/plain
forge-gui/res/cardsfolder/h/halimar_excavator.txt svneol=native#text/plain
forge-gui/res/cardsfolder/h/halimar_wavewatch.txt svneol=native#text/plain

View File

@@ -7,6 +7,7 @@ import forge.game.ability.AbilityUtils;
import forge.game.card.Card;
import forge.game.card.CardUtil;
import forge.game.event.GameEventCardStatsChanged;
import forge.game.phase.PhaseType;
import forge.game.replacement.ReplacementEffect;
import forge.game.replacement.ReplacementHandler;
import forge.game.spellability.SpellAbility;
@@ -290,6 +291,12 @@ public class AnimateEffect extends AnimateEffectBase {
source.addLeavesPlayCommand(unanimate);
} else if (sa.hasParam("UntilYourNextUpkeep")) {
game.getUpkeep().addUntil(source.getController(), unanimate);
} else if (sa.hasParam("UntilTheEndOfYourNextUpkeep")) {
if (game.getPhaseHandler().is(PhaseType.UPKEEP)) {
game.getUpkeep().registerUntilEnd(source.getController(), unanimate);
} else {
game.getUpkeep().addUntilEnd(source.getController(), unanimate);
}
} else if (sa.hasParam("UntilControllerNextUntap")) {
game.getUntap().addUntil(c.getController(), unanimate);
} else if (sa.hasParam("UntilYourNextTurn")) {

View File

@@ -93,7 +93,8 @@ public class Phase implements java.io.Serializable {
/** The until map. */
private final HashMap<Player, List<GameCommand>> untilMap = new HashMap<Player, List<GameCommand>>();
private final HashMap<Player, List<GameCommand>> untilEndMap = new HashMap<Player, List<GameCommand>>();
private final HashMap<Player, List<GameCommand>> registerMap = new HashMap<Player, List<GameCommand>>();
/**
* <p>
* Add a Command that will terminate an effect with "until <Player's> next <phase>".
@@ -121,6 +122,35 @@ public class Phase implements java.io.Serializable {
}
}
public final void registerUntilEnd(Player p, final GameCommand c) {
if (this.registerMap.containsKey(p)) {
this.registerMap.get(p).add(0, c);
} else {
this.registerMap.put(p, Lists.newArrayList(c));
}
}
public final void addUntilEnd(Player p, final GameCommand c) {
if (this.untilEndMap.containsKey(p)) {
this.untilEndMap.get(p).add(0, c);
} else {
this.untilEndMap.put(p, Lists.newArrayList(c));
}
}
public final void RegisterUntilEndCommand(final Player p) {
if (this.registerMap.containsKey(p)) {
this.untilEndMap.put(p, registerMap.get(p));
registerMap.remove(p);
}
}
public final void executeUntilEndOfPhase(final Player p) {
if (this.untilEndMap.containsKey(p)) {
this.execute(this.untilEndMap.get(p));
}
}
/**
* <p>
* execute.

View File

@@ -424,6 +424,8 @@ public class PhaseHandler implements java.io.Serializable {
c.getDamageHistory().setNotBlockedSinceLastUpkeepOf(this.getPlayerTurn());
c.getDamageHistory().setNotBeenBlockedSinceLastUpkeepOf(this.getPlayerTurn());
}
game.getUpkeep().executeUntilEndOfPhase(this.getPlayerTurn());
game.getUpkeep().RegisterUntilEndCommand(this.getPlayerTurn());
break;
case COMBAT_END:

View File

@@ -0,0 +1,11 @@
Name:Halfdane
ManaCost:1 W U B
Types:Legendary Creature Shapeshifter
PT:3/3
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigAnimate | TriggerDescription$ At the beginning of your upkeep, CARDNAME's power and toughness become equal to the power and toughness of target creature other than CARDNAME until the end of your next upkeep.
SVar:TrigAnimate:AB$ Pump | Cost$ 0 | ValidTgts$ Creature.Other | TgtPrompt$ Select target another creature | AILogic$ HighestPower | SubAbility$ DBAnimate
SVar:DBAnimate:DB$ Animate | Defined$ Self | Power$ X | Toughness$ Y | References$ X,Y | UntilTheEndOfYourNextUpkeep$ True
SVar:X:Targeted$CardPower
SVar:Y:Targeted$CardToughness
SVar:Picture:http://www.wizards.com/global/images/magic/general/halfdane.jpg
Oracle:At the beginning of your upkeep, Halfdane's power and toughness become equal to the power and toughness of target creature other than Halfdane until the end of your next upkeep.