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

Fix to_hit calculation - Previously Albeleon 2.34 + Weapon sp cost fix #1511

Merged
merged 6 commits into from Dec 6, 2018

Conversation

Projects
None yet
5 participants
@fmatthew5876
Copy link
Contributor

fmatthew5876 commented Nov 30, 2018

From Cherry:

if target is not able to move, success probability = 100, otherwise: success probability = (skill success probability * (min(100, all the attacker's state accuracy rates)/100) and then only if weapon doesn't have "ignore enemy dodge rate" option is enabled: final success probability = 100 - (100 - success probability) * (1 + 0.5 * (target agility / attacker agility - 1)) and then only if target has an equipment with "increase dodge rate against physical attacks": final success probability -= 25 "this condition": only if the failure_message is 3 >and the target is an (or all) enemy not sure why the enemy thing though. that means that if an enemy casts >a spell, the agilities never matter...? I think the failure_message 3 classifies it as a physical attack in a way so you can dodge it actually it is illogical that this applies only to skills with enemies as target, yet it checks if the target has equipment with the "increase dodge rate" option since enemies can't wear equipment but I guess it's just copied from normal attack logic...
But this is for skills. Now, for physical attack, most of this is the same. But instead of the skill success probability, you have:

if attacker is actor: max(weapon1's Item.hit, weapon2's Item.hit) or 90 if no weapons equipped else: if Enemy.miss then 70, otherwise 90

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:to_hit branch 8 times, most recently from 46e8b42 to 5c266d9 Nov 30, 2018

@fmatthew5876 fmatthew5876 changed the title Fix to_hit calculation - Albeleon 2.34 Fix to_hit calculation - Previously Albeleon 2.34 Nov 30, 2018

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:to_hit branch from 5c266d9 to 1749722 Nov 30, 2018

@Ghabry

This comment has been minimized.

Copy link
Member

Ghabry commented Dec 1, 2018

Is HasHalfSpCostused by anything?
We already have GetSpCostModifier.

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 1, 2018

Is HasHalfSpCostused by anything?
We already have GetSpCostModifier.

I missed that we have GetSpCostModifier(). I just added HasHalfSpCost() to match the style of the 3 other armor modifiers. I can change the sp cost code to use the new function.

@fdelapena fdelapena added the Battle label Dec 1, 2018

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

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:to_hit branch from 255dcaa to 9dc1a5b Dec 1, 2018

@fmatthew5876 fmatthew5876 changed the title Fix to_hit calculation - Previously Albeleon 2.34 Fix to_hit calculation - Previously Albeleon 2.34 + Weapon sp cost fix Dec 1, 2018

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 1, 2018

I'm glad you said something, our weapon sp cost logic was actually broken. I've fixed it now.

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:to_hit branch from 9dc1a5b to 61b076c Dec 1, 2018

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 2, 2018

Added the other sp cost commit. Easy to test. Just attack with a weapon with sp cost and "attack all" attribute.

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 3, 2018

I don't plan to add anymore commits to this so it's ready for review. Once this, #1519, and #1450 are in I can rebase and finish refactoring #1452. Then we will finally be done with the Sormats battle PRs!

fmatthew5876 and others added some commits Nov 30, 2018

"2.43: RM2000 + RM2003: A weapon that costs SP only takes it in the f…
…irst attack. It takes even when the attack misses, and it doesn't take more with double attacks or attacks to all enemies. No change in the attack even if you don't have SP."

Solution: Take away the "success" condition and add "IsFirstAttack".
Refactor and fix half sp cost logic
* Use HasHalfSpCost()
* Fix incorrect ceil(-cost) logic in weapon sp cost
* Support sp cost for 2 weapons, including correct half sp cost
* Optimize skill sp cost calc to not convert to/from float

@fmatthew5876 fmatthew5876 force-pushed the fmatthew5876:to_hit branch from 32e4811 to 896f3ea Dec 5, 2018

@fmatthew5876

This comment has been minimized.

Copy link
Contributor Author

fmatthew5876 commented Dec 5, 2018

Rebased to master

@Ghabry

Ghabry approved these changes Dec 6, 2018

@Ghabry Ghabry merged commit 1cef4ba into EasyRPG:master Dec 6, 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:to_hit 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.