Endure state that ends when it is activated

Status
Not open for further replies.

KrimsonKatt

Pyromancer
Veteran
Joined
Nov 12, 2016
Messages
117
Reaction score
64
First Language
English
Primarily Uses
RMMV
So, in my game I have a skill called "Endure" which allows an actor to survive an attack that would normally kill them at 1 HP. I found another person asking the same question on the forum, and this was the final answer.
Hello!


If you use Yanfly's Buff & State Core, you can use the following notetag in your Endure state:


<Custom React Effect>
if ($gameParty.inBattle() && !this.isCertainHit() && value >= target.hp) {
value = target.hp - 1;
}
</Custom React Effect>


If you wanna endure one hit only, simply check the 'Remove by Damage' box.


You can also use <Action Start: 1> to make it last until that battler's next turn.


Hope that helps!


- Riff
Well, that's all fine and dandy, but they never specified a way to get the state the only be removed if the state is activated. I know that it must involve some sort of If-then code, but I don't know javascript. @Riff or anyone else, if you're out there, please tell me what additional code I should add in order to have the state be automaticly removed when the state activates. Thanks!
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,110
Reaction score
4,396
First Language
English
Primarily Uses
RMVXA
I think that you would add the line:
target.removeState(x);
inside the IF branch of the notetag, replacing x with the Endure State's ID.

Obviously don't add any Turn End/Action End remove conditions, although you can add Remove at Battle End if you want..
 

KrimsonKatt

Pyromancer
Veteran
Joined
Nov 12, 2016
Messages
117
Reaction score
64
First Language
English
Primarily Uses
RMMV
@Wavelength Okay, though I think I already knew that. There is no "IF" section of the code though, so I will need you to give me the exact code I need to use the "IF" command. I don't know anything about JavaScript and I'm afraid that I'll mess it up and cause errors if I try to guess what I'm supposed to do. I already provided the code, so all you have to do is copy it and then insert the "IF" section at the end of it. Thanks!
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,110
Reaction score
4,396
First Language
English
Primarily Uses
RMVXA
Okay, though I think I already knew that. There is no "IF" section of the code though, so I will need you to give me the exact code I need to use the "IF" command.
<Custom React Effect>
if ($gameParty.inBattle() && !this.isCertainHit() && value >= target.hp) {
value = target.hp - 1;
target.removeState(x);
}
</Custom React Effect>

;)
 

KrimsonKatt

Pyromancer
Veteran
Joined
Nov 12, 2016
Messages
117
Reaction score
64
First Language
English
Primarily Uses
RMMV
@Wavelength Thanks a lot! You really bring hope to me in such a dark time of both my life and the history of RPG Maker.
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,110
Reaction score
4,396
First Language
English
Primarily Uses
RMVXA
Glad it worked for you. :)
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
6,734
Reaction score
4,573
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

made a bio for the protag in my project!
Beggar : "I haven't eat for days..."
Kid : "Just do crime! You will get daily necessity for free in prison~"
Stream is a bit late but will be live shortly with some game development! Feel free to drop by!
omg, why persona 5 is so good?

Forum statistics

Threads
99,157
Messages
962,423
Members
130,725
Latest member
teendinsaikha
Top