Commit Graph

2119 Commits

Author SHA1 Message Date
Hanmac
249a5a8074 PlayerCollection: functions need to be public 2017-01-11 07:24:01 +00:00
Agetian
a80119b74a - A more in-depth check for target equality when comparing SAs, fixes certain cards not guessing that they are looking at the ability they need to be looking at (e.g. Grip of Chaos). 2017-01-11 07:20:38 +00:00
Hanmac
7c0a8412c9 Card & Player: more fixes with setCounters 2017-01-11 07:02:43 +00:00
Hanmac
17bd19a46b GameEntity: setCounter now removes counterType directly when its not used anymore
Card and Player updated to use that directly instead of doing it on their own
2017-01-11 06:35:09 +00:00
Sol
1fa77e04e8 Add Maulfist Revolutionary and Skyship Plunderer 2017-01-11 02:14:43 +00:00
Hanmac
33715e446d PlayerCollection: add new class as spezialisation of FCollection<Player> 2017-01-10 19:54:30 +00:00
Sol
e3c4386473 - Add Improvise keyword handling first pass 2017-01-10 02:10:32 +00:00
Hanmac
291d42d065 Player: refactor wasDealtDamageThisGameBy & wasDealtDamageThisTurnBy add wasDealtCombatDamageThisTurnBy 2017-01-09 20:23:32 +00:00
Hanmac
17691510ab Player: extend TriggerLifeLost with FirstTime variable 2017-01-09 19:51:02 +00:00
Hanmac
ecb1ce986e Card: add blockedThisCombat from DamageHistory 2017-01-09 18:20:27 +00:00
Hanmac
8849c7d031 CounterMoveEffect: update Effect for cards using multiple Sources or multiple Targets 2017-01-08 19:26:11 +00:00
Agetian
4ad1cc90d5 - For some reason CharmEffect could not match SAs in ChoiceRestriction mode (Demonic Pact). For now, checking by equality of description, please update if necessary. 2017-01-08 17:30:51 +00:00
Hanmac
d5e138f922 CardLists: add new getValidCards with allows SpellAbility and does split by "," 2017-01-08 15:30:28 +00:00
swordshine
0c43466a56 - AER: Add 2 cards 2017-01-08 04:36:08 +00:00
pfps
beaffe830b Make yield string methods robust to effects that don't have a host card 2017-01-07 20:17:17 +00:00
pfps
87296cd6a4 Description for wrapped abilities includes stack information; Fixes problem with autoordering 2017-01-07 19:08:39 +00:00
Hanmac
7dc6a43d8e Tracker: use HashBasedTable to store the Trackable Values 2017-01-07 18:13:29 +00:00
pfps
5da185263e Autoyield on effect on a card not overall; Add new method to generate the autoyield key to prepare for fix of effect ordering 2017-01-07 15:52:24 +00:00
swordshine
5aae86e31a - Set the intrinsic parameter for keyword "Equip" 2017-01-07 14:19:30 +00:00
Hanmac
048dce234c CounterType: add Unity for Call for Unity 2017-01-07 11:47:04 +00:00
Hanmac
9531e16d02 Player: add hasRevolt similar to other Conditions, now way to calculate it, does set it in GameAction 2017-01-07 11:29:06 +00:00
Hanmac
593f4f64b1 GameEntity: move preventDamage from Card and Player to base Class,
add TriggerDamagePrevented if some damage was prevented
2017-01-07 10:26:40 +00:00
Agetian
7599e41a63 - Adding ways to determine the number of lands played and spells cast by a particular player last turn (will be necessary for some upcoming AI additions). 2017-01-07 04:59:11 +00:00
Hanmac
c46683e92d AbilityUtils: add RegisteredOpponents for PlayerCount
PlayerPredicates: add isOpponentOf Predicator
Player: make getBloodthirstAmount use of new function
2017-01-07 04:19:33 +00:00
Hanmac
bd6c729317 Player: add wasDealtCombatDamageThisTurn Property 2017-01-07 03:55:59 +00:00
Agetian
15c631be72 - Temporarily reverting a change to the way ordering SAs is handled (breaks auto-yield) and improved my original change a bit to fix its logic, feel free to revert this to continue work on this project. 2017-01-06 18:53:05 +00:00
Agetian
bd26d9f4aa - Fixed casting face-down instant spells from exile (e.g. via Gonti, Lord of Luxury), it was looking at the FaceDown state before and thought it was a creature. 2017-01-06 06:18:21 +00:00
Agetian
505b8c1c74 - Committed a change to allow the simulatenous SAs coming from different cards to be detected as different (by pfps), reverted a previous change with faulty logic. 2017-01-06 04:59:46 +00:00
Hanmac
a7dd00ed57 PlayerPredicates: create more Player Predicates to use them for AI 2017-01-05 19:47:21 +00:00
Hanmac
3f15270d75 ReplaceSplitEffect: update prevent variable on card, not on SpellAbility 2017-01-05 06:39:07 +00:00
Hanmac
126b1c3e7b ReplaceDamage: add DamageTarget param, use it for DamageRedirection and SplitDamage to check if Damage can be redirected 2017-01-05 06:18:47 +00:00
Hanmac
71180403a0 Player: add ReplacementEffect for addCounter (using existing one) 2017-01-03 20:04:57 +00:00
Hanmac
d96a79177b API: add ReplaceSplitDamageEffect its used for Damage splitting like en-Kor 2017-01-03 19:06:48 +00:00
Agetian
7feaa42299 - Code formatting. 2017-01-02 20:33:32 +00:00
Sol
9eeb7cdb11 Add Ludevic Necro-Alchemist (C16) 2017-01-02 02:52:55 +00:00
Hanmac
163cb460ab GameEntity moved addCombatDamage from the other classes there. Also add a more generic AddDamage version 2017-01-01 13:47:22 +00:00
Agetian
beadf13c30 - Added a TODO entry for now. 2017-01-01 09:01:58 +00:00
Agetian
3a285fcd92 - Reverting r32912 for now, more investigation needed. 2017-01-01 08:29:35 +00:00
Agetian
7797224826 - Simpler solution for Boonweaver Giant + Animate Dead 2017-01-01 08:13:38 +00:00
Agetian
451db2a5db - Removed unused import. 2017-01-01 07:18:22 +00:00
Agetian
8d2cf088a0 - Attempting to fix interaction of Boonweaver Giant with cards that can't legally target it (e.g. Animate Dead) such that those auras trying to enchant the creature do not move (per 303.4i/303.4j) and other similar interactions. 2017-01-01 07:17:48 +00:00
Agetian
4d5fae1c6f - Only add avatars to decks if the Vanguard or Momir Basic variant is applied. 2016-12-31 10:58:29 +00:00
Agetian
f105b3f1c1 - Allow the player to draw cards before the game starts (drawing the initial hand, drawing a new hand after a mulligan), fixes Maralen of the Mornsong Avatar. 2016-12-31 10:55:13 +00:00
Agetian
787c8decb7 - Reverting the StaticAbility change for now (PlayerTurn can be used as a type of Defined parameter to define whose turn it should be when the static ability is applied again). 2016-12-31 06:37:05 +00:00
Agetian
fd883c8190 - getDefinedPlayers should use the "Defined" parameter to look for the definition of whose turn it should be, True == You (fixes Gisa and Geralf). 2016-12-31 06:19:02 +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
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