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

Generate quick light red translucid flash when step on damaged terrain. #1389

Merged
merged 2 commits into from Jul 1, 2018

Conversation

Projects
None yet
3 participants
@Albeleon
Copy link
Member

Albeleon commented Jun 29, 2018

Problem: When stepping in damaged terrain and there's more than 0 damage, there's no flash indicating it.

Solution: Put that flash after trial and error getting the exact color, power and time. Also, no need to invoke the damage function to the party when the damage is 0.

Generate quick light red translucid flash when step on damaged terrain.
Problem: When stepping in damaged terrain and there's more than 0 damage, there's no flash indicating it.

Solution: Put that flash after trial and error getting the exact color, power and time. Also, no need to invoke the damage function to the party when the damage is 0.
@Ghabry

Ghabry approved these changes Jun 29, 2018

@Ghabry Ghabry added this to the 0.5.4 milestone Jun 29, 2018

@Ghabry
Copy link
Member

Ghabry left a comment

(comment follows)

@Ghabry

This comment has been minimized.

Copy link
Member

Ghabry commented Jul 1, 2018

I just tested one corner case:
Terrain can not kill party members, the HP only reaches "1".

The easiest way to fix this would be adding a "bool lethal" (like in Game_Interpreter ChangeHP command e.g.) as a new argument to ApplyDamage and when false it is capped to 1 HP.

I also found a bug in ApplyDamage:
https://github.com/EasyRPG/Player/blob/master/src/game_party.cpp#L414-L425

The SetHp() call must be changed to ChangeHp(-damage) because only ChangeHp handles the 0 HP case correctly...

Terrain Damage not lethal.
Solution: Add to ApplyDamage an extra input argument "lethal", which, if it's false, the damage can only be between [0, current HP - 1]. This is applied to the Terrain damage being false.
@Ghabry

Ghabry approved these changes Jul 1, 2018

@carstene1ns
Copy link
Member

carstene1ns left a comment

Looks good to me.

@carstene1ns carstene1ns merged commit ae3338a into EasyRPG:master Jul 1, 2018

7 checks passed

Android (armeabi-v7a) Build finished.
Details
GCW0 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

@Albeleon Albeleon deleted the Albeleon:stepflash branch Jul 1, 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.