Absorb Ally HP Skill

Status
Not open for further replies.

Sophitia

Veteran
Veteran
Joined
Feb 13, 2014
Messages
38
Reaction score
9
First Language
English
Primarily Uses
I'm looking to make a skill in which an actor absorbs HP from an ally, replenishing his own. I also would like it if the skill could stop short of killing the target (leaving 1 HP). The problem is, I can't seem to get it working. The ally is damaged, but no HP is being absorbed.

I've set the skill up so that it's a HP Drain type with Absorb element. The scope is One Ally, usable Only in Battle.

The formula is as follows.

if b.hp >= a.hp; a.mhp - a.hp else; a.mhp - a.hp + 1; end;
Hopefully someone can set me on the right track with this. Thanks in advance! ;)
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Hmmm... maybe because of the weird restrictions of the damages (like an HP damage skill cannot be used on an ally from my experience)... try doing the drain inside the formula too

so like:

Code:
if b.hp >= a.hp; x=a.mhp - a.hp;else; x=a.mhp - a.hp + 1;end;a.hp+=x;x
PS: it's full heal to the caster btw, since ur healing him based on the difference between his max and current hp
 
Last edited by a moderator:

Sophitia

Veteran
Veteran
Joined
Feb 13, 2014
Messages
38
Reaction score
9
First Language
English
Primarily Uses
Hmmm... maybe because of the weird restrictions of the damages (like an HP damage skill cannot be used on an ally from my experience)... try doing the drain inside the formula too

so like:

if b.hp >= a.hp; x=a.mhp - a.hp;else; x=a.mhp - a.hp + 1;end;a.hp+=x;xPS: it's full heal to the caster btw, since ur healing him based on the difference between his max and current hp
Yeah, I know. It's really an all-or-nothing kind of skill, for situations where you need to keep that one person alive (perhaps only their skills can bring down a boss or something).

Thank you for the help! The skill works now, although it does kill the ally should the HP damage be too great. But I guess I can live with that/try and tinker with it.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Code:
x=a.mhp - a.hp; if b.hp <= x ;x=b.hp-1;end;a.hp+=x;x
this way, if b will die, it will only deal damage equal to his hp minus 1 so that he will still have 1 hp left
 
Last edited by a moderator:

LawrenceindaSky

Veteran
Veteran
Joined
Apr 21, 2016
Messages
64
Reaction score
4
First Language
English
Primarily Uses
N/A
Code:
x=a.mhp - a.hp; if b.hp <= x ;x=b.hp-1;end;a.hp+=x;x
this way, if b will die, it will only deal damage equal to his hp minus 1 so that he will still have 1 hp left
I just happen to pass by a topic of what I needed, I am new to doing formulas so im a little lost on what I should input for X on this formula, Im trying to have variance from 100 by doing 100=a.mhp - a.hp; if b.hp <= 1 ;100=b.hp-1;end;a.hp+=100;100 but I guess I just don't fully understand yet, if you can help me out with this, many thanks!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,224
First Language
Dutch
Primarily Uses
RMXP

LawrenceindaSky, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


Please make a new topic with your question.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

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'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top