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
722
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
722
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
722
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
722
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 Posts

Latest Profile Posts

So far, this is how the wall tileset its looking in-editor. :kaoswt2:
1631863283853.png
Still thinking on details to add.
Added a plugin to RMMV Plugin Releases with all relevant info but it looks like the topic wasn't approved for whatever reason. Cool.
Working in the IT industry:
- "How long does it take?".
- "It takes 1 month".
- "What if we add more people to the project?".
- "It would take 2 months".
Doing RPG Maker News for 16th September 2021

cant figure out how to change my pfp
ig im stuck as the question mark

Forum statistics

Threads
115,126
Messages
1,087,410
Members
149,617
Latest member
MzHyde
Top