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.

HBGames

this is for u pokemon fans making a pokemon fan game. This Custom Battle Algorithm uses a character's stats to calculate the battle damage as if it were a pokemon game.

This CBA uses the following stats for battle damage calculations:
Level, Strenth/Intelligence, Physical defense/Magic Defense.

IMPORTANT NOTE: these algorithm use the attacker's/skill user's LV.
Monsters do not have a Level Stat. If some one can submit a Monster Level script, then this script could be complete. It's all I could find so It's all im posting.

Credits to : Hydro :D

go to Game_Battler 3 and search for this line

Code:
self.damage *= elements_correct(skill.element_set)

and delete these and ONLY these lines above it:
Code:
power = skill.power + user.atk * skill.atk_f / 100
      if power > 0
        power -= self.pdef * skill.pdef_f / 200
        power -= self.mdef * skill.mdef_f / 200
        power = [power, 0].max
      end
     
      rate = 20
      rate += (user.str * skill.str_f / 100)
      rate += (user.dex * skill.dex_f / 100)
      rate += (user.agi * skill.agi_f / 100)
      rate += (user.int * skill.int_f / 100)

      self.damage = power * rate / 20

and replace it with

Code:
      if skill.atk_f == 1
       rate = ((((2 * user.level / 5 + 2) * user.str * skill.power / self.pdef) / 50) + 2) * (100 - rand(15)) / 100 
      self.damage = rate 
    end
    if skill.atk_f == 2
       rate = ((((2 * user.level / 5 + 2) * user.int * skill.power / self.mdef) / 50) + 2) * (100 - rand(15)) / 100 
      self.damage = rate 
      end

so, All physical skills should have an "attack power" of 1.
all special/magic skilss should have an "attack power" of 2.

Hydro Pump is a Special/magic attack with an effect rating of 120. So in the skills database it should have an attack power of 2 and an effect rating of 120.

you will get an error if you dont have an "attack power" set on a skill.

The algorithm itself has its variance, so set variance to 0 on all skills.
You will also get an error when a monster/enemy uses a skill because they dont have a level, i can only suply you with this until some one makes/find a monster level script.

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