Can't make finishing attack deal extra damage to weak enemies

Darkbeetlebot

Villager
Member
Joined
Feb 25, 2016
Messages
17
Reaction score
2
First Language
English
Primarily Uses
So I'm trying to make a Coup de Grace attack where the damage dealt is only 1.1*attack under normal circumstances, but it jumps up to 10*attack if the enemy is under 20% HP. However, all of the formulas I've tried so far just do not work at all.

Using
Code:
if b.state?(20% hp weakness state); (extra damage formula); else; (Normal formula); end;
doesn't work: It either defaults to the normal formula, crashes, or deals 0 damage depending on how I word it.

The same thing happens with
Code:
if b.hp <= b.mhp/5; (extra damage formula); else; (normal formula); end;
It always deals 0 damage.

Substituting the if function for the question mark and colon doesn't do anything either.

It doesn't seem to be detecting whether the if statement is true or not. I am doing the tests in-game, and it doesn't seem to make a difference. I've also been trying to use Lunatic Damage, but with no actual results. Oddly, using only the notetags and LD for the formula makes it deal no damage no matter what I put in. It's starting to get on my last nerves. Has anyone got a tested and working custom formula for this simple task?
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
Try this setup:
Code:
b.hp_rate < 0.2 ? a.atk * 10 : a.atk * 1.1
 

Darkbeetlebot

Villager
Member
Joined
Feb 25, 2016
Messages
17
Reaction score
2
First Language
English
Primarily Uses
Try this setup:
Code:
b.hp_rate < 0.2 ? a.atk * 10 : a.atk * 1.1
That seemed to work for the most part. Unfortunately, it's about at the character limit. The full code ended up being:
Code:
b.hp_rate<=0.25?((1000-b.def)*a.atk*10/1000)-(b.def**0.9):((1000-b.def)*a.atk*1.1/1000)-(b.def**0.9)
I kind of feel stupid for not realizing hp_rate was a usable variable. Anyways, this is solved. Thanks for the solution!
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,859
Messages
1,017,037
Members
137,566
Latest member
Fl0shVS
Top