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: Fix Hitrate calculation for normal attacks and Fatigue #1055

Merged
merged 2 commits into from Oct 16, 2016

Conversation

Projects
None yet
3 participants
@Ghabry
Member

Ghabry commented Oct 6, 2016

Finally...

Concerning hitrate if not obvious:
Before the code evaluated as (100 - (100 - hit_chance)) * REST because was in 2 different lines.
But correct order is 100 - (100 - hit_chance) * REST, so the 100 - is the last.

The requirement for "std::ceil" can be tested via: Actor has 0/0 SP and check is for 34-100% exhaust. When HP is full is 33.3% exhaust, but RPG_RT triggers the 34% case.

@Ghabry Ghabry modified the milestone: 0.5.1 Oct 6, 2016

Show outdated Hide outdated src/game_party.cpp
to_hit *= (1 + (1.0 * (*current_target)->GetAgi() / ally->GetAgi() - 1) / 2);
if (weaponID != -1 && !Data::items[weaponID].ignore_evasion) {
to_hit = (int)(100 - (100 - hit_chance) * (1 + (1.0 * (*current_target)->GetAgi() / ally->GetAgi() - 1) / 2));

This comment has been minimized.

@fdelapena

fdelapena Oct 6, 2016

Contributor

Corner case check: Is possible to exist Agi = 1 to get a div0 error?

@fdelapena

fdelapena Oct 6, 2016

Contributor

Corner case check: Is possible to exist Agi = 1 to get a div0 error?

This comment has been minimized.

@Ghabry

Ghabry Oct 6, 2016

Member

In theory total_hp == 0 and agi == 0 not possibleif the database is not altered... Though about AGI I'm not 100% sure

@Ghabry

Ghabry Oct 6, 2016

Member

In theory total_hp == 0 and agi == 0 not possibleif the database is not altered... Though about AGI I'm not 100% sure

Ghabry added some commits Oct 6, 2016

Battle Algorithm "Normal" calculates now the hit-rate for ally attack…
…s enemy correctly.

The order of operations was slightly different resulting in a much lower hit rate than normal.
@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Oct 13, 2016

Member

AGI 0 and HP 0 are not possible without editing the database manually, so will not sanitize this because we don't sanitize this anywhere :/

Fixed the missing f

Member

Ghabry commented Oct 13, 2016

AGI 0 and HP 0 are not possible without editing the database manually, so will not sanitize this because we don't sanitize this anywhere :/

Fixed the missing f

@carstene1ns carstene1ns merged commit 74d3527 into EasyRPG:master Oct 16, 2016

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment