Skip to content

Fix compatibility with current STS2 combat API - #110

Open
Zamiell wants to merge 1 commit into
Gennadiyev:mainfrom
Zamiell:fix-1
Open

Fix compatibility with current STS2 combat API#110
Zamiell wants to merge 1 commit into
Gennadiyev:mainfrom
Zamiell:fix-1

Conversation

@Zamiell

@Zamiell Zamiell commented May 23, 2026

Copy link
Copy Markdown

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

  • replace CombatManager.Instance.IsPlayPhase calls with a helper based on current combat state/manager properties
  • update MerchantRoom.Inventory usages to GetLocalInventory()
  • allow target resolution against ICombatState

Validation

  • 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-restore
  • installed the rebuilt mod locally and verified GET /api/v1/singleplayer works during combat, returning state_type: "monster" and battle.is_play_phase: true

Context

With the current STS2 build, combat state reads fail with:

MissingMethodException: CombatManager.get_IsPlayPhase()

The current game API exposes related state through CombatState.CurrentSide plus CombatManager phase flags instead of IsPlayPhase.

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>
@Gennadiyev

Copy link
Copy Markdown
Owner

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.

I'm sorry, but I do not have the capacity to maintain the mod for the beta branch. While automated tests are now easy with agents, I still try to make changes incremental and systematically tested.

Please let me know if you I interpret the pull request wrong 🙇

@Zamiell

Zamiell commented May 24, 2026

Copy link
Copy Markdown
Author

ok, thanks for the quick reply!
i have a lot of other improvements to STS2MCP that I am using, like debug warping to specific combats, but I will just run on my fork for now until you are ready for pull requests.

@G07cha

G07cha commented Aug 1, 2026

Copy link
Copy Markdown

Seems like already covered by the merged #123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants