RMMV Stacking Lifesteal with Yanfly?

MiddleMang

Villager
Member
Joined
Jan 24, 2019
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm looking for help on how to make a state that utilizes counters for each hit on a target, then uses those to stack up lifesteal, up to a limit of 20, worth 5% each. I think this would be easier if I knew how to (call?) lifesteal like other values but right now I have this complicated mixture that doesn't work from other skills I wrote and found.


TLDR; Hit enemy, get 5% lifesteal per hit.

I'm not sure if user.LifeStealRate works at all.
I thought it'd start sort of like this (this clearly doesn't work but the idea is there) :

Code:
<Custom Confirm Effect>
// Check if the damage dealt deals physical HP damage.
if (value > 0 && this.isHpEffect()) {
  user._stackinglife = user._stackinglife || 0;
  // Get the current number of stacks. Min 0, Max 20.
  var stacks = user._stackinglife.clamp(0, 20);
  // Increase stack count.
  stacks += 1;
  // Set stack count min to 0, max to 20.
  stacks = stacks.clamp(0, 20);
  user.setStateCounter(stateId, 'x' + stacks);
  user._stackinglife = stacks;
var bonus = (stacks * 0.05)
dmg = Math.ceil(value * bonus);
user.gainHp(dmg);
user.startDamagePopup();
user.clearResult();
}
</Custom Confirm Effect>


<Custom Remove Effect>
// Reset the stack count.
user._stackinglife = 0;
</Custom Remove Effect>
 

Latest Threads

Latest Posts

Latest Profile Posts

I haven't make anything new yet, but I'm back addicted to writing some MZ plugins. Man, I wish I have more free time like I did 5 years ago.
Holy cow... work is demanding and I'm back in college. I'm kind of scared of my dad right now after the incident, but at least I don't live with him all the time. Anyway, working on Fandom Scouts and my FNAF character set. The FNAF sprites are actually going to be used in the game... unfortunately the enemy sprites are FNAF World traces, so no sharing those.
The honeymoon period is over with Cyberpunk 2077, It sadly doesnt live up to the hype, pretty graphics arent everything (especially when I cant even do something as simple as changing the radio station over!). Replaying Breath of the wild has reminded me what a good game really looks like, plus that one has good glitches!....

Forum statistics

Threads
107,687
Messages
1,031,438
Members
139,804
Latest member
PeJoTa
Top