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

RM2k Battle fixes - turns and action switches #1419

Merged
merged 3 commits into from Sep 22, 2018

Conversation

Projects
None yet
3 participants
@fmatthew5876
Contributor

fmatthew5876 commented Sep 22, 2018

This PR fixes some bugs in the rm2k battle system. It resolves some of the issues in #985 and makes hh3 playable past the intro (before the battle was impossible to lose).

I don't believe any of these code changes touch 2k3 but I haven't tested that.

fmatthew5876 added some commits Sep 22, 2018

Increment Battle turn before computing enemy actions
- Fixes a bug where enemy actions which are conditional
on turn number were off by 1.
@@ -1640,5 +1647,6 @@ bool Game_BattleAlgorithm::NoMove::Execute() {
void Game_BattleAlgorithm::NoMove::Apply() {
// no-op

This comment has been minimized.

@carstene1ns

carstene1ns Sep 22, 2018

Member

Not a no-op anymore ;-)

@carstene1ns

This comment has been minimized.

Member

carstene1ns commented Sep 22, 2018

First commit does not really make sense to me, why does the turn counter change midway between player and enemy turn? Maybe is a general off-by-one instead?

@@ -427,7 +427,7 @@ void Scene_Battle::CreateEnemyAction(Game_Enemy* enemy, const RPG::EnemyAction*
enemy->GetBattleAlgorithm()->SetSwitchEnable(action->switch_on_id);
}
if (action->switch_off) {
enemy->GetBattleAlgorithm()->SetSwitchEnable(action->switch_off_id);
enemy->GetBattleAlgorithm()->SetSwitchDisable(action->switch_off_id);

This comment has been minimized.

@carstene1ns

carstene1ns Sep 22, 2018

Member

good find!

@fmatthew5876

This comment has been minimized.

Contributor

fmatthew5876 commented Sep 22, 2018

First commit does not really make sense to me, why does the turn counter change midway between player and enemy turn? Maybe is a general off-by-one instead?

I think the increment is in the wrong place. Before it changed after selecting all actions but before actually running them. The result is that enemy actions that are conditional on turns that are off by one but troop pages that are conditional on turns are correct.

I can look at moving it forward to before selecting any actions. Just need to be careful not to mess up the special "turn 0" which can be used to trigger troop pages at the beginning of the battle.

@Ghabry

This comment has been minimized.

Member

Ghabry commented Sep 22, 2018

Ah, now it also makes sense to me. Right, the EnemyAction that cares about the turn count was one turn behind. Good find!

Imo you can keep the way as it is now, I'm afraid any hugher change will mess up some interpreter handling :)

@Ghabry

Ghabry approved these changes Sep 22, 2018

@Ghabry Ghabry added this to the 0.5.4 milestone Sep 22, 2018

@carstene1ns carstene1ns added the Battle label Sep 22, 2018

@carstene1ns carstene1ns merged commit 6e1e7d3 into EasyRPG:master Sep 22, 2018

7 checks passed

Android (armeabi-v7a) Build finished.
Details
GCW0 Build finished.
Details
GNU/Linux Build finished.
Details
OSX Build finished.
Details
Windows (x64) Build finished.
Details
Windows (x86) Build finished.
Details
web Build finished.
Details

@fmatthew5876 fmatthew5876 deleted the fmatthew5876:battle_fix branch Sep 22, 2018

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