Commit Graph

4208 Commits

Author SHA1 Message Date
Agetian
234c7496e3 - Better place for the logic. (#4132) 2023-11-06 07:58:21 +03:00
Agetian
20970f1380 - Fix imports. 2023-11-05 22:26:47 +03:00
Agetian
bf3d603acd - Move the Bring the Ending logic into SpecialCardAi until it's rewritten to keep BranchAi cleaner. 2023-11-05 22:25:38 +03:00
Agetian
8e0bc63a8b AI framework to improve sacrificing endangered cards + several AI hints (Stoneforge Mystic, Atog, others) and improvements. (#4014)
* - Implement a fallback mechanism in case getting a card by name and edition fails for whatever reason.

* - Patch up pulling a card without filters in All Card Variants mode.

* - Sacrifice creatures when they're endangered (currently works for
AF LifeGain, LifeLose, and any AFs that do not have phase-based AI restrictions or other factors that will prevent instant speed activation)

* - Tweaks to the requirements for the AI.
- Some AI enablement.

* - Account for non-creature endangered objects

* - Flag Wall of Limbs as RemAIDeck for now.

* - Support for AF PutCounter.

* - Clean up.

* - Logic fix for AF PutCounter.

* - Clean up.

* - Logic tweak/fix for AF Pump.

* - Another slight tweak.

* - Some AI hint fixes/additions.

* - Some AI hint fixes/additions.

* - Improve timing for AF LifeGain/LifeLose.

* - AI profile option for default SacCost AI preference.

* - Default Sacrifice AI preference master toggle.

* - Stoneforge Mystic AI hint.

* - For now, keep the default pref SacCost toggle to the Experimental AI and at minimum values (too extreme for general use).

* - AI hint: Cryptbreaker

* - Don't auto-sac creatures that evaluate above a given threshold, sac smaller CMC first

* - Lower the priority of cards that have a self-sacrifice activated ability

* - Revert the evaluation modification until a better solution is found.

* - AI hint for Hallowed Moonlight.

* - AI hint for Winds of Abandon (AI casts the non-overloaded version in Main 1, so cast the other one in Main 1 as well to be able to prioritize/choose)

* - AI logic for The One Ring.

* - Some logic tweaks/fixes.

* - Winds of Abandon: use the AI logic hint like other similar non-permanent spells.

* - Fix logic for default sacrifice priorities.
- Mark P9 Mox, Black Lotus, and Lotus Petal cards as bad for AI sacrifice.

* - More logic fixes.

* - One more logic fix.

* - Revert the AIDontSacrifice hint for now.

* - Revert Tinker as well

* - Limit LifeLoseAi sac logic to threatened cards.

* - Logic tweak.

* - Logic tweak.

* - Simplify check (part already checked above).

* - Some more minor cleanup.

* - AI shouldn't sacrifice things mid-combat in presence of Trample or Banding because of altered combat rules (likely to backfire/result in a misplay)
- Minor cleanup.

* - A [hacky] way to make the AI understand Anticognition and Bring the Ending.

* - Fix imports.

* - Avoid a crash by ensuring that the AI parameter indeed points to an AI player (and not e.g. predicting/simulating human decisions at the moment)

* - Do not try to sacrifice a card in an attempt to regenerate it

* - Clean up for AiController mustRespond

* - Suppress recursive checkSacrificeCost when called from the predictive code.
- Trample only matters for the attacking side when checking for threatened card SacCost requirements

* - Naming convention.

* - NPE guard.

* - Recommended tweaks and fixes.

* - Don't override X payment for a triggered ability (e.g. Spiteful Banditry)

* - A better attempt at handling X inside trigger code.

* - Process AI logic for EffectAi from triggered abilities.

* - Improve Black Lotus AI by handling it as if it were a Mana Ritual card when processing ManaEffectAi.

* - AI property guarded check + meaningful default for potential non-AI calls
2023-11-05 22:21:11 +03:00
tool4EvEr
bfdbb7a489 Clean up 2023-11-05 11:56:12 +01:00
tool4EvEr
6410d24e04 Apply patch 2023-11-05 11:51:45 +01:00
Northmoc
e06d4bcb87 jadelight_spelunker.txt and ExploreEffect improvements 2023-11-04 15:04:15 -04:00
tool4ever
d8b337e524 NPE tweak (#4068) 2023-11-01 13:24:42 +00:00
Anthony Calosa
45098c3089 - closes #4061 2023-11-01 19:58:02 +08:00
tool4ever
39d0f7553c Clean up (#4049)
* Clean up

* Update eaten_by_spiders.txt

---------

Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.60>
2023-10-31 13:03:26 -04:00
tool4ever
39f64dc936 Clean scripts (#4024)
Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.60>
2023-10-30 06:31:37 +03:00
Northmoc
20e5645cd6 LCI – Player.descended support and cards 2023-10-28 09:25:21 -04:00
tool4ever
c54133f1ad Fix Cyber Conversion turning face-down card face-up again (#3986)
* Fix Cyber Conversion turning face-down card face-up again

* Tweak AI

---------

Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.60>
Co-authored-by: TRT <>
2023-10-28 13:08:40 +03:00
kevlahnota
215370d09e Merge pull request #4002 from Agetian/master
Improve several AI routines.
2023-10-28 06:29:24 +08:00
Agetian
1d77d79ec3 - Improve AI for Aether Vial, Ratchet Bomb. 2023-10-27 22:49:21 +03:00
Agetian
8cdcbc89d6 - Improve ChooseTypeAi for Vanquisher's Banner. 2023-10-27 22:15:09 +03:00
Agetian
92ecb8eb23 - Sanity check not to kill own stuff preemptively if certain valid targeting options exist after a standard check (e.g. Searing Blaze) 2023-10-27 21:52:10 +03:00
Agetian
4c6d9be8e7 - Improve the AI using Roiling Vortex against abilities like Haywire Mite. 2023-10-27 17:39:06 +03:00
Agetian
77181e3cc4 - Fix AI incorrectly considering 0-power creatures for attack with multiple creatures in presence of an Exalted trigger.
- Slightly refactor EffectAi NoGain logic.
2023-10-27 17:32:02 +03:00
kevlahnota
920e811812 Merge pull request #3987 from Agetian/master
Further improve AI for Sakura-Tribe Elder and similar, fix Rampaging Geoderm AI missing a trigger.
2023-10-27 18:11:04 +08:00
kevlahnota
b414457989 Merge pull request #3980 from Card-Forge/finalityCounter
LCI: Finality counter
2023-10-27 16:05:25 +08:00
Agetian
2c5b2a5ad0 - Fix AI for Rampaging Geoderm. 2023-10-26 18:53:20 +03:00
Agetian
ae94ef9a4a - Further improve Sakura-Tribe Elder AI. 2023-10-26 18:15:39 +03:00
Agetian
68ce791e60 - Account for blocking for Sakura-Tribe Elder AI and similar. 2023-10-26 17:58:35 +03:00
kevlahnota
36fe377977 Merge pull request #3977 from tool4ever/fullControl
Full Control
2023-10-26 17:22:03 +08:00
kevlahnota
bbb91354cd Merge pull request #3971 from tool4ever/secdoc
Second Doctor
2023-10-26 17:21:20 +08:00
kevlahnota
624d0f26d8 Merge pull request #3944 from Northmoc/bamboozle
bamboozling_beeble.txt and centaur_of_attention.txt and Support
2023-10-26 16:55:47 +08:00
Hans Mackowiak
f538e2aee6 ~ add AI 2023-10-26 07:16:41 +02:00
Agetian
22ba556cff - Improve AI choosing lands from AF ChangeZone.
- Implement some basic AI for trying to get the Urza land combo in play.
2023-10-26 07:35:36 +03:00
Agetian
e9e04f6688 - Improve AI for Sakura-Tribe Elder and similar. 2023-10-26 07:02:00 +03:00
tool4EvEr
ebbbbc847b Full Control 2023-10-25 21:58:39 +02:00
Agetian
bdf5516744 - Slightly cleaner implementation. 2023-10-25 22:12:07 +03:00
Agetian
d99929d68a - Mistcaller AI improvement. 2023-10-25 22:09:07 +03:00
tool4EvEr
68391c30e2 Refactor confirm for cleaner distinction 2023-10-25 13:27:17 +02:00
Agetian
ded4d3a369 Improve several AI routines (Reflection of Kiki-Jiki; Roiling Vortex; Karn, the Great Creator; Ashad, the Lone Cyberman) (#3952)
* - DamageDealAi: allow beneficial PW abilities (e.g. Sorin, Vengeful Broodlord).

* - Better place for the logic

* - Fix AI logic for Roiling Vortex and similar.

* - Simpler implementation

* - Improve Roiling Vortex AI to account for triggers.

* - Prevent AI copying Reflection of Kiki-Jiki with another copy of itself.

* - Improve AI for Karn, the Great Creator.

* Update EffectAi.java

* - Check for combat and non-combat Lifelink

* - Add AIDontSacToCasualty hint for Ashad, the Lone Cyberman.

* - Account for cards that work like Lifelink.

* - Predict actual damage to targets
2023-10-25 05:46:36 +03:00
Hans Mackowiak
0e77babcdc remove use of hasStartOfKeyword(Keyword.toString()) in favor of hasKeyword(Keyword) 2023-10-22 11:37:45 +02:00
Northmoc
28ff7020e8 PlayerControllerAi.chooseRollToIgnore 2023-10-21 18:37:47 -04:00
kevlahnota
4643556068 add AI forced playing Living End decks (#3935)
* add AI forced playing Living End decks

* move check

* cleanup
2023-10-21 10:20:55 +03:00
Agetian
ba69a03868 Improve AI for Sorin, Vengeful Broodlord and similar + Fix Roiling Vortex AI logic (#3932)
* - DamageDealAi: allow beneficial PW abilities (e.g. Sorin, Vengeful Broodlord).

* - Better place for the logic

* - Fix AI logic for Roiling Vortex and similar.

* - Simpler implementation
2023-10-21 07:33:27 +03:00
Hans Mackowiak
01f0d674c4 AbilityUtils: add Emerged for Adipose Offering (#3912)
* AbilityUtils: add Emerged

* use ChangeZoneLKIInfo for Emerge after paid

* Add logic to skip bad choice

* Extra check for when AI does not want to pay offering

---------

Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.60>
2023-10-19 11:06:16 +03:00
Agetian
dd2f93f4d5 - Patch up "stunned" in CreatureEvaluator (#3914) 2023-10-16 18:45:49 +02:00
Agetian
29b1d1ee1b Improve AI logic for City of Brass. (#3902)
* - Improve AI logic for City of Brass.

* - Better implementation that avoids a specialized hint and checks the trigger.
2023-10-15 08:57:57 +03:00
tool4EvEr
73c32df030 Clean up 2023-10-14 22:19:18 +02:00
Northmoc
25e89b04a3 day_of_the_moon.txt and support/refactor in NameCard (#3890)
* day_of_the_moon.txt and support/refactor
2023-10-14 09:46:22 +00:00
Agetian
0fe758450c - Improve canPlayAI implementation. 2023-10-12 07:31:03 -04:00
Agetian
51db2ae822 - Simplify canPlayAI implementation. 2023-10-12 07:31:03 -04:00
Agetian
2cb6a23e87 - Use isNegativeCounter. 2023-10-12 07:31:03 -04:00
Agetian
a5e20fb3a0 - Add simple AI framework for AF TimeTravel.
- Add Wibbly-Wobbly, Timey-Wimey.
2023-10-12 07:31:03 -04:00
tool4EvEr
6460dd44f7 Revert "Modify main game loop for use with basic AI unit tests (#3669)"
This reverts commit 1e116be3b0.
2023-10-07 15:17:57 +02:00
tool4EvEr
9e64f374bf Clean up 2023-10-05 19:10:58 +02:00