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,226
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,226
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

Making Houses and Outside on the same map with RPG Maker MV!
Do people actually use buff/debuff function?
Ami


Imagine you (as Miner) Sleep in the Cave,the other side is a Bunch of Golds,how d'you feel?
finally got footage of my main character running around his corrupted street...
I finally got the ships and water to flow like I wanted to~ the canals are a success. Now to loop the animation for the kites. So many kites.

Forum statistics

Threads
107,702
Messages
1,031,532
Members
139,835
Latest member
dangkykubetim
Top