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,415
Reaction score
15,214
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,415
Reaction score
15,214
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

Working on a characteeer! (Why is it so hard to color hair?) ;-;
Silly-Sketches.png
Just finished eventing a couple simple puzzles in RMMV, for my very first game "Sample Quest." Just messing around, throwing things together, and calling it a story XD On a non-RM note, got my hair cut today!
I feel the need to inform everyone on the forums NOT to go with Web Hosting Canada for your hosting needs. It is by far the worst customer service and just overall experience I have ever had with hosting and I am Canadian...
BCj
Got another eye surgery monday. Hope I'll recover quick and all's well. A bit tired of surgeries. On a happy note, working on the next chapter of Escalia so hope I can continue soon :)
Celebrating the arrival of autumn in the Northern Hemisphere :)

Forum statistics

Threads
115,368
Messages
1,089,316
Members
150,057
Latest member
kotfwing
Top