Commit Graph

338 Commits (2733516cb9cdad7ac4cef98b819d4d01846e5c66)

Author SHA1 Message Date
melvin 23bd19ee17 separate aiKnown from gameKnown, add MagicLookAction 2014-07-20 09:54:18 +08:00
ShawnieBoy d6654be717 Add getNrOfPermanents(SubType) to MagicGame 2014-07-17 15:26:43 +01:00
Lodici 749a2440fd getAPNAP()? add comment and link. 2014-07-16 10:16:16 +01:00
melvin 35641c9c28 simplify expression to return APNAP players by removing array size, rename getPlayersAPNAP to APNAP since the P in the acronym means player 2014-07-16 08:41:16 +08:00
ShawnieBoy 244eed252f Fix getPlayerAPNAP() array size 2014-07-15 23:15:33 +01:00
ShawnieBoy 629d0c24e1 Add .getPlayersAPNAP() method to MagicGame 2014-07-15 15:41:31 +01:00
ShawnieBoy 186220f8bf Add 'getNrOfPermanents(MagicTargetFilter<MagicPermanent>)' to MagicGame.java 2014-07-02 17:33:08 +01:00
melvin 34fd620a36 only build one report for clarity, same as doAction case 2014-06-15 11:26:48 +08:00
melvin c2975b6c0f unify record and startActions as snapshot, unify gotoLastUndoPoint and undoActions as restore 2014-06-15 11:17:20 +08:00
melvin bb51741de0 backout experimental fix "Lost all abilities" effect. 2014-06-14 16:36:06 +08:00
gffunforgiven 938da08944 Experimental fix for "Lost all abilities" effect. 2014-06-13 17:32:52 -04:00
melvin 794d6ddacc add assert to check for objects that are not mapped or not copied 2014-05-15 12:52:15 +08:00
melvin 61ae2fa2d1 support effect 'each <player> sacrifices <permanent>.' 2014-05-02 20:07:14 +08:00
ShawnieBoy 12d812ca74 Import tidyup for magic.model and magic.model.action 2014-04-18 14:58:52 +01:00
melvin 91a1bd9752 remove unused import 2014-04-17 16:55:29 +08:00
melvin fb359454e6 allow players to be used damage group 2014-04-14 10:26:51 +08:00
melvin 77e40115ea split nested class out of MagicTargetFilter 2014-04-06 17:34:49 +08:00
melvin f1e7113ff2 move filter constants into MagicTargetFilterFactory 2014-04-06 17:04:14 +08:00
melvin ecc926e76b add getStateId to MagicPayedCost, call it from MagicGame and MagicCardOnStack 2014-04-02 10:33:12 +08:00
melvin 0cab4c25a6 include triggers, statics and payedCost target in stateId calculation 2014-04-02 10:30:44 +08:00
melvin d7b3996a72 include active source in game state 2014-04-01 13:57:17 +08:00
melvin e52a3d73db source of delayed trigger is the card 2014-03-28 14:09:11 +08:00
melvin 50633cd60e ensure order of trigger activation follow order of trigger definition in groovy script 2014-03-28 11:34:31 +08:00
melvin f1b5e7a444 suppress unchecked warnings 2014-03-20 14:13:46 +08:00
Lodici 363333adda - replaced DuelDialog with new DuelPlayersScreen which improves managment of player profiles (both human and AI).
- new avatar selection screen.
- improved player stats presentation.
- Now uses persistent AI personas with their own stats.
- If a duel consists of X games then is played as best of X instead of first to X.
- can now play a single game duel.
- improved layout of player tabs in DuelDecksScreen. Current score is now integrated into the tabs.
2014-03-06 09:45:19 +00:00
melvin 7aaf7b7920 fixed attach action to only update continuous effects generated by the attachable permanent
it was wrongly removing all continuous effects associated with a permanent, including the gain control effect

fixes issue 456
2014-02-03 09:13:38 +08:00
melvin 0a97959943 added record and restore method to MagicGame as convienent wrapper for undoing in a regular and AI game 2013-10-31 14:33:46 +08:00
melvin 83360f652d isSpellCardEvent broke as action is not instance of MagicSpellCardEvent when
using MagicRuleEventAction

fixed by putting the logic for moving card to graveyard/exile in resolve
method of MagicCardOnStack

fixes issue 415
2013-10-29 22:31:36 +08:00
melvin 11fabf8eb9 added variants of filter which does not depend on player, player specific filter added to MagicPlayer 2013-10-13 11:22:25 +08:00
melvin f6233ac7c6 replace MersenneTwisterFast with Xorshift 2013-09-24 11:55:52 +08:00
melvin 4f17f35a0a MagicCardDefinition of a MagicPermanent can be set in the constructor, allows Clone effects 2013-08-09 11:59:04 +08:00
melvin cc7af2332d added message when world is removed due to world rule 2013-07-23 14:46:56 +08:00
melvin d5d4730d82 implement the world rule 2013-07-23 14:44:23 +08:00
melvin 7c26347d74 rename getNrOfPermanentsWith* to getNrOfPermanents 2013-07-14 19:50:06 +08:00
melvin 1218b8dc6a remove debug println 2013-07-14 19:25:32 +08:00
melvin 82cd76d4cd rename getImmediate to isImmediate 2013-07-14 09:39:23 +08:00
melvin 9106cf0496 disable planeswalker damage redirection in immediate mode 2013-07-14 09:38:42 +08:00
melvin 4227545a73 triggered ability can be added to permanents in continous effects via addTrigger 2013-07-13 22:41:20 +08:00
melvin b5b2051ae6 added Varolz, the Scar-Striped 2013-07-12 13:43:22 +08:00
melvin e2990bb3b4 added getActiveSource 2013-07-09 14:40:18 +08:00
melvin c692d6068d remove with !exp == false 2013-07-08 13:17:04 +08:00
melvin 9b9ae39219 correct test, should set payedCost if the index is valid 2013-07-03 09:50:05 +08:00
melvin 143e9cd7b1 move card to graveyard in MagicGame 2013-07-02 22:19:34 +08:00
melvin 602d3c03c8 ensure payedCost captures paid mana cost/target correctly
fixes issue 360
2013-07-02 17:58:11 +08:00
melvin 64368e1b9a remove extraneous whitespace 2013-06-24 09:33:35 +08:00
melvin a39d5f8f48 store kicker in MagcPayedCost, remove kicker from MagicCard 2013-06-19 21:16:08 +08:00
melvin 25b190d466 implement new uniqness rule where you can choose the one to keep 2013-06-11 21:21:39 +08:00
melvin 5d535e815c uniqness rule now only for your permanents, not all permanents 2013-06-11 20:42:40 +08:00
melvin 16fe463a98 remove redundant getController 2013-06-06 13:57:29 +08:00
melvin 79d07c8ffd respect usesStack in immediate mode 2013-05-05 17:10:07 +08:00
melvin fcbfadc1ec put all triggers on stack in immediate mode, clear stack after simulated combat
fixes issue 235
2013-05-05 15:36:14 +08:00
melvin 805165949b rename hasChoices to hasChoice, added no args version of executeNextEvent 2013-05-05 13:32:10 +08:00
melvin f1b27c586c convert to UNIX line endings 2013-04-13 10:32:25 +08:00
melvin 7c1bc924a2 randomize hidden card if not cheating 2013-04-05 10:15:03 +08:00
melvin 3473a0cf82 added clone method 2013-04-05 10:07:50 +08:00
melvin 2fc9170b8c added non cheating MCTS AI 2013-04-03 22:43:20 +08:00
melvin f03d93e01b Sort cards by index first, then by id. Use sorted order to generate AI choices as hand is considered unordered for game state 2013-03-30 20:05:06 +08:00
melvin 13024db2e8 remove triggers, statics and payedCost target from getStateId 2013-03-29 11:35:34 +08:00
melvin 8c8bae6b40 show stateId in toString 2013-03-28 14:50:00 +08:00
melvin 5eef8d992b added more elements to game state id computation 2013-03-26 14:19:28 +08:00
melvin acca7a3e89 unify names to getStateId for hash based id, add more items to state id computation 2013-03-24 21:10:00 +08:00
melvin 5b8a04620b added isCombatPhase 2013-03-10 21:36:13 +08:00
melvin e91d7d5203 rename setKnownCards to hideHiddenCards, handle thread interruption in MMABWorker 2013-03-10 09:32:27 +08:00
melvin 4cf8cff169 support removing trigger by specifying source and trigger 2013-03-03 19:53:40 +08:00
melvin fd4bfbcd77 added keyboard shortcut 's' to show AI's hand
fixes issue 282
2013-03-03 09:42:09 +08:00
melvin 863432ea05 remove debug print 2013-02-24 17:57:29 +08:00
melvin 717f0b6171 implemented planeswalker uniqueness rule 2013-02-24 16:32:23 +08:00
melvin b8f6a84289 added TARGET_SPELL_YOU_DONT_CONTROL 2013-02-20 16:46:10 +08:00
melvin 71dd5f6f34 put back final modifier 2013-02-17 10:57:28 +08:00
melvin 6e5458ee57 move retry without hints into MagicGame.getLegalTargets 2013-02-17 10:56:16 +08:00
melvin 8f58723bc2 remove unused method 2013-02-11 09:48:44 +08:00
melvin 94d9a2ce97 added apply and update methods to MagicGame and MagicPlayer 2013-02-10 12:35:06 +08:00
melvin b4f734f126 only handle spells being played in MagicPutItemOnStackAction, remove it from MagicStackGetChoicesEvent. Fixes targetted storm spells copying one to many times 2013-02-03 11:59:03 +08:00
melvin 8a840b5767 add getComeIntoPlayTrigger to MagicPermanent, made MagicPlayer.getCount private 2013-01-20 14:52:37 +08:00
melvin 556fffd874 implement Legend rule using LegendaryTargetFilter 2013-01-20 10:30:50 +08:00
melvin 8d3eec6f71 call method of MagicPermanent instead of calling through to underlying MagicCardDefinition 2013-01-20 10:02:09 +08:00
melvin 250159e5d0 update only after begin and end of phase 2012-12-20 21:30:57 +08:00
melvin 7262a80da5 rename changePhase to nextPhase 2012-12-20 20:13:34 +08:00
melvin 5285984e75 simplify interface for MagicGame.changePhase 2012-12-20 20:10:37 +08:00
melvin d7e54fa10d always call MagicGame.update before when we would update the UI 2012-12-20 15:21:37 +08:00
melvin 51d092aabd update on addEvent 2012-12-12 21:27:47 +08:00
melvin 6fd1738533 perform generated state based actions so that stateCheckRequired is updated 2012-12-12 14:44:12 +08:00
melvin 069e2ffd36 move update before generating of state based actions.
fixes issue 307.
2012-12-12 14:12:57 +08:00
melvin 0a0364250f remove use of this by changing name of parameter to not clash with name of member 2012-11-16 12:15:41 +08:00
melvin 67240753a3 move update from GameController to MagicPhase and MagicGame as update to the game state should be handled by MagicGame itself so it works the same in AI simulation and real game 2012-11-16 11:55:24 +08:00
melvin e1c57c985d make sure no pending actions before update, do update after check state 2012-11-15 10:26:22 +08:00
melvin 402c62d955 move state based checks into MagicPlayer
move update from MagicPermanent into MagicPutIntoPlayAction
2012-11-13 20:34:28 +08:00
melvin 7a16d43b38 fixed bug where tokens created together cannot be removed 2012-10-31 23:47:39 +08:00
melvin 670d18865f refine the return type of getLegalTargets from List<Object> to List<MagicTarget> 2012-10-21 19:42:13 +08:00
melvin 4e1da4b41b move MagicTargetFilter.isLegal to MagicTarget.isLegalTarget 2012-10-21 17:59:46 +08:00
melvin ae2b7dda69 made isLegal generic 2012-10-21 12:29:32 +08:00
melvin 7cd96c39bf move targetting specific code into MagicTargetFilter 2012-10-21 12:11:41 +08:00
melvin 9261da7d1a remove unused method 2012-10-14 22:16:18 +08:00
melvin 2b6cd41795 made filterTargets private 2012-10-14 22:12:30 +08:00
melvin 66d8f229df fixed indentation 2012-10-14 21:35:15 +08:00
melvin a893cb4ac1 hasLegalTargets is true if targetChoice is NONE 2012-10-14 21:27:18 +08:00
melvin 1b26eb7eff remove SuppressWarnings annotations 2012-10-14 18:32:34 +08:00
melvin 8f893b808c added suppress warnings for filterTargets 2012-10-14 13:55:38 +08:00
melvin 82f93cc688 remove generic type for parameter targetFilter 2012-10-14 13:49:51 +08:00
melvin de90d77067 use the appropriate filter method for the target filter 2012-10-11 21:41:44 +08:00
melvin da02c78eeb added game.filterCards, replace filterTargets with filterCards to remove cast in card code 2012-10-11 20:31:58 +08:00
melvin 673b3178bc use generic for MagicTargetFitler to reduce casting 2012-10-10 20:40:31 +08:00
melvin d0ffecfa3a remove redundant type declaration 2012-10-09 11:10:10 +08:00
melvin d1b0f5fa74 added game.filterPermanents 2012-10-07 22:27:47 +08:00
melvin 9256733b0d changed syntax of multiple doAction to put count before action 2012-10-06 15:25:23 +08:00
melvin 76e2177cd1 added convenient method to perform an action multiple times 2012-10-06 12:59:32 +08:00
melvin ed27ad06ba execute trigger only if accept method returns true 2012-10-05 09:26:15 +08:00
melvin ca4ae7af9b remove redundant field initialization 2012-10-03 16:17:01 +08:00
melvin ac75f656e9 build report for current instance as well 2012-10-03 13:01:11 +08:00
melvin 4a8a35ce43 simplify determination of next step after resolve 2012-09-30 11:20:31 +08:00
melvin 9864cd3997 replace C style array delcaration with Java style 2012-09-28 16:09:47 +08:00
melvin 631dd73e4b infer final annotation for local variables 2012-09-28 16:04:12 +08:00
melvin dcc8d38484 optimized imports 2012-09-27 14:11:44 +08:00
melvin 841e295c3b made MagicGame's getOpponent package protected, cards should use MagicPlayer's public getOpponent method instead 2012-08-25 11:08:50 +08:00
melvin f638b19714 remove commented out code 2012-08-23 13:06:57 +08:00
melvin 14af24865d assert that delayActions must be empty when creating AI game 2012-06-22 10:00:34 +08:00
melvin 2841226f1a added more debug messages 2012-06-19 22:12:41 +08:00
melvin e803e30609 replaced undoAllActions with assert 2012-06-15 20:42:08 +08:00
melvin 5e8d202924 call update in MagicMarkerAction instead of in each undo* method 2012-06-14 14:51:29 +08:00
melvin 491a485351 added MagicGame.addDelayedActions to perform actions later 2012-06-14 13:15:45 +08:00
melvin 9e2ff54ebc revert adding of setStateCheckRequired, add call to update() in methods that undo actions 2012-06-12 21:42:06 +08:00
melvin d1948edba6 merged with new cards 2012-06-11 23:01:43 +08:00
melvin 6a505a0b2b fixed up Dungeon Geists implementation 2012-06-11 22:58:39 +08:00
melvin 57bad21299 removed initial capacity from ArrayList constructor 2012-06-11 22:25:13 +08:00
beholder 2755a227af removed unneeded variables 2012-06-11 14:08:26 +02:00
beholder 0ee8b1e481 fixed X not being set when miracle cost contains {X} 2012-06-11 13:54:00 +02:00
melvin 385e5ba631 apply continuous effects one by one to all permanents
removed need to cache properties and removed lastKnown* variables
2012-06-10 22:58:17 +08:00
melvin 27cac494d6 removed unnecessary game parameter from methods 2012-06-08 21:08:07 +08:00
melvin f369c209de removed unnecessary game parameter from methods 2012-06-03 19:36:56 +08:00
melvin 0f29b5e780 changed tab to four spaces 2012-06-03 09:59:02 +08:00
melvin 5584c3133c added a reference back to MagicGame from MagicPlayer 2012-06-03 09:57:53 +08:00
melvin 8b46a58df4 put exception handling around critical step in doAction to get more detailed game state 2012-05-25 20:54:50 +08:00
beholder 0216ec4b7e use generics wildcard type for MagicTrigger where appropriate 2012-05-08 13:56:55 +02:00
beholder 6368416652 Changed MagicTriggerOnStack to use source and controller from event 2012-05-05 13:37:43 +02:00
beholder ea6f0056cb added keeping track of amount of spells played per turn 2012-03-20 16:26:55 +01:00
beholder 33e570a136 removed unused imports 2012-03-02 14:35:18 +01:00
beholder 435842a9c2 added back code that was accidently deleted in revision 4d83fb6bffd0 . 2012-02-16 16:29:40 +01:00
beholder 5aec5166ad check losing condition for each player. fixes issue 158 .
this reverses the player that loses when life or poison counters are equal; before this change the AI would lose, now the user loses
2012-02-16 16:22:15 +01:00
beholder d7e8faddc1 added more statistics to history panel 2011-12-09 08:26:27 +01:00
melvin 19023cbc60 removed used code from MagicGame 2011-11-05 11:32:58 +08:00
beholder 0356f28a5f creatureDiedThisTurn should be copied when gamestate is cloned 2011-10-27 10:13:49 +02:00
wait321 af64d8aff8 code refactoring - 'tournament' changed to 'duel' to standardize terminology 2011-10-16 16:45:26 -07:00
melvin 404298cf24 removed checkState after every event, made getInstance public 2011-10-03 14:36:37 +08:00
beholder b165a73bd8 added Morbid condition. added Morkrut Banshee 2011-09-24 09:17:35 +02:00
melvin 3d3727211b changed names of methods dealing with statics 2011-09-22 11:35:17 +08:00
melvin 8738f0033f changed MagicPermanentTriggerMap to EnumMap 2011-09-21 10:11:06 +08:00
melvin c0c7e6dabf added game to arguments 2011-09-18 22:57:25 +08:00
melvin a956aaa5be added addStatics, removeTurnStatics method 2011-09-18 19:56:30 +08:00
melvin 03eccd8f69 use a SortedSet to that undoing MagicRemoveFromPlayAction can restore the order of effects by just adding them back without recording their previous order 2011-09-17 22:43:28 +08:00
melvin 36dbc57b19 moved MagicLayer to magic.model.mstatic.MagicLayer, changed MagicPermanentStaticList to MagicPermanentStaticMap
added getPowerToughness and getAbilityFlags to MagicLayer, called from MagicPermanent
2011-09-17 21:11:26 +08:00