mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
AttractionsYouVisitedThisTurn and Squirrel Squatters
Untangled some oracle text methods in Card and CardState Sly Spy, Everythingamajig, and two Garbage Elementals Visit card text fix. 2 more Attractions
This commit is contained in:
@@ -577,7 +577,7 @@ public final class CardEdition implements Comparable<CardEdition> {
|
||||
* functional variant name - grouping #9
|
||||
*/
|
||||
// "(^(.?[0-9A-Z]+.?))?(([SCURML]) )?(.*)$"
|
||||
"(^(.?[0-9A-Z]+\\S?[A-Z]*)\\s)?(([SCURML])\\s)?([^@#]*)( @([^\\$]*))?( \\$(.+))?$"
|
||||
"(^(.?[0-9A-Z]+\\S?[A-Z]*)\\s)?(([SCURML])\\s)?([^@\\$]*)( @([^\\$]*))?( \\$(.+))?$"
|
||||
);
|
||||
|
||||
ListMultimap<String, CardInSet> cardMap = ArrayListMultimap.create();
|
||||
|
||||
@@ -2649,6 +2649,10 @@ public class AbilityUtils {
|
||||
return game.getPhaseHandler().getPlanarDiceSpecialActionThisTurn();
|
||||
}
|
||||
|
||||
if (sq[0].startsWith("AttractionsYouVisitedThisTurn")) {
|
||||
return doXMath(player.getAttractionsVisitedThisTurn(), expr, c, ctb);
|
||||
}
|
||||
|
||||
if (sq[0].equals("AllTypes")) {
|
||||
List<Card> cards = getDefinedCards(c, sq[1], ctb);
|
||||
|
||||
|
||||
@@ -221,6 +221,12 @@ public class RollDiceEffect extends SpellAbilityEffect {
|
||||
List<Integer> rolls = new ArrayList<>();
|
||||
int total = rollDiceForPlayer(sa, player, amount, sides, ignore, modifier, rolls);
|
||||
|
||||
if (sa.hasParam("UseHighestRoll")) {
|
||||
total = Collections.max(rolls);
|
||||
} else if (sa.hasParam("UseDifferenceBetweenRolls")) {
|
||||
total = Collections.max(rolls) - Collections.min(rolls);
|
||||
}
|
||||
|
||||
if (sa.hasParam("StoreResults")) {
|
||||
host.addStoredRolls(rolls);
|
||||
}
|
||||
@@ -243,9 +249,6 @@ public class RollDiceEffect extends SpellAbilityEffect {
|
||||
sa.setSVar(sa.getParam("OtherSVar"), Integer.toString(other));
|
||||
}
|
||||
}
|
||||
if (sa.hasParam("UseHighestRoll")) {
|
||||
total = Collections.max(rolls);
|
||||
}
|
||||
|
||||
if (sa.hasParam("SubsForEach")) {
|
||||
for (Integer roll : rolls) {
|
||||
|
||||
@@ -277,8 +277,6 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
private Table<Long, Long, Pair<Integer,Integer>> newPT = TreeBasedTable.create(); // Layer 7b
|
||||
private Table<Long, Long, Pair<Integer,Integer>> boostPT = TreeBasedTable.create(); // Layer 7c
|
||||
|
||||
private String oracleText = "";
|
||||
|
||||
private final Map<Card, Integer> assignedDamageMap = Maps.newTreeMap();
|
||||
private Map<Integer, Integer> damage = Maps.newHashMap();
|
||||
private boolean hasBeenDealtDeathtouchDamage;
|
||||
@@ -2506,7 +2504,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
|| keyword.startsWith("Class") || keyword.startsWith("Blitz")
|
||||
|| keyword.startsWith("Specialize") || keyword.equals("Ravenous")
|
||||
|| keyword.equals("For Mirrodin") || keyword.startsWith("Craft")
|
||||
|| keyword.startsWith("Landwalk")) {
|
||||
|| keyword.startsWith("Landwalk") || keyword.startsWith("Visit")) {
|
||||
// keyword parsing takes care of adding a proper description
|
||||
} else if (keyword.equals("Read ahead")) {
|
||||
sb.append(Localizer.getInstance().getMessage("lblReadAhead")).append(" (").append(Localizer.getInstance().getMessage("lblReadAheadDesc"));
|
||||
@@ -3498,7 +3496,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
public final void setCopiedPermanent(final Card c) {
|
||||
if (copiedPermanent == c) { return; }
|
||||
copiedPermanent = c;
|
||||
currentState.getView().updateOracleText(this);
|
||||
currentState.setOracleText(c.getOracleText());
|
||||
}
|
||||
|
||||
public final boolean isCopiedSpell() {
|
||||
@@ -7244,7 +7242,6 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
public void setRules(CardRules r) {
|
||||
cardRules = r;
|
||||
currentState.getView().updateRulesText(r, getType());
|
||||
currentState.getView().updateOracleText(this);
|
||||
}
|
||||
|
||||
public boolean isCommander() {
|
||||
@@ -7573,15 +7570,10 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
}
|
||||
|
||||
public String getOracleText() {
|
||||
CardRules rules = cardRules;
|
||||
if (copiedPermanent != null) { //return oracle text of copied permanent if applicable
|
||||
rules = copiedPermanent.getRules();
|
||||
return currentState.getOracleText();
|
||||
}
|
||||
return rules != null ? rules.getOracleText() : oracleText;
|
||||
}
|
||||
public void setOracleText(final String oracleText0) {
|
||||
oracleText = oracleText0;
|
||||
currentState.getView().updateOracleText(this);
|
||||
public void setOracleText(final String oracleText) {
|
||||
currentState.setOracleText(oracleText);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -346,9 +346,9 @@ public class CardFactory {
|
||||
card.setColor(combinedColor);
|
||||
card.setType(new CardType(rules.getType()));
|
||||
|
||||
// Combined text based on Oracle text - might not be necessary, temporarily disabled.
|
||||
//String combinedText = String.format("%s: %s\n%s: %s", rules.getMainPart().getName(), rules.getMainPart().getOracleText(), rules.getOtherPart().getName(), rules.getOtherPart().getOracleText());
|
||||
//card.setText(combinedText);
|
||||
// Combined text based on Oracle text - might not be necessary
|
||||
String combinedText = String.format("(%s) %s\r\n\r\n(%s) %s", rules.getMainPart().getName(), rules.getMainPart().getOracleText(), rules.getOtherPart().getName(), rules.getOtherPart().getOracleText());
|
||||
card.getState(CardStateName.Original).setOracleText(combinedText);
|
||||
}
|
||||
return card;
|
||||
}
|
||||
@@ -377,7 +377,7 @@ public class CardFactory {
|
||||
c.getCurrentState().setBaseLoyalty(face.getInitialLoyalty());
|
||||
c.getCurrentState().setBaseDefense(face.getDefense());
|
||||
|
||||
c.setOracleText(face.getOracleText());
|
||||
c.getCurrentState().setOracleText(face.getOracleText());
|
||||
|
||||
// Super and 'middle' types should use enums.
|
||||
c.setType(new CardType(face.getType()));
|
||||
@@ -454,7 +454,7 @@ public class CardFactory {
|
||||
c.getCurrentState().setBaseDefense(variant.getDefense());
|
||||
|
||||
if (variant.getOracleText() != null)
|
||||
c.setOracleText(variant.getOracleText());
|
||||
c.getCurrentState().setOracleText(variant.getOracleText());
|
||||
|
||||
if (variant.getType() != null) {
|
||||
for(String type : variant.getType())
|
||||
|
||||
@@ -58,6 +58,7 @@ public class CardState extends GameObject implements IHasSVars {
|
||||
private CardType type = new CardType(false);
|
||||
private ManaCost manaCost = ManaCost.NO_COST;
|
||||
private byte color = MagicColor.COLORLESS;
|
||||
private String oracleText = "";
|
||||
private int basePower = 0;
|
||||
private int baseToughness = 0;
|
||||
private String basePowerString = null;
|
||||
@@ -194,6 +195,15 @@ public class CardState extends GameObject implements IHasSVars {
|
||||
view.updateColors(card);
|
||||
}
|
||||
|
||||
public String getOracleText() {
|
||||
return oracleText;
|
||||
}
|
||||
public void setOracleText(final String oracleText) {
|
||||
this.oracleText = oracleText;
|
||||
view.setOracleText(oracleText);
|
||||
}
|
||||
|
||||
|
||||
public final int getBasePower() {
|
||||
return basePower;
|
||||
}
|
||||
@@ -595,6 +605,7 @@ public class CardState extends GameObject implements IHasSVars {
|
||||
setType(source.type);
|
||||
setManaCost(source.getManaCost());
|
||||
setColor(source.getColor());
|
||||
setOracleText(source.getOracleText());
|
||||
setBasePower(source.getBasePower());
|
||||
setBaseToughness(source.getBaseToughness());
|
||||
setBaseLoyalty(source.getBaseLoyalty());
|
||||
|
||||
@@ -1298,8 +1298,8 @@ public class CardView extends GameEntityView {
|
||||
public String getOracleText() {
|
||||
return get(TrackableProperty.OracleText);
|
||||
}
|
||||
void updateOracleText(Card c) {
|
||||
set(TrackableProperty.OracleText, c.getOracleText().replace("\\n", "\r\n\r\n").trim());
|
||||
void setOracleText(String oracleText) {
|
||||
set(TrackableProperty.OracleText, oracleText.replace("\\n", "\r\n\r\n").trim());
|
||||
}
|
||||
|
||||
public String getRulesText() {
|
||||
|
||||
10
forge-gui/res/cardsfolder/c/clown_extruder.txt
Normal file
10
forge-gui/res/cardsfolder/c/clown_extruder.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
Name:Clown Extruder
|
||||
ManaCost:no cost
|
||||
Types:Artifact Attraction
|
||||
Variant:A:Lights:2 6
|
||||
Variant:B:Lights:3 6
|
||||
Variant:C:Lights:4 6
|
||||
Variant:D:Lights:5 6
|
||||
K:Visit:TrigToken
|
||||
SVar:TrigToken:DB$ Token | TokenScript$ w_1_1_a_clown_robot | TokenOwner$ You | SpellDescription$ Create a 1/1 white Clown Robot artifact creature token.
|
||||
Oracle:Visit — Create a 1/1 white Clown Robot artifact creature token.
|
||||
10
forge-gui/res/cardsfolder/c/concession_stand.txt
Normal file
10
forge-gui/res/cardsfolder/c/concession_stand.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
Name:Concession Stand
|
||||
ManaCost:no cost
|
||||
Types:Artifact Attraction
|
||||
Variant:A:Lights:2 6
|
||||
Variant:B:Lights:3 6
|
||||
Variant:C:Lights:4 6
|
||||
Variant:D:Lights:5 6
|
||||
K:Visit:TrigFood
|
||||
SVar:TrigFood:DB$ Token | TokenScript$ c_a_food_sac | TokenOwner$ You | SpellDescription$ Create a Food token.
|
||||
Oracle:Visit — Create a Food token. (It’s an artifact with “{2}, {T}, Sacrifice this artifact: You gain 3 life.”)
|
||||
10
forge-gui/res/cardsfolder/e/everythingamajig.txt
Normal file
10
forge-gui/res/cardsfolder/e/everythingamajig.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
Name:Everythingamajig
|
||||
ManaCost:5
|
||||
Types:Artifact
|
||||
Variant:C:A:AB$ FlipACoin | Cost$ 1 | WinSubAbility$ DBAddMana | InstantSpeed$ True | SpellDescription$ Flip a coin. If you win the flip, add {C}{C}.
|
||||
Variant:C:SVar:DBAddMana:DB$ Mana | Produced$ C | Amount$ 2
|
||||
Variant:C:A:AB$ Discard | Cost$ 3 T | ValidTgts$ Player | NumCards$ 1 | Mode$ TgtChoose | PlayerTurn$ True | SpellDescription$ Target player discards a card.
|
||||
Variant:C:A:AB$ Animate | Cost$ X | Defined$ Self | Power$ X | Toughness$ X | Types$ Creature,Artifact,Construct | RemoveCreatureTypes$ True | SpellDescription$ CARDNAME becomes an X/X Construct artifact creature until end of turn.
|
||||
Variant:C:SVar:X:Count$xPaid
|
||||
Oracle:<Unsupported Variant>
|
||||
Variant:C:Oracle:{1}: Flip a coin. If you win the flip, add {C}{C}. Activate only as an instant.\n{3}, {T}: Target player discards a card. Activate only during your turn.\n{X}: Everythingamajig becomes an X/X Construct artifact creature until end of turn.
|
||||
16
forge-gui/res/cardsfolder/g/garbage_elemental.txt
Normal file
16
forge-gui/res/cardsfolder/g/garbage_elemental.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
Name:Garbage Elemental
|
||||
ManaCost:4 R
|
||||
Types:Creature Elemental
|
||||
Variant:C:PT:3/2
|
||||
Variant:C:K:Battle cry
|
||||
Variant:C:T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigRoll | TriggerDescription$ When CARDNAME enters the battlefield, roll two six-sided dice. Create a number of 1/1 red Goblin creature tokens equal to the difference between those results.
|
||||
Variant:C:SVar:TrigRoll:DB$ RollDice | ResultSVar$ Result | Sides$ 6 | Amount$ 2 | UseDifferenceBetweenRolls$ True | SubAbility$ DBToken
|
||||
Variant:C:SVar:DBToken:DB$ Token | TokenScript$ r_1_1_goblin | TokenAmount$ Result
|
||||
Variant:D:PT:3/3
|
||||
Variant:D:K:Cascade
|
||||
Variant:D:T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigRoll | TriggerDescription$ When CARDNAME enters the battlefield, roll a six-sided die. CARDNAME deals damage equal to the result to target opponent or planeswalker.
|
||||
Variant:D:SVar:TrigRoll:DB$ RollDice | ResultSVar$ Result | SubAbility$ DBDamage
|
||||
Variant:D:SVar:DBDamage:DB$ DealDamage | ValidTgts$ Opponent,Planeswalker | TgtPrompt$ Select target opponent or planeswalker | NumDmg$ Result
|
||||
Oracle:<Unsupported Variant>
|
||||
Variant:C:Oracle:Battle cry (Whenever this creature attacks, each other attacking creature gets +1/+0 until end of turn.)\nWhen Garbage Elemental enters the battlefield, roll two six-sided dice. Create a number of 1/1 red Goblin creature tokens equal to the difference between those results.
|
||||
Variant:D:Oracle:Cascade (When you cast this spell, exile cards from the top of your library until you exile a nonland card that costs less. You may cast it without paying its mana cost. Put the exiled cards on the bottom of your library in a random order.)\nWhen Garbage Elemental enters the battlefield, roll a six-sided die. Garbage Elemental deals damage equal to the result to target opponent or planeswalker.
|
||||
9
forge-gui/res/cardsfolder/s/sly_spy.txt
Normal file
9
forge-gui/res/cardsfolder/s/sly_spy.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
Name:Sly Spy
|
||||
ManaCost:2 B
|
||||
Types:Creature Human Spy
|
||||
PT:2/2
|
||||
Variant:F:T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigRoll | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, roll a six-sided die. That player loses life equal to the result.
|
||||
Variant:F:SVar:TrigRoll:DB$ RollDice | ResultSVar$ Result | SubAbility$ DBLoseLife
|
||||
Variant:F:SVar:DBLoseLife:DB$ LoseLife | Defined$ TriggeredTarget | LifeAmount$ Result
|
||||
Oracle:<Unsupported Variant>
|
||||
Variant:F:Oracle:Whenever Sly Spy deals combat damage to a player, roll a six-sided die. That player loses life equal to the result.
|
||||
11
forge-gui/res/cardsfolder/s/squirrel_squatters.txt
Normal file
11
forge-gui/res/cardsfolder/s/squirrel_squatters.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
Name:Squirrel Squatters
|
||||
ManaCost:3 G G
|
||||
Types:Creature Squirrel
|
||||
PT:4/4
|
||||
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigOpenAttraction | TriggerDescription$ When CARDNAME enters the battlefield, open an Attraction.
|
||||
SVar:TrigOpenAttraction:DB$ OpenAttraction
|
||||
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigToken | TriggerDescription$ Whenever CARDNAME attacks, create a 1/1 green Squirrel creature token that's tapped and attacking for each Attraction you've visited this turn.
|
||||
SVar:TrigToken:DB$ Token | TokenAmount$ X | TokenScript$ g_1_1_squirrel | TokenOwner$ You | TokenTapped$ True | TokenAttacking$ True
|
||||
SVar:X:Count$AttractionsYouVisitedThisTurn
|
||||
SVar:HasAttackEffect:TRUE
|
||||
Oracle:When Squirrel Squatters enters the battlefield, open an Attraction. (Put the top card of your Attraction deck onto the battlefield.)\nWhenever Squirrel Squatters attacks, create a 1/1 green Squirrel creature token that’s tapped and attacking for each Attraction you’ve visited this turn.
|
||||
@@ -20,12 +20,12 @@ ScryfallCode=UST
|
||||
9 U Half-Kitten, Half-
|
||||
10 C Humming-
|
||||
11 R Jackknight
|
||||
12a U Knight of the Kitchen Sink A
|
||||
12b U Knight of the Kitchen Sink B
|
||||
12c U Knight of the Kitchen Sink C
|
||||
12d U Knight of the Kitchen Sink D
|
||||
12e U Knight of the Kitchen Sink E
|
||||
12f U Knight of the Kitchen Sink F
|
||||
12a U Knight of the Kitchen Sink $A
|
||||
12b U Knight of the Kitchen Sink $B
|
||||
12c U Knight of the Kitchen Sink $C
|
||||
12d U Knight of the Kitchen Sink $D
|
||||
12e U Knight of the Kitchen Sink $E
|
||||
12f U Knight of the Kitchen Sink $F
|
||||
13 U Knight of the Widget
|
||||
14 U Midlife Upgrade
|
||||
15 R Oddly Uneven
|
||||
@@ -65,12 +65,12 @@ ScryfallCode=UST
|
||||
46 U Spy Eye
|
||||
47 U Suspicious Nanny
|
||||
48 C Time Out
|
||||
49a R Very Cryptic Command A
|
||||
49b R Very Cryptic Command B
|
||||
49c R Very Cryptic Command C
|
||||
49d R Very Cryptic Command D
|
||||
49e R Very Cryptic Command E
|
||||
49f R Very Cryptic Command F
|
||||
49a R Very Cryptic Command $A
|
||||
49b R Very Cryptic Command $B
|
||||
49c R Very Cryptic Command $C
|
||||
49d R Very Cryptic Command $D
|
||||
49e R Very Cryptic Command $E
|
||||
49f R Very Cryptic Command $F
|
||||
50 C Wall of Fortune
|
||||
51 C Big Boa Constrictor
|
||||
52 C capital offense
|
||||
@@ -91,12 +91,12 @@ ScryfallCode=UST
|
||||
64 U Overt Operative
|
||||
65 U "Rumors of My Death..."
|
||||
66 U Skull Saucer
|
||||
67a U Sly Spy A
|
||||
67b U Sly Spy B
|
||||
67c U Sly Spy C
|
||||
67d U Sly Spy D
|
||||
67e U Sly Spy E
|
||||
67f U Sly Spy F
|
||||
67a U Sly Spy $A
|
||||
67b U Sly Spy $B
|
||||
67c U Sly Spy $C
|
||||
67d U Sly Spy $D
|
||||
67e U Sly Spy $E
|
||||
67f U Sly Spy $F
|
||||
68 C Snickering Squirrel
|
||||
69 R Spike, Tournament Grinder
|
||||
70 U Squirrel-Powered Scheme
|
||||
@@ -111,12 +111,12 @@ ScryfallCode=UST
|
||||
79 C Common Iguana
|
||||
80 R The Countdown Is at One
|
||||
81 C Feisty Stegosaurus
|
||||
82a U Garbage Elemental A
|
||||
82b U Garbage Elemental B
|
||||
82c U Garbage Elemental C
|
||||
82d U Garbage Elemental D
|
||||
82e U Garbage Elemental E
|
||||
82f U Garbage Elemental F
|
||||
82a U Garbage Elemental $A
|
||||
82b U Garbage Elemental $B
|
||||
82c U Garbage Elemental $C
|
||||
82d U Garbage Elemental $D
|
||||
82e U Garbage Elemental $E
|
||||
82f U Garbage Elemental $F
|
||||
83 U Goblin Haberdasher
|
||||
84 U Half-Orc, Half-
|
||||
85 C Hammer Helper
|
||||
@@ -153,12 +153,12 @@ ScryfallCode=UST
|
||||
110 U Ground Pounder
|
||||
111 U Half-Squirrel, Half-
|
||||
112 R Hydradoodle
|
||||
113a R Ineffable Blessing A
|
||||
113b R Ineffable Blessing B
|
||||
113c R Ineffable Blessing C
|
||||
113d R Ineffable Blessing D
|
||||
113e R Ineffable Blessing E
|
||||
113f R Ineffable Blessing F
|
||||
113a R Ineffable Blessing $A
|
||||
113b R Ineffable Blessing $B
|
||||
113c R Ineffable Blessing $C
|
||||
113d R Ineffable Blessing $D
|
||||
113e R Ineffable Blessing $E
|
||||
113f R Ineffable Blessing $F
|
||||
114 C Joyride Rigger
|
||||
115 U Monkey-
|
||||
116 C Mother Kangaroo
|
||||
@@ -195,12 +195,12 @@ ScryfallCode=UST
|
||||
145c C Despondent Killbot
|
||||
145d C Enraged Killbot
|
||||
146 U Entirely Normal Armchair
|
||||
147a R Everythingamajig A
|
||||
147b R Everythingamajig B
|
||||
147c R Everythingamajig C
|
||||
147d R Everythingamajig D
|
||||
147e R Everythingamajig E
|
||||
147f R Everythingamajig F
|
||||
147a R Everythingamajig $A
|
||||
147b R Everythingamajig $B
|
||||
147c R Everythingamajig $C
|
||||
147d R Everythingamajig $D
|
||||
147e R Everythingamajig $E
|
||||
147f R Everythingamajig $F
|
||||
148 C Gnome-Made Engine
|
||||
149 R Handy Dandy Clone Machine
|
||||
150 R Kindslaver
|
||||
|
||||
Reference in New Issue
Block a user