Advertisement
Guest User

Untitled

a guest
Jan 5th, 2022
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.65 KB | None | 0 0
  1. def damage_ratio(character_helper,monster_helper):
  2.  
  3.     while monster_helper.health >= 0:
  4.         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
  5.         core_m = abs(4 + (character_helper.strength * 2) + (character_helper.magic * 1.5) + (character_helper.agility * 1) - (monster_helper.defense * 1.5)) # Got monster
  6.         crit_chance = ri(0,1)
  7.         if crit_chance == 0:
  8.             character_helper.health = character_helper.health - core_ch
  9.             monster_helper.health = monster_helper.health - core_m
  10.  
  11.         if crit_chance == 1:
  12.             core_m = core_m * 2
  13.             core_ch = core_ch * 2
  14.             character_helper.health = character_helper.health - core_ch
  15.             monster_helper.health = monster_helper.health - core_m
  16.         print("\nYou dealt to " + str(monster_helper.name) + ": " + str(core_m) + "   Health "+ str(monster_helper.name) + ": "+ str(monster_helper.health))
  17.         print("\n" +str(monster_helper.name) + "dealt to you: " + str(core_ch) + "    Your health: " + str(character_helper.health))
  18.     return monster_helper.health
  19.  
  20. monster_bounty = damage_ratio(character_helper,monster_helper)
  21.  
  22. def monster_defeated(monster_bounty,monster_helper):
  23.     levelprogress = []
  24.     if monster_bounty <= 0 :
  25.         print("\n" + monster_helper.name + "defeated!")
  26.         monster_helper.printbounty()
  27.         levelprogress.append(monster_helper.xp_value)
  28.     if monster_bounty > 0 :
  29.         print("You died!")
  30.  
  31.  
  32. monster_defeated(monster_bounty,monster_helper)
  33. damage_ratio(character_helper,monster_helper)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement