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
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
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
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
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
c56c8af0bc
LifeGain + LifeLost Effect: make AFLifeLost better. No warnings anymore for Gray Merchant of Asphodel
2016-12-29 09:16:55 +00:00
Hanmac
08a2b54e76
fixed Replacement Effects
2016-12-28 15:01:33 +00:00
Hanmac
3629be1a38
Card & Player: update replaceDamage to use new Replacement Effect (not finished yet)
2016-12-28 14:30:52 +00:00
Hanmac
a8fcc7c464
new ReplacementEffect now handles if it got replaced with something else.
2016-12-28 14:14:41 +00:00
Agetian
7f05f08efc
- Change a replace call to a put call to satisfy Android SDK demands (fixes Android Forge compilation).
2016-12-27 19:11:11 +00:00
Agetian
e707613ff0
- Fixed Scourge of the Throne
2016-12-27 17:57:43 +00:00
Myrd
d64774dba0
Fix commander casting which I broke in r32823.
...
Revert to the original implementation of adding the ability to the Game cache in clone(), but now update this in setHostCard() if the new card comes from a different Game object.
2016-12-27 17:24:59 +00:00
Agetian
2344d02085
- Logic fix related to previous commit.
2016-12-27 12:42:15 +00:00
Agetian
2f121ee34e
- A somewhat more transparent implementation of DelayedTriggerRemembered fix.
2016-12-27 12:35:17 +00:00
Agetian
47709d4061
- Fixed Arcane Denial, Sapphire Charm and other similar delayed triggers not activating correctly (to make them work it's apparently necessary to check the SA itself first for DelayTriggerRemembered info before searching up the chain in getRootAbility).
2016-12-27 12:21:06 +00:00
Myrd
35014d76f8
Revert my previous change for cloning a SpellAbility.
...
Looks like setHostCard() is being called when the clone gets added to a card. However, previously the SpellAbility was being added to the Game in clone(), which doesn't work if the cloned ability should be part of a different Game - such as in simulation AI code. So, this change moves that to addSpellAbility().
2016-12-27 06:39:25 +00:00
Myrd
3729533ea9
I think I missed this in my previous commit.
2016-12-27 04:24:59 +00:00
Myrd
0fe2afb3c0
When copying spell-abilities to a new card, update the hostCard.
...
(Not sure what this affects, but noticed that it wasn't being done.)
2016-12-27 04:20:56 +00:00
Myrd
741d38f50b
Make getTargetedString() not have a trailing space.
2016-12-27 04:09:59 +00:00
Myrd
77a526b6d9
[Simulated AI] Fix copying tokens with abilities, like Eldrazi Scions.
...
Also fixes a bug in the main game code where if you have Clone try to copy a token with abilities, like an Eldrazi Scion, it would previously not get those abilities.
Adds a test for the game simulation/copy case.
2016-12-27 04:09:18 +00:00
Myrd
eafaaf5088
[Simulated AI] Copy combat when copying game state. This fixes an NPE in AI code that expects the Combat object to exist if we're in the corresponding phase.
2016-12-26 17:28:50 +00:00
Hanmac
e2eb916d72
make TokenDoubler use new Replacement Effect
2016-12-26 16:57:28 +00:00
Myrd
32cb5690d3
Reland r32802 (lazy FaceDown characteristic creation) which had an issue with hasAlternateState() which this revision hopefully fixes.
2016-12-26 16:06:12 +00:00
Hanmac
a67da177ff
add new Replacement Effect its for manipulating the original request
...
Card#addCounter does show how it is done
2016-12-26 13:31:20 +00:00
Agetian
56b40c960c
- Temporarily reverted r32802 (breaks visualization of transform, flip and meld cards in their alternate state, possibly more). Please feel free to revert this commit and update the solution when possible.
2016-12-26 07:04:20 +00:00
Myrd
f97ccdef5d
Create the FaceDown card state lazily.
...
Profiling showed this was responsible for 3% of execution time when using Simulated AI and is also wasting memory.
2016-12-25 21:13:03 +00:00
Hanmac
1d7f3e7dd5
CardPredicates: add hasSVar to check for some values like DiscardMe
2016-12-24 10:53:35 +00:00
Hanmac
20ca270e03
add SpellAbilityPredicates similar to CardPredicates and others
2016-12-24 10:52:33 +00:00
Agetian
b671ea87ac
- Implement a method to reset WrappedAbility SA targets (fixes e.g. Chandra, Torch of Defiance emblem persistently targeting the same target).
2016-12-24 09:31:49 +00:00
Agetian
d2172519b4
- Clear the temporary EndOfTurnLeavePlay SVar from a Dashed creature to avoid making it linger permanently on the card for the rest of the duel.
2016-12-24 07:05:30 +00:00
Agetian
0334dbb87c
- Do not set an EndOfTurnLeavePlay SVar on Dash cards (seems to have no functional effect while preventing the AI from ever casting the card for its full mana cost after it was dashed once).
2016-12-24 05:13:51 +00:00
Myrd
a2aa3ccc06
Fix another problem with Thespian's Stage copying itself and add a test.
2016-12-22 22:30:34 +00:00
Myrd
4efc738813
Fix dev mode save/restore of legendary tokens.
2016-12-22 21:59:35 +00:00
Myrd
3e91a56ced
Fix NPE in CardUtil.getLKICopy() that would happen when Thespian's Stage would copy itself.
...
The problem would happen when executing:
newCopy.getCurrentState().copyFrom(in, in.getState(in.getCurrentStateName()));
Because the clone code was clearing the cloned state without updating currentStateName.
Also added a test for this in the context of simulated AI, although the actual bug was not in simulation code - it's just simulation code would run into it since it tries all possible targets to copy (while humans would likely not try it).
2016-12-22 20:31:41 +00:00
Myrd
4b14c9d943
Fix copying of emblems for simulated AI along with a test.
2016-12-22 19:45:16 +00:00
Myrd
2b0c76ad66
Fix cost reduction for Not of This World when targeting an Abzan Charm that's exiling a creature.
2016-12-22 18:58:02 +00:00
Hanmac
94681b6675
Splice: do a total rewrite to make it better for the player and more rules conform
2016-12-21 18:32:50 +00:00
Hanmac
77437bdb50
Card: hide staticAbilities which are Secondary (probably made by Keyword)
2016-12-21 18:00:12 +00:00
Agetian
930c804b93
- Add a static ability string to card when adding a keyword static ability (fixes Clone on a card with one of those keyword abilities, e.g. Cloning a card with Changeling).
...
- Simplified CardFactoryUtil::addStaticAbility code.
2016-12-21 15:45:34 +00:00
Agetian
33c5f4d158
- Correctly identify the paid X for the purpose of building stack descriptions (e.g. fixes Repeal stack desc).
2016-12-20 19:20:45 +00:00
Agetian
ae608246d1
- Reverting the lifelink change for now, better solution needed.
2016-12-20 10:18:06 +00:00
Agetian
3fc05d6940
- Resetting targets not required when changing ValidTgts for Detonate.
2016-12-20 08:40:14 +00:00
Agetian
4d491a6bdf
- A [hacky] fix for Detonate that only allows targeting CMC 0 artifacts if Detonate is cast without mana cost (e.g. on Cascade) with X=0.
...
- Ideally should be done via Annouce$ X by announcing X before starting to cast the spell and presetting it to 0 when cast without mana cost, but that causes massive issues with the AI.
2016-12-20 08:37:04 +00:00
Agetian
d23964106d
- Attempting to fix interaction between lifelink on combat damage and replacement effects like Gisela, Blade of Goldnight.
2016-12-20 08:35:06 +00:00