This commit is contained in:
jyockey
2022-05-23 20:21:04 -07:00
9 changed files with 71 additions and 11 deletions

View File

@@ -1,8 +1,5 @@
package forge.game.ability.effects; package forge.game.ability.effects;
import java.util.Arrays;
import java.util.List;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import forge.GameCommand; import forge.GameCommand;
@@ -17,6 +14,10 @@ import forge.game.event.GameEventCombatChanged;
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;
import forge.util.Localizer;
import java.util.Arrays;
import java.util.List;
public class ControlGainEffect extends SpellAbilityEffect { public class ControlGainEffect extends SpellAbilityEffect {
@@ -102,6 +103,7 @@ public class ControlGainEffect extends SpellAbilityEffect {
@Override @Override
public void resolve(SpellAbility sa) { public void resolve(SpellAbility sa) {
Card source = sa.getHostCard(); Card source = sa.getHostCard();
final Player activator = sa.getActivatingPlayer();
final boolean bUntap = sa.hasParam("Untap"); final boolean bUntap = sa.hasParam("Untap");
final boolean bTapOnLose = sa.hasParam("TapOnLose"); final boolean bTapOnLose = sa.hasParam("TapOnLose");
@@ -112,13 +114,24 @@ public class ControlGainEffect extends SpellAbilityEffect {
final List<Player> controllers = getDefinedPlayersOrTargeted(sa, "NewController"); final List<Player> controllers = getDefinedPlayersOrTargeted(sa, "NewController");
final Player newController = controllers.isEmpty() ? sa.getActivatingPlayer() : controllers.get(0); final Player newController = controllers.isEmpty() ? activator : controllers.get(0);
final Game game = newController.getGame(); final Game game = newController.getGame();
CardCollectionView tgtCards = getDefinedCards(sa); CardCollectionView tgtCards = null;
if (sa.hasParam("ControlledByTarget")) { if (sa.hasParam("ControlledByTarget")) {
tgtCards = CardLists.filterControlledBy(tgtCards, getTargetPlayers(sa)); tgtCards = CardLists.filterControlledBy(tgtCards, getTargetPlayers(sa));
} else if (sa.hasParam("Choices")) {
Player chooser = sa.hasParam("Chooser") ? AbilityUtils.getDefinedPlayers(source,
sa.getParam("Chooser"), sa).get(0) : activator;
CardCollectionView choices = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield),
sa.getParam("Choices"), activator, source, sa);
if (!choices.isEmpty()) {
String title = sa.hasParam("ChoiceTitle") ? sa.getParam("ChoiceTitle") :
Localizer.getInstance().getMessage("lblChooseaCard") +" ";
tgtCards = activator.getController().chooseCardsForEffect(choices, sa, title, 1, 1, false, null);
}
} else {
tgtCards = getDefinedCards(sa);
} }
// in case source was LKI or still resolving // in case source was LKI or still resolving

View File

@@ -73,6 +73,8 @@ public enum CounterEnumType {
COMPONENT("COMPN", 224, 160, 48), COMPONENT("COMPN", 224, 160, 48),
CONTESTED("CONTES", 255, 76, 2),
CORPSE("CRPSE", 230, 186, 209), CORPSE("CRPSE", 230, 186, 209),
CORRUPTION("CRPTN", 210, 121, 210), CORRUPTION("CRPTN", 210, 121, 210),

View File

@@ -2,6 +2,7 @@ Name:Aerie Worshippers
ManaCost:3 U ManaCost:3 U
Types:Creature Human Cleric Types:Creature Human Cleric
PT:2/4 PT:2/4
T:Mode$ Untaps | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ GFGToken | TriggerDescription$ Inspired — Whenever CARDNAME becomes untapped, you may pay {2}{U}. If you do, create a 2/2 blue Bird enchantment creature token with flying. T:Mode$ Untaps | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigToken | TriggerDescription$ Inspired — Whenever CARDNAME becomes untapped, you may pay {2}{U}. If you do, create a 2/2 blue Bird enchantment creature token with flying.
SVar:GFGToken:AB$ Token | Cost$ 2 U | TokenAmount$ 1 | TokenScript$ u_2_2_e_bird_flying | TokenOwner$ You SVar:TrigToken:AB$ Token | Cost$ 2 U | TokenScript$ u_2_2_e_bird_flying
DeckHas:Ability$Token & Type$Bird|Enchantment
Oracle:Inspired — Whenever Aerie Worshippers becomes untapped, you may pay {2}{U}. If you do, create a 2/2 blue Bird enchantment creature token with flying. Oracle:Inspired — Whenever Aerie Worshippers becomes untapped, you may pay {2}{U}. If you do, create a 2/2 blue Bird enchantment creature token with flying.

View File

@@ -3,10 +3,10 @@ ManaCost:1 U B R
Types:Legendary Creature Vampire Wizard Types:Legendary Creature Vampire Wizard
PT:1/3 PT:1/3
K:Flying K:Flying
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigExile | TriggerDescription$ When CARDNAME enters the battlefield, each player exiles the top X cards of their library, where X is the amount of mana spent to cast Jeleva. T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigExile | TriggerDescription$ When CARDNAME enters the battlefield, each player exiles the top X cards of their library, where X is the amount of mana spent to cast NICKNAME.
SVar:TrigExile:DB$ Dig | Defined$ Player | DigNum$ X | ChangeNum$ All | RememberChanged$ True | DestinationZone$ Exile SVar:TrigExile:DB$ Dig | Defined$ Player | DigNum$ X | ChangeNum$ All | RememberChanged$ True | DestinationZone$ Exile
SVar:X:Count$CastTotalManaSpent SVar:X:Count$CastTotalManaSpent
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigPlay | OptionalDecider$ You | TriggerDescription$ Whenever CARDNAME attacks, you may cast an instant or sorcery card exiled with it without paying its mana cost. T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigPlay | OptionalDecider$ You | TriggerDescription$ Whenever NICKNAME attacks, you may cast an instant or sorcery card from among cards exiled with NICKNAME without paying its mana cost.
SVar:TrigPlay:DB$ Play | ValidZone$ Exile | Valid$ Instant.IsRemembered+ExiledWithSource,Sorcery.IsRemembered+ExiledWithSource | ValidSA$ Spell | Controller$ You | WithoutManaCost$ True | Amount$ 1 SVar:TrigPlay:DB$ Play | ValidZone$ Exile | Valid$ Instant.IsRemembered+ExiledWithSource,Sorcery.IsRemembered+ExiledWithSource | ValidSA$ Spell | Controller$ You | WithoutManaCost$ True | Amount$ 1
T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | Static$ True | ValidCard$ Card.IsRemembered+ExiledWithSource | Execute$ DBForget T:Mode$ ChangesZone | Origin$ Exile | Destination$ Any | Static$ True | ValidCard$ Card.IsRemembered+ExiledWithSource | Execute$ DBForget
SVar:DBForget:DB$ Pump | Defined$ TriggeredCard | ForgetObjects$ TriggeredCard SVar:DBForget:DB$ Pump | Defined$ TriggeredCard | ForgetObjects$ TriggeredCard

View File

@@ -3,7 +3,7 @@ ManaCost:no cost
Types:Plane Segovia Types:Plane Segovia
S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature | AddPower$ -5 | Description$ All Creatures get -5/-0. S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature | AddPower$ -5 | Description$ All Creatures get -5/-0.
T:Mode$ PlanarDice | Result$ Chaos | OptionalDecider$ You | TriggerZones$ Command | Execute$ RolledChaos | TriggerDescription$ Whenever you roll {CHAOS}, you may destroy target creature if it's power is 0 or less. T:Mode$ PlanarDice | Result$ Chaos | OptionalDecider$ You | TriggerZones$ Command | Execute$ RolledChaos | TriggerDescription$ Whenever you roll {CHAOS}, you may destroy target creature if it's power is 0 or less.
SVar:RolledChaos:DB$ Destroy | ValidTgts$ Creature | ConditionCheckSVar$ TgtPow | ConditionSVarCompare$ EQ1 | AITgts$ Creature.OpponentCtrl+powerLE0 SVar:RolledChaos:DB$ Destroy | ValidTgts$ Creature | ConditionCheckSVar$ TgtPow | ConditionSVarCompare$ EQ1 | AITgts$ Creature.OppCtrl+powerLE0
SVar:TgtPow:Targeted$Valid Creature.powerLE0 SVar:TgtPow:Targeted$Valid Creature.powerLE0
SVar:AIRollPlanarDieParams:Mode$ Always SVar:AIRollPlanarDieParams:Mode$ Always
Oracle:All creatures get -5/-0.\nWhenever you roll {CHAOS}, you may destroy target creature if its power is 0 or less. Oracle:All creatures get -5/-0.\nWhenever you roll {CHAOS}, you may destroy target creature if its power is 0 or less.

View File

@@ -0,0 +1,7 @@
Name:Elminster's Simulacrum
ManaCost:4 U U
Types:Instant
A:SP$ CopyPermanent | ValidTgts$ Creature.OppCtrl | TgtPrompt$ For each opponent, select up to one target creature that they control | TargetMin$ 0 | TargetMax$ OneEach | TargetsWithDifferentControllers$ True | SpellDescription$ For each opponent, you create a token that's a copy of up to one target creature that player controls.
SVar:OneEach:PlayerCountOpponents$Amount
DeckHas:Ability$Token
Oracle:For each opponent, you create a token that's a copy of up to one target creature that player controls.

View File

@@ -0,0 +1,14 @@
Name:Myrkul, Lord of Bones
ManaCost:4 W B G
Types:Legendary Creature God
PT:7/5
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Indestructible | CheckSVar$ X | SVarCompare$ LEY | Description$ As long as your life total is less than or equal to half your starting life total, CARDNAME has indestructible.
SVar:X:Count$YourLifeTotal/Times.2
SVar:Y:Count$YourStartingLife
T:Mode$ ChangesZone | ValidCard$ Creature.nonToken+Other+YouCtrl | Origin$ Battlefield | Destination$ Graveyard | TriggerZones$ Battlefield | Execute$ TrigExile | OptionalDecider$ You | TriggerDescription$ Whenever another nontoken creature you control dies, you may exile it. If you do, create a token that's a copy of that card, except it's an enchantment and loses all other card types.
SVar:TrigExile:DB$ ChangeZone | Defined$ TriggeredNewCardLKICopy | Origin$ Graveyard | Destination$ Exile | RememberChanged$ True | SubAbility$ DBCopy
SVar:DBCopy:DB$ CopyPermanent | Defined$ TriggeredCardLKICopy | AddTypes$ Enchantment | RemoveCardTypes$ True | ConditionDefined$ TriggeredNewCardLKICopy | ConditionPresent$ Card | ConditionCompare$ EQExiledCount | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:ExiledCount:Count$RememberedSize
DeckHas:Ability$Token
Oracle:As long as your life total is less than or equal to half your starting life total, Myrkul, Lord of Bones has indestructible.\nWhenever another nontoken creature you control dies, you may exile it. If you do, create a token that's a copy of that card, except it's an enchantment and loses all other card types.

View File

@@ -0,0 +1,14 @@
Name:Seize the Spotlight
ManaCost:2 R
Types:Sorcery
A:SP$ RepeatEach | RepeatPlayers$ Opponent | RepeatSubAbility$ DBChoice | SubAbility$ DBFame | ClearRememberedBeforeLoop$ True | SpellDescription$ Each opponent chooses fame or fortune. For each player who chose fame, gain control of a creature that player controls until end of turn. Untap those creatures and they gain haste until end of turn. For each player who chose fortune, you draw a card and create a Treasure token.
SVar:DBChoice:DB$ GenericChoice | Defined$ Player.IsRemembered | Choices$ Fame,Fortune | ShowChoice$ True
SVar:Fame:DB$ Pump | Defined$ Player.IsRemembered | NoteCards$ Self | NoteCardsFor$ Fame | SpellDescription$ Fame
SVar:Fortune:DB$ Pump | Defined$ Player.IsRemembered | NoteCards$ Self | NoteCardsFor$ Fortune | SpellDescription$ Fortune
SVar:DBFame:DB$ RepeatEach | RepeatPlayers$ Player.NotedForFame | RepeatSubAbility$ GainControl | SubAbility$ DBFortune | ClearRememberedBeforeLoop$ True
SVar:GainControl:DB$ GainControl | Choices$ Creature.RememberedPlayerCtrl | LoseControl$ EOT | Untap$ True | AddKWs$ Haste
SVar:DBFortune:DB$ RepeatEach | RepeatPlayers$ Player.NotedForFortune | RepeatSubAbility$ DBDraw | ClearRememberedBeforeLoop$ True
SVar:DBDraw:DB$ Draw | SubAbility$ DBTreasure
SVar:DBTreasure:DB$ Token | TokenScript$ c_a_treasure_sac
DeckHas:Ability$Token|Sacrifice & Types$Artifact|Treasure
Oracle:Each opponent chooses fame or fortune. For each player who chose fame, gain control of a creature that player controls until end of turn. Untap those creatures and they gain haste until end of turn. For each player who chose fortune, you draw a card and create a Treasure token.

View File

@@ -0,0 +1,9 @@
Name:Turf War
ManaCost:4 R
Types:Enchantment
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPutCounter | TriggerDescription$ When CARDNAME enters the battlefield, for each player, put a contested counter on target land that player controls.
SVar:TrigPutCounter:DB$ PutCounter | CounterType$ CONTESTED | ValidTgts$ Land | TgtPrompt$ For each player, select a target land | TargetMin$ OneEach | TargetMax$ OneEach | TargetsWithDifferentControllers$ True
SVar:OneEach:PlayerCountPlayers$Amount
T:Mode$ DamageDone | ValidSource$ Creature | ValidTarget$ Player.controlsLand+counters_GE1_CONTESTED | CombatDamage$ True | TriggerZones$ Battlefield | Execute$ TrigGainControl | TriggerDescription$ Whenever a creature deals combat damage to a player, if that player controls one or more lands with contested counters on them, that creature's controller gains control of one of those lands of their choice and untaps it.
SVar:TrigGainControl:DB$ GainControl | Choices$ Land.ControlledBy TriggeredTarget+counters_GE1_CONTESTED | Untap$ True | NewController$ TriggeredSourceController
Oracle:When Turf War enters the battlefield, for each player, put a contested counter on target land that player controls.\nWhenever a creature deals combat damage to a player, if that player controls one or more lands with contested counters on them, that creature's controller gains control of one of those lands of their choice and untaps it.