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

Battle Algorithm related fixes from battle 7 #1539

Merged
merged 5 commits into from Dec 12, 2018

Conversation

Projects
None yet
5 participants
@fmatthew5876
Copy link
Contributor

fmatthew5876 commented Dec 8, 2018

Battle 7 commits related to battle algorithm calculations

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:battle_algo branch 3 times, most recently from 3a320a1 to e33f820 Dec 8, 2018

@fmatthew5876 fmatthew5876 changed the title "3.11: RM2000: Getting all the battle formulas right, including all t… Battle Algorithm related fixes Dec 8, 2018

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 8, 2018

This one is tested and ready. I have nothing more to add here.

@fmatthew5876 fmatthew5876 changed the title Battle Algorithm related fixes Battle Algorithm related fixes from battle 7 Dec 8, 2018

@fdelapena fdelapena added the Battle label Dec 8, 2018

@fdelapena fdelapena added this to the 0.6.0 (likely) milestone Dec 8, 2018

Show resolved Hide resolved src/game_battlealgorithm.cpp Outdated

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:battle_algo branch 2 times, most recently from 6ade475 to e610b8e Dec 11, 2018

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 11, 2018

I've addressed the comments for this one.

@Ghabry Ghabry removed the Needs Rebase label Dec 11, 2018

@Ghabry

Ghabry approved these changes Dec 11, 2018

@Ghabry

This comment has been minimized.

Copy link
Member

Ghabry commented Dec 12, 2018

@fmatthew5876 merge conflict :/

Albeleon added some commits Jul 4, 2018

"2.33: RM2000 + RM2003: A skill that costs SP and recovers SP, it can…
… recover the SP that spent in that same skill."

Solution: In case the source and the target is the same for a positive action, we keep in mind it can recover the SP lost. Then, in Skill::Apply, before the SP is increased, we move the SP cost before.
"2.35: RM2000 + RM2003: When an absorb skill attack, if HP or SP are …
…selected and the result is 0, the skill attack misses in its entirety, but it can still hit if they are unselected and the other stat decrease are 0 if the skill does other things (states, attribute resistance, etc.). If it doesn't absorb, the attack misses if it doesn't have HP selected but yes SP and it's 0."

Solution: Put all those conditions at the end of a skill attack.
"3.11: RM2000: Getting all the battle formulas right, including all t…
…he modificators."

Solution: The formulas to solve are:

1. AbsoluteDefense gives x4 defense, not x3.
2. EscapeRate increased each turn is absolute, not relative to the current chances of escaping. This means, if even if you have 0% chance at first you can escape the more you try, 10% each time.
3. The Skill variance has been fixed and applied to both Positive and Negative skills.

Note: Also refactored a bit
Clamp attribute values based on base and battle (2k / 2k3).
Problem: The way the clamp attributes were based before in battle, there were always clamped at 999, when in reality that value always depends of the version (2k or 2k3) and the Battler's type (Ally, Enemy).

Solution: Create MaxHpValue, MaxStatBaseValue and MaxStatBattleValue in Game_Battler and overriden by Game_Actor and Game_Enemy, each one with its own specifics, and replace all the values.
Clamp maximum damage depending of version (2k / 2k3).
Problem: Damage or healing isn't clamped. In 2k it's 999 and in 2k3 it's 9999.

Solution: Add a MaxDamageValue in Game_Battler that distinguises and returns each version, and then put in every damage, skill or healing aspect it's needed.

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:battle_algo branch from e610b8e to f7f783f Dec 12, 2018

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 12, 2018

rebased to master

@fdelapena fdelapena merged commit dba6dc0 into EasyRPG:master Dec 12, 2018

7 checks passed

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

@fmatthew5876 fmatthew5876 deleted the fmatthew5876:battle_algo branch Dec 14, 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.