- A somewhat cleaner implementation for the fixes for Explorer's Scope and Quest for Ula's Temple.

This commit is contained in:
Agetian
2015-09-23 06:09:05 +00:00
parent ed6afbc77b
commit 6e3eac1258
3 changed files with 20 additions and 15 deletions

View File

@@ -73,6 +73,14 @@ public class DigEffect extends SpellAbilityEffect {
final boolean noMove = sa.hasParam("NoMove"); final boolean noMove = sa.hasParam("NoMove");
final boolean skipReorder = sa.hasParam("SkipReorder"); final boolean skipReorder = sa.hasParam("SkipReorder");
// A hack for cards like Explorer's Scope that need to ensure that a card is revealed to the player activating the ability
final boolean forceRevealToController = sa.hasParam("ForceRevealToController");
// These parameters are used to indicate that a dialog box must be show to the player asking if the player wants to proceed
// with an optional ability, otherwise the optional ability is skipped.
final boolean mayBeSkipped = sa.hasParam("PromptToSkipOptionalAbility");
final String optionalAbilityPrompt = sa.hasParam("OptionalAbilityPrompt") ? sa.getParam("OptionalAbilityPrompt") : "";
boolean changeAll = false; boolean changeAll = false;
boolean allButOne = false; boolean allButOne = false;
final List<String> keywords = new ArrayList<String>(); final List<String> keywords = new ArrayList<String>();
@@ -189,24 +197,21 @@ public class DigEffect extends SpellAbilityEffect {
andOrCards = new CardCollection(); andOrCards = new CardCollection();
} }
if (sa.hasParam("ForcedRevealToController")) { if (forceRevealToController) {
// TODO: this parameter is used on Explorer's Scope to ensure the card is shown to the ability controller // Force revealing the card to the player activating the ability (e.g. Explorer's Scope)
// (making this global for ChangeNum=All,NumToDig=1 causes cards like Quest for Ula's Temple to reveal the card multiple times,
// but something has to be done about this to make it more universal)
game.getAction().revealTo(top, player); game.getAction().revealTo(top, player);
} }
// Optional abilities that use a dialog box to prompt the user to skip the ability (e.g. Explorer's Scope, Quest for Ula's Temple)
if (optional && mayBeSkipped && !valid.isEmpty()) {
String prompt = !optionalAbilityPrompt.isEmpty() ? optionalAbilityPrompt : "Would you like to proceed with the optional ability for " + sa.getHostCard() + "?\n\n(" + sa.getDescription() + ")";
if (!p.getController().confirmAction(sa, null, prompt)) {
return;
}
}
if (changeAll) { if (changeAll) {
movedCards = new CardCollection(valid); movedCards = new CardCollection(valid);
if (optional && !valid.isEmpty() && sa.hasParam("ShowOptionalAbilityPrompt")) {
// TODO: Without ShowOptionalAbilityPrompt, ChangeAll mode with NumToDig = 1 does not give the player any confirmation request
// (however, making it global for this mode causes it to appear for cards with subabilities which do not require extra
// prompting, e.g. Write into Being or Quest for Ula's Temple).
if (!p.getController().confirmAction(sa, null, sa.getParam("ShowOptionalAbilityPrompt"))) {
return;
}
}
} }
else if (sa.hasParam("RandomChange")) { else if (sa.hasParam("RandomChange")) {
int numChanging = Math.min(destZone1ChangeNum, valid.size()); int numChanging = Math.min(destZone1ChangeNum, valid.size());

View File

@@ -3,6 +3,6 @@ ManaCost:1
Types:Artifact Equipment Types:Artifact Equipment
K:Equip 1 K:Equip 1
T:Mode$ Attacks | ValidCard$ Card.AttachedBy | Execute$ TrigDig | TriggerDescription$ Whenever equipped creature attacks, look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped. T:Mode$ Attacks | ValidCard$ Card.AttachedBy | Execute$ TrigDig | TriggerDescription$ Whenever equipped creature attacks, look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped.
SVar:TrigDig:AB$Dig | Cost$ 0 | DigNum$ 1 | ChangeNum$ All | ForcedRevealToController$ True | Optional$ True | ShowOptionalAbilityPrompt$ Would you like to put the land onto the battlefield tapped? | ChangeValid$ Land | DestinationZone$ Battlefield | Tapped$ True | LibraryPosition2$ 0 SVar:TrigDig:AB$Dig | Cost$ 0 | DigNum$ 1 | ChangeNum$ All | ForceRevealToController$ True | Optional$ True | PromptToSkipOptionalAbility$ True | OptionalAbilityPrompt$ Would you like to put the land onto the battlefield tapped? | ChangeValid$ Land | DestinationZone$ Battlefield | Tapped$ True | LibraryPosition2$ 0
SVar:Picture:http://www.wizards.com/global/images/magic/general/explorers_scope.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/explorers_scope.jpg
Oracle:Whenever equipped creature attacks, look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped.\nEquip {1} ({1}: Attach to target creature you control. Equip only as a sorcery Oracle:Whenever equipped creature attacks, look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped.\nEquip {1} ({1}: Attach to target creature you control. Equip only as a sorcery

View File

@@ -3,7 +3,7 @@ ManaCost:U
Types:Enchantment Types:Enchantment
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigDig | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ At the beginning of your upkeep, you may look at the top card of your library. If it's a creature card, you may reveal it and put a quest counter on Quest for CARDNAME. T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigDig | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ At the beginning of your upkeep, you may look at the top card of your library. If it's a creature card, you may reveal it and put a quest counter on Quest for CARDNAME.
SVar:TrigDig:AB$ Dig | Cost$ 0 | DigNum$ 1 | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | SubAbility$ TrigDig2 SVar:TrigDig:AB$ Dig | Cost$ 0 | DigNum$ 1 | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | SubAbility$ TrigDig2
SVar:TrigDig2:DB$ Dig | Cost$ 0 | DigNum$ 1 | ChangeNum$ All | RevealValid$ Creature | ChangeValid$ Creature | Optional$ True | ShowOptionalAbilityPrompt$ Would you like to reveal the creature and put a quest counter on Quest for Ula's Temple? | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | RememberChanged$ True | SubAbility$ DBPutCounter SVar:TrigDig2:DB$ Dig | Cost$ 0 | DigNum$ 1 | ChangeNum$ All | RevealValid$ Creature | ChangeValid$ Creature | Optional$ True | PromptToSkipOptionalAbility$ True | OptionalAbilityPrompt$ Would you like to reveal the creature and put a quest counter on Quest for Ula's Temple? | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | RememberChanged$ True | SubAbility$ DBPutCounter
SVar:DBPutCounter:DB$ PutCounter | CounterType$ QUEST | CounterNum$ 1 | Defined$ Self | ConditionDefined$ Remembered | ConditionPresent$ Creature | ConditionCompare$ EQ1 | SubAbility$ DBCleanup SVar:DBPutCounter:DB$ PutCounter | CounterType$ QUEST | CounterNum$ 1 | Defined$ Self | ConditionDefined$ Remembered | ConditionPresent$ Creature | ConditionCompare$ EQ1 | SubAbility$ DBCleanup
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ Player | Execute$ TrigChangeZone | OptionalDecider$ You | TriggerZones$ Battlefield | IsPresent$ Card.Self+counters_GE3_QUEST | PresentCompare$ EQ1 | TriggerDescription$ At the beginning of each end step, if there are three or more quest counters on Quest for CARDNAME, you may put a Kraken, Leviathan, Octopus, or Serpent creature card from your hand onto the battlefield. T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ Player | Execute$ TrigChangeZone | OptionalDecider$ You | TriggerZones$ Battlefield | IsPresent$ Card.Self+counters_GE3_QUEST | PresentCompare$ EQ1 | TriggerDescription$ At the beginning of each end step, if there are three or more quest counters on Quest for CARDNAME, you may put a Kraken, Leviathan, Octopus, or Serpent creature card from your hand onto the battlefield.
SVar:TrigChangeZone:AB$ ChangeZone | Cost$ 0 | Origin$ Hand | Destination$ Battlefield | ChangeType$ Creature.Kraken,Creature.Leviathan,Creature.Octopus,Creature.Serpent | ChangeNum$ 1 | Hidden$ True SVar:TrigChangeZone:AB$ ChangeZone | Cost$ 0 | Origin$ Hand | Destination$ Battlefield | ChangeType$ Creature.Kraken,Creature.Leviathan,Creature.Octopus,Creature.Serpent | ChangeNum$ 1 | Hidden$ True