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.

Battle Formula Help...

Yazus

Member

Hello there, i created a new battle formula

Code:
atk = [(attacker.atk * (attacker.atk + attacker.str) * 5) / 100].max
self.damage = (atk - (self.pdef + self.dex) * 2) * 20

BUT it doesn't work lol

anyway there is the scheme:

{[(Attacker's Attack * (Attacker's Attack + Attacker's Streght)) * 5] / 100 - [(Victim's Phisical Defense + Victim's Dexerity) * 2} * 20

So... if i have wronged everything please re do everything please
 
Hmm I tried it and it seemed to work.
Only thing I noticed was that you don't have the min damage in so that if an enemy has high def he's probably gaining life rather then taking 0 damage.
That can be fixed by by changing your self.damage line to this....

self.damage = [(atk - (self.pdef + self.dex) * 2) * 20,0].max

the ,0 makes it so you can't take off less then zero.
If it was something else you may have to describe the problem a little more.
 

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