Condition if the target isn't the user?

crustyclarinet

Villager
Member
Joined
May 8, 2017
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm trying to create a skill that heals an ally and also heals the user by a portion of that amount, similarly to the Clemency skill from FFXIV. Using yanfly's skill core lunatic mode, I've used this to achieve this effect:

<Post-Damage Eval>
user.gainHp(Math.floor(-value * 0.5));
</Post-Damage Eval>

However, I'm not quite sure how to make it so that this effect doesn't proc when the selected target is the user itself. I've tried setting the condition "if (!target.isUser()) {", but that didn't work for me.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
Don't even bother with a Plugin, this is best done with damage formula coding.
Basically, set the skill to a single ally with the heal effect, but then add a command before the damage formula to heal a (the user).
I don't know the JavaScript Syntax and don't have real computer access at the moment, but there is a pinned topic about using damage formula code in the MV area.
 

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
146
First Language
English
Primarily Uses
RMMV
Try using the condition "if (user !== target) {"
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top