From 541b4323c2933e3beb7f2d2aa34d5fbe7da5a4e3 Mon Sep 17 00:00:00 2001 From: melvinzhang Date: Sun, 7 May 2017 10:04:42 +0800 Subject: [PATCH] temp fix for #1116 by removing choice in rider and add check to detect future cases --- release/Magarena/scripts/Force_Away.txt | 2 +- release/Magarena/scripts/Shed_Weakness.txt | 2 +- release/Magarena/scripts/Swell_of_Growth.txt | 2 +- release/Magarena/scripts/Vedalken_Anatomist.txt | 2 +- src/magic/model/event/MagicRuleEventAction.java | 3 +++ src/magic/model/event/MagicSourceEvent.java | 4 ++++ 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/release/Magarena/scripts/Force_Away.txt b/release/Magarena/scripts/Force_Away.txt index 2b15241be0..dfe49fc196 100644 --- a/release/Magarena/scripts/Force_Away.txt +++ b/release/Magarena/scripts/Force_Away.txt @@ -4,6 +4,6 @@ value=3.167 rarity=C type=Instant cost={1}{U} -effect=Return target creature to its owner's hand.~If you control a creature with power 4 or greater, you may draw a card. If you do, discard a card. +effect=Return target creature to its owner's hand.~If you control a creature with power 4 or greater, draw a card. If you do, discard a card. timing=removal oracle=Return target creature to its owner's hand.\nFerocious — If you control a creature with power 4 or greater, you may draw a card. If you do, discard a card. diff --git a/release/Magarena/scripts/Shed_Weakness.txt b/release/Magarena/scripts/Shed_Weakness.txt index 8b2465dafe..c100e3dc92 100644 --- a/release/Magarena/scripts/Shed_Weakness.txt +++ b/release/Magarena/scripts/Shed_Weakness.txt @@ -4,6 +4,6 @@ value=2.500 rarity=C type=Instant cost={G} -effect=Target creature gets +2/+2 until end of turn.~You may remove a -1/-1 counter from *it*. +effect=Target creature gets +2/+2 until end of turn.~Remove a -1/-1 counter from *it*. timing=removal oracle=Target creature gets +2/+2 until end of turn. You may remove a -1/-1 counter from it. diff --git a/release/Magarena/scripts/Swell_of_Growth.txt b/release/Magarena/scripts/Swell_of_Growth.txt index 2093ffe074..a394818457 100644 --- a/release/Magarena/scripts/Swell_of_Growth.txt +++ b/release/Magarena/scripts/Swell_of_Growth.txt @@ -5,6 +5,6 @@ value=2.500 rarity=C type=Instant cost={1}{G} -effect=Target creature gets +2/+2 until end of turn.~You may put a land card from your hand onto the battlefield. +effect=Target creature gets +2/+2 until end of turn.~Put a land card from your hand onto the battlefield. timing=pump oracle=Target creature gets +2/+2 until end of turn. You may put a land card from your hand onto the battlefield. diff --git a/release/Magarena/scripts/Vedalken_Anatomist.txt b/release/Magarena/scripts/Vedalken_Anatomist.txt index 549f21b10d..7a421126e9 100644 --- a/release/Magarena/scripts/Vedalken_Anatomist.txt +++ b/release/Magarena/scripts/Vedalken_Anatomist.txt @@ -6,6 +6,6 @@ type=Creature subtype=Vedalken,Wizard cost={2}{U} pt=1/2 -ability={2}{U}, {T}: Put a -1/-1 counter on target creature.~You may tap or untap *that creature*. +ability={2}{U}, {T}: Put a -1/-1 counter on target creature.~Tap or untap *that creature*. timing=main oracle={2}{U}, {T}: Put a -1/-1 counter on target creature. You may tap or untap that creature. diff --git a/src/magic/model/event/MagicRuleEventAction.java b/src/magic/model/event/MagicRuleEventAction.java index 00c336b82a..930ea07e03 100644 --- a/src/magic/model/event/MagicRuleEventAction.java +++ b/src/magic/model/event/MagicRuleEventAction.java @@ -2995,6 +2995,9 @@ public enum MagicRuleEventAction { if (hasReference == false && riderSourceEvent.getChoice().isValid()) { throw new RuntimeException("rider should not have choice: \"" + part[i] + "\""); } + if (riderSourceEvent.getEventChoice() instanceof MagicMayChoice) { + throw new RuntimeException("rider should not have choice: \"" + part[i] + "\""); + } acts[i] = riderSourceEvent.getEventAction(); part[i] = matcher.replaceAll("$1"); diff --git a/src/magic/model/event/MagicSourceEvent.java b/src/magic/model/event/MagicSourceEvent.java index 8b23ccdee3..046df40e70 100644 --- a/src/magic/model/event/MagicSourceEvent.java +++ b/src/magic/model/event/MagicSourceEvent.java @@ -100,6 +100,10 @@ public class MagicSourceEvent { return rule.getChoice(matcher); } + public MagicChoice getEventChoice() { + return choiceFact.build(MagicSource.NONE, MagicPlayer.NONE, MagicEvent.NO_REF); + } + public MagicTargetPicker getPicker() { return rule.getPicker(matcher); }