Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LCI - Craft implementation #4140

Merged
merged 21 commits into from
Dec 3, 2023
Merged

LCI - Craft implementation #4140

merged 21 commits into from
Dec 3, 2023

Conversation

Northmoc
Copy link
Contributor

@Northmoc Northmoc commented Nov 8, 2023

@Northmoc Northmoc marked this pull request as ready for review November 12, 2023 02:04
@Northmoc Northmoc changed the title LCI - Craft implementation (work in progress) LCI - Craft implementation Nov 12, 2023
@Northmoc
Copy link
Contributor Author

This is all the Craft cards except #4167 now + Fabrication Foundry

Pretty sure AI would fail or cheat paying exile costs for Fabrication Foundry and Eye of Ojer Taq? Unsure if that should be another PR or if we add even more to this gargantuan. Perhaps quickest short-term solution is mark them both RemoveDeck:All?
@Agetian - as always your AI opinions are coveted here

@Agetian
Copy link
Contributor

Agetian commented Nov 21, 2023

Nice job!
I would say test them in the AI's hands, and if anything is off, mark them with AI DeckRemove for now and make an issue, assign it to me. I'll try to make things work as a follow-up MR.

@tool4ever
Copy link
Contributor

@Agetian
I think I cleaned AI up, please test if possible :)

@Northmoc
Copy link
Contributor Author

Northmoc commented Dec 2, 2023

@Agetian I think I cleaned AI up, please test if possible :)

AI Craft use seems the same so I think it was a good refactor

@Agetian
Copy link
Contributor

Agetian commented Dec 2, 2023

Nice job, I'll test it soon! Thanks for help! 👍

@Agetian
Copy link
Contributor

Agetian commented Dec 2, 2023

Hmm, got this crash from the following game state (attached). Supposedly when trying to activate Craft for Throne of the Grim Captain.

Game-0 > java.lang.NullPointerException
at forge.util.collect.FCollection.addAll(FCollection.java:310)
at forge.util.collect.FCollection.addAll(FCollection.java:296)
at forge.ai.ability.ChangeZoneAi.willPayCosts(ChangeZoneAi.java:65)
at forge.ai.SpellAbilityAi.canPlayWithoutRestrict(SpellAbilityAi.java:93)
at forge.ai.SpellAbilityAi.canPlayAI(SpellAbilityAi.java:54)
at forge.ai.SpellAbilityAi.canPlayAIWithSubs(SpellAbilityAi.java:37)
at forge.ai.AiController.canPlaySa(AiController.java:894)
at forge.ai.AiController.canPlayAndPayForFace(AiController.java:809)
at forge.ai.AiController.canPlayAndPayFor(AiController.java:759)
at forge.ai.AiController.chooseSpellAbilityToPlayFromList(AiController.java:1658)

craft_crash.txt

@Agetian
Copy link
Contributor

Agetian commented Dec 2, 2023

It looks like a NPE guard is needed circa ChangeZoneAi.java:65:

                    CardCollection toAdd = ComputerUtil.chooseExileFrom(ai, (CostExile) part, source, amt, sa);
                    if (toAdd != null) {
                        payingCards.addAll(toAdd);
                    }

@Agetian
Copy link
Contributor

Agetian commented Dec 2, 2023

Tested various other things, other stuff seems to work fine on my end :)

@tool4ever
Copy link
Contributor

ok, I think it's pretty ready at this point 👍

@paulsnoops paulsnoops merged commit 0e22a03 into Card-Forge:master Dec 3, 2023
2 checks passed
@Northmoc Northmoc deleted the LCI-craft branch December 16, 2023 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Craft mechanic
5 participants