Yanfly Life Steal

Hello, so I was actually waiting for a response of Yanflñy, but it seems they have decided that I should ak in here so, this is the Plug-In.


Yanfly Life Steal


This plugin has the next parametres to set on it.


Prueba.png


Which are supposed to enable a character to gain more HP than the damage dealt and recieve HP damage in certain cirtumstances instead of draining it.


I made this simple code


<Custom HP Life Steal Rate>
if (target.isStateAffected(4))
rate = 1.5;
else
rate = 0.5;
</Custom HP Life Steal Rate>


It does not pops up the cnsole, which with Yanfly newest update could mean that there is something wrong in the code, but like I said it doesn't seems to be the case


This code sorta works, the user always drains 50% of damage dealt, but when the enemy is affected by state 4 the user only drains the 100% amount of damage dealt and not the 150% of damage dealt, according to Yanfly help notes the rate should be in percentile which I belive I'm doin correctly(if not the 0.5 rate would not work)


I decide to test the skill with this code that again come in the plugin itself. Obviously I test each code individually just in case anyone was wondering.


<HP Life Steal: 50%>

<HP Life Steal: 150%>

<HP Life Steal: -50%>


The first one work perfectly, the second one only drains the damage dealt and not the 50% more, and the last one deals damage but the user doesn't recive any damage.


I asked Yanfly if their plugin actually allows the overheal and negative healing but they have not answer me yet, and as i don't have enough Javascript knowledge to actually know what to look for in the code I decide to post it here.


So in the end after all this I have two questions.


1.- Am I the one doing something wrong? If so, how do I correct it.?


2.-Is it soemthing to do witht he plug-in itself? If so what should I do to get the desired effect.


And that should be all, thnak you so muhc for your time.
I would just scrap this gimmick plugin and instead just use skill core to make your life gains when dealing damage.


<After Eval>


if (target.isStateAffected(4)) {


user.gainHp(Math.floor(value * 1.5)) 


else {


user.gainHp(Math.floor(value * 0.5)) 


}


}


</After Eval>
I see so instead of using the plugin I should use an after eval code...


Does this means th eplugin doens't actually work in the way I was wanting it to work?


what a dissapointment tough...


Have to alter the code btw as you add some extra brakets in there, but aside from that it works, so.


Thank you.


Can i ask another thing.


How should i do this.


<Pre-Damage Eval>
if (target.isActor) {
value * 0.25
} else {
value
}
</Pre-Damage Eval>




The skill can target allies and foes,but if the target is anally I want it to do less damage. I'm using the above code but the damage is ot affected at all, ow should I edit it?
To change the damage you have to switch to damage formula which completely replace your current formula at the top.


<Damage Formula>


if (target.isActor) {


value = X }


if (target.isEnemy) {


value = X }


</Damage Formula>
@lolshtar Thank you so much for this, this answers all my questions regarding this seemingly useless plug-in...


So how can I ask for this to be closed?
@emelian65 You did the right thing in reporting your post and asking for it to be closed.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-life-steal.72488/