Commit Graph

357 Commits (2733516cb9cdad7ac4cef98b819d4d01846e5c66)

Author SHA1 Message Date
Leandro Doctors 2733516cb9 Organize imports 2020-01-16 08:21:24 +08:00
Ada Joule d213884dc2 Add Saga mechanic (#1564)
* Add AtBeginOfFirstMainPhaseTrigger and adding lore counter to saga

* Make add counter trigger more generic

* Change begin main phase trigger to Saga-specific

* Add magic.data.RomanToInt

* Add chapter parsing to ARG

* Add SagaChapterTrigger

* Add chapter ability to MagicAbility

* Add lore counter mechanic to Saga card definiton

* Add Saga sacrifice state-based action

* Fix import

* Fix getPendingTriggers

* Add History of Benalia

* Fix adding ETB trigger

* Remove AtBeginningOfFirstMainPhaseTrigger.Saga, Add counters directly in MagicMainPhase.executeBeginStep()

* Remove null case from RomanToInt

* Revert "Remove AtBeginningOfFirstMainPhaseTrigger.Saga, Add counters directly in MagicMainPhase.executeBeginStep()"

This reverts commit d8e5d1f253ab7b54f401f4151b44d39ee927f44c.

* Move isSaga method to IRenderableCard
2018-05-04 14:17:55 +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
melvinzhang beefc066c8 consider hand/exiles as ordered as it affects future choice of cards in these locations, fixes #1311 2017-09-23 10:25:02 +08:00
melvinzhang 23f9a02519 track which static applied to a permanent, for #202 2017-08-16 23:25:58 +08:00
melvinzhang 09bb897c62 include equipments/auras in permanent state, for #815
previous method of including permanent in equipment/aura state could not
distinguish between two aura on one permanent or on separate permanents
2017-08-09 22:27:01 +08:00
melvinzhang 23f6c887fc add missing override annotation 2017-07-21 18:10:11 +08:00
melvinzhang bbbdcac9ef add override annotation to overridden methods 2017-06-17 11:19:03 +08:00
melvinzhang 7173ba51a9 MagicAbility.AttacksEachTurnIfAble should override AI set MagicPermanentState.ExcludeFromCombat, fixes #1135 2017-05-28 16:58:24 +08:00
melvinzhang a155571769 remove unused case as Game layer is not used by Permanents 2017-05-19 09:28:48 +08:00
ShawnieBoy e1a6bf36e9 include Vehicles in getPowerToughnessText() 2017-01-29 14:36:49 +00:00
lodici 79ae406b44 relocate IRenderableCard into magic.model. 2016-10-06 12:26:58 +01:00
melvinzhang 60976579b8 merge getPermanentImage(MagicPermanent permanent) and getCardImage(MagicCardDefinition cdef) into getCardImage(IRenderableCard face) 2016-10-06 14:12:38 +08:00
melvinzhang c2bc7a030f check for ALL_CREATURES instead of Changeling to cover Mistform Ultimus, for #623 2016-10-06 10:05:38 +08:00
melvinzhang 86bb0786fa add getSubTypeText to MagicPermanent, restore original default implementation of getSubTypeText 2016-10-06 08:54:42 +08:00
lodici b55da6a394 create 'magic.cardDefinition*' and relocate classes. 2016-10-05 13:53:20 +01:00
melvinzhang c0a6028e9e move morph activations to card layer as permanent no longer check game layer, fixes #921 2016-09-29 08:59:22 +08:00
melvinzhang dc80bb455b permanent update should not include player layer or game layer 2016-09-21 19:15:17 +08:00
melvinzhang a3e264cecc order of blocking creatures matters for stateId, use blockingCreatures instead of blockedCreature 2016-07-18 11:39:05 +08:00
melvinzhang 631192a461 add abilities 'snow landwalk', 'snow swampwalk', 'snow forestwalk', fixes #811 2016-07-18 09:03:03 +08:00
melvinzhang 39cefe24dd replace expression with call to shareColor 2016-07-12 11:57:32 +08:00
melvinzhang e5982d13dd add getColorFlags and shareColor to MagicObject 2016-07-12 11:51:53 +08:00
melvinzhang 25f66c9ac9 add MagicManaCost.getDevotion 2016-07-06 11:57:39 +08:00
melvinzhang 5448a4f3f1 add ability 'protection from multicolored' 2016-06-16 11:51:04 +08:00
ShawnieBoy 605a979f77 fix: transformed cards have no mana cost, but a converted mana cost of the other side 2016-03-27 16:29:19 +01:00
ShawnieBoy 566d258819 add White and Red fear variants 2016-02-05 17:18:39 +00:00
ShawnieBoy 1b8b58f67c add Split property to identify Split cards for Cardbuilder 2016-01-31 15:06:24 +00:00
melvinzhang a9694c6e34 replace String.format with MagicMessage.format 2016-01-31 12:44:03 +08:00
melvinzhang 295f9c1913 add whitespace to align initial stateFlags 2016-01-11 10:47:51 +08:00
ShawnieBoy 6230378e70 rename comeIntoPlayTriggers to etbTriggers 2016-01-10 18:14:09 +00:00
ShawnieBoy bdf283b71a remove unnecessary qualifiers from MagicPermanent 2016-01-10 17:45:15 +00:00
ShawnieBoy 692fc110d4 reformat MagicPermanent code 2016-01-10 17:25:27 +00:00
melvinzhang a6830b0786 consolidate duplicate implementations as default methods in IRenderableCard 2016-01-06 14:26:58 +08:00
ShawnieBoy af8159dd97 add getTransformedDefinition() to IRenderableCard 2016-01-06 03:30:11 +00:00
ShawnieBoy 391e61f570 simplify isHybrid() logic 2016-01-06 03:29:08 +00:00
ShawnieBoy 0dc50c65b8 add getRarityChar() to IRenderableCard 2016-01-05 18:14:51 +00:00
melvinzhang 16a6372251 fix crash when trying to cash HashSet to EnumSet by removing cast and creating copy of cachedSubTypeFlags 2015-12-25 08:54:58 +08:00
melvinzhang 0e47e2ed47 rename getSubTypeFlags to getSubTypes 2015-12-25 08:54:58 +08:00
melvinzhang dc2078e36b improve indentation of src code 2015-12-24 12:45:50 +08:00
ShawnieBoy 1d1c76e234 add isHidden() to IRenderableCard 2015-12-21 13:45:04 +00:00
ShawnieBoy 694902fa30 add Type booleans to IRenderableCard 2015-12-19 22:56:41 +00:00
ShawnieBoy 95a3c00c58 add Implementation of IRenderableCard 2015-12-19 16:27:28 +00:00
ShawnieBoy bd519c32aa make .getColorFlags() public 2015-12-19 14:59:56 +00:00
melvinzhang 4c40d011c7 replace reference to MagicCostManaType.Colorless MagicCostManaType.Generic 2015-12-14 23:27:25 +08:00
ShawnieBoy fd1be803a2 rename MagicWhenComesIntoPlayTrigger to EntersBattlefieldTrigger 2015-11-22 15:33:59 +00:00
melvinzhang f09b198e05 Revert "move default implementations from MagicObjectImpl into MagicObject" as it does not work with groovy type checking
This reverts commit d7f4bfb666.
2015-10-29 21:18:04 +08:00
melvinzhang d7f4bfb666 move default implementations from MagicObjectImpl into MagicObject 2015-10-29 20:37:28 +08:00
melvinzhang 4bc8922560 always show the human player the true face of face down spells 2015-10-27 19:57:54 +08:00
melvinzhang 07c8bd0084 group can/can't until EOT should affect permanents that ETB after effect resolves, fixes #443 2015-10-20 21:59:23 +08:00
melvinzhang 86df942684 create an artificial layer for ability changing that depends on condition, fixes #447 2015-10-20 20:58:56 +08:00