doodLeZ_UFoD

Warper
Member
Joined
Jul 27, 2021
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hi there! Doing some small JRPG with standard assests (my first trying in doing something small but full, lol) and I really want to utilize one battle mechanic, heavily inspired by one Touhou Project fan-game: Labyrinth of Touhou 2, where one the bosses, Shredding Amnisieri, had a particular mechanic in a skill called "Scythe of Calamity", which dealt damage, but reduced the amount of targets' Max HP by the damage dealt. Of course, Max HP would be reduced until the end of the battle, afterwards reverting back to normal.
I really want to replicate it, but simply don't know how, because I have absolutely zero skills in JavaScript, but I do have YanFly's plugins. Can someone help me out, please?
An example video for understanding:
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,435
Reaction score
15,227
First Language
English
Primarily Uses
RMMV
Just have the skill apply a state that alters the Max HP rate, and is set to remove at end of battle.

No plugin needed.
 

doodLeZ_UFoD

Warper
Member
Joined
Jul 27, 2021
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Just have the skill apply a state that alters the Max HP rate, and is set to remove at end of battle.

No plugin needed.
I just don't really understand how to set the amount of HP reduced equal to damage dealt, and that the effect of reducing stacks, that's my biggest problem
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,435
Reaction score
15,227
First Language
English
Primarily Uses
RMMV
Ah, yes, the trait uses a %.

I've moved this thread to Plugin Support. Thank you.

 

micoomer

Villager
Member
Joined
Apr 24, 2019
Messages
24
Reaction score
9
First Language
Indonesia
Primarily Uses
RMMV
I got solution for you, though you need most of the Yanfly battle plugin to work:

YEP_BuffStatesCore

Yanfly_BaseParamControl

1. Create 2 states, one for the damage dealer, one for the receiver. For the first state, just leave it blank. For the second one, make sure to tick [Remove at Battle End].
2. At the start of the battle, apply the first state to the dealer and second state for the whole party.
3. Put this into the second state notetag :

<Custom Apply Effect>
target._originalHP = target.mhp;
target._destroyedHP = target._destroyedHP || 0;
</Custom Apply Effect>

<Custom Victory Effect>
target.addMaxHp(target._destroyedHP);
target._originalHP = undefined;
target._destroyedHP = undefined;
</Custom Victory Effect>

<Custom Escape Effect>
target.addMaxHp(target._destroyedHP);
target._originalHP = undefined;
target._destroyedHP = undefined;
</Custom Escape Effect>

<Custom Defeat Effect>
target.addMaxHp(target._destroyedHP);
target._originalHP = undefined;
target._destroyedHP = undefined;
</Custom Defeat Effect>

<Custom Respond Effect>
if (value > 0 && this.isHpEffect() && attacker.isStateAffected(id)) { //change ID to dmg dealer state

var scale = 0.35; //Destroy Max HP by this percentage of damage dealt
var hardcap = 0.35; //Maximum HP allowed to be destroyed

var allowed = target._originalHP - Math.ceil(target._originalHP * hardcap);
var destroyamount = Math.ceil(value * scale);
var accumulative = target._destroyedHP + destroyamount;
if (accumulative > allowed) {var destroyamount = (allowed - target._destroyedHP)};
target._destroyedHP += destroyamount;
target.minusMaxHp(destroyamount);
}
</Custom Respond Effect>

4. Change the number inside notetag to your need.

This will make the dealer destroy his target Max HP, as long as he has the first state applied.
If you want only the certain attack which reduce Max HP, make sure to ONLY apply the first state when using said attack, then remove it afterward.
 
Last edited:

doodLeZ_UFoD

Warper
Member
Joined
Jul 27, 2021
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
I got solution for you, though you need most of the Yanfly battle plugin to work:

YEP_BuffStatesCore

Yanfly_BaseParamControl

1. Create 2 states, one for the damage dealer, one for the receiver. For the first state, just leave it blank. For the second one, make sure to tick [Remove at Battle End].
2. At the start of the battle, apply the first state to the dealer and second state for the whole party.
3. Put this into the second state notetag :

<Custom Apply Effect>
target._originalHP = target.mhp;
target._destroyedHP = target._destroyedHP || 0;
</Custom Apply Effect>

<Custom Remove Effect>
target.addMaxHp(target._destroyedHP);
target._originalHP = undefined;
target._destroyedHP = undefined;
</Custom Remove Effect>

<Custom Respond Effect>
if (value > 0 && this.isHpEffect() && origin.isStateAffected(ID)) { //change ID to dmg dealer state ID

var scale = 0.35; //Destroy Max HP by this percentage of damage dealt
var hardcap = 0.35; //Maximum percentage of HP allowed to be destroyed

var allowed = target._originalHP - Math.ceil(target._originalHP * hardcap);
var destroyamount = Math.ceil(value * scale);
var accumulative = target._destroyedHP + destroyamount;
if (accumulative > allowed) {var destroyamount = (allowed - target._destroyedHP)};
target._destroyedHP += destroyamount;
target.minusMaxHp(destroyamount);
}
</Custom Respond Effect>

4. Change the number inside notetag to your need.

This will make the dealer destroy his target Max HP, as long as he has the first state applied.
If you want only the certain attack which reduce Max HP, make sure to ONLY apply the first state when using said attack, then remove it afterward.
Okay, thank you for your help, but there's something I clealry don't understand, because I couldn't get it to work. How did you make it to work yourself?
 

micoomer

Villager
Member
Joined
Apr 24, 2019
Messages
24
Reaction score
9
First Language
Indonesia
Primarily Uses
RMMV
Try changing the notetag a bit on first line of <Custom Respond Effect> to:
if (value > 0 && this.isHpEffect() && attacker.isStateAffected(id)) { //change ID to dmg dealer state
Also, if you fail to recover the destroyed HP when the battle end, try to put this notetag into the same state:
<Custom Victory Effect>
target.addMaxHp(target._destroyedHP);
target._originalHP = undefined;
target._destroyedHP = undefined;
</Custom Victory Effect>

<Custom Escape Effect>
target.addMaxHp(target._destroyedHP);
target._originalHP = undefined;
target._destroyedHP = undefined;
</Custom Escape Effect>

<Custom Defeat Effect>
target.addMaxHp(target._destroyedHP);
target._originalHP = undefined;
target._destroyedHP = undefined;
</Custom Defeat Effect>
 

doodLeZ_UFoD

Warper
Member
Joined
Jul 27, 2021
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Try changing the notetag a bit on first line of <Custom Respond Effect> to:
if (value > 0 && this.isHpEffect() && attacker.isStateAffected(id)) { //change ID to dmg dealer state
Also, if you fail to recover the destroyed HP when the battle end, try to put this notetag into the same state:
<Custom Victory Effect>
target.addMaxHp(target._destroyedHP);
target._originalHP = undefined;
target._destroyedHP = undefined;
</Custom Victory Effect>

<Custom Escape Effect>
target.addMaxHp(target._destroyedHP);
target._originalHP = undefined;
target._destroyedHP = undefined;
</Custom Escape Effect>

<Custom Defeat Effect>
target.addMaxHp(target._destroyedHP);
target._originalHP = undefined;
target._destroyedHP = undefined;
</Custom Defeat Effect>
No, sorry, still ain't working :(
 

micoomer

Villager
Member
Joined
Apr 24, 2019
Messages
24
Reaction score
9
First Language
Indonesia
Primarily Uses
RMMV
Hmm weird, it worked on me just fine. I can't really check your issues on my end. If you're willing to send me a copy of your project via pm, I would gladly check on it.
 

Latest Threads

Latest Profile Posts

Oh boi!! Nikki angst!!

Not sure what to call the shrooms, but they eat you up inside for a week, and then they leave you with suicidal thoughts or something. I'm not sure yet.
Turns out our homegirl got an accidental whiff of em. :kaosigh:
Just released a new trailer for Manafinder! It's the TGS trailer! :D I'm very happy with the result!
sooo... im gonna go ahead and release all my game ideas on android as Beta. Everyone will be nice right? cause its Beta... right?...

AABS traps and heals (detail is below the YTB desc)
 I may actually have something I can put into the Boss Battle Build Bout by the time it’s due. It won’t be anything spectacular (or even great (and maybe not even good (I have no idea how to do combat (yay for nested parentheses)))), but I might have a submission none the less.

Forum statistics

Threads
115,411
Messages
1,089,658
Members
150,150
Latest member
Moss-eater
Top