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,223
Reaction score
1,630
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,223
Reaction score
1,630
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

While we prepare the official trailer, enjoy this kind-of-second teaser! ^^
-Ele
New Episodes of RPG Shenanigans Uploaded to Youtube!

Episode 5 - Surprise Party!
Youtube Link:
Episode 6 - Killer Gin
Youtube Link:
Episode 7 - Gaia's Melody: Echoed Melodies
(Coming soon!)

Episode 8 - Clarent Saga: Tactics
(Coming soon!)

Episode 9 - Star Shift
(Coming soon!)
When the Map Generator throws in the assets in the most dumbest way possible - your path is blocked :D

I went to sleep at 3 am because of my anxiety. Set up my alarm for 7 am so that I could have sasagues for breakfast and do morning routine before lessons starts at 8 am. I knew I wouldn't be able to sleep even after my lessons finished because I have to visit my grandparents today I was sad bc I was really tired. Thats when I realised. My lesson starts at 9 am. I could get one extra hour of sleep if I didnt forget it

Forum statistics

Threads
107,565
Messages
1,030,598
Members
139,671
Latest member
WDRS
Top