Commit Graph

1957 Commits

Author SHA1 Message Date
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
Agetian
c255cb5285 - Fixed copying a SA with no mana cost not setting the WithoutManaCost param which is needed by e.g. Play effect AI to properly determine that the spell should be played without paying its mana cost. 2016-12-20 05:22:37 +00:00
Agetian
7e4ab8d0bb - Fixed Grip of Chaos NPEing when Maze of Ith is used in its presence (and other potential similar NPEs). 2016-12-19 16:47:45 +00:00
Agetian
9f17f2700d - Chandra, Torch of Defiance should show the exiled card to the ability activator prior to asking whether the player wants to play it or not. 2016-12-19 06:06:30 +00:00
Hanmac
875198bed5 TriggerChangesZone: use ArrayUtils.contains to check for String in String[] 2016-12-18 21:15:05 +00:00
Agetian
d07a0913ad - Allow multiple Destinations for TriggerChangesZone (fixes Reyhan, Last of the Abzan). 2016-12-18 18:46:09 +00:00
Agetian
e8f30ace1e - Formatting imports. 2016-12-18 05:30:24 +00:00
Agetian
9352b7f3ce - A more transparent fix for Kalitas, Traitor of Ghet which does not affect cards such as Aurification, Curse of Stalked Prey and others.
- Adds an extra parameter to Card which stores the last known zone information for the card when it is copied for the purpose of LKI. Thus, things such as the zone and the timestamp of the LKI copy are not affected.
- If the card is not a LKI copy, the last known zone info is assumed to be the current zone the card is in.
2016-12-18 05:29:23 +00:00
Agetian
281e5f12c0 - Hopefully a better solution for the LKI problem: add a special flag to show that the card is a temporary copy and should not be considered as being in play 2016-12-17 20:12:08 +00:00
Agetian
b50183e7c4 - Copy the timstamp over to the LKI copy of a card (may be necessary to "prove" that the card and its LKI copy are the same, e.g. for the purpose of some triggers). 2016-12-17 19:47:07 +00:00
Hanmac
d8c97d9c4e CardFactoryUtil: moved "At the beginning of your upkeep, sacrifice" as "UpkeepCost" in CardFactoryUtil
delete Upkeep class because its not needed anymore
2016-12-17 18:03:43 +00:00
Agetian
4b10704390 - When setting cloned SA targets in CharmEffect::ChainAbilities, call setTargets last in order not to forget if there were several targets selected (fixes Abzan Charm AI failing to correctly divide and allocate counters to two targets). 2016-12-17 17:31:57 +00:00
Hanmac
2b055b84fb CardFactoryUtil: fixed Manifest 2016-12-17 11:04:05 +00:00