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.

Dongeons and Dragons attack system

merfie

Member

Ok I have been tooling around with RMXP for a week or so and the whole massively huge stats as well as the odd way damage is calculated makes me annoyed. I am rewriting the damage script to be more dungeons and dragons like. However I have a few scripting questions:

First
Logically does this work?
Code:
# First hit detection
    attacker_hit = (rand(20) + attacker.str + attacker.agi)
    self_defence = (10 + self.pdef + self.dex)
    hit_result = (self_defence < attacker_hit)
    # If hit occurs
    if hit_result == true
      # Calculate basic damage
      atk = [rand(attacker.atk) + attacker.str].max
      self.damage = atk

Second
Dungeons and dragons handles criticals in this way
critical check: rand(20) > Weapons Critical range
critical damage: damage * weapons critical multiplier

I would need to have the script check the weapon ID and then based on the ID of the weapon assign those variables. I know it goes something like this

when 1 # weapon Id 1
Assign variables
when 2 # weapon Id 2
Assign variables

there just needs to be some script before that part and i don't know that part. If I could have that part explained it would make me happy.

Third
In dungeons and dragons you can attack multiple times in one round if your Bab or in the case in the script above your agi is high enough. Such that if (agi - 5) > 0 you can attack again. Then after that attack if (agi - 10) > 0 you can attack a third time. You can keep attacking in this manner until your agi - (some numeber) =< 0 Can someone point me in the right direction on how to get this done?
 

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