Status that deals constant damage to enemies and to yourself (RPGMMV)

Hello!

This is my first post in this forum, so I hope I don't make any mistake (in case, please correct me!). Anyway, this is what I'm trying to do in the past few days. I'm developing a skill-tree that has a very high-risk, high-reward type of approach, and one of its attacks deal massive damage to every enemies and medium damage to themselves. Now, to do such a thing it's very simple, doesn't even need to script anything. But if I wanted to turn this into a sort of an Aura-type attack that deals damage each turn? I of course need Statuses, and some of my other skills (called sustained states) are statuses that constantly drain your Mind (MP) and last until you choose to remove them, so I wanted to do something like that. Problem is, at least to my knowledge, I can't give script commands in statuses, or even Common Events.

So, to summarize, I need to create a status that deals constant damage to enemies and yourself (though this part shouldn't be a problem once I figure out a way to do the first). My inspiration came from the Aura of Pain talent of the Reaver specialization in Dragon Age: Origins.

Thanks a lot!
not possible by default, as each state only affects the bearer.

there are two possible workarounds:
One is to make it ,multiple states and use troop events to syncronise them (removing the second state when the first one is gone).

The other possibility is to use a plugin for advanced states - those can execute javascript in notetags under specific conditions. But you'll still have to get tricky with the javascript code even with such a plugin.
not possible by default, as each state only affects the bearer.

there are two possible workarounds:
One is to make it ,multiple states and use troop events to syncronise them (removing the second state when the first one is gone).

The other possibility is to use a plugin for advanced states - those can execute javascript in notetags under specific conditions. But you'll still have to get tricky with the javascript code even with such a plugin.
Mh, thanks! So it's quite complicated... For now, I have other priorities for the project, so I'll leave it as a simple attack that deals damage to each enemy and yourself. But I will note your suggestions and give it a shot. Do you think Yanfly's Buffs and States could help me? I never used it but I could give it a shot.
Buffs and States should do it, but you'll also need Action Sequences to inflict a state on the user and the target at the same time. I actually created something similar. Here is a tweaked version I hope will work for you:

You'll need two states, both with the negative HP-Regeneration you want and the same duration in turns. One for the user (1) and one for the target (2). Using Action Sequences you can make a skill inflict those states by using these notetags:
Spoiler: SKILL NOTETAG
<target action> ADD STATE 1: USER ADD STATE 2: TARGET <target action>
(You'll probably want to have a longer target action with animations and stuff)

To remove state 1 from the caster if the target is cured or dies you use these notetags on state 2:
Spoiler: STATE 2 NOTETAG A
<Custom Remove Effect> origin.removeState(1) </Custom Remove Effect>
Spoiler: STATE 2 NOTETAG B
<Custom Respond Effect> if (target.hp <= 0){ origin.removeState(1) } </Custom Respond Effect>
To remove state 2 from the target if the user dies you use these notetags, also on state 2:
Spoiler: STATE 2 NOTETAG C
<Custom Action End Effect> if (origin.isDead() || origin.hp <= 0){ user.removeState(2); } </Custom Action End Effect>

Hope this helps 🙂 Tell me if it worked for you, should you decide to give it a try.
Buffs and States should do it, but you'll also need Action Sequences to inflict a state on the user and the target at the same time. I actually created something similar. Here is a tweaked version I hope will work for you:

You'll need two states, both with the negative HP-Regeneration you want and the same duration in turns. One for the user (1) and one for the target (2). Using Action Sequences you can make a skill inflict those states by using these notetags:

<target action> ADD STATE 1: USER ADD STATE 2: TARGET <target action>

(You'll probably want to have a longer target action with animations and stuff)

To remove state 1 from the caster if the target is cured or dies you use these notetags on state 2:

<Custom Remove Effect> origin.removeState(1) </Custom Remove Effect>

<Custom Respond Effect> if (target.hp <= 0){ origin.removeState(1) } </Custom Respond Effect>

To remove state 2 from the target if the user dies you use these notetags, also on state 2:

<Custom Action End Effect> if (origin.isDead() || origin.hp <= 0){ user.removeState(2); } </Custom Action End Effect>

Hope this helps 🙂 Tell me if it worked for you, should you decide to give it a try.
Wow, thanks a lot! I will give it a shot and see if I can make it work!
Buffs and States should do it, but you'll also need Action Sequences to inflict a state on the user and the target at the same time.
Just to point it out, that's actually not necessary. You could inflict a state on both battlers using Skill Core notetags, and I don't see from the OP why the target needs a state at all. It's specified that the damage is done to every enemy.

I guess it depends on when the OP wants the damage to happen. If it's at the end of each battler's turn as it happens, then yes, everyone needs their own state. If it's okay for everyone to take the damage at the end of the caster's turn, that's much more straightforward.

Using Action Sequences you can make a skill inflict those states by using these notetags:
You can also do it without getting into Action Sequences if you find the rest of what they entail to be intimidating.

Using Yanfly's Skill Core,
Code:
<Post-Damage Eval>
user.addState(ID_1);

if (!target.isDead())
    target.addState(ID_2);
</Post-Damage Eval>

Or, if you want the damage to happen to every enemy at the end of that enemy's turn, you put the state on them all:
Code:
$gameTroop.aliveMembers().forEach(enemy => enemy.addState(ID_2));

To remove state 1 from the caster if the target is cured or dies you use these notetags on state 2:
It doesn't break anything, but you don't need both of these. Custom Remove will run when the state is removed for any reason, including dying from taking damage. The Custom Respond is unnecessary.

And just to put out the additional suggestion; if you want to do something like hitting some/all actors and some/all enemies and it's okay for that to be happening just at the end of the actor's turn, that's easily doable with less code and you don't need more than one state.

For example, from Yanfly's Buffs & States, this will damage everything on the screen at the end of the caster's turn (the one with the state on):
Code:
<Custom Regenerate Effect>
$gameParty.aliveMembers().forEach(actor => actor.gainHp(-30));
$gameTroop.aliveMembers()forEach(enemy => enemy.gainHp(-100));
</Custom Regenerate Effect>
Just to point it out, that's actually not necessary. You could inflict a state on both battlers using Skill Core notetags, and I don't see from the OP why the target needs a state at all. It's specified that the damage is done to every enemy.

I guess it depends on when the OP wants the damage to happen. If it's at the end of each battler's turn as it happens, then yes, everyone needs their own state. If it's okay for everyone to take the damage at the end of the caster's turn, that's much more straightforward.


You can also do it without getting into Action Sequences if you find the rest of what they entail to be intimidating.

Using Yanfly's Skill Core,
Code:
<Post-Damage Eval>
user.addState(ID_1);

if (!target.isDead())
    target.addState(ID_2);
</Post-Damage Eval>

Or, if you want the damage to happen to every enemy at the end of that enemy's turn, you put the state on them all:
Code:
$gameTroop.aliveMembers().forEach(enemy => enemy.addState(ID_2));


It doesn't break anything, but you don't need both of these. Custom Remove will run when the state is removed for any reason, including dying from taking damage. The Custom Respond is unnecessary.

And just to put out the additional suggestion; if you want to do something like hitting some/all actors and some/all enemies and it's okay for that to be happening just at the end of the actor's turn, that's easily doable with less code and you don't need more than one state.

For example, from Yanfly's Buffs & States, this will damage everything on the screen at the end of the caster's turn (the one with the state on):
Code:
<Custom Regenerate Effect>
$gameParty.aliveMembers().forEach(actor => actor.gainHp(-30));
$gameTroop.aliveMembers()forEach(enemy => enemy.gainHp(-100));
</Custom Regenerate Effect>
Ok, I'll look into this too! Thanks a lot! I'm still very new to RPG Maker. I have coding experience, but never with javascript (I'm a java guy...), so I'm still trying to figure all these things out. I'll lok into SkillCore and try your solution as soon as possible!
Just to point it out, that's actually not necessary. You could inflict a state on both battlers using Skill Core notetags, and I don't see from the OP why the target needs a state at all. It's specified that the damage is done to every enemy.

I guess it depends on when the OP wants the damage to happen. If it's at the end of each battler's turn as it happens, then yes, everyone needs their own state. If it's okay for everyone to take the damage at the end of the caster's turn, that's much more straightforward.


You can also do it without getting into Action Sequences if you find the rest of what they entail to be intimidating.

Using Yanfly's Skill Core,
Code:
<Post-Damage Eval>
user.addState(ID_1);

if (!target.isDead())
    target.addState(ID_2);
</Post-Damage Eval>

Or, if you want the damage to happen to every enemy at the end of that enemy's turn, you put the state on them all:
Code:
$gameTroop.aliveMembers().forEach(enemy => enemy.addState(ID_2));


It doesn't break anything, but you don't need both of these. Custom Remove will run when the state is removed for any reason, including dying from taking damage. The Custom Respond is unnecessary.

And just to put out the additional suggestion; if you want to do something like hitting some/all actors and some/all enemies and it's okay for that to be happening just at the end of the actor's turn, that's easily doable with less code and you don't need more than one state.

For example, from Yanfly's Buffs & States, this will damage everything on the screen at the end of the caster's turn (the one with the state on):
Code:
<Custom Regenerate Effect>
$gameParty.aliveMembers().forEach(actor => actor.gainHp(-30));
$gameTroop.aliveMembers()forEach(enemy => enemy.gainHp(-100));
</Custom Regenerate Effect>
<Custom Regenerate Effect> $gameParty.aliveMembers().forEach(actor => actor.gainHp(-30)); $gameTroop.aliveMembers()forEach(enemy => enemy.gainHp(-100)); </Custom Regenerate Effect>

This is almost exactly what I needed! Thanks again, it works now.
I also just realized I got your initial question wrong. I thought it's just one enemy that should be affected. Still ATT_Turans way seems way more elegant, so you are better probably better of doing that.
The Custom Respond is unnecessary.
You are sure about this? I remember it didn't work for me when I first created that skill. The state of the casting enemy always remained, when the actor the second state was inflicted on died until I added the Custom Respond.
You are sure about this? I remember it didn't work for me when I first created that skill.
I just checked and you're right. When a battler dies it doesn't remove their states, it just clears the array.

I'll have a fix for that in my snippets thread in a few minutes.

Original thread: https://forums.rpgmakerweb.com/threads/status-that-deals-constant-damage-to-enemies-and-to-yourself-rpgmmv.158634/