Commit Graph

28996 Commits (5e54d8ab9054a15748e03af8c1e9ac2bc0d1b3e4)

Author SHA1 Message Date
Ada Joule 5e54d8ab90 Remove "to mana pool" from abilities that produce mana (#1558)
* Make "to your mana pool" optional in mana abilities

* Remove "to your mana pool" entirely

* Remove "to your mana pool" in card scripts

* Remove "to your mana pool" in scripts_missing

* Remove "to your mana pool" from other places

* Remove "to [anyone's] mana pool"
2018-04-15 08:32:42 +08:00
Ada Joule baffa65bb5 Correct target filter in Scrap Trawler (#1556)
* Correct target filter in Scrap Trawler

* Revert "Correct target filter in Scrap Trawler"

This reverts commit e6f2575c3a1903ba1db701bba906d393d98bf237.

* Add cmcLT to MagicCardFilterImpl and Scrap Trawler
2018-04-14 11:48:20 +08:00
ShawnieBoy 2e89cfb7b8 add Dominaria to sets - new scripts pending gatherer update next week 2018-04-14 03:23:01 +01:00
Ada Joule e0441c1cdc Add player check to Nest of Scarabs (#1554) 2018-04-14 08:28:20 +08:00
Ada Joule 5282913412 Extract counter change data to a local variable (#1555) 2018-04-14 08:25:56 +08:00
Ada Joule 8b0a79ee12 Add "Whenever you put one or more counters" abilities (#1553)
* Add createYou method for counter is put triggers

* Add "when you put one or more counter" to MagicAbility.java

* Add Defiant Greatmaw

* Add Hapatra, Vizier of Poisons and Snake token

* Add superclass accept check to created triggers

* Add Nest of Scarabs and Insect token

* Add Obelisk Spider
2018-04-13 09:29:35 +08:00
Ada Joule df7e5932b5 Remove redundant amount check in ChangeCountersAction.java (#1550) 2018-04-11 19:04:48 +08:00
Ada Joule 80891e0be2 Fix Deathgorge Scavenger and Verdant Sun's Avatar (#1548)
* Fix Deathgorge Scavenger

* Fix Verdant Sun's Avatar

* Fix wrong code location
2018-04-10 12:58:08 +08:00
Ada Joule 2a0d8c0394 Add player argument to ChangeCountersAction (#1549)
* Add source argument to ChangeCountersAction

* Add source argument to usages of ChangeCountersAction in event package

* Update usages in DealDamageAction

* Update usages in trigger package

* Change source argument to player argument

The oracle text refers to the player putting counters, so it's more
logical to have a player argument.

* Add player data to MagicCounterChangeTriggerData

* Update DealDamageAction

* Change to player in event package

* Change to player argument in trigger package

* Add import

* Fix usage in test package

* Fix usage in groovy scripts

* Fix bug
2018-04-10 12:08:37 +08:00
Ada Joule 209bb0a6d0 Add cards that utilise IfCounterWouldChangeTrigger (#1544)
* Add Corpsejack Menace

* Add Hardened Scales

* Add "one or more would be put" to accept method

* Add Tatterkite

* Add Vizier of Remedies

* Add Winding Constrictor

* Simplify condition in Winding Constrictor
2018-04-09 16:52:15 +08:00
melvinzhang 407d0c3665 check amount after it has been possibly modified by IfCounterWouldChange 2018-04-09 15:00:29 +08:00
Martin Petricek bd5ae5fd7a Refactoring (#1543)
* Fix typos.

* Remove unnecessary boxing/unboxing.

* Replace traditional 'for' loops with 'foreach' loops.

* Replace explicit types with <> (diamonds) where they can be inferred.

* Collapse identical catch branches.

* Replace statement lambda with expression lambda for short statements.

* Remove unnecessary imports.

* Replace some lambdas with Comparator.comparing

* Replace Runnables with lambdas.

* Use addAll instead of adding whole collection manually.

* Simplify boolean expressions.

* Remove redundant 'else'.

* Simplify some boolean conditions that are always true or false.

* Inline redundant local variables.

* Remove extraneous semicolons.

* Fix Javadoc errors.

* Replace anonymous classes with lambdas.

* Replace chain of 'if's with switch.

* Remove delaration of exception that is never thrown.

* Use String/StringBuilder properly.
2018-04-08 08:59:14 +08:00
Ada Joule 66ffd3f1d1 Add abilities that trigger when a counter is put on a card, or one or more counters are put (#1541)
* Add CounterIsAddedTrigger

* Add counter type to MagicCounterChangeTriggerData

* Rename CounterIsAdded to CounterIsPlaced

* Add CounterIsRemovedTrigger

* Add executeTrigger statements to ChangeCountersAction

* Fix errors

* Add IfCounterWouldChangeTrigger

* Change CounterIsPlacedTrigger to also have counterType argument

* Add when one or more counter is placed to MagicAbility

* Rename CounterIsPlacedTrigger to OneOrMoreCounterIsPlacedTrigger

* Change one or more counter is placed on SN to on permanent

* Change OneOrMoreCounterIsPlaced to OneOrMoreCountersArePlaced

* Add "are put" to counter checking

* Remove counter removed trigger type

* Change CountersArePlaced to CountersArePut

* Remove CounterIsRemovedTrigger.java

* Add cards that doesn't need groovy

* Revert "Add cards that doesn't need groovy"

This reverts commit 05f8782baba7280edb24c41a9f0ddeb6f54a312d.

* Add Enduring Scalelord

* Add ACounterIsPutTrigger

* Add Bloodcrazed Hoplite

* Add Fathom Mage

* Add Flourishing Defenses

* Rename counterType argument to aCounterType

* Use ARG.WORD1 in MagicAbility

* Change TriggerType name
2018-04-07 22:54:49 +08:00
melvinzhang 2c239a081e replace other uses of matcher.group(type) with ARG.word1(matcher) 2018-04-07 08:44:37 +08:00
melvinzhang 97627ea02b remove hardcoded regex with ARG constant 2018-04-07 08:40:26 +08:00
Ada Joule d2e44c054e Add Saga subtype and historic keyword (#1540)
* Add MagicSubType.Saga

* Add historic to MagicTargetFilterFactory
2018-04-06 19:54:56 +08:00
melvinzhang 35f423b263 add casting condition to legendary sorceries, closes #1536 2018-04-05 20:21:52 +08:00
melvinzhang 0c5a72ff4c use generic method to remove raw type warning 2018-04-05 19:55:19 +08:00
melvinzhang f9af5282b2 use existing ScriptParseException instead of FilterParseException 2018-04-01 12:47:33 +08:00
melvinzhang 55e06d3585 use FilterParseException instead of RuntimeException 2018-04-01 12:42:05 +08:00
melvinzhang 91605aa3c1 replace filter generators with filter parsers 2018-04-01 12:36:38 +08:00
Martin Petricek 5b371494a1 Improve and generalize script parsing (#1530)
* "it" and "SN" are synonyms, use both forms where this is true.

* Generalize parsing of targets

* Generalize parsing of targets with filter generator with numeric parameters.

* Simplify some of the existing Groovy scripts

* Simplify and refactor spells and CMC filters.

* Generalize parsing of spells with numeric parameters.

* Generalize parsing of permanent targets, support numeric parameters.

* Simplify parsing simple prefixes (color, type, subtype).
Use regexes instead of only looping over all possible colors/types/subtypes.

* Add three cards that are now supported with parser improvements:
 Horribly Awry
 Radiant Kavu
 Thoughtbind

* Remove complex old-style filters that are unreferenced from Java / Groovy.

* Further simplification of predefined rules.

* Fix bad mana cost in Sequestered Stash
2018-04-01 10:24:15 +08:00
melvinzhang b46234f3eb update release notes up to March 2018-03-31 20:20:59 +08:00
melvinzhang 5d09412609 add missing newline at end of file, remove blank lines at end of file 2018-03-28 16:24:04 +08:00
Ada Joule c34a40e9e8 Fix abilities that reveal cards from top of library until certain condition (#1531)
* Fix Tezzeret, Master of Metal

* Fix Ajani, Valiant Protector

* Fix MoveCardAction

* Fix Madcap Experiment

* Fix Treasure Keeper

* Fix RemoveCardAction

* Fix RemoveCardAction in castAction

* Fix variable name

* Use break to exit loop
2018-03-28 16:21:12 +08:00
ShawnieBoy 257bc61717 correct image url for 0/1 red elemental creature token 2018-03-23 15:20:39 +00:00
melvinzhang 1d157f84a1 fix incorrect interface for MagicPermanentAction instances 2018-03-23 21:58:08 +08:00
Martin Petricek 5ce8792d61 more cards 5 (#1517)
* Add more new cards after playtesting (credit goes to Kelsioboy):
Akuta, Born of Ash
Dark Dabbling
Defiling Tears
Doorkeeper
Dragon Grip
Explorer's Scope
Gigapede
Guul Draz Overseer
Into the Wilds
Salt Road Ambushers
Tainted Remedy
Terrifying Presence
Thrasios, Triton Hero
Trail of Mystery
Yomiji, Who Bars the Way

* Cleanup: Remove trailing whitespace from scripts

* Fix all HTTP to HTTPS for magiccards.info
2018-03-22 17:35:32 +08:00
Ada Joule e5ebff99b1 Add more cards from Kaladesh and Amonkhet blocks (#1504)
* Add Aetherstorm Roc

* Add Dubious Challenge

* Fix cost event of Aetherstorm Roc

* Fix Aetherstorm Roc

* Add MagicPayEnergyEvent in Aetherstorm Roc

* Add Fateful Showdown

* Add Madcap Experiment

* Add Tezzeret's Betrayal

* Add Treasure Keeper

* Add Edifice of Authority

* Add Gate to the Afterlife

* Remove groovy ability in Gate_to_the_Afterlife.txt

* Add Gideon's Resolve

* Add requires_groovy_code line to added cards

* Move another ability of Gate to the Afterlife to groovy

* Add Harvest Season

* Fix closure in Treasure Keeper

* Fix static type checking in Treasure Keeper

* Revert predicate declaration back

* Fix negative predicate closure in Treasure Keeper

* Fix static type checking in Treasure Keeper

* Add God Pharaoh's Gift

* Add requires_groovy_code to Harvest Season

* Use MagicCardList type for event ref

* Add missing comma

* Fix wrong return type

* Add groovy script for God Pharaoh's Gift

* Fix typo

* Fix int type in Harvest Season

* Add Imaginary Threats

* Add Nicol Bolas, the Deceiver

* Remove groovy ability from Nicol_Bolas__the_Deceiver.txt

* Remove redundant player ref from Nicol Bolas, the Deceiver's event

* Add Torment of Hailfire

* Add missing parenthesis

* Add Torment of Venom

* Remove Torment of Venom's effect from txt and add requires_groovy_code
line

* Remove extra ref argument from Torment of Venom's event

* Fix shuffle in Madcap Experiment

* Fix rest.remove(it) in Dubious Challenge

* Refine Madcap Experiment

* Fix Treasure Keeper

* Add exile action in God Pharaoh's Gift

* Use constructor instead of casting in Madcap Experiment

* Add missing choice argument in Torment of Venom

* Fix variable name

* Fix Edifice of Authority

* Fix Fateful Showdown

* Fix Treasure Keeper

* Fix targeting ruling in Tezzeret's Betrayal

* Rewrite Aetherstorm Roc

* Refine Aetherstorm Roc
2018-03-22 17:20:31 +08:00
Ada Joule 1d5e788838 Make targeting spells and abilities "countered" if the target becomes illegal (#1516)
* Fix Kari Zev's Expertise

* Fix Confiscation Coup

* Fix Liberating Combustion

* Fix typo

* Fix Chandra's Defeat

* Fix Imminent Doom

* Fix Wasp of the Bitter End

* Fix Field of Ruin

* Fix Expel from Orazca

* Remove extra $ in Chandra's Defeat
2018-03-22 17:19:08 +08:00
Ada Joule 0301e99c1b Add RevealAction to groovy scripts (#1509)
* Fix Commune with Dinosaurs

* Fix Aetherworks Marvel

* Fix Azcanta, the Sunken Ruin

* Fix Sunbird's Invocation

* Change Aetherworks Marvel back

* Add LookAction to Commune with Dinosaurs
2018-03-20 17:55:05 +08:00
Martin Petricek f9745090fc More cards again (#1511)
* Put back https:// instead of http:// on new card scripts.

* Add support for new cards (credit goes to kelsioboy for them):
 Aleatory
 Blazing Salvo
 Chaotic Strike
 Confront the Unknown
 Cyclopean Giant
 Hamletback Goliath
 Indulgent Tormentor
 Intimidation Bolt
 Learn from the Past
 Measure of Wickedness
 Neko-Te
 Sylvan Primordial
 Tenacious Dead
 Thran Foundry
 Waxing Moon
 Wheel and Deal
 Wolfcaller's Howl
2018-03-20 10:42:31 +08:00
melvinzhang 42df2b22f9 fix crash due to wrong interface for playMod, use AddTurnTriggerAction instead of AddTrigerAction, fixes #1512 2018-03-20 10:28:36 +08:00
melvinzhang 3e0569e541 include casts in groovy code when looking for casts 2018-03-20 10:05:05 +08:00
Ada Joule acf6d97960 Add cards that have Ascend ability (#1510)
* Add Deadeye Brawler

* Add Pride of Conquerors

* Add Secrets of the Golden City

* Add status to Radiant Destiny

* Add Wayward Swordtooth

* Add Snubhorn Sentry

* Add Dusk Charger

* Add Spire Winder

* Add Skymarcher Aspirant

* Add Resplendent Griffin

* Add groovy code for Pride of Conquerors

* Add Storm Fleet Swashbuckler

* Add Mausoleum Harpy

* Add Tendershoot Dryad

* Add Orazca Relic

* Add Slippery Scoundrel

* Add Arch of Orazca

* Add Timestream Navigator

* Fix addEvent in Pride of Conquerors

* Add ride to Orazca Relic

* Add put self on bottom of owner's library to MagicCostEvent

* Cast source to MagicPermanent

* Add groovy script for Secrets of the Golden City

* Add Twilight Prophet

* Add Kumena's Awakening

* Add Expel from Orazca

* Add Golden Demise

* Fix may choice in Expel from Orazca

* Fix missing parenthesis

* Add missing player local variable in Golden Demise

* Add Tilonalli's Summoner

* Fix playmod in Tilonalli's Summoner

* Add Vona's Hunger

* Change timing of Pride of Conquerors to Pump

* Add removal of exile trigger in Tilonalli's Summoner

* Convert the half number of permanents in Vona's Hunger to integer

* Add checking event.getChosen().length in Expel from Orazca

This avoids ArrayIndexOutOfBoundException in event.isYes()
2018-03-20 09:38:52 +08:00
Martin Petricek 583813407f Add support for new cards (credit goes to kelsioboy for them): (#1507)
Long Road Home
 Otherworldly Journey
 Pyre Zombie
 Joven's Ferrets
 Bounty Hunter
 Cranial Archive
 Feed the Pack
 Harvest Season
 Loxodon Peacekeeper
 Strip Bare
 Cellar Door
 Rekindling Phoenix
2018-03-19 22:17:47 +08:00
Ada Joule 54f6badc3d Fix card bugs (#1503)
* Fix GroovyCastException in Combustible Gearhulk

* Fix getGame() called for MagicPlayer.NONE in Rashmi, Eternities Crafter

* Move topCards.removeCard(it) in card list events before the action

* Fix shuffling in Tezzeret, Master of Metal

* Fix predicate

* Fix shuffle in Ajani, Valiant Protector

* Fix typo

* Fix static type checking

* Modify Rashmi's action

* Change getCardAtTop() to getCardsFromTop(1)

* Fix variable name

* Use constructor for MagicCardList instead of casting
2018-03-18 13:06:42 +08:00
Martin Petricek 4313c14b41 Configurable time limits for running AI game. (#1505) 2018-03-18 10:40:19 +08:00
Martin Petricek 4c82c0956c Implement cards that are variations to existing already implemented cards. (#1501)
Brazen Freebooter
 Consuming Vapors
 Flood of Recollection
 Gleaming Barrier
 Jungle Creeper
 Manipulate Fate
 Moment of Craving
 Moment of Triumph
2018-03-16 09:39:49 +08:00
Martin Petricek a77ed3ae76 Add cards that need only minor modification: (#1499)
Frilled Deathspitter
 Needletooth Raptor
 Raging Regisaur
 Tilonalli's Crown

All those cards were tested in actual gameplay.
2018-03-15 09:26:37 +08:00
ShawnieBoy a9f25ce310 update enchant targets for parsed cards 2018-03-13 12:47:08 +00:00
ShawnieBoy 4a76474000 add parsed cards 2018-03-13 12:43:40 +00:00
ShawnieBoy c9b207e99f edit partial legendary names for parsing 2018-03-13 11:43:39 +00:00
ShawnieBoy 6d4becc689 update rix image urls 2018-03-12 13:59:00 +00:00
ShawnieBoy 5005d828c6 add M25 to sets 2018-03-12 13:04:33 +00:00
ShawnieBoy 0e719be6b8 update modern format legalities 2018-03-12 10:46:31 +00:00
Ada Joule e44d086554 Add Ascend mechanic to the game engine (#1486)
* Add MagicAbility.Ascend

* Add MagicPlayerState.CitysBlessing

* Add Ascend spell ability to MagicSpellCardEvent

* Add import

* Get rid of type name

* Add the city's blessing to MagicCondition

* Use doAction in Ascend spell card event

* Add import

* Add checking if player already has city's blessing

* Add AscendTrigger.java

* Add import

* Add AscendTrigger to Ascend ability

* Move AscendTrigger into OtherEntersBattlefieldTrigger.java

Creating a new instance of AscendTrigger would hog memory.

* Move ascend spell ability to MagicRuleEventAction

* Revert "Move AscendTrigger into OtherEntersBattlefieldTrigger.java"

This reverts commit 72fdf16e7ad13343ffe2b52458a28b22c2dd970c.

* Use single AscendTrigger instance

* Remove AscendTrigger, add MagicStatic.Ascend

* Remove PutStateTriggerOnStackAction from Ascend

* Add import

* Use source.getController() for ascending player
2018-03-04 08:52:08 +08:00
Ada Joule 967ac7aa34 Add Pharika's Snake token (#1492) 2018-03-02 09:40:25 +08:00
melvinzhang a996a5f956 fix missing closing parenthesis in groovy code 2018-03-01 21:35:04 +08:00
melvinzhang 6d0879620f remove extra permanent parameter, correct getRefPermanent to getPermanent 2018-03-01 21:08:25 +08:00