Basically, I am trying to create a skill, Flame Shield. When the actor uses this skill, it adds a state to the actor that adds a Burn state to any enemy that attacks them with a physical hit while the shield is active. I have been trying to find out how to make such a skill work, but I cannot find a solution. Does anyone have any suggestions?
A state that adds another state to attacker
RPG Maker MV SupportI believe yanfly plugins can do it. He may also have a youtube video on his channel that shows something similar.
Not at my computer so I cant find the video at the moment.
Not at my computer so I cant find the video at the moment.
In Ace this could be done easily using the damage formula. I know the Ruby code for it, but not the JavaScript. I give below how it could be done in Ruby and perhaps a more knowledgeable reader of this query could do the necessary translation.
Basically you want to say that if the actor has state #n, then inflict state #nn to the enemy. You do this in 2 stages.
For the actor's Flame skill, using state id#100 in this example, have
a.add_state(100); damage formula here
For the enemy skills which are physical, you would have this, using state id#101 for the burn state :
if b.state?(100); a.add_state(101); end; damage formula here
Basically you want to say that if the actor has state #n, then inflict state #nn to the enemy. You do this in 2 stages.
For the actor's Flame skill, using state id#100 in this example, have
a.add_state(100); damage formula here
For the enemy skills which are physical, you would have this, using state id#101 for the burn state :
if b.state?(100); a.add_state(101); end; damage formula here
The problem with this is that it shows a damage indicator on my characters even though I don't want the spell to do any damage / healing, and I was hoping I could confine it all within a state rather than adding it to every physical ability.
It's a self target ability and that the only thing it does is give the user the Flame Shield state right? Add the flame shield via Effects, not via damage formula then.
Use the lunatic mode of Yanfly's States plugin's then, with it you can specify in the state that if the user is attacked by a physical attack...
I know how to add the state with the ability... the problem is getting the state to apply another state upon taking physical damage. I watched Yanfly's Thornmail video, and it does exactly what I want, except I do not know how to edit the lunatic code properly to get it to apply a state rather than reflect damage. Would you be able to help me? Or at least point me in the direction of learning how to create proper lunatic code for Yanfly plugins?
Here's the lunatic code for Thornmail:
<Custom React Effect>
// Check to see if any physical damage is dealt.
if (value > 0 && this.isPhysical()) {
// Sets the Recoil Rate to 15%.
var rate = 0.15;
// Determines the amount of recoil damage dealt.
var recoil = value * rate;
// Sets the DEF bonus rate to 25%.
var rate = 0.25;
// Determines the amount of bonus damage dealt.
var bonus = target.def * rate;
// Rounds up the bonus damage and recoil damage.
var dmg = Math.ceil(bonus + recoil);
// Makes the attacker lose damage equal to the dmg variable.
user.gainHp(-1 * dmg);
// Check to see if the attacker is dead.
if (user.isDead()) {
// If the attacker is dead, make it collapse.
user.performCollapse();
}
}
</Custom React Effect>
// Check to see if any physical damage is dealt.
if (value > 0 && this.isPhysical()) {
// Sets the Recoil Rate to 15%.
var rate = 0.15;
// Determines the amount of recoil damage dealt.
var recoil = value * rate;
// Sets the DEF bonus rate to 25%.
var rate = 0.25;
// Determines the amount of bonus damage dealt.
var bonus = target.def * rate;
// Rounds up the bonus damage and recoil damage.
var dmg = Math.ceil(bonus + recoil);
// Makes the attacker lose damage equal to the dmg variable.
user.gainHp(-1 * dmg);
// Check to see if the attacker is dead.
if (user.isDead()) {
// If the attacker is dead, make it collapse.
user.performCollapse();
}
}
</Custom React Effect>
Code:
<Custom React Effect>
// Check to see if any physical damage is dealt.
if (value > 0 && this.isPhysical()) {
target.addState(STATE_ID_OF_BURN);
}
</Custom React Effect>
This worked almost perfectly, just had to change target.addState to user.addState for it to work. Thank you very much! Is there a way to add an animation after the attack as well, to show them getting burned? Sorry for being clueless.
ah yes it's react so user is actually the one who attacked the battler that has the state... XD
It's possible but IDK the MV call for calling animation in battle and make the battle actually wait for it to finish...
It's possible but IDK the MV call for calling animation in battle and make the battle actually wait for it to finish...
Original thread: https://forums.rpgmakerweb.com/threads/a-state-that-adds-another-state-to-attacker.73195/