(Answered) Damage enemy and self?

Servidion

Last Soul Keeper
Veteran
Joined
Mar 15, 2015
Messages
233
Reaction score
27
First Language
English
Primarily Uses
RMMV
Alright. So. More questions. I keep finding formulas that don't seem to do as I would expect (I am beginning to assume many of these are from older RPG Makers).


Skill that does damage to the target and you take 1/4 of that damage:


r = a.atk * 2 - b.def; a.hp -= r / 4; r


That's the formula I found. The -= part doesn't make much sense to me, but I went with it anyway. lol


I modified it for my own purposes to:


r = (100+((a.level/4)*(a.atk/10)))*2.25; a.hp -= r / 4; r


But whichever formula I use it won't deal damage to the actor using it. Damages the target just fine.


*edit* Answer thanks to Ogouka:


a.gainHp(Math.floor(-0.25*(damage_formula))); damage_formula
 
Last edited by a moderator:

Ugouka

Veteran
Veteran
Joined
Mar 11, 2016
Messages
140
Reaction score
53
First Language
English
Primarily Uses
Poked around and found this that might work for you. Just so you know, there is a specific thread for damage formulae where you should probably be directing this particular type of question.


a.gainHp(Math.floor(-0.25*(damage_formula))); damage_formula
 
 
Last edited by a moderator:

Servidion

Last Soul Keeper
Veteran
Joined
Mar 15, 2015
Messages
233
Reaction score
27
First Language
English
Primarily Uses
RMMV
That worked perfectly. Also I did not know about that thread. I was just using the search option for whatever my question was. If I didn't see it within the first 2-3 pages of posts I would just make a post. lol


Thank you very much for the formula, as well as the knowledge of that thread. :)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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

Forum statistics

Threads
105,868
Messages
1,017,078
Members
137,580
Latest member
Snavi
Top