Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Combat System -------
- def battle_menu():
- print("BATTLE MENU:")
- print("\n(1) ATTACK")
- print("(2) SPECIAL ATTACK")
- def recall_last(func):
- def _inner(*args, **kwargs):
- if args:
- func.last_dealt = func(*args,**kwargs)
- else:
- func.last_dealt = getattr(func,'last_dealt',0)
- return func.last_dealt
- return _inner
- @recall_last
- def rand_damage(*values):
- return random.randrange(*values)
- jack_health = 300
- jack_damage = random.randrange(1, 10)
- jack_defense = random.randrange(1, 5)
- boss_health = 700
- boss_damage = random.randrange(10, 15)
- boss_defense = random.randrange(15, 20)
- def boss_specialattack(my_defense):
- my_defense = my_defense - 10
- boss_killed = False
- # ---------------------
- #'my_damage' values
- deskemon_selection_input = input("> ")
- if deskemon_selection_input == "1":
- deskemon = "TIMOSHA"
- my_health = 500
- my_damage = (25, 30)
- my_defense = (10, 15)
- my_specialattack = 0
- print("You have selected TIMOSHA as your Deskemon")
- deskemon_selection_loop = False
- elif deskemon_selection_input == "2":
- deskemon = "PICKAPOO"
- my_health = 750
- my_min = 20
- my_max = 25
- my_damage = lambda: random.randrange(my_min, my_max)
- my_defense = random.randrange(20, 25)
- my_specialattack = 0
- print("You have selected PICKAPOO as your Deskemon")
- deskemon_selection_loop = False
- elif deskemon_selection_input == "3":
- deskemon = "LILWILLY"
- my_health = 1000
- my_damage = random.randrange(40, 45)
- my_defense = random.randrange(10, 15)
- def my_specialattack():
- boss_killed = True
- print("You have selected LILWILLY as your Deskemon")
- deskemon_selection_loop = False
- elif deskemon_selection_input == "4":
- deskemon = "BIGGBOI"
- my_health = 2000
- my_damage = random.randrange(10, 15)
- my_defense = random.randrange(50, 60)
- my_specialattack = 0
- print("You have selected BIGGBOI as your Deskemon")
- deskemon_selection_loop = False
- elif deskemon_selection_input == "":
- deskemon_selection_loop = True
- else:
- deskemon_selection_loop = True
- #combat system
- print("LET'S GO BATTLE!")
- jack_battle_loop = True
- while jack_battle_loop:
- battle_menu()
- choise = input("> ")
- if choise == "1":
- #(jack_health + jack_defense) - my_damage = jack_health
- jack_health = (jack_health + jack_defense) - rand_damage(*my_damage)
- print(deskemon + " HAS INFLICTED " + str(rand_damage()) + " TO CHIPHEAD")
- if jack_health <= 0:
- jack_battle_loop = False
- break
- print("CHIPHEAD HAS " + str(jack_health) + " HITPOINTS LEFT!")
- time.sleep(1)
- print("...")
- time.sleep(1)
- print("...")
- time.sleep(1)
- print("...")
- time.sleep(1)
- #(my_health + my_defense) - jack_damage = my_health
- my_health = (my_health + my_defense) - jack_damage
- print("CHIPHEAD HAVE INFLICTED " + str(jack_damage) + " TO " + deskemon)
- if my_health <= 0:
- jack_battle_loop = False
- break
- print(deskemon + " HAS " + str(jack_health) + " HITPOINTS LEFT!")
- jack_battle_loop = True
- elif choise == "":
- jack_battle_loop = True
- else:
- jack_battle_loop = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement