mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
CardProperty: add CastSA to card
ForgeScript: add mayPlaySource
This commit is contained in:
@@ -7,6 +7,7 @@ import forge.game.card.Card;
|
|||||||
import forge.game.card.CardState;
|
import forge.game.card.CardState;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
|
import forge.game.staticability.StaticAbility;
|
||||||
import forge.util.Expressions;
|
import forge.util.Expressions;
|
||||||
|
|
||||||
public class ForgeScript {
|
public class ForgeScript {
|
||||||
@@ -179,6 +180,14 @@ public class ForgeScript {
|
|||||||
if (!sa.hasParam("Equip")) {
|
if (!sa.hasParam("Equip")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else if (property.equals("MayPlaySource")) {
|
||||||
|
StaticAbility m = sa.getMayPlay();
|
||||||
|
if (m == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!source.equals(m.getHostCard())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else if (property.startsWith("IsTargeting")) {
|
} else if (property.startsWith("IsTargeting")) {
|
||||||
String k[] = property.split(" ", 2);
|
String k[] = property.split(" ", 2);
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
|
|||||||
@@ -1683,6 +1683,15 @@ public class CardProperty {
|
|||||||
if (card.hasCounters()) {
|
if (card.hasCounters()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else if (property.startsWith("CastSa")) {
|
||||||
|
SpellAbility castSA = card.getCastSA();
|
||||||
|
if (castSA == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String v = property.substring(7);
|
||||||
|
if (!castSA.isValid(v, sourceController, source, spellAbility)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else if (property.equals("wasCast")) {
|
} else if (property.equals("wasCast")) {
|
||||||
if (null == card.getCastFrom()) {
|
if (null == card.getCastFrom()) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
Name:Bosium Strip
|
Name:Bosium Strip
|
||||||
ManaCost:3
|
ManaCost:3
|
||||||
Types:Artifact
|
Types:Artifact
|
||||||
A:AB$ Effect | Cost$ 3 T | Triggers$ TrigBosiumStrip1,TrigBosiumStrip2 | ReplacementEffects$ REBosiumStrip | StaticAbilities$ STBosiumStrip | SVars$ RememberCastFromGrave,MoveExile,DBCleanup | RememberObjects$ TriggeredCard | SpellDescription$ Until end of turn, if the top card of your graveyard is an instant or sorcery card, you may cast that card. If a card cast this way would be put into a graveyard this turn, exile it instead.
|
A:AB$ Effect | Cost$ 3 T | ReplacementEffects$ REBosiumStrip | StaticAbilities$ STBosiumStrip | SVars$ MoveExile | SpellDescription$ Until end of turn, if the top card of your graveyard is an instant or sorcery card, you may cast that card. If a card cast this way would be put into a graveyard this turn, exile it instead.
|
||||||
SVar:STBosiumStrip:Mode$ Continuous | Affected$ Card.TopGraveyard+Instant+YouCtrl,Card.TopGraveyard+Sorcery+YouCtrl | MayPlay$ True | EffectZone$ Command | AffectedZone$ Graveyard | Description$ Until end of turn, if the top card of your graveyard is an instant or sorcery card, you may cast that card. If a card cast this way would be put into a graveyard this turn, exile it instead.
|
SVar:STBosiumStrip:Mode$ Continuous | Affected$ Card.TopGraveyard+Instant+YouCtrl,Card.TopGraveyard+Sorcery+YouCtrl | MayPlay$ True | EffectZone$ Command | AffectedZone$ Graveyard | Description$ Until end of turn, if the top card of your graveyard is an instant or sorcery card, you may cast that card. If a card cast this way would be put into a graveyard this turn, exile it instead.
|
||||||
SVar:TrigBosiumStrip1:Mode$ ChangesZone | ValidCard$ Card.Instant+YouCtrl,Card.Sorcery+YouCtrl | Origin$ Graveyard | Destination$ Stack | TriggerZones$ Command | Execute$ RememberCastFromGrave | Static$ True
|
SVar:REBosiumStrip:Event$ Moved | ValidCard$ Card.CastSa Spell.MayPlaySource | Origin$ Stack | Destination$ Graveyard | ReplaceWith$ MoveExile
|
||||||
SVar:TrigBosiumStrip2:Mode$ ChangesZone | ValidCard$ Instant.YouCtrl+IsRemembered,Sorcery.YouCtrl+IsRemembered | Origin$ Stack | Destination$ Hand,Library,Exile | TriggerZones$ Command | Execute$ DBCleanup | Static$ True
|
SVar:MoveExile:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ Stack | Destination$ Exile
|
||||||
SVar:RememberCastFromGrave:DB$ Pump | RememberObjects$ TriggeredCard
|
|
||||||
# TODO: find a better way to check "card cast this way" to interact properly with other cards that allow you to cast cards from graveyard
|
|
||||||
# but not exile them (also relevant for Kess, Dissident Mage)
|
|
||||||
SVar:REBosiumStrip:Event$ Moved | ActiveZones$ Command | ValidCard$ Instant.YouCtrl+IsRemembered,Sorcery.YouCtrl+IsRemembered | Origin$ Stack | Destination$ Graveyard | ReplaceWith$ MoveExile
|
|
||||||
SVar:MoveExile:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ Stack | Destination$ Exile | SubAbility$ DBCleanup
|
|
||||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
|
||||||
SVar:NeedsOrderedGraveyard:TRUE
|
SVar:NeedsOrderedGraveyard:TRUE
|
||||||
SVar:RemAIDeck:True
|
SVar:RemAIDeck:True
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/bosium_strip.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/bosium_strip.jpg
|
||||||
|
|||||||
@@ -4,13 +4,7 @@ Types:Legendary Creature Human Wizard
|
|||||||
PT:3/4
|
PT:3/4
|
||||||
K:Flying
|
K:Flying
|
||||||
S:Mode$ Continuous | Affected$ Instant.YouCtrl,Sorcery.YouCtrl | Condition$ PlayerTurn | MayPlay$ True | MayPlayLimit$ 1 | EffectZone$ Battlefield | AffectedZone$ Graveyard | Description$ During each of your turns, you may cast an instant or sorcery card from your graveyard. If a card cast this way would be put into your graveyard this turn, exile it instead.
|
S:Mode$ Continuous | Affected$ Instant.YouCtrl,Sorcery.YouCtrl | Condition$ PlayerTurn | MayPlay$ True | MayPlayLimit$ 1 | EffectZone$ Battlefield | AffectedZone$ Graveyard | Description$ During each of your turns, you may cast an instant or sorcery card from your graveyard. If a card cast this way would be put into your graveyard this turn, exile it instead.
|
||||||
T:Mode$ ChangesZone | ValidCard$ Instant.YouCtrl,Sorcery.YouCtrl | Origin$ Graveyard | Destination$ Stack | TriggerZones$ Battlefield | Execute$ RememberCastFromGrave | Static$ True
|
R:Event$ Moved | ValidCard$ Card.CastSa Spell.MayPlaySource | Origin$ Stack | Destination$ Graveyard | ReplaceWith$ MoveExile
|
||||||
T:Mode$ ChangesZone | ValidCard$ Instant.YouCtrl+IsRemembered,Sorcery.YouCtrl+IsRemembered | Origin$ Stack | Destination$ Hand,Library,Exile | TriggerZones$ Battlefield | Execute$ DBCleanup | Static$ True
|
SVar:MoveExile:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ Stack | Destination$ Exile
|
||||||
SVar:RememberCastFromGrave:DB$ Pump | RememberObjects$ TriggeredCard
|
|
||||||
# TODO: find a better way to check "card cast this way" to interact properly with other cards that allow you to cast cards from graveyard
|
|
||||||
# but not exile them (also relevant for Bosium Strip)
|
|
||||||
R:Event$ Moved | ValidCard$ Instant.YouCtrl+IsRemembered,Sorcery.YouCtrl+IsRemembered | Origin$ Stack | Destination$ Graveyard | ReplaceWith$ MoveExile
|
|
||||||
SVar:MoveExile:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ Stack | Destination$ Exile | SubAbility$ DBCleanup
|
|
||||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/kess_dissident_mage.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/kess_dissident_mage.jpg
|
||||||
Oracle:Flying\nDuring each of your turns, you may cast an instant or sorcery card from your graveyard. If a card cast this way would be put into your graveyard this turn, exile it instead.
|
Oracle:Flying\nDuring each of your turns, you may cast an instant or sorcery card from your graveyard. If a card cast this way would be put into your graveyard this turn, exile it instead.
|
||||||
|
|||||||
Reference in New Issue
Block a user