Element Rate Problem

Sanquil

Warper
Member
Joined
Jul 10, 2014
Messages
2
Reaction score
0
First Language
English
Primarily Uses
So, in my current project, I've designed an skill, Stitch Up, that deals damage in it's own unique element, Torn. All enemies have a 0% Rate to torn because the skill is supposed to be a follow up kind of attack that only works if the Torn State is applied to the target. I've set the Torn State to have Element Rate: Torn * 100%. I get the message saying "*Enemy*'s soul was reassembled" so I know the skill worked, but the enemy took no damage. I've made sure that the Torn State is applied every time. What am I doing wrong and how can I fix it?
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
The enemy's rate is 0%. 0% means immunity.
 

shockra

Slightly Crazy Programmer
Veteran
Joined
Feb 16, 2016
Messages
444
Reaction score
208
First Language
English
Primarily Uses
RMMV
The state doesn't overwrite the trait the enemy already has. It accounts for both, meaning it reads the rate as 0% * 100%, which is still zero.

You need an if statement to make this work. This can be done in the damage formula. I think it's something like this:

b.isStateAffected(Torn ID State) ? damage effect : 0

Replace Torn ID State with the ID of the state you're checking for (keep the parentheses), and replace damage effect with the formula for that attack. 0 occurs if the condition is false.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
That code is for MV and this is Ace.

If no one has given the correct formula by the time I'm back on my computer, I'll edit this post with it.

EDIT
if b.state?(x); a.atk * 4 - b.def * 2; end; 0

where x is the ID number of the state 'Torn'. Change the a.atk * 4 - b.def to whatever damage formula you want.
 
Last edited:

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

Latest Threads

Latest Posts

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,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top