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

@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -28,7 +28,7 @@ import forge.util.Localizer;
* <p>
* Trigger_LandPlayed class.
* </p>
*
*
* @author Forge
* @version $Id$
*/
@@ -38,7 +38,7 @@ public class TriggerLandPlayed extends Trigger {
* <p>
* Constructor for Trigger_LandPlayed.
* </p>
*
*
* @param params
* a {@link java.util.HashMap} object.
* @param host
@@ -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.