Fix compatibility with current STS2 combat API - #110
Conversation
Replace CombatManager.IsPlayPhase usages with a compatibility helper based on current combat state and manager properties. Update merchant inventory and combat target typing for the current game API. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Hi, thanks for your interest in the mod and thanks for the PR! It seems that your fix can be a duplicate of PR #75. For players on the beta branch, this should be the right way to go. We will be integrating this patch after 0.104+ becomes stable.
Please let me know if you I interpret the pull request wrong 🙇 |
|
ok, thanks for the quick reply! |
|
Seems like already covered by the merged #123 |
Hello and thanks for the amazing API! I'm attempting to write a machine learning bot to get good at playing STS2, so I am building on top of your work. However, I found this bug. The below description is from a LLM:
Summary
CombatManager.Instance.IsPlayPhasecalls with a helper based on current combat state/manager propertiesMerchantRoom.Inventoryusages toGetLocalInventory()ICombatStateValidation
dotnet build "STS2_MCP.csproj" -c Release -o "out\STS2_MCP" -p:STS2GameDir="C:\Program Files (x86)\Steam\steamapps\common\Slay the Spire 2" --no-restoreGET /api/v1/singleplayerworks during combat, returningstate_type: "monster"andbattle.is_play_phase: trueContext
With the current STS2 build, combat state reads fail with:
The current game API exposes related state through
CombatState.CurrentSideplusCombatManagerphase flags instead ofIsPlayPhase.