Create DOT state that increase DOT/stat over turn

tyranzero

Villager
Member
Joined
Jun 17, 2020
Messages
16
Reaction score
2
First Language
english
Primarily Uses
RMMV
might be confused with the title, but here.

I want to make negative state increase damage if didn't immediately take care of it.

for example, Poison= Base: 2% b.mhp
if the poison didn't get treated immediately, it will increase by 1% every turn.
so, 1st = 2%, 2nd = 3%, 3rd = 4%, and onward.

also apply to parameter, like rage state continue to increase dmg but decrease defense for each turn pass

is there any plugin or code to do it?
 

KenSoulslayer

Graphic Designer/JS Dev
Member
Joined
Nov 29, 2020
Messages
26
Reaction score
10
First Language
Hindi
Primarily Uses
RMMZ
I am not sure but you should be able to hack at it by using common events
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,227
Reaction score
1,634
First Language
EN
Primarily Uses
RMMZ
I think you could do this with Yanfly's Buffs & States Core plugin:
With that, you could try copy+pasting this into the state's notebox:
JavaScript:
<Custom Apply Effect>
// Initialise counter
user._poisonMult = 2;
// Display counter on state icon (optional)
user.setStateCounter(stateId, '' + user._poisonMult + '%');
</Custom Apply Effect>

<Custom Regenerate Effect>
// Calculate damage
var dmg = user._poisonMult * user.mhp / 100;
// Apply damage
user.gainHp(-Math.round(dmg));
// +1 to counter
user._poisonMult += 1;
// Update displayed counter (optional)
user.setStateCounter(stateId, '' + user._poisonMult + '%');
</Custom Regenerate Effect>
These notetags will (in theory) handle all the state's damage, so you don't need any -HP regen traits on the state. Also make sure to save your project after making changes in the Plugin Manager, otherwise those changes will not be seen during play.

[Edit: replaced var dmg = user.hpRate() * user._poisonMult; with correct line. :kaoswt:]
 
Last edited:

tyranzero

Villager
Member
Joined
Jun 17, 2020
Messages
16
Reaction score
2
First Language
english
Primarily Uses
RMMV
I think you could do this with Yanfly's Buffs & States Core plugin:
With that, you could try copy+pasting this into the state's notebox:
JavaScript:
<Custom Apply Effect>
// Initialise counter
user._poisonMult = 2;
// Display counter on state icon (optional)
user.setStateCounter(stateId, '' + user._poisonMult + '%');
</Custom Apply Effect>

<Custom Regenerate Effect>
// Calculate damage
var dmg = user.hpRate() * user._poisonMult;
// Apply damage
user.gainHp(-Math.round(dmg));
// +1 to counter
user._poisonMult += 1;
// Update displayed counter (optional)
user.setStateCounter(stateId, '' + user._poisonMult + '%');
</Custom Regenerate Effect>
These notetags will (in theory) handle all the state's damage, so you don't need any -HP regen traits on the state. Also make sure to save your project after making changes in the Plugin Manager, otherwise those changes will not be seen during play.

handle all state dmg. if want to change the var hp dmg, change {user._poisonMult = X;} / {user._poisonMult += X;}? while X as the var number?

add: the increase dmg work, but the exact dmg deal are not right. 2000 hp, 2% = 2
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,227
Reaction score
1,634
First Language
EN
Primarily Uses
RMMZ
handle all state dmg. if want to change the var hp dmg, change {user._poisonMult = X;} / {user._poisonMult += X;}? while X as the var number?
:kaoswt: I'm not sure what you're asking, so here's some more detailed explanations:
  • var dmg = stuff;
    "Make a temporary variable called dmg and set it equal to stuff."

  • user._poisonMult = 2;
    "Define a variable called _poisonMult for the state bearer and set it equal to 2."

  • user._poisonMult += 1;
    "Add 1 to the bearer's _poisonMult value."
add: the increase dmg work, but the exact dmg deal are not right. 2000 hp, 2% = 2
:kaoswt2: Oops, yes, I multiplied it by the wrong thing, sorry! Try this line instead:
JavaScript:
var dmg = user._poisonMult * user.mhp / 100;
I'll edit this into my previous post~
 

tyranzero

Villager
Member
Joined
Jun 17, 2020
Messages
16
Reaction score
2
First Language
english
Primarily Uses
RMMV
:kaoswt: I'm not sure what you're asking, so here's some more detailed explanations:
  • var dmg = stuff;
    "Make a temporary variable called dmg and set it equal to stuff."

  • user._poisonMult = 2;
    "Define a variable called _poisonMult for the state bearer and set it equal to 2."

  • user._poisonMult += 1;
    "Add 1 to the bearer's _poisonMult value."

:kaoswt2: Oops, yes, I multiplied it by the wrong thing, sorry! Try this line instead:
JavaScript:
var dmg = user._poisonMult * user.mhp / 100;
I'll edit this into my previous post~

the explanation is enough for me to get it. and the damage is working now.
thank you for helping again.
 

Latest Threads

Latest Posts

Latest Profile Posts


I ended up needing to do a chapter one world map remake. It's still WIP but coming along nicely. =D
Stream will be live shortly! I will be beginning a play-through of Resident Evil 4! Feel free to drop by!

1st iteration on castle interior in Tiled.
I've started up Pillars of Eternity. It's interesting how the game does a "select choice" cutscene using still image art for dramatic flair. I wonder if that might work for my RPGMaker project.
The self-righteous indignation of family when you expect them to pay back money you've leant to them never ceases to amaze me.

Forum statistics

Threads
107,748
Messages
1,031,860
Members
139,889
Latest member
MapleFoxEdit
Top