トピック
********** DarkRevengeOf319

How can I randomize damage?

I want to make an RPG, but I'm not sure how to randomize the damage an enemy/the player will take when an attack is used. Can anybody help me out?
4そうだね
未プレイ
返信[1]
親投稿
OlOOlOOl pi_r_round
Define a chance of the attack hitting the target. This can be modified by the attacker's & defender's fighting skill levels. Define the minimum and maximum damage the attacker's weapon can inflict. This can be modified by the attacker's strength and the defender's armour. Then use the SmileBASIC random number function to pick numbers within those ranges.
2そうだね
プレイ済み
返信[2]
親投稿
********** DarkRevengeOf319
Can you show me that in code?
0そうだね
未プレイ
返信[3]
親投稿
OlOOlOOl pi_r_round
Honestly, it's just my idea of how a battle could work. Others will have different ideas. The key for Random_Battle is in the screenshot. The code seems to work for me, but there could be mistakes or bugs in it. Modify the player & weapon data and attack & defense formulas and observe the results.
0そうだね
プレイ済み