Commit Graph

2152 Commits

Author SHA1 Message Date
asvitkine
d6af6aa68f Fix deck re-randomization on new game. 2022-12-28 14:04:15 -07:00
asvitkine
b0d5d952e8 Add "ask simulated ai" dev option. (#2180)
* Add "ask simulated ai" dev option.

Also moves the setup/dump game state options at the end of the list, as they're different from the other ones and shouldn't just be in the middle.

Also makes the code a bit more concise for the different mouse listeners.

* Fix comment location.
2022-12-28 10:02:47 +00:00
DorkmasterFlek
0645b23405 Fix crash when filtering card sets in workshop
Null pointer exception caused a crash when trying to filter by set in the debug workshop.  Null value was in the limitedSets parameter being passed in.
2022-12-26 15:44:42 -05:00
Anthony Calosa
a5decc0b78 Merge pull request #2157 from asvitkine/sim_imprv
Simulated AI: Fix land pruning logic and skip invalid targets.
2022-12-26 11:43:34 +08:00
asvitkine
00c6771608 Fix ArrayIndexOutOfBounds exception printed to stderr. (#2141) 2022-12-25 09:11:52 +00:00
asvitkine
6e8a21a58a Simulated AI: Copy changed SVars when copying state. (#2159) 2022-12-24 08:51:54 +00:00
asvitkine
4c568f941f Clean up unused vars. 2022-12-23 20:33:01 -07:00
asvitkine
e788d3683a Improve comment. 2022-12-23 20:31:41 -07:00
asvitkine
eb0f426adc Use ComputerUtilAbility.isFullyTargetable() and add more tests. 2022-12-23 20:28:05 -07:00
asvitkine
56b22ee73a Simulated AI: Fix land pruning logic and skip invalid targets.
This change improves Simulated AI logic by eliminating many unnecessary simulations, particularly due to:
  - Invalid targets involving counterspells countering themselves (including modal spells).
  - Pruning identical land drop decisions.

Tests are added to cover these cases.

Some core logic is changed, in particular, SpellAbility.canTarget() was not rejecting self-targeting for counterspells. This was likely being done at a higher level somewhere (e.g. in UI code for choosing targets for the human player or AI-specific code for non-simulated AI).

Additionally, a convenience SpellAbility.hasLegalTargets() method is added, from the logic that was previously in AIController.java, so that it can be re-used by the simulation AI code.

A few small style clean ups are included in the code being changed.
2022-12-22 21:40:52 -07:00
Anthony Calosa
3dd574cc03 Merge pull request #2153 from Northmoc/comp
Compleated update/fix
2022-12-23 08:46:26 +08:00
tool4ever
40524426e2 Workshop: support DFC (#2150)
Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.59>
2022-12-22 12:18:21 +03:00
Northmoc
773894b575 Compleated update/fix 2022-12-21 11:29:02 -05:00
asvitkine
439b1a83c6 Cache deckchoosers to avoid re-randomizing decks. 2022-12-19 10:18:55 -07:00
asvitkine
ca54e87eb0 Remove more code duplication. 2022-12-19 07:20:22 -07:00
asvitkine
53e3899932 Small clean ups. 2022-12-18 23:26:01 -07:00
asvitkine
2abafbc2ee Remove print statements. 2022-12-18 23:21:54 -07:00
asvitkine
dcc90fb0d1 Clean up lobby code and fix a deck deselect bug. 2022-12-18 23:15:27 -07:00
tool4EvEr
1f6c4a430d Clean up 2022-12-11 20:14:22 +01:00
asvitkine
96b6bafc2b Fix simulation AI exception with random effects.
Uses a seeded deterministic random generator when simulating choices, which ensures  the same number of sub-choices are always used, which the code requires. Adds a test.
2022-12-09 16:08:44 -05:00
Northmoc
c4763528ff fix tests 2022-12-08 08:10:33 -05:00
Paul Hammerton
e10fb8945f Merge pull request #2049 from Card-Forge/fix-tests
update_tests
2022-12-08 10:04:55 +00:00
Paul Hammerton
2db15bee3c update_tests 2022-12-08 10:04:17 +00:00
Anthony Calosa
92ce6a4fde update TransitionScreen
- update Shaders
- adjust bgmatch y-axis
- adjust graytransition bias
- add versus bg for ArenaScene
2022-11-30 18:40:29 +08:00
Anthony Calosa
8ae6100a7c Merge pull request #1794 from Robbatog/enforce_sets_in_quest
Enforce sets in quest
2022-11-29 16:47:38 +08:00
tool4ever
57c8644469 Clean up (#1978) 2022-11-27 22:51:42 +00:00
paulsnoops
5100ca2198 fix test 2022-11-26 09:34:40 +00:00
Anthony Calosa
b8ea883259 Merge pull request #1902 from Northmoc/spaceb
UNF: space_beleren.txt and support
2022-11-22 08:54:01 +08:00
Anthony Calosa
f3966ecfef Merge pull request #1906 from Northmoc/ticket
UNF: Tickets initial implementation
2022-11-22 08:50:31 +08:00
Anthony Calosa
6b3cf252b7 Merge pull request #1913 from Northmoc/comet
UNF: Comet, Stellar Pup and support
2022-11-21 07:15:49 +08:00
Anthony Calosa
3031e2f942 fix combat arrows on desktop 2022-11-21 06:40:07 +08:00
Anthony Calosa
1375cfe460 Show combat arrow for attacked player on desktop 2022-11-20 13:43:55 +08:00
Northmoc
09fa7c00d8 add {TK} 2022-11-19 10:39:22 -05:00
Northmoc
06e9827464 localize sector prompts 2022-11-19 10:37:29 -05:00
Northmoc
15b7909171 space_beleren.txt and support 2022-11-19 10:37:18 -05:00
Northmoc
36d2c8212e CMatchUI.getAbilityToPlay trim multi-line ability descs for menu 2022-11-17 16:25:21 -05:00
tool4EvEr
5dc7a22228 Improve MouseWheel support in play choice popup 2022-11-12 17:18:04 +01:00
Robbatog
f643460a22 Added Quest Preference for toggling quest+world rules on/off in duels 2022-11-03 19:26:31 +01:00
Anthony Calosa
e570479e8d Merge pull request #1786 from asvitkine/fix_lands
Fix simulation AI logic related to playing lands.
2022-11-03 20:52:28 +08:00
asvitkine
5a2b714a67 Revert a print statement. 2022-11-02 14:02:09 -04:00
asvitkine
061a24a88c Image fetcher: Don't download card images that are already present.
Fixes a bug where a card's image will be repeatedly downloaded when ImageCache would return for a reason other than the image not being present, such as when requesting a very small image. That happened in practice during the drawing a card animation, where the card is scaled during the animation.
2022-11-02 14:01:17 -04:00
asvitkine
3c57330aa5 Add a comment. 2022-11-02 10:28:14 -04:00
asvitkine
b0120eedf0 Fix simulation AI logic related to playing lands.
This got broken by the following refactor:
79c9c914e2

The result was that simulation AI was ignoring certain decision trees that involved
playing lands, leading to not considering certain lines of play and some log
messages printed to standard error. I've added a test that covers this logic to prevent
it breaking again in the future.

Also, a couple small clean ups to related tests.
2022-11-02 10:26:37 -04:00
add-le
9cd4fb32ec add an alchemy icon for A- cards 2022-10-31 21:17:15 +01:00
Anthony Calosa
c129b0f290 update last selected tab
- closes #751
2022-10-15 19:36:44 +08:00
add-le
e5f16c4d67 label to translate color choices 2022-10-14 18:50:10 +02:00
tool4ever
9d5953579c Desktop: speed up lobby slot type changes caused by multiple deck generation calls in some cases (#1657)
* Clean up

* Avoid multiple deck generation calls during refresh of deck lists

Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.59>
2022-10-09 08:19:30 +03:00
paulsnoops
d6fb986aa5 test_fixes_2 2022-10-08 18:06:25 +01:00
paulsnoops
5cb1024a50 test_fix 2022-10-08 17:52:15 +01:00
Northmoc
2834993cb5 Refactor K:Unblockable > Static (#1551)
* round 1

* round 2

* 10 more (Oct 1)

* attempt to add "Pump" to EffectAi

* more 10/4

* more/fixes 10/4

* more 10/4 (80 to go...)

* more 10/4 (70 to go...)

* 10/5 (60 to go...)

* more 10/5 (50 to go...)

* more 10/5 (40 to go...)

* more 10/5 (30 to go...)

* 10/6 (20 to go...)

* more 10/6 (10 to go...)

* more 10/6 (last of pump -> effect)

* more 10/6 (continuous kw static > cantblockby... 30 to go)

* more 10/6 (continuous > cantblockby... 20 to go)

* more 10/6 (continuous > cantblockby... 10 to go)

* last 10/6 (continuous > cantblockby)

* Final keyword cleanup?

* GameSimulationTest.testEquippedAbilities use Shroud instead of Unblockable

* fish token!

* CreatureEvaluator evaluate for unblockable

* AttachAi evaluate for unblockable
2022-10-08 11:39:26 +03:00