mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Draw: use Cause if able (#4614)
* Draw: use Cause if able * Avoid Thousand Moons Smithy warning
This commit is contained in:
@@ -96,11 +96,7 @@ public class DrawEffect extends SpellAbilityEffect {
|
||||
|
||||
final CardCollectionView drawn = p.drawCards(actualNum, sa, moveParams);
|
||||
if (sa.hasParam("Reveal")) {
|
||||
if (sa.getParam("Reveal").equals("All")) {
|
||||
p.getGame().getAction().reveal(drawn, p, false);
|
||||
} else {
|
||||
p.getGame().getAction().reveal(drawn, p);
|
||||
}
|
||||
p.getGame().getAction().reveal(drawn, p, !sa.getParam("Reveal").equals("All"));
|
||||
}
|
||||
if (sa.hasParam("RememberDrawn")) {
|
||||
source.addRemembered(drawn);
|
||||
|
||||
@@ -82,10 +82,8 @@ public class RevealEffect extends SpellAbilityEffect {
|
||||
} else {
|
||||
game.getAction().reveal(revealed, p);
|
||||
}
|
||||
for (final Card c : revealed) {
|
||||
if (sa.hasParam("RememberRevealed")) {
|
||||
host.addRemembered(c);
|
||||
}
|
||||
if (sa.hasParam("RememberRevealed")) {
|
||||
host.addRemembered(revealed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -792,7 +792,6 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
public boolean turnFaceUp(SpellAbility cause) {
|
||||
return turnFaceUp(true, cause);
|
||||
}
|
||||
|
||||
public boolean turnFaceUp(boolean runTriggers, SpellAbility cause) {
|
||||
if (!isFaceDown()) {
|
||||
return false;
|
||||
|
||||
@@ -1184,7 +1184,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
}
|
||||
|
||||
public final CardCollectionView drawCard() {
|
||||
return drawCards(1, null, AbilityKey.newMap());
|
||||
return drawCards(1);
|
||||
}
|
||||
|
||||
public final CardCollectionView drawCards(final int n) {
|
||||
@@ -1230,10 +1230,15 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
/**
|
||||
* @return a CardCollectionView of cards actually drawn
|
||||
*/
|
||||
private CardCollectionView doDraw(Map<Player, CardCollection> revealed, SpellAbility cause, Map<AbilityKey, Object> params) {
|
||||
private CardCollectionView doDraw(Map<Player, CardCollection> revealed, SpellAbility sa, Map<AbilityKey, Object> params) {
|
||||
final CardCollection drawn = new CardCollection();
|
||||
final PlayerZone library = getZone(ZoneType.Library);
|
||||
|
||||
SpellAbility cause = sa;
|
||||
if (cause != null && cause.isReplacementAbility()) {
|
||||
cause = (SpellAbility) cause.getReplacingObject(AbilityKey.Cause);
|
||||
}
|
||||
|
||||
// Replacement effects
|
||||
Map<AbilityKey, Object> repParams = AbilityKey.mapFromAffected(this);
|
||||
repParams.put(AbilityKey.Cause, cause);
|
||||
@@ -1263,6 +1268,12 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
c = game.getAction().moveToHand(c, cause, params);
|
||||
drawn.add(c);
|
||||
|
||||
// CR 121.6c additional actions can't be performed when draw gets replaced
|
||||
// but "drawn this way" effects should still count them
|
||||
if (cause != null && cause.hasParam("RememberDrawn") && cause.getParam("RememberDrawn").equals("AllReplaced")) {
|
||||
cause.getHostCard().addRemembered(drawn);
|
||||
}
|
||||
|
||||
for (Player p : pList) {
|
||||
if (!revealed.containsKey(p)) {
|
||||
revealed.put(p, new CardCollection());
|
||||
|
||||
@@ -2,9 +2,7 @@ Name:Academy Loremaster
|
||||
ManaCost:U U
|
||||
Types:Creature Human Wizard
|
||||
PT:2/3
|
||||
T:Mode$ Phase | Phase$ Draw | ValidPlayer$ Player | TriggerZones$ Battlefield | OptionalDecider$ TriggeredPlayer | Execute$ TrigDraw | TriggerDescription$ At the beginning of each player's draw step, that player may draw an additional card. If they do, spells they cast this turn cost {2} more to cast.
|
||||
SVar:TrigDraw:DB$ Draw | NumCards$ 1 | Defined$ TriggeredPlayer | RememberDrawn$ True | SubAbility$ DBEffect
|
||||
SVar:DBEffect:DB$ Effect | ConditionDefined$ Remembered | ConditionPresent$ Card | Duration$ EndOfTurn | StaticAbilities$ RaiseCost | SubAbility$ DBCleanup
|
||||
T:Mode$ Phase | Phase$ Draw | ValidPlayer$ Player | TriggerZones$ Battlefield | Execute$ TrigDraw | TriggerDescription$ At the beginning of each player's draw step, that player may draw an additional card. If they do, spells they cast this turn cost {2} more to cast.
|
||||
SVar:TrigDraw:DB$ Effect | UnlessCost$ Draw<1/Player.TriggeredPlayer> | UnlessPayer$ TriggeredPlayer | UnlessSwitched$ True | StaticAbilities$ RaiseCost
|
||||
SVar:RaiseCost:Mode$ RaiseCost | ValidCard$ Card.ActivePlayerCtrl | Type$ Spell | Amount$ 2 | Description$ Spells they cast this turn cost {2} more to cast.
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
Oracle:At the beginning of each player's draw step, that player may draw an additional card. If they do, spells they cast this turn cost {2} more to cast.
|
||||
|
||||
@@ -4,6 +4,5 @@ Types:Creature Cat Cleric
|
||||
PT:3/4
|
||||
K:Flash
|
||||
R:Event$ DrawCards | ActiveZones$ Battlefield | ValidPlayer$ Player.Opponent | Number$ GE2 | ReplaceWith$ DrawEach | Description$ If an opponent would draw two or more cards, instead you and that player each draw a card.
|
||||
SVar:DrawEach:DB$ Draw | SubAbility$ DBDraw
|
||||
SVar:DBDraw:DB$ Draw | Defined$ ReplacedPlayer | NumCards$ 1
|
||||
SVar:DrawEach:DB$ Draw | Defined$ You & ReplacedPlayer
|
||||
Oracle:Flash\nIf an opponent would draw two or more cards, instead you and that player each draw a card.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Name:Ancient Excavation
|
||||
ManaCost:2 U B
|
||||
Types:Instant
|
||||
A:SP$ Draw | Cost$ 2 U B | NumCards$ X | SubAbility$ DBDiscard | RememberDrawn$ True | SpellDescription$ Draw cards equal to the number of cards in your hand, then discard a card for each card drawn this way.
|
||||
A:SP$ Draw | Cost$ 2 U B | NumCards$ X | SubAbility$ DBDiscard | RememberDrawn$ AllReplaced | SpellDescription$ Draw cards equal to the number of cards in your hand, then discard a card for each card drawn this way.
|
||||
SVar:DBDiscard:DB$ Discard | Defined$ You | Mode$ TgtChoose | NumCards$ Y | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:X:Count$InYourHand
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
Name:Cut a Deal
|
||||
ManaCost:2 W
|
||||
Types:Sorcery
|
||||
A:SP$ Draw | Defined$ Opponent | RememberDrawn$ True | SubAbility$ DBDraw | SpellDescription$ Each opponent draws a card, then you draw a card for each opponent who drew a card this way.
|
||||
A:SP$ Draw | Defined$ Opponent | RememberDrawn$ AllReplaced | SubAbility$ DBDraw | SpellDescription$ Each opponent draws a card, then you draw a card for each opponent who drew a card this way.
|
||||
SVar:DBDraw:DB$ Draw | NumCards$ X | SubAbility$ DBCleanup | StackDescription$ {p:You} draws a card for each opponent who drew a card this way.
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:X:Remembered$Amount
|
||||
SVar:X:PlayerCountRememberedOwner$Amount
|
||||
AI:RemoveDeck:Random
|
||||
Oracle:Each opponent draws a card, then you draw a card for each opponent who drew a card this way.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Name:Explosion of Riches
|
||||
ManaCost:5 R
|
||||
Types:Sorcery
|
||||
A:SP$ Draw | Cost$ 5 R | Defined$ You | NumCards$ 1 | SubAbility$ DBDraw | StackDescription$ SpellDescription | RememberDrawn$ True | SpellDescription$ Draw a card, then each other player may draw a card. Whenever a card is drawn this way, CARDNAME deals 5 damage to target opponent chosen at random from among your opponents.
|
||||
SVar:DBDraw:DB$ Draw | Defined$ Player.Other | OptionalDecider$ True | NumCards$ 1 | RememberDrawn$ True | SubAbility$ DBRepeatEach | StackDescription$ None
|
||||
A:SP$ Draw | Cost$ 5 R | Defined$ You | NumCards$ 1 | SubAbility$ DBDraw | StackDescription$ SpellDescription | RememberDrawn$ AllReplaced | SpellDescription$ Draw a card, then each other player may draw a card. Whenever a card is drawn this way, CARDNAME deals 5 damage to target opponent chosen at random from among your opponents.
|
||||
SVar:DBDraw:DB$ Draw | Defined$ Player.Other | OptionalDecider$ True | NumCards$ 1 | RememberDrawn$ AllReplaced | SubAbility$ DBRepeatEach | StackDescription$ None
|
||||
SVar:DBRepeatEach:DB$ RepeatEach | RepeatCards$ Card.IsRemembered | Zone$ Hand | RepeatSubAbility$ DBImmediateTrigger | SubAbility$ DBCleanup
|
||||
SVar:DBImmediateTrigger:DB$ ImmediateTrigger | Execute$ TrigDamage | Secondary$ True | TriggerDescription$ Whenever a card is drawn this way, CARDNAME deals 5 damage to target opponent chosen at random from among your opponents.
|
||||
SVar:TrigDamage:DB$ DealDamage | ValidTgts$ Player.Opponent | NumDmg$ 5 | TargetsAtRandom$ True
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
Name:Force Away
|
||||
ManaCost:1 U
|
||||
Types:Instant
|
||||
A:SP$ ChangeZone | Cost$ 1 U | ValidTgts$ Creature | TgtPrompt$ Select target creature | Origin$ Battlefield | SubAbility$ DBDraw | Destination$ Hand | SpellDescription$ Return target creature to its owner's hand. Ferocious — If you control a creature with power 4 or greater, you may draw a card. If you do, discard a card.
|
||||
SVar:DBDraw:DB$ Draw | NumCards$ 1 | OptionalDecider$ You | RememberDrawn$ True | ConditionPresent$ Creature.YouCtrl+powerGE4 | ConditionCompare$ GE1 | SubAbility$ DBDiscard
|
||||
SVar:DBDiscard:DB$ Discard | Defined$ You | NumCards$ 1 | Mode$ TgtChoose | ConditionCheckSVar$ X | ConditionSVarCompare$ GE1 | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:X:Remembered$Amount
|
||||
A:SP$ ChangeZone | Cost$ 1 U | ValidTgts$ Creature | TgtPrompt$ Select target creature | Origin$ Battlefield | SubAbility$ DBDiscard | Destination$ Hand | SpellDescription$ Return target creature to its owner's hand. Ferocious — If you control a creature with power 4 or greater, you may draw a card. If you do, discard a card.
|
||||
SVar:DBDiscard:DB$ Discard | Defined$ You | NumCards$ 1 | Mode$ TgtChoose | UnlessCost$ Draw<1/You> | UnlessPayer$ You | UnlessSwitched$ True | ConditionPresent$ Creature.YouCtrl+powerGE4
|
||||
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.
|
||||
|
||||
@@ -5,9 +5,7 @@ PT:3/3
|
||||
K:Flying
|
||||
S:Mode$ Continuous | Affected$ Zombie.YouCtrl+Other | AddKeyword$ Flying | Description$ Other Zombies you control have flying.
|
||||
T:Mode$ DamageAll | ValidSource$ Creature.Zombie+YouCtrl | ValidTarget$ Opponent | CombatDamage$ True | TriggerZones$ Battlefield | Execute$ TrigDraw | OptionalDecider$ You | TriggerDescription$ Whenever one or more Zombies you control deal combat damage to one or more of your opponents, you may draw cards equal to the number of opponents dealt damage this way. If you do, discard that many cards.
|
||||
SVar:TrigDraw:DB$ Draw | Defined$ You | NumCards$ X | RememberDrawn$ True | SubAbility$ DBDiscard
|
||||
SVar:DBDiscard:DB$ Discard | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GEX | Defined$ You | Mode$ TgtChoose | NumCards$ X | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:TrigDraw:AB$ Discard | Cost$ Draw<X/You> | Defined$ You | Mode$ TgtChoose | NumCards$ X
|
||||
SVar:X:TriggeredPlayersTargets$Amount
|
||||
DeckHints:Type$Zombie
|
||||
DeckHas:Ability$Discard
|
||||
|
||||
@@ -2,7 +2,7 @@ Name:Kwain, Itinerant Meddler
|
||||
ManaCost:W U
|
||||
Types:Legendary Creature Rabbit Wizard
|
||||
PT:1/3
|
||||
A:AB$ Draw | Cost$ T | Defined$ Player | OptionalDecider$ True | RememberDrawn$ True | SubAbility$ DBGainLife | SpellDescription$ Each player may draw a card, then each player who drew a card this way gains 1 life.
|
||||
A:AB$ Draw | Cost$ T | Defined$ Player | OptionalDecider$ True | RememberDrawn$ AllReplaced | SubAbility$ DBGainLife | SpellDescription$ Each player may draw a card, then each player who drew a card this way gains 1 life.
|
||||
SVar:DBGainLife:DB$ GainLife | Defined$ RememberedController | LifeAmount$ 1 | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
Oracle:{T}: Each player may draw a card, then each player who drew a card this way gains 1 life.
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
Name:Laquatus's Creativity
|
||||
ManaCost:4 U
|
||||
Types:Sorcery
|
||||
A:SP$ Draw | Cost$ 4 U | NumCards$ X | ValidTgts$ Player | TgtPrompt$ Select target player | RememberDrawn$ True | SubAbility$ DBDiscard | SpellDescription$ Target player draws cards equal to the number of cards in their hand, then discards that many cards.
|
||||
SVar:DBDiscard:DB$ Discard | Defined$ Targeted | Mode$ TgtChoose | NumCards$ Y | SubAbility$ DBCleanup
|
||||
A:SP$ Draw | Cost$ 4 U | NumCards$ X | ValidTgts$ Player | TgtPrompt$ Select target player | RememberDrawn$ AllReplaced | SubAbility$ DBDiscard | SpellDescription$ Target player draws cards equal to the number of cards in their hand, then discards that many cards.
|
||||
SVar:DBDiscard:DB$ Discard | Defined$ Targeted | Mode$ TgtChoose | NumCards$ Z | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:X:TargetedPlayer$CardsInHand
|
||||
SVar:Y:Remembered$Amount
|
||||
SVar:Z:SVar$X/Minus.Y
|
||||
AI:RemoveDeck:All
|
||||
Oracle:Target player draws cards equal to the number of cards in their hand, then discards that many cards.
|
||||
|
||||
@@ -6,7 +6,7 @@ K:Flying
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigVote | TriggerDescription$ Council's dilemma — When CARDNAME enters the battlefield, starting with you, each player votes for feather or quill. Put a +1/+1 counter on CARDNAME for each feather vote and draw a card for each quill vote. For each card drawn this way, discard a card.
|
||||
SVar:TrigVote:DB$ Vote | Defined$ Player | StoreVoteNum$ True | VoteType$ Feather,Quill | SubAbility$ DBVoteFeather | AILogic$ FeatherOrQuill
|
||||
SVar:DBVoteFeather:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ VoteNumFeather | SubAbility$ DBVoteQuill
|
||||
SVar:DBVoteQuill:DB$ Draw | NumCards$ VoteNumQuill | SubAbility$ DBDiscard | RememberDrawn$ True
|
||||
SVar:DBVoteQuill:DB$ Draw | NumCards$ VoteNumQuill | SubAbility$ DBDiscard | RememberDrawn$ AllReplaced
|
||||
SVar:DBDiscard:DB$ Discard | Defined$ You | NumCards$ X | Mode$ TgtChoose | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:X:Remembered$Amount
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Name:Read the Runes
|
||||
ManaCost:X U
|
||||
Types:Instant
|
||||
A:SP$ Draw | Cost$ X U | NumCards$ X | SubAbility$ DBRepeat | RememberDrawn$ True | SpellDescription$ Draw X cards. For each card drawn this way, discard a card unless you sacrifice a permanent.
|
||||
A:SP$ Draw | Cost$ X U | NumCards$ X | SubAbility$ DBRepeat | RememberDrawn$ AllReplaced | SpellDescription$ Draw X cards. For each card drawn this way, discard a card unless you sacrifice a permanent.
|
||||
SVar:DBRepeat:DB$ RepeatEach | UseImprinted$ True | RepeatCards$ Card.IsRemembered | Zone$ Hand | RepeatSubAbility$ DBDiscard | SubAbility$ DBCleanup
|
||||
SVar:DBDiscard:DB$ Discard | Defined$ You | NumCards$ 1 | Mode$ TgtChoose | UnlessCost$ Sac<1/Permanent> | UnlessPayer$ You
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
|
||||
@@ -6,7 +6,7 @@ A:AB$ Draw | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | NumCards$ 1 | Sp
|
||||
SVar:DBDiscard:DB$ Discard | Defined$ You | NumCards$ 1 | Mode$ TgtChoose
|
||||
AI:RemoveDeck:All
|
||||
A:AB$ Pump | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ +2 | KW$ First Strike & Trample | SpellDescription$ Target creature gets +2/+0 and gains first strike and trample until end of turn.
|
||||
A:AB$ Draw | Cost$ SubCounter<8/LOYALTY> | Planeswalker$ True | Ultimate$ True | NumCards$ 4 | RememberDrawn$ True | SubAbility$ DBTrigger | SpellDescription$ Draw four cards.
|
||||
A:AB$ Draw | Cost$ SubCounter<8/LOYALTY> | Planeswalker$ True | Ultimate$ True | NumCards$ 4 | RememberDrawn$ AllReplaced | SubAbility$ DBTrigger | SpellDescription$ Draw four cards.
|
||||
SVar:DBTrigger:DB$ ImmediateTrigger | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE4 | Execute$ DBDamage | SpellDescription$ When you do, CARDNAME deals damage to any target equal to the number of cards in your hand. | SubAbility$ DBCleanup
|
||||
SVar:DBDamage:DB$ DealDamage | ValidTgts$ Any | NumDmg$ X
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
|
||||
@@ -1201,7 +1201,9 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
||||
}
|
||||
|
||||
if (c > typeList.size()) {
|
||||
controller.getGui().message(Localizer.getInstance().getMessage("lblEnoughValidCardNotToPayTheCost"), Localizer.getInstance().getMessage("lblCostPaymentInvalid"));
|
||||
if (!isEffect()) {
|
||||
controller.getGui().message(Localizer.getInstance().getMessage("lblEnoughValidCardNotToPayTheCost"), Localizer.getInstance().getMessage("lblCostPaymentInvalid"));
|
||||
}
|
||||
return null; // not enough targets anymore (e.g. Crackleburr + Smokebraider tapped to get mana)
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ public class HumanPlaySpellAbility {
|
||||
&& (!mayChooseTargets || ability.setupTargets()) // if you can choose targets, then do choose them.
|
||||
&& ability.canCastTiming(human)
|
||||
&& ability.isLegalAfterStack()
|
||||
&& (isFree || payment.payCost(new HumanCostDecision(controller, human, ability, false)));
|
||||
&& (isFree || payment.payCost(new HumanCostDecision(controller, human, ability, ability.isTrigger())));
|
||||
|
||||
game.clearTopLibsCast(ability);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user