How do I make a debuff that explodes for damage after x amount of turns?

Awesomejr44

Dragon-Type Master
Veteran
Joined
Dec 24, 2015
Messages
89
Reaction score
118
First Language
English
Primarily Uses
RMMV
Hello! As the title states, I am trying to make a debuff that if not removed by cleansing spells will explode and deal damage to the person its on. Also, if you also know how to make the explosion hit the entire party, I could also use that information for another debuff as well. (Not sure if it would be a simple change or not to make it hit all PCs) And if you’re even more knowledgeable and are willing to go the extra mile, is there a way to apply another debuff if the original debuff explodes? Perhaps the explosion could apply damage dealt down as a punishment for just trying to heal through it.

I have all of the Yanfly plugins, but I'm not familiar with scripting so I'm not sure what to do exactly. Any help is greatly appreciated! :)
 
Last edited:

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
724
Reaction score
234
First Language
Vietnamese
Primarily Uses
RMMV
Buffs and States Core is enough to make this. I think you can try this in the state:
Code:
<Custom Leave Effect>
user.startAnimation(x); //X is your animation ID in case you wanna show some animation
var dmg = y; //Y is the damage set by you. Tell me if you want a more complex damage formula.
user.gainHp(-dmg);
</Custom Leave Effect>
 
Last edited:

Awesomejr44

Dragon-Type Master
Veteran
Joined
Dec 24, 2015
Messages
89
Reaction score
118
First Language
English
Primarily Uses
RMMV
Thank you! Do you happen to know how to make the damage hit the entire party, or how to inflict a debuff along with the damage?
 

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
724
Reaction score
234
First Language
Vietnamese
Primarily Uses
RMMV
Sure. I can do the explosion damage to hit all other enemies (both including and excluding the target) and apply a new state to them. Tell me in detail if you want to do that.
P/s: There was a mistake in the above formula (-y). It should be (-dmg). I made a fix so please check again.
 
Last edited:

Awesomejr44

Dragon-Type Master
Veteran
Joined
Dec 24, 2015
Messages
89
Reaction score
118
First Language
English
Primarily Uses
RMMV
Sure. I can do the explosion damage to hit all other enemies (both including and excluding the target) and apply a new state to them. Tell me in detail if you want to do that.
P/s: There was a mistake in the above formula (-y). It should be (-dmg). I made a fix so please check again.
I'd prefer a version of the code you've already provided that hits all player characters, including the main target, as well as a separate code that applies debuff x if the original debuff explodes from expiring. Not sure if you'd need anymore details, but let me know if you do!
Thanks for the update on the original code and for your help so far! :)
 

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
724
Reaction score
234
First Language
Vietnamese
Primarily Uses
RMMV
Well, I will make 2 versions as you said below:

1. Target explodes, damaging all of its allies including itself:
Code:
<Custom Leave Effect>
//Set the damage with X is the explosion damage
var dmg = x;
// Get the living members of the same party (all other enemies).
var members = user.friendsUnit().aliveMembers();
// Make an empty group to list affected members.
var affected = [];
// We'll go through each member to check them.
for (var i = 0; i < members.length; ++i) {
// Getting the individual member.
var member = members[i];
affected.push(member);}
// We'll go through each of the affected members now.
for (var i = 0; i < affected.length; ++i){
// Getting the individual affected member.
var member = affected[i];
// Ignore the effect if the member is the target of attack.
// Let's play animation y on the affected member.
member.startAnimation(y);
// The affected member takes damage.
member.gainHp(-dmg);
// We'll have the affected member reveal a damage popup.
member.startDamagePopup();
// Clear the results of the effect.
member.clearResult();
// Next, check to see if the member is dead.
if (member.isDead()){
// If the member is dead, we'll make it collapse.
member.performCollapse();}}
</Custom Leave Effect>

2. Target explodes, adding new negative state to itself. This is easy. Just add another line of code to the original codes I gave you before
Code:
<Custom Leave Effect>
user.startAnimation(x); //X is your animation ID in case you wanna show some animation
var dmg = y; //Y is the damage set by you.
user.gainHp(-dmg);
user.addState(z); //Z is another state ID
</Custom Leave Effect>
 

Awesomejr44

Dragon-Type Master
Veteran
Joined
Dec 24, 2015
Messages
89
Reaction score
118
First Language
English
Primarily Uses
RMMV
Thank you so much for your help! I'll test these soon (I'm busy with irl stuff at the moment) and let you know if I need any more help! :)
 

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
724
Reaction score
234
First Language
Vietnamese
Primarily Uses
RMMV
Ok please let me know if it works or if you encounter some weird things.
 

Latest Threads

Latest Profile Posts

Lately I have been taking a break from game and resource making so I won't get burnt out. But I am also interested in the Game Jams this site periodically holds. It'd be great if I knew when the next one, if any, is planned.
elexy 1.2.pngSome bust art to be cropped and cleaned. May use in special decision moments. Depending on how it looks in game I may cut it.
Tiamat-86 wrote on ATT_Turan's profile.
apparently since its turning 15 years old this year the ps3 is considered "retro". now how old do you feel?
guess that means im an "antique" gamer since ill still play games as old as i am.
"you know your getting old when your childhood console changes ethnicity" lol it turned yellow
I'm making Toilet in Wonderland 2. and tell vinny about it lol

Forum statistics

Threads
115,346
Messages
1,089,175
Members
150,021
Latest member
Jackitrick
Top