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

Implement ATB active mode #2360

Merged
merged 1 commit into from Sep 29, 2020
Merged

Implement ATB active mode #2360

merged 1 commit into from Sep 29, 2020

Conversation

ghost
Copy link

@ghost ghost commented Sep 26, 2020

This PR implements the ATB active mode. This fixes bullet point 3 of #2175.

case State_SelectEnemyTarget:
case State_SelectAllyTarget: {
if (Game_System::GetAtbMode() == lcf::rpg::SaveSystem::AtbMode_atb_wait && (state == State_SelectCommand || state == State_SelectEnemyTarget || state == State_SelectAllyTarget)) break;
if ((state == State_SelectEnemyTarget || state == State_SelectAllyTarget) && (previous_state == State_SelectSkill || previous_state == State_SelectItem)) break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You check "case" values in an if and then break out of the switch.
I suggest putting them before State selectactor and then just // fallthrough

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm probably too stupid but how I'm supposed to do the fallthrough?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fallthrough just don't use break. It is just convention (compilers warn about it) that you must use // fallthrough (a comment) when the fallthrough was intended.

Something like this.

case State_SelectEnemyTarget:
case State_SelectAllyTarget:
  if (previous_state == State_SelectSkill || previous_state == State_SelectItem) {
    break;
  }
  // fallthrough
case State_SelectCommand:
  if (Game_System::GetAtbMode() == lcf::rpg::SaveSystem::AtbMode_atb_wait) {
    break;
  }
  // fallthrough
case State_SelectActor:
case State_AutoBattle:
 /* more code */

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your input! It helps me understanding the switch-case-operation a bit better. I have updated the PR.

@ghost ghost mentioned this pull request Sep 27, 2020
The ATB active mode has been implemented now.
@Ghabry Ghabry added this to the 0.6.3 milestone Sep 28, 2020
Copy link
Member

@Ghabry Ghabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo this is an anti feature but works for me.
Tested attacking while being killed through a skill, worked without crashing.
For later commits there shouldbe a checklist what RPG_RT does at these edge cases:

  • Killed while starting normal attack
  • Killed while opening Skill Window
  • Game Over while opening Item window
    etc.

Copy link
Contributor

@fmatthew5876 fmatthew5876 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks ok, if @Ghabry tested this one then it's good enough for me.

@Ghabry Ghabry merged commit 71d362e into EasyRPG:master Sep 29, 2020
@ghost ghost deleted the battle2k3-atbactive branch September 29, 2020 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants