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

BattleStateCheck never checks if Player has Won #87

Open
SkipWestcott opened this issue Mar 15, 2023 · 1 comment
Open

BattleStateCheck never checks if Player has Won #87

SkipWestcott opened this issue Mar 15, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@SkipWestcott
Copy link
Contributor

SkipWestcott commented Mar 15, 2023

** TO REPRODUCE **
Enter a city and use:

//captivity.fire_event TB_catcall_duel

Turns out this is because the City battle is just using PlayerStartBattle which will always kick you out of the Town!

The way Alley battles work, they call Mission.Current.GetMissionBehavior().StartCustomFight, but the args here are Agents, not Parties. I'm going to see what I can do.

@SkipWestcott
Copy link
Contributor Author

Original Bug

** TO REPRODUCE **
Enter a city and use:

//captivity.fire_event TB_catcall_duel

This var is never set: CEPersistence.playerWon, so the Lose event will always fire.

Since the BattleStateCheck is only fired on map tick, it looks to me that it is never hitting the logic to actually check on the post-battle status.

Briefly, PlayerEncounter.Current becomes null immediately, and there is no Battle to check for WinningSide.

CESubmodule.BattleStateCheck()
...
else if (CEPersistence.battleState == CEPersistence.BattleState.AfterBattle && Game.Current.GameStateManager.ActiveState is MapState mapstate2 && !mapstate2.IsMenuState)
{
if (PlayerEncounter.Current == null)
{
HandleFinishBattle(mapstate2);
}
...

And of course you already knew:

       //TODO: move all of these to their proper listeners and out of the OnApplicationTick

I

@TheBadListener TheBadListener self-assigned this Apr 3, 2023
@TheBadListener TheBadListener added the bug Something isn't working label Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants