RMMV Damage Formula - ideas and help

Discussion in 'RPG Maker MV' started by Shaz, Oct 25, 2015.

  1. PlatypusOfDoom

    PlatypusOfDoom Villager Member

    Messages:
    24
    Likes Received:
    5
    You could add in something like atk * (1 - (a.hp/a.mhp)) to get that effect. It deals damage based on a percentage of their current health over their max health. Alternatively, if you wanted to do something like deal 2 damage per each HP lost, you would do 2 * (a.mhp - a.hp). 

    I've been trying to figure out the command for doing this, as well. My only difference is that I would want it to heal the entire party instead of every OTHER member, but I figure the way to do it would be similar. Any ideas?
     
  2. dayhjawk

    dayhjawk Veteran Veteran

    Messages:
    107
    Likes Received:
    12
    First Language:
    English
    So I would do something like this for the formula?

    a.atk * (1 - (a.hp/a.mhp)) - b.def * 2
     
  3. VHStapes

    VHStapes Game Designer Veteran

    Messages:
    57
    Likes Received:
    7
    Location:
    Vashon, Wa
    First Language:
    English
    If I'm right, I think it would need a for loop to target all the actors. I just don't know what the code would be exactly.

    Something like

    for(var i = 0; i < $gameParty.members.length(); i++) { $gameParty.members(i).hp + x; $gameParty.members(i).removeBuff };You might want to replace:

    $gameParty.member(i)withBattleManager.actor(i)Of course you'd need some code in there for the actual damage and healing calculations.

    Also, I wouldn't expect to plug this in and have it work as I am a Javascript n00b, but I'm sure someone can clean it up from here.

    (So many edits, I shall not double post!)
     
    Last edited by a moderator: Nov 6, 2015
  4. Heathurr

    Heathurr Veteran Veteran

    Messages:
    38
    Likes Received:
    2
    First Language:
    English
    I might have missed it, but is there a way to make sure attacks do at least 1 point of damage? Having NULL pop up when the party outlevels enemies is kinda sloppy looking. :c

    edit: Nevermind! I got it!
     
    Last edited by a moderator: Nov 6, 2015
  5. VHStapes

    VHStapes Game Designer Veteran

    Messages:
    57
    Likes Received:
    7
    Location:
    Vashon, Wa
    First Language:
    English
    I'm trying to make a skill that adds to the actor's atk value based on your party's gold, then removes gold equal to the amount it added. So far I've got it adding damage correctly, but it doesn't remove the gold. In fact, when I include any attempt at removing gold, it deals exactly 0 damage every time. Any ideas?

    Code:
    x = a.atk + ($gameParty.gold() / 100); x - b.def; x; $gameParty.gainGold(-x)
     
    Last edited by a moderator: Nov 6, 2015
  6. Musashi

    Musashi Veteran Veteran

    Messages:
    134
    Likes Received:
    200
    First Language:
    Portuguese
    @VHStapes, damage must be the last thing in the formula
     
  7. Silenity

    Silenity Veteran Veteran

    Messages:
    647
    Likes Received:
    239
    Location:
    Oregon
    First Language:
    English
    Primarily Uses:
    RMMV
    How do I make a damage formula that scales off of the enemies missing health?

    I'm trying to copy Riven's Wind Slash skill from League of Legends.

    [​IMG]
     
  8. VHStapes

    VHStapes Game Designer Veteran

    Messages:
    57
    Likes Received:
    7
    Location:
    Vashon, Wa
    First Language:
    English
    Wow I swear I tried it that way, but that fixed it! Thanks
     
  9. RogdagoR

    RogdagoR Veteran Veteran

    Messages:
    127
    Likes Received:
    29
    Location:
    Venice
    First Language:
    Italian
     
    I was wondering if there is a command for "call" one other skill, i mean i cast my aoe, it resolve the damage and then call the aoe heal spell, is it doable?
     
    Last edited by a moderator: Nov 6, 2015
  10. Nuhada

    Nuhada Villager Member

    Messages:
    27
    Likes Received:
    14
    First Language:
    French
    If you want to make exactly this skill (exept for the level of the skill), it should look at something like this:

    y=(1-Math.max((b.hp/b.mhp),0.25));r=120+(a.atk*0.6);r=Math.round(r*(2.67*y+1));rWith the y as the % of target's missing health with a cap for the 75%, first part r as the minimum physical damages increased by the atk of the user (or the AD in lol), and second part r as the multiplication of the target's missing health percentage.
     
    SgtBusCake and Silenity like this.
  11. Silenity

    Silenity Veteran Veteran

    Messages:
    647
    Likes Received:
    239
    Location:
    Oregon
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks! Do you think you could help me with another one?

    I'm trying to recreate Garen's Decisive Strike from League of Legends. I find that LoL has a lot of interesting skills that I can pull ideas from. >_<

    I'm trying to have the skill remove negative states from Garen while also adding a speed buff to him. On top of that I'm trying to make the skill add a silence state to the enemy.

    a.add_state(13); 30 + a.atk + (a.atk * .4)
    This is what I currently have but it seems to do no damage. I can inflict the silence fine but need help with removing negative states as well as adding the speed state.

    [​IMG]
     
  12. luigiman2201

    luigiman2201 Villager Member

    Messages:
    16
    Likes Received:
    2
    First Language:
    English
    Use a.addState
     
  13. lexisgemini

    lexisgemini Warper Member

    Messages:
    3
    Likes Received:
    1
    If i was to use this formula when creating skills the higher lvled the skill is the higher i would make the atk number say from a.atk * 4 - b.def * 2 to something like a.atk * 6 - b.def * 3 to make that a stronger atk?
     
  14. Nuhada

    Nuhada Villager Member

    Messages:
    27
    Likes Received:
    14
    First Language:
    French
    For adding the state, do as he said:

    To remove hexes, just put "a.removeState(x)" or all the states you want to remove, and for the buff, put "a.addBuff(6,y)" with y as the number of turns the buff stay. (6 is for the agi buff).
     
  15. jgleazy

    jgleazy Villager Member

    Messages:
    7
    Likes Received:
    0
    First Language:
    english
    Hey guys,

    I'm trying to create a skill which will inflict state X at a 50% chance rate, ONLY when the enemy's darkness element rate is X.  Any help?
     
    Last edited by a moderator: Nov 8, 2015
  16. Nuhada

    Nuhada Villager Member

    Messages:
    27
    Likes Received:
    14
    First Language:
    French
    b.elementRate(Y)>X?Math.random()>0.5?a.addState(Z):0:0;with

    Y: ID of darkness element

    X: Darkness element rate (with 1=100%, 2=200%, 0.5=50%, etc...)

    Z: Id of state you want to add

    :)
     
    jgleazy likes this.
  17. PlatypusOfDoom

    PlatypusOfDoom Villager Member

    Messages:
    24
    Likes Received:
    5
    I finally figured this one out. :D For those of you wondering how to do this, try:

    b.result().critical = true 

    With that in mind, you could do something like: 

    if (b.result().critical) {a.addState(x); y} else {y}Here you would replace x with your state ID and y with your base damage formula. Also, a.addState(x) would add a state to the user, whereas you could do b.addState(x) to add a state to the victim in the case of a crit.

    Note that I just tested this with Yanfly's new Damage Core plugin and that plugin seems to prevent this from working, probably because it changes the order that damage is calculated.
     
    boomy and SgtBusCake like this.
  18. SgtBusCake

    SgtBusCake Villager Member

    Messages:
    15
    Likes Received:
    7
    Location:
    East Coast
    First Language:
    English
    The below has been working for me splendidly for testing purposes (or something close):

    if (b.result().critical) {a.addState(x); y} else {y}I think for the other b.result().critical = true, the game will display the graphical effects of a critical hit, but does not seem force critical damage. I don't have any plugins enabled at the moment.
     
  19. jgleazy

    jgleazy Villager Member

    Messages:
    7
    Likes Received:
    0
    First Language:
    english
    You are the bomb thank you! :)  
     
  20. saikais

    saikais Warper Member

    Messages:
    1
    Likes Received:
    1
    First Language:
    English
    Hey I dont know if it the right place to ask this, sorry in advance if it's not.

    So I'm using small number in my game, ex: starting stat are around 30hp, 10 atk,10 def and so on.

    But the default formula (a.atk*4 - b.def*2) make battle mostly once side for the fastest side.

    So I tried takimg out the multiplier but the defence become way to strong for most battle.

    So you guys/girls have any suggestion of what I could use ?

    Thanks in advances.
     
    VHStapes likes this.

Share This Page