diff options
| author | godz4762 <samuelmandelkow@proton.me> | 2026-08-15 13:36:19 -0500 |
|---|---|---|
| committer | godz4762 <samuelmandelkow@proton.me> | 2026-08-15 13:36:19 -0500 |
| commit | baae5a8738718a5b102b99d4b87cdfd0767257ae (patch) | |
| tree | 23a16531fedfb27b76137ad4a500d7ac0340e4d8 /rpg.py | |
Hi bums my rpg is here now too
Diffstat (limited to 'rpg.py')
| -rw-r--r-- | rpg.py | 411 |
1 files changed, 411 insertions, 0 deletions
| diff --git a/rpg.py b/rpg.py new file mode 100644 index 0000000..d8cbb47 --- /dev/null +++ b/rpg.py | |||
| @@ -0,0 +1,411 @@ | |||
| 1 | |||
| 2 | # print game name | ||
| 3 | |||
| 4 | |||
| 5 | print("====================================") | ||
| 6 | print() | ||
| 7 | print(" The Organ Braille ") | ||
| 8 | print() | ||
| 9 | print("====================================") | ||
| 10 | |||
| 11 | inventory = [] | ||
| 12 | |||
| 13 | hpup1 = False | ||
| 14 | |||
| 15 | # ask for player username | ||
| 16 | |||
| 17 | name = input("What is your name, Traveler? ") | ||
| 18 | |||
| 19 | # welcome them | ||
| 20 | |||
| 21 | |||
| 22 | print(f"Welcome to the game, {name}, I wish you the best of luck!") | ||
| 23 | |||
| 24 | |||
| 25 | answer = input("Do you wish to proceed further? ") | ||
| 26 | |||
| 27 | |||
| 28 | if answer.lower() == "no": | ||
| 29 | print("Well then, off you go!") | ||
| 30 | exit() | ||
| 31 | |||
| 32 | |||
| 33 | print("Choose your class!") | ||
| 34 | print("1. Knight") | ||
| 35 | print("2. Rogue") | ||
| 36 | print("3. Mage") | ||
| 37 | |||
| 38 | |||
| 39 | valid_class = False | ||
| 40 | |||
| 41 | |||
| 42 | while valid_class == False: | ||
| 43 | player_class_input = input("> ") | ||
| 44 | |||
| 45 | if player_class_input == "1": | ||
| 46 | print("A mighty knight you are! Move forward with pride!") | ||
| 47 | valid_class = True | ||
| 48 | player_class = 1 | ||
| 49 | elif player_class_input == "2": | ||
| 50 | print("A stealthy rogue, sneak between shadows and cut from behind!") | ||
| 51 | valid_class = True | ||
| 52 | player_class = 2 | ||
| 53 | elif player_class_input == "3": | ||
| 54 | print("A powerful mage, cast spells of fire and ice to batter your opponent!") | ||
| 55 | valid_class = True | ||
| 56 | player_class = 3 | ||
| 57 | else: | ||
| 58 | print("That isn't a class!") | ||
| 59 | |||
| 60 | if player_class == 1: | ||
| 61 | print("health - 150") | ||
| 62 | player_health = 150 | ||
| 63 | max_player_health = 150 | ||
| 64 | print("damage - 80") | ||
| 65 | player_damage = 80 | ||
| 66 | elif player_class == 2: | ||
| 67 | print("health - 80") | ||
| 68 | player_health = 80 | ||
| 69 | max_player_health = 80 | ||
| 70 | print("damage - 120") | ||
| 71 | player_damage = 120 | ||
| 72 | elif player_class == 3: | ||
| 73 | print("health - 130") | ||
| 74 | player_health = 130 | ||
| 75 | max_player_health = 130 | ||
| 76 | print("damage - 90") | ||
| 77 | player_damage = 90 | ||
| 78 | |||
| 79 | alchemist_shop = False | ||
| 80 | |||
| 81 | |||
| 82 | print("You procede along a small path towards a giant cave far in the distance.") | ||
| 83 | |||
| 84 | print("The cave was home to an evil dragon, the end goal of your quest is to slay him and save the kingdom!") | ||
| 85 | |||
| 86 | print("Will you procede forward to fight a Goblin or detour at the Alchemy shop?") | ||
| 87 | |||
| 88 | while alchemist_shop == False: | ||
| 89 | potioninq = input("Goblin or Alchemist? ") | ||
| 90 | |||
| 91 | |||
| 92 | if potioninq.lower() == "alchemist": | ||
| 93 | print("You say hello to the Alchemist and he gives you a potion and a small piece of bread for the road.") | ||
| 94 | inventory.append("Potion") | ||
| 95 | inventory.append("Bread") | ||
| 96 | alchemist_shop = True | ||
| 97 | elif potioninq.lower() == "goblin": | ||
| 98 | print("You procede forward to battle the goblin") | ||
| 99 | alchemist_shop = True | ||
| 100 | else: | ||
| 101 | print("That isn't an option!") | ||
| 102 | |||
| 103 | def battle(enemy_name, enemy_health, enemy_damage): | ||
| 104 | global player_health | ||
| 105 | global inventory | ||
| 106 | global max_player_health | ||
| 107 | global player_damage | ||
| 108 | global hpup1 | ||
| 109 | import random | ||
| 110 | print(f"You enter a battle with a {enemy_name}!") | ||
| 111 | |||
| 112 | while player_health > 0 and enemy_health > 0: | ||
| 113 | itemselected = False | ||
| 114 | print("Select the number of the action you would like to do!") | ||
| 115 | print("1. Fight") | ||
| 116 | print("2. Item") | ||
| 117 | print("3. Run") | ||
| 118 | battle_selection = (input("> ")) | ||
| 119 | |||
| 120 | |||
| 121 | if battle_selection.lower() in ["1", "fight"]: | ||
| 122 | damage = random.randint( | ||
| 123 | player_damage - 25, | ||
| 124 | player_damage + 15 | ||
| 125 | ) | ||
| 126 | enemy_health = enemy_health - damage | ||
| 127 | print(f"You dealt {damage} to {enemy_name}") | ||
| 128 | print(f"{enemy_name} has {enemy_health} HP remaining!") | ||
| 129 | |||
| 130 | |||
| 131 | elif battle_selection.lower() in ["2", "item"]: | ||
| 132 | if not inventory: | ||
| 133 | print("Your inventory is empty!") | ||
| 134 | continue | ||
| 135 | else: | ||
| 136 | while itemselected == False: | ||
| 137 | print("Inventory") | ||
| 138 | for item in inventory: | ||
| 139 | print(f"- {item}") | ||
| 140 | |||
| 141 | |||
| 142 | itemselected = input("Use which item? Type exit to not use an item. ") | ||
| 143 | if itemselected.lower() == "potion": | ||
| 144 | if "Potion" in inventory: | ||
| 145 | inventory.remove("Potion") | ||
| 146 | if hpup1 == False: | ||
| 147 | player_health = player_health + 80 | ||
| 148 | print("You drank the potion. You regained 80 Health.") | ||
| 149 | elif hpup1 == True: | ||
| 150 | player_health = player_health + 130 | ||
| 151 | print("You drank the potion. You regained 130 Health.") | ||
| 152 | print(player_health) | ||
| 153 | item_selected = True | ||
| 154 | if player_health > max_player_health: | ||
| 155 | player_health = max_player_health | ||
| 156 | print(player_health) | ||
| 157 | else: | ||
| 158 | print("You do not have that!") | ||
| 159 | elif itemselected.lower() == "bread": | ||
| 160 | if "Bread" in inventory: | ||
| 161 | inventory.remove("Bread") | ||
| 162 | if hpup1 == False: | ||
| 163 | player_health = player_health + 50 | ||
| 164 | print("You ate the bread. You regained 50 Health.") | ||
| 165 | elif hpup1 == True: | ||
| 166 | player_health = player_health + 90 | ||
| 167 | print("You ate the bread. You regained 90 Health.") | ||
| 168 | item_selected = True | ||
| 169 | if player_health > max_player_health: | ||
| 170 | player_health = max_player_health | ||
| 171 | print(player_health) | ||
| 172 | elif itemselected.lower() == "witch's brew": | ||
| 173 | if "Witch's Brew" in inventory: | ||
| 174 | inventory.remove("Witch's Brew") | ||
| 175 | brewkill = random.randint(1, 10000) | ||
| 176 | if brewkill >= 2: | ||
| 177 | player_health = max_player_health | ||
| 178 | print("You are healed fully by the Witch's Brew") | ||
| 179 | itemselected = True | ||
| 180 | elif brewkill <= 1: | ||
| 181 | print("The Witch's Brew eat and burns through your throat.") | ||
| 182 | print("You collapse slowly to the ground.") | ||
| 183 | print("Game over.") | ||
| 184 | exit() | ||
| 185 | elif itemselected.lower() == "exit": | ||
| 186 | itemselected = True | ||
| 187 | break | ||
| 188 | continue | ||
| 189 | elif battle_selection.lower() in ["3", "run"]: | ||
| 190 | print("You can't run, idiot.") | ||
| 191 | player_health = player_health - 15 | ||
| 192 | print("You tripped and took 15 damage.") | ||
| 193 | else: | ||
| 194 | print("Not an option!") | ||
| 195 | continue | ||
| 196 | |||
| 197 | |||
| 198 | if enemy_health > 0: | ||
| 199 | |||
| 200 | |||
| 201 | |||
| 202 | enemy_attack = random.randint( | ||
| 203 | enemy_damage - 5, | ||
| 204 | enemy_damage + 5 | ||
| 205 | ) | ||
| 206 | |||
| 207 | |||
| 208 | player_health = player_health - enemy_attack | ||
| 209 | |||
| 210 | |||
| 211 | if player_health <= 0: | ||
| 212 | print("You died!") | ||
| 213 | exit() | ||
| 214 | |||
| 215 | |||
| 216 | print(f"{enemy_name} attacks!") | ||
| 217 | print(f"You take {enemy_damage} damage") | ||
| 218 | |||
| 219 | |||
| 220 | print(f"You have {player_health} HP Remaining!") | ||
| 221 | |||
| 222 | |||
| 223 | battle("Goblin", 125, 15) | ||
| 224 | |||
| 225 | |||
| 226 | import random | ||
| 227 | |||
| 228 | |||
| 229 | player_gold = random.randint(150, 250) | ||
| 230 | |||
| 231 | |||
| 232 | print("You won! The goblin falls to the ground defeated.") | ||
| 233 | print() | ||
| 234 | print() | ||
| 235 | print("He points you down the path. Ahead was a small shop.") | ||
| 236 | print(f"The goblin gives you {player_gold} gold.") | ||
| 237 | print() | ||
| 238 | print() | ||
| 239 | print() | ||
| 240 | print("Down the path was a little shop. You stop inside.") | ||
| 241 | print("Spend your gold here!") | ||
| 242 | print("What would you like to buy?") | ||
| 243 | |||
| 244 | def shop(): | ||
| 245 | global player_gold | ||
| 246 | road_shop = False | ||
| 247 | |||
| 248 | |||
| 249 | while road_shop == False: | ||
| 250 | print(f"You have {player_gold} to spend!") | ||
| 251 | item_bought = input("Potion 35 Gold, Bread 20 Gold, Witch's Brew 80 Gold. Type exit to leave without buying anything. ") | ||
| 252 | |||
| 253 | |||
| 254 | if item_bought.lower() == "potion": | ||
| 255 | if player_gold >= 35: | ||
| 256 | print("You bought a Potion!") | ||
| 257 | inventory.append("Potion") | ||
| 258 | player_gold = player_gold - 35 | ||
| 259 | print(f"You have {player_gold} gold left!") | ||
| 260 | elif player_gold < 35: | ||
| 261 | print("You don't have enough gold...") | ||
| 262 | |||
| 263 | elif item_bought.lower() == "bread": | ||
| 264 | if player_gold >= 20: | ||
| 265 | print("You bought bread!") | ||
| 266 | inventory.append("Bread") | ||
| 267 | player_gold = player_gold - 20 | ||
| 268 | print(f"You have {player_gold} gold left!") | ||
| 269 | elif player_gold < 20: | ||
| 270 | print("You don't have enough gold...") | ||
| 271 | |||
| 272 | elif item_bought.lower() == "witch's brew": | ||
| 273 | if player_gold >= 80: | ||
| 274 | print("You bought a bubbling Witch's brew!") | ||
| 275 | inventory.append("Witch's Brew") | ||
| 276 | player_gold = player_gold - 80 | ||
| 277 | print(f"You have {player_gold} gold left!") | ||
| 278 | elif player_gold < 80: | ||
| 279 | print("You don't have enough gold...") | ||
| 280 | |||
| 281 | elif item_bought.lower() == "exit": | ||
| 282 | print("You leave the shop after taking a look around.") | ||
| 283 | road_shop = True | ||
| 284 | |||
| 285 | else: | ||
| 286 | print("Not an option!") | ||
| 287 | |||
| 288 | |||
| 289 | shop() | ||
| 290 | |||
| 291 | |||
| 292 | print("You stumble across a man along the path after you leave the shop.") | ||
| 293 | print("He asks if you want to know about the path ahead of you.") | ||
| 294 | |||
| 295 | |||
| 296 | manquestion = input("yes or no? ") | ||
| 297 | |||
| 298 | |||
| 299 | if manquestion.lower() == "yes": | ||
| 300 | 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.") | ||
| 302 | |||
| 303 | |||
| 304 | else: | ||
| 305 | print("You feel an impending sense of doom of the path ahead of you.") | ||
| 306 | print("You don't know how to feel about it.") | ||
| 307 | |||
| 308 | |||
| 309 | print("You come across a bridge. There's a seemingly evil presence under it. Will you investigate or not.") | ||
| 310 | |||
| 311 | |||
| 312 | bridgelook = input("yes or no ") | ||
| 313 | |||
| 314 | if bridgelook.lower() == "yes": | ||
| 315 | print("You find a horrifying looking monster. He tells you to not worry.") | ||
| 316 | print() | ||
| 317 | print("He tells you that he wasn't anything to worry about.") | ||
| 318 | print("The creature asks if you wanted to be friends, and introduces himself as Golem.") | ||
| 319 | print() | ||
| 320 | print("You tell him you will be his friend, and he gives you 200 Gold.") | ||
| 321 | player_gold = player_gold + 200 | ||
| 322 | |||
| 323 | |||
| 324 | else: | ||
| 325 | print("You cross the bridge carefully. Nothing happens as you cross, and you continue down the path.") | ||
| 326 | |||
| 327 | |||
| 328 | print("You felt a sense of unease rise onto your back. You turn and a goblin ambushes you!") | ||
| 329 | |||
| 330 | |||
| 331 | battle("Strong Goblin", 300, 40) | ||
| 332 | |||
| 333 | |||
| 334 | print("The strong goblin falls beneath your strength. He gives you a permanent health upgrade.") | ||
| 335 | |||
| 336 | |||
| 337 | if player_class == 1: | ||
| 338 | print("Your max HP increased to 350") | ||
| 339 | max_player_health = 350 | ||
| 340 | player_health = max_player_health | ||
| 341 | print("Your HP was also fully restored!") | ||
| 342 | elif player_class == 2: | ||
| 343 | print("Your max HP increased to 180") | ||
| 344 | max_player_health = 180 | ||
| 345 | player_health = max_player_health | ||
| 346 | print("Your HP was also fully restored!") | ||
| 347 | elif player_class == 3: | ||
| 348 | print("Your max HP increased to 230") | ||
| 349 | max_player_health = 230 | ||
| 350 | player_health = max_player_health | ||
| 351 | print("Your HP was also fully restored!") | ||
| 352 | |||
| 353 | |||
| 354 | hpup1 = True | ||
| 355 | |||
| 356 | |||
| 357 | print("You press on going forawrd.") | ||
| 358 | print() | ||
| 359 | print() | ||
| 360 | print() | ||
| 361 | print("You enter a forest. You heard a twig break behind you and you look to see a young girl.") | ||
| 362 | |||
| 363 | |||
| 364 | print("Be a monster?") | ||
| 365 | print("1. Yes.") | ||
| 366 | print("2. No.") | ||
| 367 | |||
| 368 | |||
| 369 | brutality = input("> ") | ||
| 370 | |||
| 371 | |||
| 372 | if brutality.lower() == "yes": | ||
| 373 | print("You feel stronger. You leave the splatter of blood on the ground.") | ||
| 374 | print("Your fate is sealed.") | ||
| 375 | print() | ||
| 376 | print() | ||
| 377 | print() | ||
| 378 | print("You encounter the dreadful Ogre. Be prepared.") | ||
| 379 | print("He judges you a distasteful stain of this world. Good luck.") | ||
| 380 | battle("Ogre", 1500, 60) | ||
| 381 | |||
| 382 | |||
| 383 | elif brutality.lower() == "no": | ||
| 384 | print("You give the girl a little flower.") | ||
| 385 | print("She runs off into the wilderness.") | ||
| 386 | |||
| 387 | |||
| 388 | if manquestion.lower() == "yes": | ||
| 389 | print("You come across the Ogre that the strange man told you about.") | ||
| 390 | print("He thanks you for gifting his friend a flower.") | ||
| 391 | print() | ||
| 392 | elif manquestion.lower() == "no": | ||
| 393 | print("You come across an Ogre") | ||
| 394 | print("He thanks you for gifting his friend a flower.") | ||
| 395 | |||
| 396 | print("Attack the Ogre in fear?") | ||
| 397 | print("Yes.") | ||
| 398 | print("No.") | ||
| 399 | ogrefight = input("> ") | ||
| 400 | |||
| 401 | |||
| 402 | if ogrefight.lower() in ["1", "yes"]: | ||
| 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 | |||
| 410 | |||
| 411 | shop() | ||
