How to obtain a user's state resistance?

Rink27

Veteran
Veteran
Joined
Jul 18, 2014
Messages
222
Reaction score
13
First Language
English
Primarily Uses
RMMV
So I understand the following can be done to obtain a user's resistance to the death state:

Code:
var deathState = user.deathStateId();
if (user.stateRate(deathState) > 0.01 && !user.isStateResist(deathState)) {
  user.setHp(0);
  if (user.isDead()) {
    user.performCollapse();
  }
}
The above code is used to check if important enemies are resistant to the death state. What if I wanted to check a user's resistance to another state? Say it was ID 9. What would it be?

user. ???
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
I haven't learned any JavaScript yet, but it looks like you can just do this:
user.stateRate(9) User's percent resistance to state 9. Returns a value between 0.00 and 1.00
user.isStateResist(9) User is resistant to state 9. Returns true or false.
 

shockra

Slightly Crazy Programmer
Veteran
Joined
Feb 16, 2016
Messages
444
Reaction score
208
First Language
English
Primarily Uses
RMMV
I haven't learned any JavaScript yet, but it looks like you can just do this:
user.stateRate(9) User's percent resistance to state 9. Returns a value between 0.00 and 1.00
user.isStateResist(9) User is resistant to state 9. Returns true or false.
That's right. Simply replace 'deathState' with the ID of the state you want to check.
 

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,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top