Lifesteal

lithkast

Quirky mini boss
Veteran
Joined
May 12, 2014
Messages
105
Reaction score
49
First Language
english
Primarily Uses
Simple question.  Is there a way to make attacks lifesteal in MV. 



Ex: Blood sword.  Its a weapon that will drain life from whatever it damages.  Preferably at a rate of 15-30% of the damage dealt.  So if 100 damage is dealt, you get 30 hp back. 

 

I just want to know if there is a way in the base game to do that, or do I need to write a script for it.  Thanks in advance! ​
 

OtakuD50

Villager
Member
Joined
Jan 5, 2014
Messages
26
Reaction score
19
First Language
English
Primarily Uses
The closest thing I've found is in the Kadokawa plugins, there's a plugin called WeaponSkill.  What this does is allow you to add a tag for a weapon to make it perform a Skill when you use it to attack (default is the "Attack" skill, which should be your reserved #1 skill).  You can make a Skill that uses the HP Drain damage type and have the weapon use that skill for its attack.  However, as far as I can tell, you'll always absorb exactly the amount of damage you deal.
 

SgtBusCake

Villager
Member
Joined
Oct 27, 2015
Messages
15
Reaction score
10
First Language
English
Primarily Uses
Other
Hello Lithkast,

Posting this here in case of future searches for things like HP Steal, Blood Drinker, Life Steal and Health Steal. Disclaimer: Still learning myself and may end up being a reference for myself if I put the tool down for a month for some reason.

If you're using the HP Damage formula, you may be able to break down your equation in three pieces. The formula box likes to calculate statuses and recovering first, then damage last. In this case, we calculate the damage first to determine how much damage you could have dealt and store it, then apply the lifesteal's recovery effect (and make sure it does not return a decimal), then place the damage you stored at the end.

For example, if you would like Blood Sword to life steal 15% of the damage you deal, then the following should work in MV (give or take how much Variance you have):

c = a.atk * 4 - b.def * 2; a.gainHp(Math.round(c * 0.15)); cSimilarly, if you want a life steal of 30% of damage dealt:

c = a.atk * 4 - b.def * 2; a.gainHp(Math.round(c * 0.30)); cHope that helps some.
 

highlord90

Aspiring Creator
Veteran
Joined
Jun 30, 2014
Messages
32
Reaction score
12
First Language
English
Primarily Uses
oh my god I am so darn stupid, I spent ages thinking I would have to script in a Leech Life effect when it was under my nose the entire time. I'm sorry this isn't what was asked for but thanks you OtakuD50, I made a rookie mistake
 

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

Latest Threads

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,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top