Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def char_select():
- char_decision = 'n'
- classes = [0, warrior, tanker, thief, archer, mage, healer, assassin]
- char_choose = 'stupid value'
- while char_decision.lower() != 'y':
- char_choose = int(input('What class do you want to choose? \n1. Warrior \n2. Tanker \n'
- '3. Thief \n4. Archer \n5. Mage \n6. Healer \n7. Assassin \n'))
- if char_choose > 7 or char_choose < 0:
- print('You chose the wrong value! \n>Enter value from 1 to 7 ')
- if char_choose < 7 :
- print('Selected class:')
- classes[char_choose].printstats()
- char_decision = input((f'Do you want to play as {classes[char_choose].name}\n'))
- return classes[char_choose]
- def monster_select():
- monster_pointer = [goblin,blackgoblin,magegoblin,summonergoblin,wolfyoung,wolfold,molerat,flasheater,kelpie,skylight]
- monster_select = ri(0,9)
- print('Summoned monster: ')
- monster_pointer[monster_select].printstats()
- return monster_pointer[monster_select]
- def damage_ratio(character_helper,monster_helper):
- while monster_helper.health >= 0 and character_helper.health > 0:
- core_ch = abs(4 + (monster_helper.strength * 1.5) + (monster_helper.magic * 2) + (monster_helper.agility * 1) - (character_helper.defense * 1.5)) # Got player
- core_m = abs(4 + (character_helper.strength * 2) + (character_helper.magic * 3) + (character_helper.agility * 2) - (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 and character_helper.health
- def monster_defeated(monster_bounty):
- monster_defeated = ['You defeated: ',]
- if monster_bounty > 0:
- print("\nš " + monster_helper.name + " defeated! š")
- monster_helper.printbounty()
- monster_defeated.append(monster_helper.name)
- print(monster_defeated)
- if monster_bounty < 0:
- print("š You died! š \nZacznij nowa gre")
- if __name__ == '__main__':
- character_helper = char_select()
- monster_helper = monster_select()
- monster_bounty = damage_ratio(character_helper,monster_helper)
- monster_defeated(monster_bounty)
- damage_ratio(character_helper,monster_helper)
Advertisement
Add Comment
Please, Sign In to add comment