Passive ability to heal self for % when healing others?

Ohhh I see! That's okay though, because I don't think I want him gaining extra healing if he heals himself anyway. Only if he heals another target.
Yep. It isn't like I designed it that way though, it just happens to not heal for 120% on the caster. I don't have a working understanding of why. :kaomad3:

Edit: Something you could do in the future to ensure that it doesn't get cast on himself is to copy that heal and paste it to a new skill, then

Another Self Deprecating Edit: I honestly am surprised that someone hasn't come on this thread yet to explain to me in very simple terms why that doesn't work.
Yeah I'm looking at it and don't understand why either...that's odd. I'll have to implement it in my game and mess around with it after I get off work this evening.

I love this solution though - I was worried from the start I would have to make it a passive state but this is so much simpler!
I didn't test the scriptlets version on self-heal. Though if it IS doing that additional healing, it would be fairly simple to add in a condition where it doesn't do the self-heal if the target is the user.

So I think bhindi's version is easier and simpler to use, mine allows for more control without having to have duplicate skills. It only does the self-heal if the caster has the <healer> notetag, and the rate can be defined by setting a variable, so you can use whatever parameter you want.

Damage formulas shouldn't differentiate between a and b when the target is the user. Well, they will, but a references the caster, and b references the target, which in this case is also the caster, so ... same thing.
Awesome! It's working! Thanks so much!

One last question just for my own curiosity - would it be possible to get this formula working if Variance was involved? In my testing, it didn't seem to take it into account for the self-heal. I was just wondering if it's possible. Not a big deal if it can't,
It works fine with or without variance. I had it turned off while trying to figure out what the two different numbers that I was getting were. It was apparently the whole number and the decimal. I didn't have it turned off for any particular reason. To the best of my knowledge it would work just like any other heal skill, regardless of database parameters you set.

Edit: If you mean variance for the caster, I'm sure you could just add a random number generator in that formula, but I think the variance values only apply to the target.

Testing something currently, brb
Yeah I meant applying the variance to the caster. But I see what you're saying - the variance only applies to the target, and the formula doesn't actually look at that.
Ok. If you bake the variance into the equation, it works just fine.
Spoiler: This code (all on one line) will do it.
healformula=(200+a.mat); heal=(healformula*((Math.random() * .4 + .8))); a.gainHp(Math.floor(heal*.2)); Math.floor(heal);
All of this is assuming a 20% variance and a 20% heal going back to the caster.

The first part sets the formula you want to use for healing just like you normally would (assuming the default) which is 200+a.mat (200 points plus caster's magic attack rating). The second part attaches a 20% variance to it through a complicated method that I'll both quote and cite in a minute. The third and fourth parts apply the heal to the caster and the target respectively by applying heal*.2 to the caster and the full heal to the target.
Spoiler: Complicated way to generate a random number with java
I found the pertinent information here. Essentially java can generate a semi-random number between 0 and 1. You then need to take the result and apply it to your minimum value you wanted and the maximum as well. The formula for this is Math.random() * (max - min) + min; I decided not to put that whole section into the equation and did part of it myself. The max we want for a 20% variance is 1.2, the minimum is .8 . I did (1.2 - .8) and came up with 0.4 as the answer and plugged that into the equation as ((Math.random()*.4)+.8)
Edit: If you wanted a 30% variance for instance, your min would be .7 and your max would be 1.3, giving you the equation ((Math.random()*.6)+.7)

Lol, I'm learning HTML5 for a class atm, maybe I'll make a page later to auto-convert based on text entered into a page. Would probably be good to learn how.
This was perfect - exactly what I needed! Thank you so much for your work on this!
No problem. Both glad and surprised I could help.

Original thread: https://forums.rpgmakerweb.com/threads/passive-ability-to-heal-self-for-when-healing-others.85532/