summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--rpg.py80
1 files changed, 48 insertions, 32 deletions
diff --git a/rpg.py b/rpg.py index d8cbb47..72c1118 100644 --- a/rpg.py +++ b/rpg.py
@@ -19,8 +19,9 @@ name = input("What is your name, Traveler? ")
19# welcome them 19# welcome them
20 20
21 21
22print(f"Welcome to the game, {name}, I wish you the best of luck!") 22print(f"Welcome to the kingdom, {name}, I wish you the best of luck!")
23 23
24# troll
24 25
25answer = input("Do you wish to proceed further? ") 26answer = input("Do you wish to proceed further? ")
26 27
@@ -29,6 +30,7 @@ if answer.lower() == "no":
29 print("Well then, off you go!") 30 print("Well then, off you go!")
30 exit() 31 exit()
31 32
33# classes
32 34
33print("Choose your class!") 35print("Choose your class!")
34print("1. Knight") 36print("1. Knight")
@@ -56,6 +58,8 @@ while valid_class == False:
56 player_class = 3 58 player_class = 3
57 else: 59 else:
58 print("That isn't a class!") 60 print("That isn't a class!")
61
62# set stats
59 63
60if player_class == 1: 64if player_class == 1:
61 print("health - 150") 65 print("health - 150")
@@ -76,6 +80,8 @@ elif player_class == 3:
76 print("damage - 90") 80 print("damage - 90")
77 player_damage = 90 81 player_damage = 90
78 82
83# small little thing to give player items
84
79alchemist_shop = False 85alchemist_shop = False
80 86
81 87
@@ -100,6 +106,8 @@ while alchemist_shop == False:
100 else: 106 else:
101 print("That isn't an option!") 107 print("That isn't an option!")
102 108
109# define battle function bc we're gonna need that maybe.
110
103def battle(enemy_name, enemy_health, enemy_damage): 111def battle(enemy_name, enemy_health, enemy_damage):
104 global player_health 112 global player_health
105 global inventory 113 global inventory
@@ -117,6 +125,7 @@ def battle(enemy_name, enemy_health, enemy_damage):
117 print("3. Run") 125 print("3. Run")
118 battle_selection = (input("> ")) 126 battle_selection = (input("> "))
119 127
128# fight
120 129
121 if battle_selection.lower() in ["1", "fight"]: 130 if battle_selection.lower() in ["1", "fight"]:
122 damage = random.randint( 131 damage = random.randint(
@@ -127,6 +136,7 @@ def battle(enemy_name, enemy_health, enemy_damage):
127 print(f"You dealt {damage} to {enemy_name}") 136 print(f"You dealt {damage} to {enemy_name}")
128 print(f"{enemy_name} has {enemy_health} HP remaining!") 137 print(f"{enemy_name} has {enemy_health} HP remaining!")
129 138
139# items (my finest work)
130 140
131 elif battle_selection.lower() in ["2", "item"]: 141 elif battle_selection.lower() in ["2", "item"]:
132 if not inventory: 142 if not inventory:
@@ -186,6 +196,7 @@ def battle(enemy_name, enemy_health, enemy_damage):
186 itemselected = True 196 itemselected = True
187 break 197 break
188 continue 198 continue
199# troll more (run)
189 elif battle_selection.lower() in ["3", "run"]: 200 elif battle_selection.lower() in ["3", "run"]:
190 print("You can't run, idiot.") 201 print("You can't run, idiot.")
191 player_health = player_health - 15 202 player_health = player_health - 15
@@ -194,7 +205,7 @@ def battle(enemy_name, enemy_health, enemy_damage):
194 print("Not an option!") 205 print("Not an option!")
195 continue 206 continue
196 207
197 208# enemy attacks
198 if enemy_health > 0: 209 if enemy_health > 0:
199 210
200 211
@@ -207,7 +218,7 @@ def battle(enemy_name, enemy_health, enemy_damage):
207 218
208 player_health = player_health - enemy_attack 219 player_health = player_health - enemy_attack
209 220
210 221# check if you died like a pleb
211 if player_health <= 0: 222 if player_health <= 0:
212 print("You died!") 223 print("You died!")
213 exit() 224 exit()
@@ -219,13 +230,13 @@ def battle(enemy_name, enemy_health, enemy_damage):
219 230
220 print(f"You have {player_health} HP Remaining!") 231 print(f"You have {player_health} HP Remaining!")
221 232
222 233# actually run the battle fnct
223battle("Goblin", 125, 15) 234battle("Goblin", 125, 15)
224 235
225 236
226import random 237import random
227 238
228 239# money
229player_gold = random.randint(150, 250) 240player_gold = random.randint(150, 250)
230 241
231 242
@@ -241,6 +252,7 @@ print("Down the path was a little shop. You stop inside.")
241print("Spend your gold here!") 252print("Spend your gold here!")
242print("What would you like to buy?") 253print("What would you like to buy?")
243 254
255# add shop func
244def shop(): 256def shop():
245 global player_gold 257 global player_gold
246 road_shop = False 258 road_shop = False
@@ -285,7 +297,7 @@ def shop():
285 else: 297 else:
286 print("Not an option!") 298 print("Not an option!")
287 299
288 300# let the player get items
289shop() 301shop()
290 302
291 303
@@ -295,7 +307,7 @@ print("He asks if you want to know about the path ahead of you.")
295 307
296manquestion = input("yes or no? ") 308manquestion = input("yes or no? ")
297 309
298 310# story stuff
299if manquestion.lower() == "yes": 311if manquestion.lower() == "yes":
300 print("The man tells you about a powerful Ogre down the path a little while.") 312 print("The man tells you about a powerful Ogre down the path a little while.")
301 print("You feel as if you will cross paths with that monster.") 313 print("You feel as if you will cross paths with that monster.")
@@ -308,7 +320,7 @@ else:
308 320
309print("You come across a bridge. There's a seemingly evil presence under it. Will you investigate or not.") 321print("You come across a bridge. There's a seemingly evil presence under it. Will you investigate or not.")
310 322
311 323# prompt for more money
312bridgelook = input("yes or no ") 324bridgelook = input("yes or no ")
313 325
314if bridgelook.lower() == "yes": 326if bridgelook.lower() == "yes":
@@ -327,13 +339,13 @@ else:
327 339
328print("You felt a sense of unease rise onto your back. You turn and a goblin ambushes you!") 340print("You felt a sense of unease rise onto your back. You turn and a goblin ambushes you!")
329 341
330 342# more battle
331battle("Strong Goblin", 300, 40) 343battle("Strong Goblin", 300, 40)
332 344
333 345
334print("The strong goblin falls beneath your strength. He gives you a permanent health upgrade.") 346print("The strong goblin falls beneath your strength. He gives you a permanent health upgrade.")
335 347
336 348# give player more hp for later things
337if player_class == 1: 349if player_class == 1:
338 print("Your max HP increased to 350") 350 print("Your max HP increased to 350")
339 max_player_health = 350 351 max_player_health = 350
@@ -350,10 +362,10 @@ elif player_class == 3:
350 player_health = max_player_health 362 player_health = max_player_health
351 print("Your HP was also fully restored!") 363 print("Your HP was also fully restored!")
352 364
353 365# make it so that the hpup affects items
354hpup1 = True 366hpup1 = True
355 367
356 368# story
357print("You press on going forawrd.") 369print("You press on going forawrd.")
358print() 370print()
359print() 371print()
@@ -365,7 +377,7 @@ print("Be a monster?")
365print("1. Yes.") 377print("1. Yes.")
366print("2. No.") 378print("2. No.")
367 379
368 380# ask if the player wants to fight and impossible fight
369brutality = input("> ") 381brutality = input("> ")
370 382
371 383
@@ -377,7 +389,7 @@ if brutality.lower() == "yes":
377 print() 389 print()
378 print("You encounter the dreadful Ogre. Be prepared.") 390 print("You encounter the dreadful Ogre. Be prepared.")
379 print("He judges you a distasteful stain of this world. Good luck.") 391 print("He judges you a distasteful stain of this world. Good luck.")
380 battle("Ogre", 1500, 60) 392 battle("Enraged Ogre", 9999999999, 100)
381 393
382 394
383elif brutality.lower() == "no": 395elif brutality.lower() == "no":
@@ -385,27 +397,31 @@ elif brutality.lower() == "no":
385 print("She runs off into the wilderness.") 397 print("She runs off into the wilderness.")
386 398
387 399
388 if manquestion.lower() == "yes": 400if manquestion.lower() == "yes":
389 print("You come across the Ogre that the strange man told you about.") 401 print("You come across the Ogre that the strange man told you about.")
390 print("He thanks you for gifting his friend a flower.") 402 print("He thanks you for gifting his friend a flower.")
391 print() 403 print()
392 elif manquestion.lower() == "no": 404elif manquestion.lower() == "no":
393 print("You come across an Ogre") 405 print("You come across an Ogre")
394 print("He thanks you for gifting his friend a flower.") 406 print("He thanks you for gifting his friend a flower.")
395 407
396 print("Attack the Ogre in fear?") 408# hard fight?
397 print("Yes.")
398 print("No.")
399 ogrefight = input("> ")
400 409
410print("Attack the Ogre in fear?")
411print("Yes.")
412print("No.")
413ogrefight = input("> ")
401 414
402 if ogrefight.lower() in ["1", "yes"]: 415# good luckkk
403 print("You swing at the Ogre. He initates a fight.")
404 battle("Ogre", 850, 60)
405 player_gold = player_gold + random.randint(500, 700)
406 elif ogrefight.lower() in ["2", "no"]:
407 print("You carry on down the path.")
408 print("Good choice.")
409 416
417if ogrefight.lower() in ["1", "yes"]:
418 print("You swing at the Ogre. He initates a fight.")
419 battle("Ogre", 850, 60)
420 player_gold = player_gold + random.randint(500, 700)
421# boring
422elif ogrefight.lower() in ["2", "no"]:
423 print("You carry on down the path.")
424 print("Good choice.")
410 425
426# atp the player wants or needs more items depending on their choices, so let em have it.
411shop() 427shop()