Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def damage_ratio(character_helper,monster_helper):
- while monster_helper.health >= 0:
- core_ch = abs(2 + (monster_helper.strength * 2.5) + (monster_helper.magic * 1.5) + (monster_helper.agility * 0.5) - (character_helper.defense * 1)) # Got player
- core_m = abs(4 + (character_helper.strength * 2) + (character_helper.magic * 1.5) + (character_helper.agility * 1) - (monster_helper.defense * 1.5)) # Got monster
- crit_chance = ri(0,1)
- if crit_chance == 0:
- character_helper.health = character_helper.health - core_ch
- monster_helper.health = monster_helper.health - core_m
- if crit_chance == 1:
- core_m = core_m * 2
- core_ch = core_ch * 2
- character_helper.health = character_helper.health - core_ch
- monster_helper.health = monster_helper.health - core_m
- print("\nYou dealt to " + str(monster_helper.name) + ": " + str(core_m) + " Health "+ str(monster_helper.name) + ": "+ str(monster_helper.health))
- print("\n" +str(monster_helper.name) + "dealt to you: " + str(core_ch) + " Your health: " + str(character_helper.health))
- return monster_helper.health
- monster_bounty = damage_ratio(character_helper,monster_helper)
- def monster_defeated(monster_bounty,monster_helper):
- levelprogress = []
- if monster_bounty <= 0 :
- print("\n" + monster_helper.name + "defeated!")
- monster_helper.printbounty()
- levelprogress.append(monster_helper.xp_value)
- if monster_bounty > 0 :
- print("You died!")
- monster_defeated(monster_bounty,monster_helper)
- damage_ratio(character_helper,monster_helper)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement