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

Increment SaveInventory::steps and fix state damage algo #1472

Merged
merged 3 commits into from Nov 4, 2018

Conversation

Projects
None yet
5 participants
@fmatthew5876
Copy link
Contributor

fmatthew5876 commented Nov 2, 2018

  • Ticks when player moves with keyboard
  • Ticks when plyaer moves with keyboard in a vehicle
  • Does not tick for events forcing player movement
  • Does not tick for moving once space to embark/disembark
  • Tested and matches RPG_RT behavior

This counter ticks in RPG_RT and is stored in the save data, but outside of that it appears completely unused.

@CherryDT Is there anything we should be doing in the interpreter that depends on this?

Implement SaveInventory::steps
* Ticks when player moves with keyboard
* Ticks when plyaer moves with keyboard in a vehicle
* Does not tick for events forcing player movement
* Does not tick for moving once space to embark/disembark
* Tested and matches RPG_RT behavior
@CherryDT

This comment has been minimized.

Copy link

CherryDT commented Nov 2, 2018

No I think it's only for use in "change variable"

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Nov 2, 2018

In steam rm2k there is no option to set a variable to steps from the ChangeVariable dialog. It appears impossible to get at this value within a game. Maybe a bug in rm2k?

EDIT: Steam rm2k3 also does not support this feature in ChangeVariable.

@CherryDT

This comment has been minimized.

Copy link

CherryDT commented Nov 2, 2018

You are right. That was my mistake. I confused it with RMXP which had this option.
RM2k(3) uses this value for the terrain poison feature.

EDIT: I'm talking only nonsense today. I meant the conditions which have field HP/MP reduction every X steps. Not terrains. X.x

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Nov 2, 2018

I see it now. RPG_RT has a very simple algorithm for computing damage steps related to states like Poison. It just does a modulus of the step count by the number of steps in the effect.

It has the benefit of making the start of the effect more random and the effect steps persist after a save game.

Right now in Player if you have a poison effect that triggers on every 4th step, you can save the game every 3 steps and never take poison damage.

Fix States field damage steps algorithm
* Matches RPG_RT
* Prevents save scumming to avoid state damage
* Fixes a bug there Player would trigger damage on every step if
  the hp modifier was > 0 but the steps modifier was 0. It should be
  disable if steps is 0.

@fmatthew5876 fmatthew5876 changed the title Implement SaveInventory::steps Increment SaveInventory::steps and fix state damage algo Nov 2, 2018

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Nov 3, 2018

Tested this against RPG_RT and behavior matches. Ready to be reviewed and merged.

@Ghabry

This comment has been minimized.

Copy link
Member

Ghabry commented Nov 4, 2018

great, when I was discussing this with Sormat weeks ago we tried to figure out how RPG_RT saves this

@Ghabry

Ghabry approved these changes Nov 4, 2018

@Ghabry Ghabry added this to the 0.5.5 (or 0.6.0) -> we will see milestone Nov 4, 2018

Show resolved Hide resolved src/game_party.cpp Outdated
Update src/game_party.cpp
Co-Authored-By: fmatthew5876 <fmatthew5876@gmail.com>

@carstene1ns carstene1ns merged commit c71d914 into EasyRPG:master Nov 4, 2018

6 checks passed

Android (armeabi-v7a) 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:steps branch Nov 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.