mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Fix and cleanup Hideaway. Plus a typo in Praetor's Grasp.
This commit is contained in:
@@ -52,6 +52,7 @@ public class EffectEffect extends SpellAbilityEffect {
|
||||
String effectRemembered = null;
|
||||
String effectImprinted = null;
|
||||
Player ownerEff = null;
|
||||
boolean imprintOnHost = false;
|
||||
|
||||
if (sa.hasParam("Abilities")) {
|
||||
effectAbilities = sa.getParam("Abilities").split(",");
|
||||
@@ -85,7 +86,6 @@ public class EffectEffect extends SpellAbilityEffect {
|
||||
effectImprinted = sa.getParam("ImprintCards");
|
||||
}
|
||||
|
||||
// Effect eff = new Effect();
|
||||
String name = sa.getParam("Name");
|
||||
if (name == null) {
|
||||
name = sa.getHostCard().getName() + "'s Effect";
|
||||
@@ -97,10 +97,14 @@ public class EffectEffect extends SpellAbilityEffect {
|
||||
}
|
||||
|
||||
if (sa.hasParam("EffectOwner")) {
|
||||
List<Player> effectOwner = AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("EffectOwner"), sa);
|
||||
final List<Player> effectOwner = AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("EffectOwner"), sa);
|
||||
ownerEff = effectOwner.get(0);
|
||||
}
|
||||
|
||||
if (sa.hasParam("ImprintOnHost")) {
|
||||
imprintOnHost = true;
|
||||
}
|
||||
|
||||
final Player controller = sa.hasParam("EffectOwner") ? ownerEff : sa.getActivatingPlayer();
|
||||
final Card eff = new Card(controller.getGame().nextCardId());
|
||||
eff.setName(name);
|
||||
@@ -112,8 +116,6 @@ public class EffectEffect extends SpellAbilityEffect {
|
||||
eff.setImmutable(true);
|
||||
eff.setEffectSource(hostCard);
|
||||
|
||||
final Card e = eff;
|
||||
|
||||
// Grant SVars first in order to give references to granted abilities
|
||||
if (effectSVars != null) {
|
||||
for (final String s : effectSVars) {
|
||||
@@ -211,7 +213,7 @@ public class EffectEffect extends SpellAbilityEffect {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
game.getAction().exile(e);
|
||||
game.getAction().exile(eff);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -233,6 +235,10 @@ public class EffectEffect extends SpellAbilityEffect {
|
||||
}
|
||||
}
|
||||
|
||||
if (imprintOnHost) {
|
||||
hostCard.addImprintedCard(eff);
|
||||
}
|
||||
|
||||
// TODO: Add targeting to the effect so it knows who it's dealing with
|
||||
game.getTriggerHandler().suppressMode(TriggerType.ChangesZone);
|
||||
game.getAction().moveTo(ZoneType.Command, eff);
|
||||
|
||||
@@ -2613,6 +2613,23 @@ public class CardFactoryUtil {
|
||||
card.addSpellAbility(bestow);
|
||||
card.getCurrentState().addUnparsedAbility(sbAttach.toString());
|
||||
}
|
||||
else if (keyword.equals("Hideaway")) {
|
||||
card.getCurrentState().addIntrinsicKeyword("CARDNAME enters the battlefield tapped.");
|
||||
|
||||
final Trigger hideawayTrigger = TriggerHandler.parseTrigger("Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigHideawayDig | TriggerDescription$ When CARDNAME enters the battlefield, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.", card, true);
|
||||
card.addTrigger(hideawayTrigger);
|
||||
card.setSVar("TrigHideawayDig", "DB$ Dig | Defined$ You | DigNum$ 4 | DestinationZone$ Exile | ExileFaceDown$ True | RememberChanged$ True | SubAbility$ DBHideawayEffect");
|
||||
final Trigger gainControlTrigger = TriggerHandler.parseTrigger("Mode$ ChangesController | ValidCard$ Card.Self | Execute$ DBHideawayEffect | Static$ True", card, true);
|
||||
card.addTrigger(gainControlTrigger);
|
||||
card.setSVar("DBHideawayEffect", "DB$ Effect | StaticAbilities$ STHideawayEffectLookAtCard | Triggers$ THideawayEffectCleanup | SVars$ DBHideawayEffectExileSelf | ImprintOnHost$ True | SubAbility$ DBHideawayRemember");
|
||||
card.setSVar("STHideawayEffectLookAtCard", "Mode$ Continuous | Affected$ Card.IsRemembered | MayLookAt$ True | EffectZone$ Command | AffectedZone$ Exile | Description$ You may look at the exiled card.");
|
||||
card.setSVar("THideawayEffectCleanup", "Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Exile | Destination$ Any | TriggerZone$ Command | Execute$ DBHideawayEffectExileSelf | Static$ True");
|
||||
card.setSVar("DBHideawayEffectExileSelf", "DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile");
|
||||
final Trigger changeZoneTrigger = TriggerHandler.parseTrigger("Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Exile | Destination$ Any | TriggerZone$ Command | Execute$ DBHideawayCleanup | Static$ True", card, true);
|
||||
card.addTrigger(changeZoneTrigger);
|
||||
card.setSVar("DBHideawayRemember", "DB$ Animate | Defined$ Imprinted | RememberObjects$ Remembered | Permanent$ True");
|
||||
card.setSVar("DBHideawayCleanup", "DB$ Cleanup | ClearRemembered$ True");
|
||||
}
|
||||
}
|
||||
|
||||
// AddCost
|
||||
|
||||
@@ -30,6 +30,7 @@ import forge.game.trigger.ZCTrigger;
|
||||
* </p>
|
||||
*
|
||||
* @author Forge
|
||||
|
||||
* @version $Id$
|
||||
*/
|
||||
public class PlayerZoneBattlefield extends PlayerZone {
|
||||
@@ -53,12 +54,6 @@ public class PlayerZoneBattlefield extends PlayerZone {
|
||||
super.add(c, position);
|
||||
|
||||
if (trigger) {
|
||||
if (c.hasKeyword("Hideaway")) {
|
||||
// it enters the battlefield this way, and should not fire
|
||||
// triggers
|
||||
c.setTapped(true);
|
||||
}
|
||||
else {
|
||||
// ETBTapped static abilities
|
||||
for (final Card ca : game.getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) {
|
||||
for (final StaticAbility stAb : ca.getStaticAbilities()) {
|
||||
@@ -70,7 +65,6 @@ public class PlayerZoneBattlefield extends PlayerZone {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (trigger) {
|
||||
c.setSickness(true); // summoning sickness
|
||||
|
||||
@@ -2,8 +2,6 @@ Name:Howltooth Hollow
|
||||
ManaCost:no cost
|
||||
Types:Land
|
||||
K:Hideaway
|
||||
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDig | TriggerDescription$ This land enters the battlefield tapped. When it does, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.
|
||||
SVar:TrigDig:AB$ Dig | Cost$ 0 | Defined$ You | DigNum$ 4 | DestinationZone$ Exile | ExileFaceDown$ True | RememberChanged$ True
|
||||
A:AB$ Mana | Cost$ T | Produced$ B | SpellDescription$ Add {B} to your mana pool.
|
||||
A:AB$ Play | Cost$ B T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ Hands | ConditionSVarCompare$ EQ0 | ForgetRemembered$ True | References$ Hands | SpellDescription$ You may play the exiled card without paying its mana cost if each player has no cards in hand.
|
||||
SVar:Hands:Count$NumInAllHands
|
||||
|
||||
@@ -2,8 +2,6 @@ Name:Mosswort Bridge
|
||||
ManaCost:no cost
|
||||
Types:Land
|
||||
K:Hideaway
|
||||
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDig | TriggerDescription$ This land enters the battlefield tapped. When it does, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.
|
||||
SVar:TrigDig:AB$ Dig | Cost$ 0 | Defined$ You | DigNum$ 4 | DestinationZone$ Exile | ExileFaceDown$ True | RememberChanged$ True | ForgetOtherRemembered$ True
|
||||
A:AB$ Mana | Cost$ T | Produced$ G | SpellDescription$ Add {G} to your mana pool.
|
||||
A:AB$ Play | Cost$ G T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | References$ X | ConditionCheckSVar$ X | ConditionSVarCompare$ GE10 | ForgetRemembered$ True | SpellDescription$ You may play the exiled card without paying its mana cost if creatures you control have total power 10 or greater.
|
||||
SVar:X:Count$SumPower_Creature.YouCtrl
|
||||
|
||||
@@ -2,7 +2,7 @@ Name:Praetor's Grasp
|
||||
ManaCost:1 B B
|
||||
Types:Sorcery
|
||||
A:SP$ ChangeZone | Cost$ 1 B B | Origin$ Library | Destination$ Exile | ExileFaceDown$ True | ValidTgts$ Opponent | ChangeType$ Card | ChangeNum$ 1 | IsCurse$ True | RememberChanged$ True | SubAbility$ DBEffect | StackDescription$ SpellDescription | SpellDescription$ Search target opponent's library for a card and exile it face down. Then that player shuffles his or her library. You may look at and play that card for as long as it remains exiled.
|
||||
SVar:DBEffect:DB$ Effect | MayLookAt$ True | MayPlay$ True | RememberObjects$ Remembered | StaticAbilities$ STPlay | Duration$ Permanent | Triggers$ TrigCleanup | SVars$ DBExileSelf | SubAbility$ DBCleanup
|
||||
SVar:DBEffect:DB$ Effect | RememberObjects$ Remembered | StaticAbilities$ STPlay | Duration$ Permanent | Triggers$ TrigCleanup | SVars$ DBExileSelf | SubAbility$ DBCleanup
|
||||
SVar:STPlay:Mode$ Continuous | MayLookAt$ True | MayPlay$ True | EffectZone$ Command | Affected$ Card.IsRemembered | AffectedZone$ Exile | Description$ You may look at and play a card as long as it remains exiled.
|
||||
SVar:TrigCleanup:Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Exile | Destination$ Any | TriggerZones$ Command | Execute$ DBExileSelf | Static$ True
|
||||
SVar:DBExileSelf:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile
|
||||
|
||||
@@ -2,8 +2,6 @@ Name:Shelldock Isle
|
||||
ManaCost:no cost
|
||||
Types:Land
|
||||
K:Hideaway
|
||||
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDig | TriggerDescription$ This land enters the battlefield tapped. When it does, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.
|
||||
SVar:TrigDig:AB$ Dig | Cost$ 0 | Defined$ You | DigNum$ 4 | DestinationZone$ Exile | ExileFaceDown$ True | RememberChanged$ True
|
||||
A:AB$ Mana | Cost$ T | Produced$ U | SpellDescription$ Add {U} to your mana pool.
|
||||
A:AB$ Play | Cost$ U T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ LE20 | ForgetRemembered$ True | References$ X | SpellDescription$ You may play the exiled card without paying its mana cost if a library has twenty or fewer cards in it.
|
||||
SVar:X:PlayerCountPlayers$LowestValidLibrary Card.YouOwn
|
||||
|
||||
@@ -2,8 +2,6 @@ Name:Spinerock Knoll
|
||||
ManaCost:no cost
|
||||
Types:Land
|
||||
K:Hideaway
|
||||
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDig | TriggerDescription$ This land enters the battlefield tapped. When it does, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.
|
||||
SVar:TrigDig:AB$ Dig | Cost$ 0 | Defined$ You | DigNum$ 4 | DestinationZone$ Exile | ExileFaceDown$ True | RememberChanged$ True
|
||||
A:AB$ Mana | Cost$ T | Produced$ R | SpellDescription$ Add {R} to your mana pool.
|
||||
A:AB$ Play | Cost$ R T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ GE7 | References$ X | ForgetRemembered$ True | SpellDescription$ You may play the exiled card without paying its mana cost if an opponent was dealt 7 or more damage this turn.
|
||||
SVar:X:Count$MaxOppDamageThisTurn
|
||||
|
||||
@@ -2,10 +2,8 @@ Name:Windbrisk Heights
|
||||
ManaCost:no cost
|
||||
Types:Land
|
||||
K:Hideaway
|
||||
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDig | TriggerDescription$ This land enters the battlefield tapped. When it does, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.
|
||||
SVar:TrigDig:AB$ Dig | Cost$ 0 | Defined$ You | DigNum$ 4 | DestinationZone$ Exile | ExileFaceDown$ True | RememberChanged$ True
|
||||
A:AB$ Mana | Cost$ T | Produced$ W | SpellDescription$ Add {W} to your mana pool.
|
||||
A:AB$ Play | Cost$ W T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ GE3 | ForgetRemembered$ True | PlayerTurn$ True | SpellDescription$ You may play the exiled card without paying its mana cost if you attacked with three or more creatures this turn.
|
||||
A:AB$ Play | Cost$ W T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ GE3 | References$ X | ForgetRemembered$ True | PlayerTurn$ True | SpellDescription$ You may play the exiled card without paying its mana cost if you attacked with three or more creatures this turn.
|
||||
SVar:X:Count$AttackersDeclared
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/windbrisk_heights.jpg
|
||||
|
||||
Reference in New Issue
Block a user