diff --git a/.gitattributes b/.gitattributes index a360fed773c..e21307c99e6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17224,6 +17224,7 @@ forge-gui/res/cardsfolder/upcoming/priest_of_the_wakening_sun.txt -text forge-gui/res/cardsfolder/upcoming/prosperous_pirates.txt -text forge-gui/res/cardsfolder/upcoming/revel_in_riches.txt -text forge-gui/res/cardsfolder/upcoming/ripjaw_raptor.txt -text +forge-gui/res/cardsfolder/upcoming/rowdy_crew.txt -text forge-gui/res/cardsfolder/upcoming/sanguine_sacrament.txt -text forge-gui/res/cardsfolder/upcoming/settle_the_wreckage.txt -text forge-gui/res/cardsfolder/upcoming/sleek_schooner.txt -text diff --git a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java index 51825aa1800..a965753d288 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java @@ -809,6 +809,24 @@ public class CardFactoryUtil { return doXMath(num, m, c); } + if (l[0].startsWith("RememberedWithSharedCardType")) { + int num = 0; + for (final Object o : c.getRemembered()) { + if (o instanceof Card) { + Card firstCard = (Card) o; + for (final Object p : c.getRemembered()) { + if (p instanceof Card) { + Card secondCard = (Card) p; + if (!firstCard.equals(secondCard) && firstCard.sharesCardTypeWith(secondCard)) { + num++; + } + } + } + } + } + return doXMath(num, m, c); + } + // Count$CountersAddedToPermYouCtrl if (l[0].startsWith("CountersAddedToPermYouCtrl")) { final String[] components = l[0].split(" ", 2); diff --git a/forge-gui/res/cardsfolder/upcoming/rowdy_crew.txt b/forge-gui/res/cardsfolder/upcoming/rowdy_crew.txt new file mode 100644 index 00000000000..75e5929d9e6 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/rowdy_crew.txt @@ -0,0 +1,13 @@ +Name:Rowdy Crew +ManaCost:2 R R +Types:Creature Human Pirate +PT:3/3 +K:Trample +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDraw | TriggerDescription$ When CARDNAME enters the battlefield, draw three cards, then discard two cards at random. If two cards that share a card type are discarded this way, put two +1/+1 counters on CARDNAME. +SVar:TrigDraw:DB$ Draw | Defined$ You | NumCards$ 3 | SubAbility$ DBDiscard +SVar:DBDiscard:DB$ Discard | NumCards$ 2 | Mode$ Random | Defined$ You | RememberDiscarded$ True | SubAbility$ DBPutCounter +SVar:DBPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ 2 | ConditionCheckSVar$ SameType | ConditionSVarCompare$ EQ2 | References$ SameType | SubAbility$ DBCleanup +SVar:SameType:Count$RememberedWithSharedCardType +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:Picture:http://www.wizards.com/global/images/magic/general/rowdy_crew.jpg +Oracle:Trample\nWhen Rowdy Crew enters the battlefield, draw three cards, then discard two cards at random. If two cards that share a card type are discarded this way, put two +1/+1 counters on Rowdy Crew.