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,372
Reaction score
15,183
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,372
Reaction score
15,183
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 Posts

Latest Profile Posts

Should've done this a few days ago but...
PRI_200136808.jpg
Rest in Peace, Sir Clive Sinclair
1940 - 2021
Entrepreneur, Technologist, Father of the British Computing Industry, and protagonist of Legend of ZUN.

Without you, England's games and tech industry wouldn't be where it is.
Woof, haven't touched any game-making elements in a couple of weeks I think.
Doing a thing in MV...

R3PuRjF.png
Don't you just hate it when you get a high level armor only for it to look like a metal plated bikini on your female character?? Seriously. How can that protect you??? Enemies can hit the squishy parts! :kaosigh:

Forum statistics

Threads
115,282
Messages
1,088,598
Members
149,898
Latest member
Tomeney1400
Top