EasyRPG / Player

RPG Maker 2000/2003 and EasyRPG games interpreter
https://easyrpg.org/player/
GNU General Public License v3.0
1.01k stars 192 forks source link

RM2K: Element Rate not working as intended for Ally-Targeting Heal Skills #2848

Open KafroHudrep opened 2 years ago

KafroHudrep commented 2 years ago

Name of the game: Ocean OI (https://tunditur-unda.itch.io/ocean-oi)

Player platform: Windows, tested on 0.7.0 and Continuous Build

Attach files: Ocean OI EasyRPG GitHub Issue.zip

Describe the issue in detail and how to reproduce it:

I was recently using EasyRPG Player to play the RPG Maker 2000 game Ocean OI, and the developer and I realized a discrepancy in the battle system between EasyRPG Player and the original RPG_RT.

Specifically, when using an ally-targeting healing skill with the Elemental Defense property for an Element checked (image 1) and the targeted party member with an Element Rate for said Element at 0% (image 2), the party member will be healed in EasyRPG Player (image 3) but will not be healed — as intended — using the RPG_RT (image 4).

issue

To reproduce this issue, start from the attached save file, choose "Journey onward..." to get into battle, and then use Ron's "Mandate" skill and let the result play out. (Pretty sure what the other party members do doesn't matter.)

carstene1ns commented 2 years ago

Thank you for the detailed and good issue description! 👍

Ghabry commented 2 years ago

The problem is line 988 in Game_BattleAlgorithm:

const auto cur_sp = target->GetSp() - sp_cost;

The Sp are already removed from the battler when the action starts and this calculation substracts it again.

I guess the real intention is here to add the costs so the value is the one before the action started.

But the problem could be also something else. I have to compare it with the HP code which has a similiar logic.

Tayruu commented 2 years ago

That doesn't appear to be quite the issue. What they're trying to create is a skill that restores SP to everyone but the user - hence the user is immune to the element of that restoration skill.

Is CalculateSkillCost combining the usage cost for SP with possible SP "damage" caused by the skill? Its naming format is different to CalculateSkillHpCost, which makes me wonder.

Or I'm misunderstanding your post, as "cost" in Game_BattleAlgorithm appears to be the damage result, rather than the "skill cost".