diff --git a/.gitattributes b/.gitattributes index ef8ba2a53d3..df43ca5968e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11186,6 +11186,7 @@ res/cardsfolder/t/thought_prison.txt -text svneol=unset#text/plain res/cardsfolder/t/thought_reflection.txt -text res/cardsfolder/t/thought_scour.txt -text res/cardsfolder/t/thoughtbind.txt svneol=native#text/plain +res/cardsfolder/t/thoughtbound_primoc.txt -text res/cardsfolder/t/thoughtcast.txt svneol=native#text/plain res/cardsfolder/t/thoughtcutter_agent.txt svneol=native#text/plain res/cardsfolder/t/thoughtflare.txt -text @@ -12422,6 +12423,7 @@ res/cardsfolder/w/wild_guess.txt -text res/cardsfolder/w/wild_hunger.txt -text res/cardsfolder/w/wild_jhovall.txt svneol=native#text/plain res/cardsfolder/w/wild_leotau.txt svneol=native#text/plain +res/cardsfolder/w/wild_mammoth.txt -text res/cardsfolder/w/wild_might.txt -text res/cardsfolder/w/wild_mongrel.txt svneol=native#text/plain res/cardsfolder/w/wild_nacatl.txt svneol=native#text/plain diff --git a/res/cardsfolder/t/thoughtbound_primoc.txt b/res/cardsfolder/t/thoughtbound_primoc.txt new file mode 100644 index 00000000000..5a8b2ce4f0a --- /dev/null +++ b/res/cardsfolder/t/thoughtbound_primoc.txt @@ -0,0 +1,12 @@ +Name:Thoughtbound Primoc +ManaCost:2 R +Types:Creature Bird Beast +PT:2/3 +K:Flying +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | CheckDefinedPlayer$ Player.withMostTypeWizardOnly | Execute$ TrigGain | TriggerDescription$ At the beginning of your upkeep, if a player controls more Wizards than each other player, the player who controls the most Wizards gains control of CARDNAME. +SVar:TrigGain:AB$ GainControl | Cost$ 0 | Defined$ Self | NewController$ Player.withMostTypeWizardOnly +SVar:RemRandomDeck:True +DeckHints:Type$Wizard +SVar:Picture:http://www.wizards.com/global/images/magic/general/thoughtbound_primoc.jpg +Oracle:Flying\nAt the beginning of your upkeep, if a player controls more Wizards than each other player, the player who controls the most Wizards gains control of Thoughtbound Primoc. +SetInfo:ONS Uncommon \ No newline at end of file diff --git a/res/cardsfolder/w/wild_mammoth.txt b/res/cardsfolder/w/wild_mammoth.txt new file mode 100644 index 00000000000..c0919418fdf --- /dev/null +++ b/res/cardsfolder/w/wild_mammoth.txt @@ -0,0 +1,10 @@ +Name:Wild Mammoth +ManaCost:2 G +Types:Creature Elephant +PT:3/4 +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | CheckDefinedPlayer$ Player.withMostTypeCreatureOnly | Execute$ TrigGain | TriggerDescription$ At the beginning of your upkeep, if a player controls more creatures than each other player, the player who controls the most creatures gains control of CARDNAME. +SVar:TrigGain:AB$ GainControl | Cost$ 0 | Defined$ Self | NewController$ Player.withMostTypeCreatureOnly +SVar:RemRandomDeck:True +SVar:Picture:http://www.wizards.com/global/images/magic/general/wild_mammoth.jpg +Oracle:At the beginning of your upkeep, if a player controls more creatures than each other player, the player who controls the most creatures gains control of Wild Mammoth. +SetInfo:NMS Uncommon \ No newline at end of file diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 25e7d1e3ff2..d8e814e9593 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -3773,7 +3773,7 @@ public class Card extends GameEntity implements Comparable { total += this.getCounters(CounterType.P1P1) + this.getCounters(CounterType.P1P2) + this.getCounters(CounterType.P1P0) - this.getCounters(CounterType.M1M1) + 2 * this.getCounters(CounterType.P2P2) - 2 * this.getCounters(CounterType.M2M1) - - 2 * this.getCounters(CounterType.M2M2) - this.getCounters(CounterType.M1M0); + - 2 * this.getCounters(CounterType.M2M2) - this.getCounters(CounterType.M1M0) + 2 * this.getCounters(CounterType.P2P0); return total; } @@ -3827,7 +3827,8 @@ public class Card extends GameEntity implements Comparable { total += this.getCounters(CounterType.P1P1) + 2 * this.getCounters(CounterType.P1P2) - this.getCounters(CounterType.M1M1) + this.getCounters(CounterType.P0P1) - 2 * this.getCounters(CounterType.M0M2) + 2 * this.getCounters(CounterType.P2P2) - - this.getCounters(CounterType.M0M1) - this.getCounters(CounterType.M2M1) - 2 * this.getCounters(CounterType.M2M2); + - this.getCounters(CounterType.M0M1) - this.getCounters(CounterType.M2M1) - 2 * this.getCounters(CounterType.M2M2) + + 2 * this.getCounters(CounterType.P0P2); return total; } diff --git a/src/main/java/forge/card/TriggerReplacementBase.java b/src/main/java/forge/card/TriggerReplacementBase.java index 4622b05adb0..796cd757e39 100644 --- a/src/main/java/forge/card/TriggerReplacementBase.java +++ b/src/main/java/forge/card/TriggerReplacementBase.java @@ -278,6 +278,22 @@ public abstract class TriggerReplacementBase { return false; } } + + if (params.containsKey("CheckDefinedPlayer")) { + final String sIsPresent = params.get("CheckDefinedPlayer"); + int playersize = AbilityUtils.getDefinedPlayers(game.getCardState(this.getHostCard()), sIsPresent, + this.getHostCard().getFirstSpellAbility()).size(); + String comparator = "GE1"; + if (params.containsKey("DefinedPlayerCompare")) { + comparator = params.get("DefinedPlayerCompare"); + } + final String svarOperator = comparator.substring(0, 2); + final String svarOperand = comparator.substring(2); + final int operandValue = AbilityUtils.calculateAmount(game.getCardState(this.getHostCard()), svarOperand, null); + if (!Expressions.compare(playersize, svarOperator, operandValue)) { + return false; + } + } if (params.containsKey("CheckSVar")) { final int sVar = AbilityUtils.calculateAmount(game.getCardState(this.getHostCard()), params.get("CheckSVar"), null); diff --git a/src/main/java/forge/game/player/Player.java b/src/main/java/forge/game/player/Player.java index 4a56bf74ccb..5f8742b98fd 100644 --- a/src/main/java/forge/game/player/Player.java +++ b/src/main/java/forge/game/player/Player.java @@ -2448,6 +2448,32 @@ public class Player extends GameEntity implements Comparable { return false; } } + else if (property.substring(8).startsWith("Type")) { + String type = property.split("Type")[1]; + boolean checkOnly = false; + if (type.endsWith("Only")) { + checkOnly = true; + type = type.replace("Only", ""); + } + int typeNum = 0; + List controlmost = new ArrayList(); + for (final Player p : game.getPlayers()) { + final int num = CardLists.getType(p.getCardsIn(ZoneType.Battlefield), type).size(); + if (num > typeNum) { + typeNum = num; + controlmost.clear(); + } + if (num == typeNum) { + controlmost.add(p); + } + } + if (checkOnly && controlmost.size() != 1) { + return false; + } + if (!controlmost.contains(this)) { + return false; + } + } } else if (property.startsWith("withLowest")) { if (property.substring(10).equals("Life")) { int lowestLife = 1000;