Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

is there a way to change the way the battle damage is calculated?

hi i was just wondering if there is a way to change how rmxp calculates damage becase i would like to change it

is there a script or do i have to change something?

please help.
 
Line 43 to 77  of Game_Battler 3 calculates the damage in battle, and line 103 to 204 calculates skill damage. The code is as follows:

All variables are available there for either skill or other things. The main variables are attacker, user and skill. You may also use 'self' to obtain values for the targeted battler.
 
heres how i want it to be calculated.

(attack power - defence) x Character's parameter (depending on the wepon used)
eg.
for a sword

(attack power - defence) x strength
for a gun

attack power x Attack power

can i do this ??
 
Yes, you can. The best way to do this is to use elements per stat for weapons. So if a weapon has the 'Strength' element set, find its ID and use:
Code:
id_of_element = 9 # the element ID
weapon = $data_weapons[$game_party.actors[0].weapon_id]
if weapon.element_set.include?(id_of_element)
   self.damage = (attacker.atk - self.pdef) * attacker.str
end
Something along those lines should work perfectly fine.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top