HP-to-6 problem

● ARCHIVED · READ-ONLY
Started by The MM 5 posts View original ↗
  1. So, I have nearly finished a tiny game, but one skill poses problems.


    The skill is named HEX, and it is meant to set the target's HP to 6.


    I've tried a bunch of ways, but I always hit a few walls when trying to make it work.


    - Another of the skills in the game, Nova Barrier, causes its user to take 1% of all magic damage. Since HEX is a magic attack, I ended up in situation where it would do nothing.


    - You could just guard it, causing the skill to only deal "around" 50% of the character's current HP. And unlike Nova Barrier, Guarding is available to everyone.


    I've tried a bunch of ways to make it work, but using a formula with "b.hp = 6; [...]" requires me to give damage to the skill that would kill the purpose of bring the target's HP to 6.


    Is there a way to do the skill that would bring the target's HP where I want it while displaying the popup and ignoring magic damage rate as well as guarding..?


    Thanks in advance for your answers.
  2. Try this:


    Damage formula:


    b.hp - 6


    That should make it so that you always have 6 HP when finished, as the damage it will do is your current HP minus 6.


    Edit: Though, a warning, this might heal the person if they have less than 6 HP. May need a tweak to avoid that, unless that is your intended behavior.
  3. temp = b.mhp - b.hp - 6; temp


    any variable defined in the damage formula is automatically scrapped after the eval, that is why you can use any name to calculate the number you need for the damage


    EDIT: for the other effects you have to use the damage rate of the enemy in the damage calculation - I don't have time to get everything into the formula, but it uses the same principle and revers-calculates the needed damage to get to 6 after damage rates and whatever else
  4. bgillisp said:
    Try this:


    Damage formula: b.hp - 6


    That should make it so that you always have 6 HP when finished, as the damage it will do is your current HP minus 6.


    Edit: Though, a warning, this might heal the person if they have less than 6 HP. May need a tweak to avoid that, unless that is your intended behavior.

    I tried, but Nova Barrier affects the magic attacks and nearly-nulls the damage. (Fixed: made it a certain hit skill)

    Andar said:
    temp = b.mhp - b.hp - 6; temp


    any variable defined in the damage formula is automatically scrapped after the eval, that is why you can use any name to calculate the number you need for the damage


    EDIT: for the other effects you have to use the damage rate of the enemy in the damage calculation - I don't have time to get everything into the formula, but it uses the same principle and reverse-calculates the needed damage to get to 6 after damage rates and whatever else

    Yeah, but I don't know the damage for guarding. Is it the same as VX Ace's [damage / 2*grd] formula..?
  5. I seem to have made it work outside of using YEP's SkillCore eval codes.


    Here's the formula:

    Code:
    (b.hp-6) / (b.mdr*100) * (b.isGuard() ? 200*b.grd : 1)