Figuring damage formula or else with presents

● ARCHIVED · READ-ONLY
Started by JonathanTBE 4 posts View original ↗
  1. So i'm adding new class to my game which do all damages by presents But not of max hp but of current hp.

    For example if monster has max hp of 1000 but the player already caused some damage, now the monster has 500 hp, Then the new class uses skill which deals 50% damage of the current hp,

    Now the monster left with 250 hp.

    Same on hp recovery, for example, The player max hp is 700 but he left with 500, Now the new class uses skill which recovers 25% of the current hp so the recovery effect stands on 125

    How do i pull this off? It seems kinda easy i'm just not advance enough in damage formula feature
  2. Hey Jonathan

    All you need to do is write the damage formula using their HP values in the equation.

    a.hp = the user's hp

    b.hp = the targets hp.

    So an hp damage formula like b.hp/2 will reduce the target's hp by half.

    If you set the skill to restore hp with an equation (a.hp *0.25).to_i this will heal 25% the .to_i rounds it to the nearest whole number.

    This topic has some great info about damage formulas. There is alot you can do with them:

    http://cobbtocs.co.uk/wp/?p=271

    ~ Dinhbat
  3. dinhbat3 It helps a lot. I find the link rather helpful as well, thank you :D
  4. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.