Commit Graph

31978 Commits

Author SHA1 Message Date
Sol
6e6dc53927 - Add Treacherous Terrain (C16) 2016-12-31 00:59:28 +00:00
Sol
243c081da7 - Migrate upcoming C16 cards to their normal card folders 2016-12-30 21:58:41 +00:00
Myrd
5046c00566 One more fix for the TrackableTypes changes. 2016-12-30 19:57:31 +00:00
Myrd
a14a370107 Fix NPE from my previous change to TrackableTypes. 2016-12-30 19:43:40 +00:00
Myrd
18ba55ae27 Attempt to fix memory leak with TrackableTypes.
The problem was that TrackableTypes were all global (held in static variables), but kept around state (objLookup maps) that shouldn't be global - e.g. that could contain per game data. Additionally, it seems this state wasn't always getting cleared correctly and thus would cause leaking of memory over multiple games - which would especially be a problem for Simulated AI code which created temporary games for simulation.

This change attempts to fix the issue by moving the storage of objLookup maps to the Tracker object, which corresponds to a single Game. This way, there is no cross-contamination between different games and the state is properly cleaned up when a Game goes away.
2016-12-30 19:34:07 +00:00
Myrd
6f0eda7509 [Simulated AI] Fix inverted logic I accidentally landed earlier. 2016-12-30 18:10:19 +00:00
Myrd
a2e2753429 [Simulated AI] Fix energy counters propagation with a test. 2016-12-30 18:03:58 +00:00
Myrd
ce4ef7a4d7 [Simulated AI] More safety guards around executing a planned decision.
This keeps the index and list size of the available decisions as part of the plan, to be compared with when following through with the plan. Among other things, this ensures that the correct SA is chosen from the list when there are multiple similar SAs (e.g. correctly crewing the 2nd Smuggler's Copter).
2016-12-30 17:50:47 +00:00
Myrd
6ac9182701 [Simulated AI] Fix a NPE in target caching code. 2016-12-30 17:21:51 +00:00
Myrd
503ee37c8a [Simulated AI] Make a SpellAbilityRef helper class.
I plan to expand it in the future, but for now this doesn't introduce any functional changes.
2016-12-30 17:08:34 +00:00
Hanmac
e5dc653b4c GameSimulatorTest: add Testcases for Damage with Lifelink 2016-12-30 15:02:04 +00:00
Hanmac
36dbda7b86 cards: use new DamageLifeThreshold keyword for Worship effect 2016-12-30 14:58:46 +00:00
Hanmac
e1ddd0fc5f Stuffy Doll Avatar is a PreventionEffect 2016-12-30 14:57:23 +00:00
Hanmac
99d2afc748 update Blizzard Specter using new Charm description 2016-12-30 14:56:49 +00:00
Hanmac
2c4c749207 cards: update cards with ReplaceEffect 2016-12-30 14:54:10 +00:00
Hanmac
1738f49798 Big Damage Rewrite Part 2: now use CombatDamageMap everywhere 2016-12-30 14:50:45 +00:00
Hanmac
4aa68c3fa6 CardDamageMap: add extra Table class for storeing the damage dealt by Card to GameEntity, might extended with extra functions 2016-12-30 08:08:18 +00:00
Hanmac
71871686a4 ReplaceEffect: make it ready for getting other types like Card or Player 2016-12-30 08:03:31 +00:00
Agetian
03f5f1f42a - Somewhat better explanation for presenceCondition. 2016-12-30 05:47:35 +00:00
Agetian
8a9d80c10c - Check SpellAbility for Presence condition (fixes Dragon Presence cards like Draconic Roar, Dragonlord's Prerogative, Foul-Tongue Invocation and others). 2016-12-30 05:25:56 +00:00
Myrd
4ffa41f624 [Simulated AI] Stop recursing when we've found a winning move already. 2016-12-29 22:56:19 +00:00
Myrd
1c1de9a195 [Simulated AI] Fix transformed state with a test and commit part of my fix from my previous change.
I forgot to actually commit the validation and activatedPlayer setting part of my last change, so this change contains that too.
2016-12-29 22:42:37 +00:00
Myrd
0e9b327fd9 [Simulated AI] Fix memory leak caused by SAs making it into the wrong game's spabCache.
The problem was that during copying of SAs, the spabCache was not updated correctly due to the code being in the wrong order. A further problem was that activatingPlayer was not being correctly set on the new abilities, so you would end up referencing a Player from a different Game object from an SA that was in a spabCache, resulting in many previously-simulated Game objects being leaked through this reference chain.

This change fixes both of those problems and also adds a validation function that checks the contents of the spabCache at every game copy.
2016-12-29 22:31:18 +00:00
Myrd
6b968eeb08 Fix activating playing call in unit test. 2016-12-29 22:12:59 +00:00
Hanmac
b3ad32bc4f cards: update cards using ReplaceCount/Times.2, now they use Twice 2016-12-29 20:17:39 +00:00
Myrd
f2204c594a Remove dealtDamageToThisCombat field from Combat class.
Its contents were never used and it was actually causing a problem for simulated AI when the current Combat was copied into a simulated game - as it would contain references to tokens that were killed that were no longer in the game and thus caused a mapping exception.
2016-12-29 18:54:18 +00:00
Myrd
c3f30c6871 [Simulated AI] Make printing of the decision tree a bit better.
Also removes a print line from a test.
2016-12-29 18:22:31 +00:00
Agetian
1880fc6df1 - Removed unused imports. 2016-12-29 17:17:14 +00:00
Agetian
9b49b4ae95 - Removed the test code from QuestTournamentsScreen 2016-12-29 17:11:54 +00:00
Hanmac
0b087fc884 AbilityFactory: removed unneeded special cases 2016-12-29 16:15:26 +00:00
Agetian
256f539cb0 - Fixing additional abilities not working for Mana Clash, Fiery Gambit et al. (not created for Repeat/RepeatEach APIs) 2016-12-29 15:51:33 +00:00
Agetian
9b86aebaaa - Added Edit Deck and Leave Tournament buttons to quest draft tournament bracket screen in mobile Forge.
- Some more experiments with result injection (to be removed later).
2016-12-29 15:02:31 +00:00
Hanmac
2b4648c250 cards: update cards with ReplaceCount/Plus 2016-12-29 13:52:46 +00:00
Hanmac
ef87367ae6 cards: update cards with ReplaceCount/Twice using new ReplaceEffect 2016-12-29 13:45:46 +00:00
Hanmac
c32fbaa94d DamageAllEffect: fixed sourceLKI for Lifelink 2016-12-29 13:16:20 +00:00
Hanmac
21a34b8f3c commit GameEntity i forgot 2016-12-29 12:47:28 +00:00
Hanmac
f891446b8b Combat: fixed assigin damage more than once if damage got replaced 2016-12-29 12:43:36 +00:00
Hanmac
0426896c01 Refactor Damage/CombatDamage/Lifelink, now it works as it should with DamageRedirection/Prevention/Multiplication 2016-12-29 11:33:25 +00:00
Hanmac
068b9b4cc0 GameSimulatorTest: fixed warning for "Ajani, Mentor of Heroes" 2016-12-29 09:18:41 +00:00
Hanmac
c56c8af0bc LifeGain + LifeLost Effect: make AFLifeLost better. No warnings anymore for Gray Merchant of Asphodel 2016-12-29 09:16:55 +00:00
Agetian
3959d171dc - Imports fix. 2016-12-29 07:48:21 +00:00
Agetian
1b63d4f39c - Update quest draft tournament screen when leaving draft editing screen.
- Prevent NPE in quest draft tournament screen if the tournament hasn't started yet.
- Added some test code for testing AIvsAI match result injections (will be removed later).
2016-12-29 07:47:54 +00:00
Myrd
c67a809367 [Simulated AI] Get target candidates from the SA that requires targets, rather than the root one.
This makes sense correct target restrictions are used.
2016-12-29 06:44:14 +00:00
Myrd
1d1b94e757 [Simulated AI] Teach simulated AI how to choose card modes (e.g. on Charms and Commands).
Note: There's still a limitation in the simulated AI where it doesn't know what to do when multiple effects from an ability require targets. This can be addressed in the future to support things like Cryptic Command to both counter a spell and bounce a permanent.
2016-12-29 06:36:08 +00:00
Agetian
c8ad6fe56a - Code formatting. 2016-12-29 05:24:56 +00:00
Myrd
485623b631 Fix dev mode restoring game state with counters (e.g. planeswalker loyalty). 2016-12-28 21:32:29 +00:00
Myrd
010d958e33 [Simulated AI] I forgot to commit the marked damage test. 2016-12-28 21:31:44 +00:00
Hanmac
54b69e8040 Covenant of minds: move Cleanup to Choice for all choices 2016-12-28 18:57:26 +00:00
Agetian
e597f692e7 - Fixed Covenant of Minds (should not count as draw). 2016-12-28 18:25:00 +00:00
Agetian
823cb6c62a - Rudimentary implementation of quest draft tournament screen in mobile Forge (feel free to improve). 2016-12-28 17:27:26 +00:00