I need help on how to add critical/miss chance on my attacks in battle loop engine. I haven't found any topic that could help me so I decided to make one.
For example I have random value damage skill with 100% hit chance. Now how do I add to my code lets say 20% miss and critical chance every time I use this skill?
Here are defined values of character and skill:
Code: Select all
$ party_list =[{"name":"Angel",
"max_hp":10000,
"current_hp":10000,
"min_missile_damage":25,
"max_missile_damage":50,
"imga2":"angel_picture", "def_imga2":"defeated_angel",
"laser_gun_max_damage":100,
"laser_gun_min_damage":80,
"id":str(renpy.random.randint(0,1000)*renpy.random.randint(0,1000))}]
Code: Select all
menu:
"MISSILE LAUNCHER" if angel_missile_ammo >= 1:
$ angel_missile_ammo -= 1
$ player_damage = renpy.random.randint( current_player["min_missile_damage"], current_player["max_missile_damage"] )
$ enemies_list[res]["current_hp"] -= player_damage
"Firing the missile! {i}(Enemy took damage of - [player_damage]HP){/i}"
$ renpy.block_rollback()