Add ValidSA check to LandPlayed trigger

This commit is contained in:
Lyu Zong-Hong
2021-07-23 11:38:55 +09:00
parent 5d9e0f54a6
commit ebcfa5b084
4 changed files with 16 additions and 11 deletions

View File

@@ -1778,7 +1778,9 @@ public class Player extends GameEntity implements Comparable<Player> {
game.fireEvent(new GameEventLandPlayed(this, land));
// Run triggers
game.getTriggerHandler().runTrigger(TriggerType.LandPlayed, AbilityKey.mapFromCard(land), false);
Map<AbilityKey, Object> runParams = AbilityKey.mapFromCard(land);
runParams.put(AbilityKey.SpellAbility, cause);
game.getTriggerHandler().runTrigger(TriggerType.LandPlayed, runParams, false);
game.getStack().unfreezeStack();
addLandPlayedThisTurn();

View File

@@ -71,7 +71,7 @@ public class LandAbility extends Ability {
@Override
public void resolve() {
getHostCard().setSplitStateToPlayAbility(this);
final Card result = getActivatingPlayer().playLandNoCheck(getHostCard(), null);
final Card result = getActivatingPlayer().playLandNoCheck(getHostCard(), this);
// increase mayplay used
if (getMayPlay() != null) {

View File

@@ -71,6 +71,10 @@ public class TriggerLandPlayed extends Trigger {
return false;
}
if (!matchesValidParam("ValidSA", runParams.get(AbilityKey.SpellAbility))) {
return false;
}
if (hasParam("NotFirstLand")) {
Card land = (Card) runParams.get(AbilityKey.Card);
if (land.getController().getLandsPlayedThisTurn() < 1) {

View File

@@ -1,8 +1,7 @@
Name:Share the Spoils
ManaCost:1 R
Types:Enchantment
T:Mode$ ChangesZone | ValidCard$ Card.nonLand+IsRemembered | Origin$ Exile | Destination$ Any | ExcludedDestinations$ Stack | TriggerZones$ Battlefield | Execute$ TrigForget | Static$ True
T:Mode$ ChangesZone | ValidCard$ Land.IsRemembered | Origin$ Exile | Destination$ Any | ExcludedDestinations$ Battlefield | TriggerZones$ Battlefield | Execute$ TrigForget | Static$ True
T:Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Exile | Destination$ Any | TriggerZones$ Battlefield | Execute$ TrigForget | Static$ True
SVar:TrigForget:DB$ Pump | ForgetObjects$ TriggeredCard
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Any | Execute$ DBCleanup | Static$ True
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
@@ -10,7 +9,7 @@ T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefi
T:Mode$ LosesGame | ValidPlayer$ Player.Opponent | TriggerZones$ Battlefield | Execute$ TrigExile | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield or an opponent loses the game, exile the top card of each player's library.
SVar:TrigExile:DB$ Dig | DigNum$ 1 | ChangeNum$ All | Defined$ Player | DestinationZone$ Exile | RememberChanged$ True
S:Mode$ Continuous | Affected$ Card.IsRemembered | MayPlay$ True | MayPlayLimit$ 1 | MayPlayIgnoreColor$ True | MayPlayPlayer$ ActivePlayer | EffectZone$ Battlefield | AffectedZone$ Exile | Description$ During each player's turn, that player may play a land or cast a spell from among cards exiled with CARDNAME, and they may spend mana as though it were mana of any color to cast that spell. When they do, exile the top card of their library.
T:Mode$ SpellCast | ValidCard$ Card.IsRemembered | TriggerZones$ Battlefield | Execute$ TrigExileTop | Secondary$ True | TriggerDescription$ When they do, exile the top card of their library.
T:Mode$ LandPlayed | ValidCard$ Card.IsRemembered | TriggerZones$ Battlefield | Execute$ TrigExileTop | Secondary$ True | TriggerDescription$ When they do, exile the top card of their library.
SVar:TrigExileTop:DB$ Dig | DigNum$ 1 | ChangeNum$ All | Defined$ TriggeredCardController | DestinationZone$ Exile | RememberChanged$ True | SubAbility$ TrigForget
T:Mode$ SpellCast | ValidCard$ Card | ValidSA$ Spell.MayPlaySource | TriggerZones$ Battlefield | Execute$ TrigExileTop | Secondary$ True | TriggerDescription$ When they do, exile the top card of their library.
T:Mode$ LandPlayed | ValidCard$ Land | ValidSA$ SpellAbility.MayPlaySource | TriggerZones$ Battlefield | Execute$ TrigExileTop | Secondary$ True | TriggerDescription$ When they do, exile the top card of their library.
SVar:TrigExileTop:DB$ Dig | DigNum$ 1 | ChangeNum$ All | Defined$ TriggeredCardController | DestinationZone$ Exile | RememberChanged$ True
Oracle:When Share the Spoils enters the battlefield or an opponent loses the game, exile the top card of each player's library.\nDuring each player's turn, that player may play a land or cast a spell from among cards exiled with Share the Spoils, and they may spend mana as though it were mana of any color to cast that spell. When they do, exile the top card of their library.