├── LICENSE ├── README.md ├── thecrusadersquest1.2screenreader.py └── thecrusadersquest1.2.py /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 GagaGievous 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The-Crusader-s-Quest 2 | 3 | Download Python 3.8 or higher to run the game in Python. 4 | 5 | Game Manual (don't read below if you don't want mechanic spoilers): 6 | 7 | The manual will help you make sense of the game. The first part will be about everything associated with your character: 8 | 9 | Race: Determines your HP, Martial Prowess, Consumption Rate, Endurance, and extra starting Gold. 10 | 11 | Occupation: Determines any extra HP, any extra Martial Prowess, Starting and Max Food, Starting and Max Arrows, and Starting and Max Gold. 12 | 13 | HP: If it goes to zero, you die. 14 | 15 | Martial Prowess: Your power in combat. A high Martial Prowess will make you invulnerable to damage from enemies. 16 | 17 | Consumption Rate: How much food you use every turn. If your food hits zero, you will start to use up Endurance. 18 | 19 | Endurance: A resource that dwindles every turn you have no food. If Endurance hits zero, you die. Getting Endurance back is rare. 20 | 21 | Food: You can buy and sell food at a tavern, get it from hunting, or find it in a random event. 22 | 23 | Arrows: You can hunt with arrows. You can buy and sell arrows at the blacksmith, or find it in a random event. 24 | 25 | Gold: Used for buying and selling things, as well as upgrading your weapon at the blacksmith. 26 | 27 | Name: Has minimal effect on the game. For roleplaying purposes (for example, call yourself Alexander or Macho Man Randy Savage). 28 | 29 | Weapon: Has minimal effect on the game. For roleplaying purposes (for example, wield a sword or a flamethrower). 30 | -------------------------------------------------------------------------------- /thecrusadersquest1.2screenreader.py: -------------------------------------------------------------------------------- 1 | # Python Text RPG 2 | # Authored by: Gaga Gievous 3 | # Copyright February 2021 4 | 5 | import cmd 6 | import textwrap 7 | import sys 8 | import os 9 | import time 10 | import random 11 | import math 12 | 13 | counter = 0 14 | counter_set = 0 15 | 16 | name ='' 17 | hp = 0 18 | max_hp = 0 19 | 20 | martial_prowess = 0 21 | consumption_rate = 10 22 | endurance = 10 23 | food = 0 24 | max_food = 0 25 | race = '' 26 | luck = 0 27 | arrows = 0 28 | max_arrows = 0 29 | speed = 0 30 | occupation = '' 31 | illness = 'None' 32 | gold = 100 33 | max_gold = 0 34 | 35 | blacksmith_price = 500 36 | 37 | 38 | 39 | weapon = 'Sword' 40 | weapon_type = 'sword' 41 | 42 | location = '' 43 | days_to_go = 0 44 | adventure_state = False 45 | 46 | enemy_adjective = '' 47 | enemy_type = '' 48 | enemy_locater = '' 49 | enemy_number = '' 50 | enemy_exclude = 0 51 | enemy_battlescore = 0 52 | enemy_gold = 0 53 | enemy_arrows = 0 54 | enemy_food = 0 55 | enemy_specific_gold = 0 56 | enemy_specific_arrows = 0 57 | enemy_specific_food = 0 58 | damage_taken = 0 59 | 60 | ### Title Screen ### 61 | def title_screen_selections(): 62 | option = input('>: ') 63 | 64 | if option.lower() == '1': 65 | setup_game() 66 | elif option.lower() == '2': 67 | help_menu() 68 | elif option.lower() == '0': 69 | sys.exit() 70 | while option.lower() not in ['1', '2', '0']: 71 | option = input('>: ') 72 | if option() == '1': 73 | setup_game() 74 | elif option() == '2': 75 | help_menu() 76 | elif option() == '0': 77 | sys.exit() 78 | 79 | def title_screen(): 80 | os.system('cls') 81 | 82 | print('The Crusader\'s Quest: Survival Text RPG.\n') 83 | print(' 1 Play ') 84 | print(' 2 Tips ') 85 | print(' 0 Quit ') 86 | title_screen_selections() 87 | 88 | def help_menu(): 89 | print('Human, Dwarf, and Satyr are the best races for beginners.') 90 | print('The Adventurer class works well with every race, but is not necessarily the best.') 91 | 92 | title_screen_selections() 93 | 94 | ### Character Creation ### 95 | 96 | # Name # 97 | def setup_game(): 98 | global name 99 | global hp 100 | global max_hp 101 | global martial_prowess 102 | global consumption_rate 103 | global endurance 104 | global food 105 | global max_food 106 | global race 107 | global luck 108 | global arrows 109 | global max_arrows 110 | global speed 111 | global occupation 112 | global illness 113 | global illness_chance 114 | global gold 115 | global max_gold 116 | global durability 117 | global weapon 118 | global max_heal_item 119 | global adventure_state 120 | 121 | arrows = 0 122 | gold = 0 123 | food = 0 124 | max_arrows = 0 125 | max_gold = 0 126 | max_food = 0 127 | hp = 0 128 | max_hp = 0 129 | martial_prowess = 0 130 | heal_item = 0 131 | endurance = 10 132 | adventure_state = False 133 | os.system('cls') 134 | print('The Antipope is defiling the holiest religious site in the world. You are a warrior monk from the Freemasons, and it is up to you to destroy the Antipope.\n') 135 | print('You begin your journey in Goodshire, one of the many towns you hope to pass through.\n') 136 | print('What is your name?\n') 137 | 138 | name = input('>: ') 139 | 140 | # Race # 141 | os.system('cls') 142 | print('What is your race?\n') 143 | print('1 Human\n2 Dwarf\n3 Satyr\n4 Halfling\n5 Elf\n6 Tigerman\n7 Leprechaun\n') 144 | 145 | selection = input('>: ') 146 | if selection == '1': 147 | race = "Human" 148 | hp = 25 149 | max_hp = 25 150 | martial_prowess = 10 151 | consumption_rate = 10 152 | endurance = 30 153 | gold = 100 154 | luck = 0 155 | speed = 0 156 | 157 | elif selection == '2': 158 | race = "Dwarf" 159 | hp = 50 160 | max_hp = 50 161 | martial_prowess = 30 162 | consumption_rate = 20 163 | endurance = 240 164 | gold = 200 165 | luck = 0 166 | speed = 0 167 | 168 | elif selection == '3': 169 | race = "Satyr" 170 | hp = 200 171 | max_hp = 200 172 | martial_prowess = 0 173 | consumption_rate = 20 174 | endurance = 240 175 | gold = 0 176 | luck = 0 177 | speed = 0 178 | 179 | elif selection == '4': 180 | race = "Halfling" 181 | hp = 25 182 | max_hp = 25 183 | martial_prowess = 0 184 | consumption_rate = 20 185 | endurance = 200 186 | gold = 100 187 | luck = 0 188 | speed = 0 189 | 190 | elif selection == '5': 191 | race = "Elf" 192 | hp = 10 193 | max_hp = 10 194 | martial_prowess = 0 195 | consumption_rate = 10 196 | endurance = 1000 197 | gold = 100 198 | luck = 0 199 | speed = 0 200 | 201 | elif selection == '6': 202 | race = "Tigerman" 203 | hp = 25 204 | max_hp = 25 205 | martial_prowess = 50 206 | consumption_rate = 20 207 | endurance = 100 208 | gold = 0 209 | luck = 0 210 | speed = 0 211 | 212 | elif selection == '7': 213 | race = "Leprechaun" 214 | hp = 10 215 | max_hp = 10 216 | martial_prowess = 0 217 | consumption_rate = 10 218 | endurance = 10 219 | gold = 1000 220 | luck = 0 221 | speed = 0 222 | 223 | else: 224 | race = "Human" 225 | hp = 25 226 | max_hp = 25 227 | martial_prowess = 10 228 | consumption_rate = 10 229 | endurance = endurance + 30 230 | gold = 100 231 | luck = 0 232 | speed = 0 233 | 234 | os.system('cls') 235 | 236 | # Occupation # 237 | print('What is your occupation?\n') 238 | print('1 Hunter\n2 Knight\n3 Adventurer\n4 Assassin\n5 Glutton\n') 239 | 240 | selection = input('>: ') 241 | if selection == '1': 242 | occupation = 'Hunter' 243 | hp = hp + 10 244 | max_hp = max_hp + 10 245 | food = food + 50 246 | max_food = max_food + 150 247 | arrows = arrows + 75 248 | max_arrows = max_arrows + 100 249 | gold = gold + 0 250 | max_gold = max_gold + 800 251 | martial_prowess = martial_prowess + 0 252 | elif selection == '2': 253 | occupation = 'Knight' 254 | hp = hp + 100 255 | max_hp = max_hp + 100 256 | food = food + 25 257 | max_food = max_food + 100 258 | arrows = arrows + 8 259 | max_arrows = max_arrows + 10 260 | gold = gold + 400 261 | max_gold = max_gold + 1000 262 | martial_prowess = martial_prowess + 20 263 | elif selection == '3': 264 | occupation = 'Adventurer' 265 | hp = hp + 25 266 | max_hp = max_hp + 25 267 | food = food + 75 268 | max_food = max_food + 100 269 | arrows = arrows + 20 270 | max_arrows = max_arrows + 20 271 | gold = gold + 100 272 | max_gold = max_gold + 800 273 | martial_prowess = martial_prowess + 10 274 | elif selection == '4': 275 | occupation = 'Assassin' 276 | hp = hp + 0 277 | max_hp = max_hp + 0 278 | food = food + 25 279 | max_food = max_food + 100 280 | arrows = arrows + 8 281 | max_arrows = max_arrows + 10 282 | gold = gold + 100 283 | max_gold = max_gold + 1000 284 | martial_prowess = martial_prowess + 60 285 | elif selection == '5': 286 | occupation = 'Glutton' 287 | hp = hp + 25 288 | max_hp = max_hp + 25 289 | food = food + 500 290 | max_food = max_food + 500 291 | arrows = arrows + 0 292 | max_arrows = max_arrows + 1 293 | gold = gold + 0 294 | max_gold = max_gold + 1000 295 | martial_prowess = martial_prowess + 0 296 | else: 297 | occupation = 'Hunter' 298 | hp = hp + 10 299 | max_hp = max_hp + 10 300 | food = food + 50 301 | max_food = max_food + 150 302 | arrows = arrows + 75 303 | max_arrows = max_arrows + 100 304 | gold = gold + 0 305 | max_gold = max_gold + 300 306 | martial_prowess = martial_prowess + 0 307 | 308 | os.system('cls') 309 | 310 | print('What kind of weapon do you want to use? (ie. sword, poleaxe, etc.)') 311 | 312 | weapon = input('>: ') 313 | gold_mechanic() 314 | os.system('cls') 315 | 316 | #print('What is your weapon called? (ie. Thorn, Crusher, etc.)') 317 | 318 | #weapon = input('>: ') 319 | #os.system('cls') 320 | 321 | print('You are ' + name + ', the ' + race + ' ' + occupation + '. You wield a ' + weapon + '.\n') 322 | print('1 Begin Adventure\n2 Restart') 323 | selection = input('>: ') 324 | if selection == '1': 325 | start_game() 326 | else: 327 | title_screen() 328 | 329 | ### Death ### 330 | def death(): 331 | os.system('cls') 332 | print('You have died.\n') 333 | selection = input('Press enter enter to continue') 334 | char_menu() 335 | print() 336 | print('1 Menu\n') 337 | selection = input('>: ') 338 | if selection == '1': 339 | title_screen() 340 | else: 341 | title_screen() 342 | 343 | ### Food and Endurance Mechanic ### 344 | 345 | def food_endurance_mechanic(): 346 | global food 347 | global endurance 348 | global consumption_rate 349 | if food < consumption_rate and food > 0: 350 | food = 0 351 | elif food > 1: 352 | food = food - consumption_rate 353 | elif food < 1: 354 | food = 0 355 | endurance = endurance - consumption_rate 356 | if endurance < 1: 357 | endurance = 0 358 | death() 359 | elif endurance <= consumption_rate: 360 | print('If you do not get food, you will starve to death.') 361 | 362 | #need to work on restoring endurance# 363 | 364 | ### Resource Mechanics ### 365 | 366 | def hp_mechanic(): 367 | global hp 368 | global max_hp 369 | if hp > max_hp: 370 | hp = max_hp 371 | print('You have max HP.') 372 | if hp < 1: 373 | hp = 0 374 | death() 375 | 376 | def gold_mechanic(): 377 | global gold 378 | global max_gold 379 | if gold < 1: 380 | gold = 0 381 | if gold > max_gold: 382 | gold = max_gold 383 | print('You have completely filled your coin purse.') 384 | if gold < 1: 385 | gold = 0 386 | 387 | def food_mechanic(): 388 | global food 389 | global max_food 390 | if food > max_food: 391 | food = max_food 392 | print('You have maxed out your food supply.') 393 | if food < 1: 394 | food = 0 395 | 396 | def arrows_mechanic(): 397 | global arrows 398 | global max_arrows 399 | if arrows < 1: 400 | arrows = 0 401 | if arrows > max_arrows: 402 | arrows = max_arrows 403 | print('You have maxed out your arrow count.') 404 | if arrows < 1: 405 | arrows = 0 406 | 407 | ### Character Menu ### 408 | def char_menu(): 409 | os.system('cls') 410 | global name 411 | global hp 412 | global max_hp 413 | global martial_prowess 414 | global consumption_rate 415 | global endurance 416 | global food 417 | global max_food 418 | global race 419 | global luck 420 | global arrows 421 | global max_arrows 422 | global speed 423 | global occupation 424 | global illness 425 | global illness_chance 426 | global gold 427 | global max_gold 428 | global weapon 429 | 430 | 431 | print('Name: ' + name + '') 432 | print('Race: ' + race + '') 433 | print('Occupation: ' + occupation + '') 434 | 435 | print('HP: ' + str(hp) + '/' + str(max_hp) + '') 436 | print('Martial Prowess: ' + str(martial_prowess) + '') 437 | print('Weapon: ' + weapon + '') 438 | #print('######################') 439 | print('Consumption Rate: ' + str(consumption_rate) + '') 440 | print('Food: ' + str(food) + '/' + str(max_food) + '') 441 | print('Endurance: ' + str(endurance) + '') 442 | print('Arrows: ' + str(arrows) + '/' + str(max_arrows) + '') 443 | #print('######################') 444 | #print('Luck: ' + str(luck) + '') 445 | #print('Speed: ' + str(speed) + '\n') 446 | #print('Illness: ' + illness + '') 447 | print('Gold: ' + str(gold) + '/' + str(max_gold) + '') 448 | #print('######################\n') 449 | selection = input('Press enter to continue') 450 | 451 | 452 | ### Adventure Menu ### 453 | def adventure_menu(): 454 | global hp 455 | global max_hp 456 | global martial_prowess 457 | global consumption_rate 458 | global endurance 459 | global food 460 | global max_food 461 | global arrows 462 | global max_arrows 463 | global gold 464 | global max_gold 465 | global weapon 466 | 467 | os.system('cls') 468 | print('######################') 469 | print('HP: ' + str(hp) + '/' + str(max_hp) + '') 470 | print('Food: ' + str(food) + '/' + str(max_food) + '') 471 | print('Arrows: ' + str(arrows) + '/' + str(max_arrows) + '') 472 | print('Gold: ' + str(gold) + '/' + str(max_gold) + '') 473 | print('Endurance: ' + str(endurance) + '') 474 | print('######################') 475 | print('Martial Prowess: ' + str(martial_prowess) + '') 476 | print('Weapon: ' + weapon + '') 477 | print('Consumption Rate: ' + str(consumption_rate) + '') 478 | print('######################\n') 479 | 480 | ### Map ### Update this to turn X into another symbol when that location is active 481 | def the_map(): 482 | #print('Key: T = Town; C = City; etc.) 483 | 484 | 485 | 486 | days_to_go() 487 | 488 | ### Days to Go ### 489 | def days_to_go(): 490 | global location 491 | global counter 492 | global counter_set 493 | global adventure_state 494 | 495 | if location == 'Goodshire': 496 | if adventure_state == False: 497 | counter_set = 7 498 | counter = 7 499 | print('You will brave the wilds for ' + str(counter_set) + ' days.') 500 | print('1 Continue\n2 Back') 501 | selection = input('>: ') 502 | if selection == '1': 503 | input('Press enter to continue') 504 | adventuring() 505 | 506 | elif selection == '2': 507 | town() 508 | else: 509 | town() 510 | if adventure_state == True: 511 | print('You have ' + str(counter) + ' days to go.') 512 | input('Press enter to continue') 513 | 514 | if location == 'Rodez': 515 | if adventure_state == False: 516 | counter_set = 11 517 | counter = 11 518 | print('You will brave the wilds for ' + str(counter_set) + ' days.') 519 | print('1 Continue\n2 Back') 520 | selection = input('>: ') 521 | if selection == '1': 522 | input('Press enter to continue') 523 | adventuring() 524 | 525 | if selection == '2': 526 | town() 527 | else: 528 | town() 529 | if adventure_state == True: 530 | print('You have ' + str(counter) + ' days to go.') 531 | input('Press enter to continue') 532 | if location == 'Oristano': 533 | if adventure_state == False: 534 | counter_set = 15 535 | counter = 15 536 | print('You will brave the wilds for ' + str(counter_set) + ' days.') 537 | print('1 Continue\n2 Back') 538 | selection = input('>: ') 539 | if selection == '1': 540 | input('Press enter to continue') 541 | adventuring() 542 | 543 | if selection == '2': 544 | town() 545 | else: 546 | town() 547 | if adventure_state == True: 548 | print('You have ' + str(counter) + ' days to go.') 549 | input('Press enter to continue') 550 | if location == 'Thasos': 551 | if adventure_state == False: 552 | counter_set = 19 553 | counter = 19 554 | print('You will brave the wilds for ' + str(counter_set) + ' days.') 555 | print('1 Continue\n2 Back') 556 | selection = input('>: ') 557 | if selection == '1': 558 | input('Press enter to continue') 559 | adventuring() 560 | 561 | if selection == '2': 562 | town() 563 | else: 564 | town() 565 | if adventure_state == True: 566 | print('You have ' + str(counter) + ' days to go.') 567 | input('Press enter to continue') 568 | if location == 'Karabuk': 569 | if adventure_state == False: 570 | counter_set = 25 571 | counter = 25 572 | print('You will brave the wilds for ' + str(counter_set) + ' days.') 573 | print('1 Continue\n2 Back') 574 | selection = input('>: ') 575 | if selection == '1': 576 | input('Press enter to continue') 577 | adventuring() 578 | 579 | if selection == '2': 580 | town() 581 | else: 582 | town() 583 | if adventure_state == True: 584 | print('You have ' + str(counter) + ' days to go.') 585 | input('Press enter to continue') 586 | if location == 'Last Refuge': 587 | if adventure_state == False: 588 | counter_set = 25 589 | counter = 25 590 | print('You will brave the wilds for ' + str(counter_set) + ' days.') 591 | print('1 Continue\n2 Back') 592 | selection = input('>: ') 593 | if selection == '1': 594 | input('Press enter to continue') 595 | adventuring() 596 | 597 | if selection == '2': 598 | town() 599 | else: 600 | town() 601 | if adventure_state == True: 602 | print('You have ' + str(counter) + ' days to go.') 603 | input('Press enter to continue') 604 | 605 | ### Treasure Generator ### 606 | #def treasure_generator(): 607 | # v = random.randint(0, 3) 608 | # print('You found ' + str(v) + ' treasures on this leg of the journey.') 609 | 610 | 611 | ### Location Changer ### 612 | def location_changer(): 613 | global location 614 | global adventure_state 615 | 616 | adventure_state == False 617 | 618 | if location == 'Goodshire': 619 | location = 'Rodez' 620 | blacksmith_price_generator() 621 | #treasure_generator() 622 | town() 623 | if location == 'Rodez': 624 | location = 'Oristano' 625 | blacksmith_price_generator() 626 | town() 627 | if location == 'Oristano': 628 | location = 'Thasos' 629 | blacksmith_price_generator() 630 | town() 631 | if location == 'Thasos': 632 | location = 'Karabuk' 633 | blacksmith_price_generator() 634 | town() 635 | if location == 'Karabuk': 636 | location = 'Salem' 637 | blacksmith_price_generator() 638 | salem() 639 | if location == 'Last Refuge': 640 | location = 'Rodez' 641 | blacksmith_price_generator() 642 | #end_game() 643 | 644 | #town() 645 | 646 | ### Town Description ### 647 | def town_description(): 648 | global location 649 | 650 | if location == 'Goodshire': 651 | print('The sun shines brightly on the lazy Halfling natives.') 652 | elif location == 'Rodez': 653 | print('The sky is overcast, and your feet squelch in the mud from a recent rain.') 654 | elif location == 'Oristano': 655 | print('The surrounding trees loom over the town like giants, and block the sun\'s rays.') 656 | elif location == 'Thasos': 657 | print('A hot, dry wind blows clouds across the yellow sun, and you feel hot.') 658 | elif location == 'Karabuk': 659 | print('There is a foul stench in the air, and the ground is covered bubbling puddles of unknown origin.') 660 | 661 | ### Start Game ### 662 | def start_game(): 663 | global location 664 | location = 'Goodshire' 665 | blacksmith_price_generator() 666 | enemy_locater_generator() 667 | town() 668 | 669 | ### Town ### 670 | def town(): 671 | global counter 672 | global adventure_state 673 | os.system('cls') 674 | adventure_state == False 675 | print('You are in ' + location + '.') 676 | town_description() 677 | print() 678 | print('1 Tavern\n2 Blacksmith\n3 Character\n4 Adventure') 679 | selection = input('>: ') 680 | if selection == '1': 681 | os.system('cls') 682 | tavern() 683 | if selection == '4': 684 | os.system('cls') 685 | counter = 0 686 | the_map() 687 | print('You will brave the wilds for 5 days.') 688 | input('Press enter to continue') 689 | adventuring() 690 | 691 | if selection == '2': 692 | os.system('cls') 693 | blacksmith() 694 | if selection == '3': 695 | os.system('cls') 696 | char_menu() 697 | town() 698 | else: 699 | town() 700 | 701 | ### Tavern ### 702 | def tavern(): 703 | global food 704 | global consumption_rate 705 | global gold 706 | global hp 707 | global location 708 | 709 | os.system('cls') 710 | 711 | print('Gold: ' + str(gold) + '/' + str(max_gold) + '') 712 | print('HP: ' + str(hp) + '/' + str(max_hp) + '') 713 | print('Food: ' + str(food) + '/' + str(max_food) + '') 714 | 715 | print('"Welcome to the ' + location + ' Inn. How may I serve you?"\n') 716 | print('1 Rest (1 gold)\n2 Buy Food (5 gold)\n3 Sell Food (3 gold)\n4 Speak with random patron\n5 Back') 717 | selection = input('>: ') 718 | if selection == '1': 719 | if gold < 1: 720 | print('You cannot afford a bed here.') 721 | input('Press enter to continue.') 722 | tavern() 723 | else: 724 | print('You slept like a rock.') 725 | hp = hp + 99999 726 | hp_mechanic() 727 | gold = gold - 1 728 | input('Press enter to continue.') 729 | tavern() 730 | 731 | if selection == '2': 732 | print('How much food do you want to buy?') 733 | total_cost = 0 734 | food_price = 5 735 | n = input('>: ') 736 | if n == '0': 737 | tavern() 738 | n = int(n) 739 | total_cost = n * food_price 740 | if total_cost > gold: 741 | print('You do not have enough gold to buy ' + str(n) + ' food.') 742 | input('Press enter to continue') 743 | tavern() 744 | elif total_cost <= gold: 745 | food = food + n 746 | food_mechanic() 747 | gold = gold - total_cost 748 | print('You complete the transaction') 749 | input('Press enter to continue') 750 | tavern() 751 | if selection == '3': 752 | print('How much food do you want to sell?') 753 | total_sell = 0 754 | food_sell = 3 755 | n = input('>: ') 756 | if n == '0': 757 | tavern() 758 | n = int(n) 759 | total_sell = n * food_sell 760 | if food < n: 761 | print('You do not have that much food.') 762 | input('Press enter to continue') 763 | blacksmith() 764 | if food >= n: 765 | food = food - n 766 | gold = gold + total_sell 767 | print('You complete the transaction') 768 | gold_mechanic() 769 | input('Press enter to continue') 770 | os.system('cls') 771 | tavern() 772 | if selection == '4': 773 | talk() 774 | tavern() 775 | if selection == '5': 776 | town() 777 | else: 778 | tavern() 779 | 780 | # Talk # 781 | def talk(): 782 | dialogue = random.randint(1, 10) 783 | part = '' 784 | if dialogue == 1: 785 | print('I don\'t take too kindly to travelers.') 786 | if dialogue == 2: 787 | print('I\'m too scared to leave ' + location + '. I don\'t know how you survive out there.') 788 | if dialogue == 3: 789 | print('The ' + location + ' Inn is the best tavern in the world. Not that I would know.') 790 | if dialogue == 4: 791 | print('There\'s nasty things where you\'re headed.') 792 | if dialogue == 5: 793 | print('Someone I know was killed looking inside a hollow tree. You wouldn\'t want that happening to you.') 794 | if dialogue == 6: 795 | print('If you run out of food and arrows in the wilds, how will you survive? On pure endurance?') 796 | if dialogue == 7: 797 | print('If you want stronger equipment, I recommend going to the blacksmith.') 798 | if dialogue == 8: 799 | n = random.randint(1, 8) 800 | if n == 1: 801 | part = 'arm' 802 | if n == 2: 803 | part = 'leg' 804 | if n == 3: 805 | part = 'hand' 806 | if n == 4: 807 | part = 'foot' 808 | if n == 5: 809 | part = 'eye' 810 | if n == 6: 811 | part = 'ear' 812 | if n == 7: 813 | part = 'finger' 814 | if n == 8: 815 | part = 'toe' 816 | print('In the wilds, I got caught in a hunter\'s trap. That\'s how I lost my ' + part + '.') 817 | if dialogue == 9: 818 | print('Tales of the beasts and Satanic denizens in the wilds have kept me inside the city walls.') 819 | if dialogue == 10: 820 | print('The good thing about resting at ' + location + ' Inn is that you get a complimentary meal.') 821 | input('Press enter to continue') 822 | tavern() 823 | ### Blacksmith ### 824 | def blacksmith(): 825 | global weapon 826 | global weapon_type 827 | global gold 828 | global max_gold 829 | global blacksmith_price 830 | global martial_prowess 831 | global arrows 832 | global max_arrows 833 | 834 | os.system('cls') 835 | 836 | print('Gold: ' + str(gold) + '/' + str(max_gold) + '') 837 | print('Arrows: ' + str(arrows) + '/' + str(max_arrows) + '') 838 | print('Martial Prowess: ' + str(martial_prowess) + '') 839 | 840 | print('"What can I do for you, traveler?"') 841 | print('1 Upgrade your ' + weapon + ' (' + str(blacksmith_price) + ') gold.\n2 Buy Arrows (5 gold)\n3 Sell Arrows (3 gold) \n4 Back') 842 | selection = input('>: ') 843 | if selection == '1': 844 | if gold < blacksmith_price: 845 | print('You do not have enough gold to upgrade your ' + weapon_type + '.') 846 | input('Press enter to continue') 847 | blacksmith() 848 | else: 849 | gold = gold - blacksmith_price 850 | gold_mechanic() 851 | v = random.randint(10, 30) 852 | martial_prowess = martial_prowess + v 853 | print('Your martial prowess increases by ' + str(v) + '.') 854 | input('Press enter to continue') 855 | blacksmith() 856 | if selection == '2': 857 | print('How many arrows do you want to buy?') 858 | total_cost = 0 859 | arrow_price = 5 860 | n = input('>: ') 861 | n = int(n) 862 | total_cost = n * arrow_price 863 | if total_cost > gold: 864 | print('You do not have enough gold to buy ' + str(n) + ' arrows.') 865 | input('Press enter to continue') 866 | blacksmith() 867 | if total_cost <= gold: 868 | arrows = arrows + n 869 | arrows_mechanic() 870 | gold = gold - total_cost 871 | print('You complete the transaction') 872 | input('Press enter to continue') 873 | blacksmith() 874 | if selection == '3': 875 | print('How many arrows do you want to sell?') 876 | total_sell = 0 877 | arrow_sell = 3 878 | n = input('>: ') 879 | n = int(n) 880 | total_sell = n * arrow_sell 881 | if arrows < n: 882 | print('You do not have that many arrows.') 883 | input('Press enter to continue') 884 | blacksmith() 885 | if arrows >= n: 886 | arrows = arrows - n 887 | gold = gold + total_sell 888 | print('You complete the transaction') 889 | gold_mechanic() 890 | input('Press enter to continue') 891 | os.system('cls') 892 | blacksmith() 893 | 894 | if selection == '4': 895 | town() 896 | else: 897 | blacksmith() 898 | 899 | 900 | ### Blacksmith Price Generator ### 901 | def blacksmith_price_generator(): 902 | global gold 903 | global location 904 | global blacksmith_price 905 | 906 | blacksmith_price = random.randint(51, 75) 907 | if location == 'Rodez': 908 | blacksmith_price = blacksmith_price + 25 909 | if location == 'Oristano': 910 | blacksmith_price = blacksmith_price + 45 911 | if location == 'Thasos': 912 | blacksmith_price = blacksmith_price + 65 913 | if location == 'Karabuk': 914 | blacksmith_price = blacksmith_price + 85 915 | if location == 'Last Refuge': 916 | blacksmith_price = blacksmith_price + 105 917 | 918 | 919 | ### Adventuring ### 920 | def adventuring(): 921 | global name 922 | global hp 923 | global max_hp 924 | global martial_prowess 925 | global consumption_rate 926 | global endurance 927 | global food 928 | global max_food 929 | global race 930 | global luck 931 | global arrows 932 | global max_arrows 933 | global speed 934 | global occupation 935 | global illness 936 | global gold 937 | global max_gold 938 | global weapon 939 | global counter 940 | global location 941 | global adventure_state 942 | 943 | adventure_state == True 944 | while counter != 0: 945 | adventure_state = True 946 | if hp > 0: 947 | adventure_menu() 948 | print('1 Continue\n2 Hunt\n3 Rest\n4 Map\n') 949 | selection = input('>: ') 950 | os.system('cls') 951 | if selection == '1': 952 | food_endurance_mechanic() 953 | adventure_menu() 954 | random_event() 955 | counter = counter - 1 956 | if selection == '2': 957 | hunt() 958 | if selection == '3': 959 | rest() 960 | if selection == '4': 961 | the_map() 962 | else: 963 | adventuring() 964 | else: 965 | death() 966 | counter = 0 967 | os.system('cls') 968 | adventure_menu() 969 | print('You have survived the trip.') 970 | adventure_state = False 971 | print('Enter 0 to continue.') 972 | selection = input('>: ') 973 | if selection == '0': 974 | location_changer() 975 | else: 976 | adventuring() #was location_changer() 977 | 978 | ### Rest ### 979 | def rest(): 980 | global hp 981 | global max_hp 982 | global food 983 | 984 | x = random.randint(15, 25) 985 | food_endurance_mechanic() 986 | 987 | if hp == max_hp: 988 | print('You rest for one day. Your HP is already maxed out.') 989 | 990 | input('Press enter to continue') 991 | adventuring() 992 | 993 | print('You rest for one day, gaining ' + str(x) + ' HP.') 994 | hp = hp + x 995 | hp_mechanic() 996 | 997 | input('Press enter to continue') 998 | 999 | ### Hunt ### 1000 | def hunt(): 1001 | global arrows 1002 | global food 1003 | x = random.randint(1, 10) 1004 | y = random.randint(1, 25) 1005 | 1006 | if arrows == 0: 1007 | print('You do not have any arrows to hunt with.') 1008 | input('Press enter to continue') 1009 | adventuring() 1010 | 1011 | elif arrows < x: 1012 | adventure_menu() 1013 | x = arrows 1014 | arrows = arrows - x 1015 | food = food + y 1016 | arrows_mechanic() 1017 | print('You shot ' + str(x) + ' arrows, and gained ' + str(y) + ' food.') 1018 | food_mechanic() 1019 | 1020 | else: 1021 | adventure_menu() 1022 | arrows = arrows - x 1023 | food = food + y 1024 | arrows_mechanic() 1025 | food_mechanic() 1026 | print('You shot ' + str(x) + ' arrows, and gained ' + str(y) + ' food.') 1027 | 1028 | input('Press enter to continue') 1029 | 1030 | 1031 | ######################################################################## 1032 | ########################### Random Events ############################## 1033 | ######################################################################## 1034 | def random_event(): 1035 | n = random.randint(1, 20) 1036 | if n == 1: 1037 | chest() 1038 | if n == 2: 1039 | fight() 1040 | if n == 3: 1041 | robbed() 1042 | if n == 4: 1043 | traveller() 1044 | if n == 5: 1045 | damaged() 1046 | if n == 6: 1047 | miracle() 1048 | if n == 7: 1049 | mushroom() 1050 | if n == 8: 1051 | nothing() 1052 | if n == 9: 1053 | fight() 1054 | if n == 10: 1055 | fight() 1056 | if n == 11: 1057 | chest() 1058 | if n == 12: 1059 | fight() 1060 | if n == 13: 1061 | robbed() 1062 | if n == 14: 1063 | traveller() 1064 | if n == 15: 1065 | damaged() 1066 | if n == 16: 1067 | mystic() 1068 | if n == 17: 1069 | bigger_bag() 1070 | if n == 18: 1071 | lose_day() 1072 | if n == 19: 1073 | fight() 1074 | if n == 20: 1075 | fight() 1076 | 1077 | ### Mushroom ### 1078 | def mushroom(): 1079 | global endurance 1080 | global hp 1081 | global consumption_rate 1082 | global race 1083 | 1084 | print('You see a strange mushroom.') 1085 | print('1 Consume\n2 Leave') 1086 | w = 0 1087 | selection = input('>: ') 1088 | if selection == '1': 1089 | x = random.randint(1, 4) 1090 | if x == 1: 1091 | if race == 'Satyr': 1092 | w = consumption_rate + consumption_rate + consumption_rate 1093 | endurance = endurance + w 1094 | print('You eat the mushroom, and gain ' + str(w) + ' Endurance.') 1095 | else: 1096 | print('You eat the mushroom, and nothing happened.') 1097 | if x == 2: 1098 | if race == 'Satyr': 1099 | w = consumption_rate + consumption_rate + consumption_rate 1100 | endurance = endurance + w 1101 | print('You eat the mushroom, and gain ' + str(w) + ' Endurance.') 1102 | else: 1103 | print('You eat the mushroom, and it causes you to vomit.') 1104 | food_endurance_mechanic() 1105 | if x == 3: 1106 | w = consumption_rate + consumption_rate 1107 | endurance = endurance + w 1108 | print('You eat the mushroom, and gain ' + str(w) + ' Endurance.') 1109 | if x == 4: 1110 | if race == 'Satyr': 1111 | w = consumption_rate + consumption_rate 1112 | endurance = endurance + w 1113 | print('You eat the mushroom, and gain ' + str(w) + ' Endurance.') 1114 | else: 1115 | hp = 0 1116 | endurance = 0 1117 | print('You eat the mushroom, and then fall to the ground, foaming at the mouth.') 1118 | input('Press enter to continue') 1119 | death() 1120 | 1121 | elif selection == '2': 1122 | print('You leave the mushroom.') 1123 | else: 1124 | mushroom() 1125 | input('Press enter to continue') 1126 | 1127 | ### Miracle ### 1128 | def miracle(): 1129 | global race 1130 | global food 1131 | global max_food 1132 | global arrows 1133 | global max_arrows 1134 | global gold 1135 | global max_gold 1136 | global hp 1137 | global max_hp 1138 | 1139 | if race == 'Halfling': 1140 | print('You see an old wizard, and the wizard beckons you over.') 1141 | print('"Ho, there, traveler!"') 1142 | print('"I did not expect to see a Halfing out in the wilderness."') 1143 | print('"This is delightful. Here, have a gift."') 1144 | print('Fill:\n1 Food\n2 Arrows\n3 Gold\n4 HP') 1145 | selection = input('>: ') 1146 | if selection == '1': 1147 | food = max_food 1148 | food_mechanic 1149 | if selection == '2': 1150 | arrows = max_arrows 1151 | arrows_mechanic 1152 | if selection == '3': 1153 | gold = max_gold 1154 | gold_mechanic 1155 | if selection == '4': 1156 | hp = max_hp 1157 | hp_mechanic 1158 | input('Press enter to continue') 1159 | else: 1160 | nothing() 1161 | 1162 | ### Bigger Bag ### 1163 | def bigger_bag(): 1164 | global max_food 1165 | global max_arrows 1166 | global max_gold 1167 | 1168 | y = random.randint(1, 3) 1169 | if y == 1: 1170 | max_food = max_food + 10 1171 | print('You find an empty food storage container on the side of the path, and it holds more food than your current one.') 1172 | input('Press enter to take\n') 1173 | print('Max food increased by 10.') 1174 | if y == 2: 1175 | max_arrows = max_arrows + 10 1176 | print('You spot an empty quiver on the side of the path. It holds more arrows than your current one.') 1177 | input('Press enter to take\n') 1178 | print('Max arrows increased by 10.') 1179 | if y == 3: 1180 | max_gold = max_gold + 100 1181 | print('You discover an empty coin purse on the side of the path. It holds more gold than your current one.') 1182 | input('Press enter to take\n') 1183 | print('Max gold increased by 100.') 1184 | print() 1185 | input('Press enter to continue') 1186 | 1187 | ### Lose a Day ### 1188 | def lose_day(): 1189 | global counter 1190 | global location 1191 | v = random.randint(1, 3) 1192 | #y = random.randint(1, 2) 1193 | #k = random.randint(1, 100) 1194 | counter = counter + v 1195 | #if y == 1: 1196 | 1197 | print('You realize that you are lost. It will take you ' + str(v) + ' days to get back on the right path.') 1198 | #if y == 2: 1199 | #if location == 'Goodshire' or 'Rodez': 1200 | #print('You arrive at a bridge spanning a massive whitewater river that is guarded by a score of bandits. One bandit approaches you.') 1201 | #elif location == 'Oristano' or 'Thasos' or 'Karabuk': 1202 | #print('You arrive at a bridge spanning an enormous chasm that is guarded by a score of bandits. One bandit approaches you.') 1203 | #print('"If you want to cross this bridge, you have to pay us, ' + str(k) 'gold.\n') 1204 | # print('1 Pay gold\n2 Take a detour\n') 1205 | ## selection = input('>: ') 1206 | # if selection == '1': 1207 | # if k > gold: 1208 | # print('"That is not enough to cross, but we will keep what you gave us, and you can find another way around. Have fun out there."') 1209 | # gold = 0 1210 | ## else: 1211 | # gold = gold - k 1212 | # print('You gave the bandit ' + str(k) + ' gold, and they let you cross the bridge.') 1213 | # elif selection == '2' 1214 | # else: 1215 | # selection = input('>: ') 1216 | 1217 | 1218 | input('Press enter to continue') 1219 | 1220 | ### Mystic ### 1221 | def mystic(): 1222 | global name 1223 | global hp 1224 | global max_hp 1225 | global martial_prowess 1226 | global consumption_rate 1227 | global endurance 1228 | global food 1229 | global max_food 1230 | global race 1231 | global luck 1232 | global arrows 1233 | global max_arrows 1234 | global speed 1235 | global occupation 1236 | global illness 1237 | global illness_chance 1238 | global gold 1239 | global max_gold 1240 | global weapon 1241 | global consumption_rate 1242 | 1243 | 1244 | 1245 | print('You come upon a roaming mystic.') 1246 | print('The mystic offers you a blessing.\n') 1247 | print('Increase:\n1 Max HP\n2 Endurance\n3 Martial Prowess\n') 1248 | #print('Fill: ') 1249 | selection = input('>: ') 1250 | os.system('cls') 1251 | if selection == '1': 1252 | max_hp = max_hp + 10 1253 | hp = hp + 10 1254 | print('Your max HP increases by 10.') 1255 | input('Press enter to continue') 1256 | elif selection == '2': 1257 | endurance = endurance + consumption_rate 1258 | print('Your endurance increases by ' + str(consumption_rate) + '.') 1259 | input('Press enter to continue') 1260 | elif selection == '3': 1261 | martial_prowess = martial_prowess + 10 1262 | print('Your martial prowess increases by 10.') 1263 | input('Press enter to continue') 1264 | else: 1265 | mystic() 1266 | 1267 | 1268 | ### Nothing ### 1269 | def nothing(): 1270 | print('Nothing notable happens.') 1271 | input('Press enter to continue') 1272 | 1273 | ### Damaged (Random Event) ### 1274 | def damaged(): 1275 | global hp 1276 | global gold 1277 | global food 1278 | global arrows 1279 | #adventure_menu() 1280 | v = random.randint(1, 20) 1281 | n = random.randint(1, 3) 1282 | hp = hp - v 1283 | 1284 | if n == 1: 1285 | g = random.randint(1, 20) 1286 | gold = gold + g 1287 | print('You sprain your ankle in a divot, taking ' + str(v) + ' damage.') 1288 | print('However, you find ' + str(g) + ' gold on the ground.') 1289 | gold_mechanic() 1290 | if n == 2: 1291 | f = random.randint(1, 20) 1292 | food = food + f 1293 | print('You are stung by a swarm of bees, taking ' + str(v) + ' damage.') 1294 | print('However, you manage to take ' + str(f) + ' honey before you flee.') 1295 | food_mechanic() 1296 | 1297 | if n == 3: 1298 | a = random.randint(1, 20) 1299 | arrows = arrows + a 1300 | print('You walk into an hunter\'s trap, taking ' + str(v) + ' damage.') 1301 | print('However, you find ' + str(a) + ' arrows nearby.') 1302 | arrows_mechanic() 1303 | 1304 | 1305 | input('Press enter to continue') 1306 | hp_mechanic() 1307 | 1308 | ### Traveller ### 1309 | def traveller(): 1310 | global gold 1311 | global arrows 1312 | global food 1313 | global hp 1314 | print('A friendly adventurer approaches you and wants to trade.') 1315 | n = random.randint(1, 3) 1316 | if n == 1: 1317 | print('"Good morning, traveler."\n') 1318 | if n == 2: 1319 | print('"Good evening, traveler."\n') 1320 | if n == 3: 1321 | print('"Good afternoon, traveler."\n') 1322 | 1323 | traveller_values() 1324 | 1325 | # Traveller Values # 1326 | def traveller_values(): 1327 | 1328 | traveller_generation() 1329 | input('Press enter to continue') 1330 | 1331 | 1332 | 1333 | #### Traveller Generation #### 1334 | def traveller_generation(): 1335 | global gold 1336 | global arrows 1337 | global food 1338 | global hp 1339 | x = random.randint(1, 50) # how much trader wants 1340 | v = random.randint(1, 100) #how much trader is willing to give 1341 | c = random.randint(1, 4) # what trader wants 1342 | 1343 | if c == 1: 1344 | print('The trader wants ' + str(x) + ' food.') 1345 | p = random.randint(1, 3) # what trader is giving 1346 | if p == 1: 1347 | print('The trader is willing to give ' + str(v) + ' arrows.') 1348 | print('1 Accept\n2 Decline') 1349 | selection = input('>: ') 1350 | if selection == '1': 1351 | if food < x: 1352 | print('You cannot afford the trade.') 1353 | else: 1354 | food = food - x 1355 | arrows = arrows + v 1356 | print('You accept the trade.') 1357 | arrows_mechanic() 1358 | 1359 | else: 1360 | print('You decline the trade.') 1361 | 1362 | if p == 2: 1363 | print('The trader is willing to pay ' + str(v) + ' gold.') 1364 | print('1 Accept\n2 Decline') 1365 | selection = input('>: ') 1366 | if selection == '1': 1367 | if food < x: 1368 | print('You cannot afford the trade.') 1369 | else: 1370 | food = food - x 1371 | gold = gold + v 1372 | print('You accept the trade.') 1373 | gold_mechanic() 1374 | 1375 | else: 1376 | print('You decline the trade.') 1377 | 1378 | if p == 3: 1379 | print('The trader is willing to heal you ' + str(v) + ' HP.') 1380 | print('1 Accept\n2 Decline') 1381 | selection = input('>: ') 1382 | if selection == '1': 1383 | if food < x: 1384 | print('You cannot afford the trade.') 1385 | else: 1386 | food = food - x 1387 | hp = hp + v 1388 | print('You accept the trade.') 1389 | hp_mechanic() 1390 | 1391 | else: 1392 | print('You decline the trade.') 1393 | if c == 2: 1394 | print('The trader wants ' + str(x) + ' arrows.') 1395 | p = random.randint(1, 3) # what trader is giving 1396 | if p == 1: 1397 | print('The trader is willing to give ' + str(v) + ' food.') 1398 | print('1 Accept\n2 Decline') 1399 | selection = input('>: ') 1400 | if selection == '1': 1401 | if arrows < x: 1402 | print('You cannot afford the trade.') 1403 | else: 1404 | arrows = arrows - x 1405 | food = food + v 1406 | print('You accept the trade.') 1407 | food_mechanic() 1408 | 1409 | else: 1410 | print('You decline the trade.') 1411 | if p == 2: 1412 | print('The trader is willing to give ' + str(v) + ' gold.') 1413 | print('1 Accept\n2 Decline') 1414 | selection = input('>: ') 1415 | if selection == '1': 1416 | if arrows < x: 1417 | print('You cannot afford the trade.') 1418 | else: 1419 | arrows = arrows - x 1420 | gold = gold + v 1421 | print('You accept the trade.') 1422 | gold_mechanic() 1423 | 1424 | else: 1425 | print('You decline the trade.') 1426 | if p == 3: 1427 | print('The trader is willing to heal you for ' + str(v) + ' HP.') 1428 | print('1 Accept\n2 Decline') 1429 | selection = input('>: ') 1430 | if selection == '1': 1431 | if arrows < x: 1432 | print('You cannot afford the trade.') 1433 | else: 1434 | arrows = arrows - x 1435 | hp = hp + v 1436 | print('You accept the trade.') 1437 | hp_mechanic() 1438 | 1439 | else: 1440 | print('You decline the trade.') 1441 | if c == 3: 1442 | print('The trader wants ' + str(x) + ' gold.') 1443 | p = random.randint(1, 3) # what trader is giving 1444 | if p == 1: 1445 | print('The trader is willing to give ' + str(v) + ' food.') 1446 | print('1 Accept\n2 Decline') 1447 | selection = input('>: ') 1448 | if selection == '1': 1449 | if gold < x: 1450 | print('You cannot afford the trade.') 1451 | else: 1452 | gold = gold - x 1453 | food = food + v 1454 | print('You accept the trade.') 1455 | food_mechanic() 1456 | 1457 | else: 1458 | print('You decline the trade.') 1459 | if p == 2: 1460 | print('The trader is willing to give ' + str(v) + ' arrows.') 1461 | print('1 Accept\n2 Decline') 1462 | selection = input('>: ') 1463 | if selection == '1': 1464 | if gold < x: 1465 | print('You cannot afford the trade.') 1466 | else: 1467 | gold = gold - x 1468 | arrows = arrows + v 1469 | print('You accept the trade.') 1470 | arrows_mechanic() 1471 | 1472 | else: 1473 | print('You decline the trade.') 1474 | 1475 | if p == 3: 1476 | print('The trader is willing to heal you ' + str(v) + ' HP.') 1477 | print('1 Accept\n2 Decline') 1478 | selection = input('>: ') 1479 | if selection == '1': 1480 | if gold < x: 1481 | print('You cannot afford the trade.') 1482 | else: 1483 | gold = gold - x 1484 | hp = hp + v 1485 | print('You accept the trade.') 1486 | hp_mechanic() 1487 | 1488 | else: 1489 | print('You decline the trade.') 1490 | if c == 4: 1491 | print('The trader wants your blood. Specifically, ' + str(x) + ' HP.') 1492 | p = random.randint(1, 3) # what trader is giving 1493 | if p == 1: 1494 | print('The trader is willing to give ' + str(v) + ' food.') 1495 | print('1 Accept\n2 Decline') 1496 | selection = input('>: ') 1497 | if selection == '1': 1498 | if hp < x: 1499 | print('You cannot afford the trade, but the trader will accept what you have.') 1500 | hp = hp - x 1501 | food = food + v 1502 | food_mechanic() 1503 | else: 1504 | hp = hp - x 1505 | food = food + v 1506 | print('You accept the trade.') 1507 | food_mechanic() 1508 | 1509 | else: 1510 | print('You decline the trade.') 1511 | if p == 2: 1512 | print('The trader is willing to give ' + str(v) + ' arrows.') 1513 | print('1 Accept\n2 Decline') 1514 | selection = input('>: ') 1515 | if selection == '1': 1516 | if hp < x: 1517 | print('You cannot afford the trade, but the trader is willing to let you slide, this time.') 1518 | hp = hp - x 1519 | food = food + v 1520 | food_mechanic() 1521 | else: 1522 | hp = hp - x 1523 | arrows = arrows + v 1524 | print('You accept the trade.') 1525 | arrows_mechanic() 1526 | 1527 | else: 1528 | print('You decline the trade.') 1529 | if p == 3: 1530 | print('The trader is willing to give ' + str(v) + ' gold.') 1531 | print('1 Accept\n2 Decline') 1532 | selection = input('>: ') 1533 | if selection == '1': 1534 | if hp < x: 1535 | print('You cannot afford the trade, but the trader is willing to let you slide, this time.') 1536 | hp = hp - x 1537 | food = food + v 1538 | food_mechanic() 1539 | else: 1540 | hp = hp - x 1541 | gold = gold + v 1542 | print('You accept the trade.') 1543 | gold_mechanic() 1544 | 1545 | else: 1546 | print('You decline the trade.') 1547 | 1548 | 1549 | 1550 | ### Robbed ### 1551 | def robbed(): 1552 | global gold 1553 | global arrows 1554 | global food 1555 | 1556 | x = random.randint(1, 3) 1557 | if food == 0 and arrows == 0 and gold == 0: 1558 | nothing() 1559 | elif x == 1: 1560 | v = random.randint(1, 50) 1561 | if food < v: 1562 | v = food 1563 | 1564 | food = food - v 1565 | food_mechanic() 1566 | y = random.randint(1, 2) 1567 | #adventure_menu() 1568 | if y == 1: 1569 | print('During the night, a shadowy figure stole ' + str(v) + ' of your food.') 1570 | elif y == 2: 1571 | print('You check your food supply and find that ' + str(v) + ' food is missing.') 1572 | elif x == 2: 1573 | v = random.randint(1, 50) 1574 | if arrows < v: 1575 | v = arrows 1576 | arrows = arrows - v 1577 | arrows_mechanic() 1578 | y = random.randint(1, 2) 1579 | #adventure_menu() 1580 | if y == 1: 1581 | print('During the night, a shadowy figure stole ' + str(v) + ' of your arrows.') 1582 | elif y == 2: 1583 | print('You check your arrow quill, and find that ' + str(v) + ' arrows are missing.') 1584 | 1585 | elif x == 3: 1586 | v = random.randint(1, 50) 1587 | if gold < v: 1588 | v = gold 1589 | gold = gold - v 1590 | gold_mechanic() 1591 | y = random.randint(1, 2) 1592 | #adventure_menu() 1593 | if y == 1: 1594 | print('During the night, a shadowy figure stole ' + str(v) + ' of your gold.') 1595 | elif y == 2: 1596 | print('You check your coin purse, and find that ' + str(v) + ' gold is missing.') 1597 | 1598 | v = 0 1599 | x = 0 1600 | 1601 | input('Press enter to continue') 1602 | 1603 | # Doppelganger # 1604 | def doppelganger(): 1605 | global enemy_type 1606 | global weapon 1607 | global name 1608 | 1609 | if enemy_type == 'Doppelganger': 1610 | print('The doppelganger is wielding a ' + weapon + ' exactly like yours.') 1611 | 1612 | ### Fight ### 1613 | def fight(): 1614 | global hp 1615 | global martial_prowess 1616 | global weapon 1617 | global durability 1618 | global gold 1619 | global enemy_adjective 1620 | global enemy_type 1621 | global enemy_battlescore 1622 | global enemy_gold 1623 | global counter 1624 | 1625 | 1626 | enemy_generator() 1627 | print('You see a ' + enemy_adjective + ' ' + enemy_type + ' approaching.') 1628 | doppelganger() 1629 | print('1 Fight\n2 Flee') 1630 | selection = input('>: ') 1631 | if selection == '1': 1632 | fight_simulation() 1633 | counter = counter - 1 1634 | adventuring() 1635 | 1636 | if selection == '2': 1637 | flee_fight() 1638 | counter = counter - 1 1639 | adventuring() 1640 | 1641 | else: 1642 | flee_fight() 1643 | counter = counter - 1 1644 | adventuring() 1645 | 1646 | # Fight Simulation # 1647 | def fight_simulation(): 1648 | global hp 1649 | global martial_prowess 1650 | global weapon 1651 | global gold 1652 | global enemy_adjective 1653 | global enemy_type 1654 | global enemy_battlescore 1655 | global enemy_gold 1656 | global enemy_arrows 1657 | global enemy_food 1658 | global damage_taken 1659 | 1660 | your_damage_taken() 1661 | enemy_loot() 1662 | 1663 | input('Press enter to continue') 1664 | #adventure_menu() 1665 | 1666 | # Enemy Loot # 1667 | def enemy_loot(): 1668 | global gold 1669 | global arrows 1670 | global food 1671 | global enemy_gold 1672 | global enemy_arrows 1673 | global enemy_food 1674 | 1675 | f = random.randint(1, 10) 1676 | enemy_food = enemy_food + f 1677 | food = food + enemy_food 1678 | a = random.randint(1, 5) 1679 | enemy_arrows = enemy_arrows + a 1680 | arrows = arrows + enemy_arrows 1681 | g = random.randint(1, 10) 1682 | enemy_gold = enemy_gold + g 1683 | gold = gold + enemy_gold 1684 | print('You found ' + str(enemy_food) + ' food, ' + str(enemy_arrows) + ' arrows, and ' + str(enemy_gold) + ' gold on the corpse.') 1685 | food_mechanic() 1686 | arrows_mechanic() 1687 | gold_mechanic() 1688 | 1689 | # Your Damage Taken # 1690 | def your_damage_taken(): 1691 | global hp 1692 | global martial_prowess 1693 | global enemy_battlescore 1694 | global damage_taken 1695 | 1696 | damage_taken = enemy_battlescore - martial_prowess 1697 | hp = int(hp - damage_taken) 1698 | if damage_taken < 1: 1699 | hp = hp + damage_taken 1700 | damage_taken = 0 1701 | print('The enemy was slain, and you took no damage.') 1702 | else: 1703 | print('The enemy was slain, but you took ' + str(damage_taken) + ' damage.') 1704 | 1705 | # Flee Fight # 1706 | def flee_fight(): 1707 | n = random.randint(1, 2) 1708 | if n == 1: 1709 | print('You escaped the fight.') 1710 | input('Press enter to continue') 1711 | adventure_menu() 1712 | elif n == 2: 1713 | print('You failed to flee the fight.') 1714 | input('Press enter to continue') 1715 | fight_simulation() 1716 | 1717 | # Enemy Generator # 1718 | def enemy_generator(): 1719 | global enemy_adjective 1720 | global enemy_type 1721 | global enemy_battlescore 1722 | 1723 | enemy_resetter() 1724 | enemy_adjective_generator() 1725 | enemy_type_generator() 1726 | 1727 | # Enemy Resetter # 1728 | def enemy_resetter(): 1729 | global enemy_type 1730 | global enemy_battlescore 1731 | global enemy_gold 1732 | global enemy_food 1733 | global enemy_arrows 1734 | global enemy_specific_gold 1735 | global enemy_specific_arrows 1736 | global enemy_specific_food 1737 | 1738 | enemy_type = '' 1739 | enemy_food = 0 1740 | enemy_arrows = 0 1741 | enemy_gold = 0 1742 | enemy_specific_gold = 0 1743 | enemy_specific_arrows = 0 1744 | enemy_specific_food = 0 1745 | enemy_battlescore = 0 1746 | enemy_adjective = '' 1747 | 1748 | ### Enemy Locater and Excluder Generator ### 1749 | def enemy_locater_generator(): 1750 | global enemy_locater 1751 | global location 1752 | global enemy_exclude 1753 | global enemy_number 1754 | 1755 | if location == 'Goodshire': 1756 | enemy_locater = 'Goodshire' 1757 | enemy_exclude = [3,4,5] 1758 | if location == 'Rodez': 1759 | enemy_locater = 'Rodez' 1760 | enemy_exclude = [2,4,5] 1761 | if location == 'Oristano': 1762 | enemy_locater = 'Oristano' 1763 | enemy_exclude = [1,2,5] 1764 | if location == 'Thasos': 1765 | enemy_locater = 'Thasos' 1766 | enemy_exclude = [1,2] 1767 | if location == 'Karabuk': 1768 | enemy_locater = 'Karabuk' 1769 | enemy_exclude = [1,2,3] 1770 | if location == 'Last Refuge': 1771 | enemy_locater = 'Last Refuge' 1772 | enemy_exclude = [2,3] 1773 | enemy_number = random.randint(1, 5) 1774 | while enemy_number in enemy_exclude: 1775 | enemy_number = random.randint(1, 5) 1776 | 1777 | # Enemy Type Generator # 1778 | def enemy_type_generator(): 1779 | global enemy_type 1780 | global enemy_battlescore 1781 | global enemy_gold 1782 | global enemy_food 1783 | global enemy_arrows 1784 | global enemy_specific_gold 1785 | global enemy_specific_arrows 1786 | global enemy_specific_food 1787 | global enemy_locater 1788 | global enemy_exclude 1789 | global enemy_number 1790 | 1791 | enemy_locater_generator() 1792 | 1793 | if enemy_number == 1: 1794 | enemy_type = 'Lone Wolf' 1795 | enemy_battlescore = enemy_battlescore + 35 1796 | enemy_specific_food = 2 1797 | enemy_specific_arrows = 0 1798 | enemy_specific_gold = 0 1799 | enemy_food = enemy_food + enemy_specific_food 1800 | enemy_arrows = enemy_arrows + enemy_specific_arrows 1801 | enemy_gold = enemy_gold + enemy_specific_gold 1802 | 1803 | 1804 | if enemy_number == 2: 1805 | enemy_type = 'Large Maggot' 1806 | enemy_battlescore = enemy_battlescore + 15 1807 | enemy_specific_food = 1 1808 | enemy_specific_arrows = 0 1809 | enemy_specific_gold = 0 1810 | enemy_food = enemy_food + enemy_specific_food 1811 | enemy_arrows = enemy_arrows + enemy_specific_arrows 1812 | enemy_gold = enemy_gold + enemy_specific_gold 1813 | 1814 | if enemy_number == 3: 1815 | enemy_type = 'Rogue Vampire' 1816 | enemy_battlescore = enemy_battlescore + 55 1817 | enemy_specific_food = 0 1818 | enemy_specific_arrows = 0 1819 | enemy_specific_gold = 5 1820 | enemy_food = enemy_food + enemy_specific_food 1821 | enemy_arrows = enemy_arrows + enemy_specific_arrows 1822 | enemy_gold = enemy_gold + enemy_specific_gold 1823 | 1824 | 1825 | if enemy_number == 4: 1826 | enemy_type = 'Dark Cultist' 1827 | enemy_battlescore = enemy_battlescore + 85 1828 | enemy_specific_food = 10 1829 | enemy_specific_arrows = 0 1830 | enemy_specific_gold = 10 1831 | enemy_food = enemy_food + enemy_specific_food 1832 | enemy_arrows = enemy_arrows + enemy_specific_arrows 1833 | enemy_gold = enemy_gold + enemy_specific_gold 1834 | 1835 | if enemy_number == 5: 1836 | enemy_type = 'Doppelganger' 1837 | enemy_battlescore = enemy_battlescore + 105 1838 | enemy_specific_food = 10 1839 | enemy_specific_arrows = 0 1840 | enemy_specific_gold = 10 1841 | enemy_food = enemy_food + enemy_specific_food 1842 | enemy_arrows = enemy_arrows + enemy_specific_arrows 1843 | enemy_gold = enemy_gold + enemy_specific_gold 1844 | 1845 | 1846 | 1847 | # Enemy Adjective Generator # 1848 | def enemy_adjective_generator(): 1849 | global enemy_adjective 1850 | global enemy_battlescore 1851 | 1852 | j = random.randint(1, 3) 1853 | if j == 1: 1854 | enemy_adjective = 'Bloodthirsty' 1855 | enemy_battlescore = enemy_battlescore + 35 1856 | if j == 2: 1857 | enemy_adjective = 'Regular' 1858 | enemy_battlescore = enemy_battlescore + 0 1859 | if j == 3: 1860 | enemy_adjective = 'Starved' 1861 | enemy_battlescore = enemy_battlescore - 10 1862 | 1863 | ### Chest ### 1864 | def chest(): 1865 | global hp 1866 | global max_hp 1867 | 1868 | p = random.randint(1, 2) 1869 | if p == 1: 1870 | print('You see a treasure chest.') 1871 | if p == 2: 1872 | print('You see a large hollow tree.') 1873 | print('1 Inspect\n2 Avoid') 1874 | selection = input('>: ') 1875 | if selection == '1': 1876 | a = random.randint(1, 3) 1877 | if a == 1: 1878 | print('It is empty. Nothing but cobwebs remain.') 1879 | input('Press enter to continue') 1880 | adventure_menu() 1881 | if a == 2: 1882 | print('It was booby trapped. A dart flies out and hits you for 20 damage.') 1883 | hp = hp - 20 1884 | input('Press enter to continue') 1885 | hp_mechanic() 1886 | adventure_menu() 1887 | #if a == 2 and luck > 0: 1888 | #print('It was booby trapped. A dart flies out and hits you for 20 damage.') 1889 | #chestloot() 1890 | if a == 3: 1891 | chest_loot() 1892 | 1893 | elif selection == '2': 1894 | print() 1895 | 1896 | else: 1897 | chest() 1898 | 1899 | # Chest Loot # 1900 | def chest_loot(): 1901 | global gold 1902 | global arrows 1903 | global food 1904 | global max_food 1905 | 1906 | x = random.randint(1, 3) 1907 | if x == 1: 1908 | v = random.randint(50, 100) 1909 | food = food + v 1910 | print('Inside, you found ' + str(v) + ' food.') 1911 | food_mechanic() 1912 | if x == 2: 1913 | v = random.randint(50, 100) 1914 | arrows = arrows + v 1915 | print('Inside, you found ' + str(v) + ' arrows.') 1916 | arrows_mechanic() 1917 | if x == 3: 1918 | v = random.randint(50, 100) 1919 | gold = gold + v 1920 | print('Inside, you found ' + str(v) + ' gold.') 1921 | gold_mechanic() 1922 | 1923 | v = 0 1924 | input('Press enter to continue') 1925 | adventure_menu() 1926 | 1927 | ####### Salem ####### 1928 | def salem(): 1929 | global counter 1930 | global adventure_state 1931 | global damage_taken 1932 | global enemy_battlescore 1933 | global martial_prowess 1934 | global hp 1935 | 1936 | os.system('cls') 1937 | print('-----------------') 1938 | print('| G | | | |') 1939 | print('+---+---+---+---+') 1940 | print('| R | | | |') 1941 | print('+---+---+---+---+') 1942 | print('| | O | | |') 1943 | print('+---+---+---+---+') 1944 | print('| | T | K | |') 1945 | print('+---+---+---+---+') 1946 | print('| | | | S |') 1947 | print('+---------------+\n') 1948 | print('Salem\n') 1949 | input('Press enter to continue') 1950 | os.system('cls') 1951 | 1952 | print('You enter the ancient city of Salem, now blackened with fire and as silent as a graveyard, and see a man who looks like a commoner lounging upon a throne of skeletons in the courtyard.') 1953 | print('"Ah, ' + name + '", I was expecting you."\n') 1954 | print('Type \'who are you?\'') 1955 | input('>: ') 1956 | 1957 | os.system('cls') 1958 | print('"I am the called by your order the Antipope or the Prince of Darkness, but my birth name is Chernobog."') 1959 | print('"As you can see, I have already razed Salem. Your sacred temples and artifacts are totally destroyed. You have failed."') 1960 | print('"But I admire your willpower and resourcefulness to make it all the way here from Goodshire."') 1961 | print('"I want to make you an offer. Join me, and become my champion. Together, we will forge a New Dawn."') 1962 | print('"Your old ways are gone. You have failed your order, and they will no longer accept you."') 1963 | print('"If you decline, I won\'t kill you, but I will beat you within an inch of your life and enslave you for eternity."\n') 1964 | print('"The choice is yours, ' + name + '."\n') 1965 | print('1 Accept offer\n2 Decline offer\n') 1966 | selection = input('>: ') 1967 | os.system('cls') 1968 | 1969 | if selection == '1': 1970 | char_menu() 1971 | print('You join the forces of Chernobog, the Prince of Darkness, and forsake your old way of life. You both combine your powers and forge a New Dawn.') 1972 | print() 1973 | input('Press enter to end game') 1974 | title_screen() 1975 | 1976 | elif selection == '2': 1977 | print('"Very well, then." Chernobog stands up.') 1978 | input('Press enter to fight') 1979 | 1980 | enemy_battlescore = 170 1981 | damage_taken = enemy_battlescore - martial_prowess 1982 | hp = int(hp - damage_taken) 1983 | if hp > 0: 1984 | print('You have slain the Antipope. His body magically lights on fire, and leaves ashes on the ground.') 1985 | print('Your surroundings shimmer, and the city of Salem transforms from its ruined state to its former glory. You have succeeded in every goal.') 1986 | input('Press enter to continue') 1987 | char_menu() 1988 | os.system('cls') 1989 | print('You win!') 1990 | 1991 | print('Occupation: ' + occupation + '') 1992 | input('Press enter to end game') 1993 | title_screen() 1994 | 1995 | else: 1996 | hp = 0.1 1997 | char_menu() 1998 | print() 1999 | print('You have lost the fight, letting Chernobog win. He enslaves you for all eternity, and he takes over the world.\n') 2000 | input('Press enter to end game') 2001 | title_screen() 2002 | 2003 | else: 2004 | salem() 2005 | 2006 | 2007 | title_screen() 2008 | -------------------------------------------------------------------------------- /thecrusadersquest1.2.py: -------------------------------------------------------------------------------- 1 | # Python Text RPG 2 | # Authored by: Gaga Gievous 3 | # Copyright February 2021 4 | 5 | import cmd 6 | import textwrap 7 | import sys 8 | import os 9 | import time 10 | import random 11 | import math 12 | 13 | counter = 0 14 | counter_set = 0 15 | 16 | name ='' 17 | hp = 0 18 | max_hp = 0 19 | 20 | martial_prowess = 0 21 | consumption_rate = 10 22 | endurance = 10 23 | food = 0 24 | max_food = 0 25 | race = '' 26 | luck = 0 27 | arrows = 0 28 | max_arrows = 0 29 | speed = 0 30 | occupation = '' 31 | illness = 'None' 32 | gold = 100 33 | max_gold = 0 34 | 35 | blacksmith_price = 500 36 | 37 | 38 | 39 | weapon = 'Sword' 40 | weapon_type = 'sword' 41 | 42 | location = '' 43 | days_to_go = 0 44 | adventure_state = False 45 | 46 | enemy_adjective = '' 47 | enemy_type = '' 48 | enemy_locater = '' 49 | enemy_number = '' 50 | enemy_exclude = 0 51 | enemy_battlescore = 0 52 | enemy_gold = 0 53 | enemy_arrows = 0 54 | enemy_food = 0 55 | enemy_specific_gold = 0 56 | enemy_specific_arrows = 0 57 | enemy_specific_food = 0 58 | damage_taken = 0 59 | 60 | ### Title Screen ### 61 | def title_screen_selections(): 62 | option = input('>: ') 63 | 64 | if option.lower() == '1': 65 | setup_game() 66 | elif option.lower() == '2': 67 | help_menu() 68 | elif option.lower() == '0': 69 | sys.exit() 70 | while option.lower() not in ['1', '2', '0']: 71 | option = input('>: ') 72 | if option() == '1': 73 | setup_game() 74 | elif option() == '2': 75 | help_menu() 76 | elif option() == '0': 77 | sys.exit() 78 | 79 | def title_screen(): 80 | os.system('cls') 81 | print('#####################################################################################################################') 82 | print('#####################################################################################################################') 83 | print('## ## ## ## ###### ## ### ## #### ## ## #### ## ### #### ##### #### ## ## #### ## ###') 84 | print('#### #### ## ## ######## #### ## ## ## ### #### ## ## # ### #### ## ## ### ####### ## #### ## ## ##### ###### #####') 85 | print('#### #### ## ###### #### #### ## ### ### ## ## ## ## ######## ###### ## #### ## ## ### ##### #####') 86 | print('#### #### ## ## ######## #### # #### ## #### ### ## ## # ### #### # ######### ###### ## #### ## ## ###### ##### #####') 87 | print('#### #### ## ## ###### ## ## ## ## #### ## ## #### ## ## ##### ####### ## ## ## ###### #####') 88 | print('#####################################################################################################################') 89 | print('#####################################################################################################################') 90 | print('The Crusader\'s Quest: Survival Text RPG.\n') 91 | print(' 1 Play ') 92 | print(' 2 Tips ') 93 | print(' 0 Quit ') 94 | title_screen_selections() 95 | 96 | def help_menu(): 97 | print('Human, Dwarf, and Satyr are the best races for beginners.') 98 | print('The Adventurer class works well with every race, but is not necessarily the best.') 99 | 100 | title_screen_selections() 101 | 102 | ### Character Creation ### 103 | 104 | # Name # 105 | def setup_game(): 106 | global name 107 | global hp 108 | global max_hp 109 | global martial_prowess 110 | global consumption_rate 111 | global endurance 112 | global food 113 | global max_food 114 | global race 115 | global luck 116 | global arrows 117 | global max_arrows 118 | global speed 119 | global occupation 120 | global illness 121 | global illness_chance 122 | global gold 123 | global max_gold 124 | global durability 125 | global weapon 126 | global max_heal_item 127 | global adventure_state 128 | 129 | arrows = 0 130 | gold = 0 131 | food = 0 132 | max_arrows = 0 133 | max_gold = 0 134 | max_food = 0 135 | hp = 0 136 | max_hp = 0 137 | martial_prowess = 0 138 | heal_item = 0 139 | endurance = 10 140 | adventure_state = False 141 | os.system('cls') 142 | print('The Antipope is defiling the holiest religious site in the world. You are a warrior monk from the Freemasons, and it is up to you to destroy the Antipope.\n') 143 | print('You begin your journey in Goodshire, one of the many towns you hope to pass through.\n') 144 | print('What is your name?\n') 145 | 146 | name = input('>: ') 147 | 148 | # Race # 149 | os.system('cls') 150 | print('What is your race?\n') 151 | print('1 Human\n2 Dwarf\n3 Satyr\n4 Halfling\n5 Elf\n6 Tigerman\n7 Leprechaun\n') 152 | 153 | selection = input('>: ') 154 | if selection == '1': 155 | race = "Human" 156 | hp = 25 157 | max_hp = 25 158 | martial_prowess = 10 159 | consumption_rate = 10 160 | endurance = 30 161 | gold = 100 162 | luck = 0 163 | speed = 0 164 | 165 | elif selection == '2': 166 | race = "Dwarf" 167 | hp = 50 168 | max_hp = 50 169 | martial_prowess = 30 170 | consumption_rate = 20 171 | endurance = 240 172 | gold = 200 173 | luck = 0 174 | speed = 0 175 | 176 | elif selection == '3': 177 | race = "Satyr" 178 | hp = 200 179 | max_hp = 200 180 | martial_prowess = 0 181 | consumption_rate = 20 182 | endurance = 240 183 | gold = 0 184 | luck = 0 185 | speed = 0 186 | 187 | elif selection == '4': 188 | race = "Halfling" 189 | hp = 25 190 | max_hp = 25 191 | martial_prowess = 0 192 | consumption_rate = 20 193 | endurance = 200 194 | gold = 100 195 | luck = 0 196 | speed = 0 197 | 198 | elif selection == '5': 199 | race = "Elf" 200 | hp = 10 201 | max_hp = 10 202 | martial_prowess = 0 203 | consumption_rate = 10 204 | endurance = 1000 205 | gold = 100 206 | luck = 0 207 | speed = 0 208 | 209 | elif selection == '6': 210 | race = "Tigerman" 211 | hp = 25 212 | max_hp = 25 213 | martial_prowess = 50 214 | consumption_rate = 20 215 | endurance = 100 216 | gold = 0 217 | luck = 0 218 | speed = 0 219 | 220 | elif selection == '7': 221 | race = "Leprechaun" 222 | hp = 10 223 | max_hp = 10 224 | martial_prowess = 0 225 | consumption_rate = 10 226 | endurance = 10 227 | gold = 1000 228 | luck = 0 229 | speed = 0 230 | 231 | else: 232 | race = "Human" 233 | hp = 25 234 | max_hp = 25 235 | martial_prowess = 10 236 | consumption_rate = 10 237 | endurance = endurance + 30 238 | gold = 100 239 | luck = 0 240 | speed = 0 241 | 242 | os.system('cls') 243 | 244 | # Occupation # 245 | print('What is your occupation?\n') 246 | print('1 Hunter\n2 Knight\n3 Adventurer\n4 Assassin\n5 Glutton\n') 247 | 248 | selection = input('>: ') 249 | if selection == '1': 250 | occupation = 'Hunter' 251 | hp = hp + 10 252 | max_hp = max_hp + 10 253 | food = food + 50 254 | max_food = max_food + 150 255 | arrows = arrows + 75 256 | max_arrows = max_arrows + 100 257 | gold = gold + 0 258 | max_gold = max_gold + 800 259 | martial_prowess = martial_prowess + 0 260 | elif selection == '2': 261 | occupation = 'Knight' 262 | hp = hp + 100 263 | max_hp = max_hp + 100 264 | food = food + 25 265 | max_food = max_food + 100 266 | arrows = arrows + 8 267 | max_arrows = max_arrows + 10 268 | gold = gold + 400 269 | max_gold = max_gold + 1000 270 | martial_prowess = martial_prowess + 20 271 | elif selection == '3': 272 | occupation = 'Adventurer' 273 | hp = hp + 25 274 | max_hp = max_hp + 25 275 | food = food + 75 276 | max_food = max_food + 100 277 | arrows = arrows + 20 278 | max_arrows = max_arrows + 20 279 | gold = gold + 100 280 | max_gold = max_gold + 800 281 | martial_prowess = martial_prowess + 10 282 | elif selection == '4': 283 | occupation = 'Assassin' 284 | hp = hp + 0 285 | max_hp = max_hp + 0 286 | food = food + 25 287 | max_food = max_food + 100 288 | arrows = arrows + 8 289 | max_arrows = max_arrows + 10 290 | gold = gold + 100 291 | max_gold = max_gold + 1000 292 | martial_prowess = martial_prowess + 60 293 | elif selection == '5': 294 | occupation = 'Glutton' 295 | hp = hp + 25 296 | max_hp = max_hp + 25 297 | food = food + 500 298 | max_food = max_food + 500 299 | arrows = arrows + 0 300 | max_arrows = max_arrows + 1 301 | gold = gold + 0 302 | max_gold = max_gold + 1000 303 | martial_prowess = martial_prowess + 0 304 | else: 305 | occupation = 'Hunter' 306 | hp = hp + 10 307 | max_hp = max_hp + 10 308 | food = food + 50 309 | max_food = max_food + 150 310 | arrows = arrows + 75 311 | max_arrows = max_arrows + 100 312 | gold = gold + 0 313 | max_gold = max_gold + 300 314 | martial_prowess = martial_prowess + 0 315 | 316 | os.system('cls') 317 | 318 | print('What kind of weapon do you want to use? (ie. sword, poleaxe, etc.)') 319 | 320 | weapon = input('>: ') 321 | gold_mechanic() 322 | os.system('cls') 323 | 324 | #print('What is your weapon called? (ie. Thorn, Crusher, etc.)') 325 | 326 | #weapon = input('>: ') 327 | #os.system('cls') 328 | 329 | print('You are ' + name + ', the ' + race + ' ' + occupation + '. You wield a ' + weapon + '.\n') 330 | print('1 Begin Adventure\n2 Restart') 331 | selection = input('>: ') 332 | if selection == '1': 333 | start_game() 334 | else: 335 | title_screen() 336 | 337 | ### Death ### 338 | def death(): 339 | os.system('cls') 340 | print('You have died.\n') 341 | selection = input('Press enter enter to continue') 342 | char_menu() 343 | print() 344 | print('1 Menu\n') 345 | selection = input('>: ') 346 | if selection == '1': 347 | title_screen() 348 | else: 349 | title_screen() 350 | 351 | ### Food and Endurance Mechanic ### 352 | 353 | def food_endurance_mechanic(): 354 | global food 355 | global endurance 356 | global consumption_rate 357 | if food < consumption_rate and food > 0: 358 | food = 0 359 | elif food > 1: 360 | food = food - consumption_rate 361 | elif food < 1: 362 | food = 0 363 | endurance = endurance - consumption_rate 364 | if endurance < 1: 365 | endurance = 0 366 | death() 367 | elif endurance <= consumption_rate: 368 | print('If you do not get food, you will starve to death.') 369 | 370 | #need to work on restoring endurance# 371 | 372 | ### Resource Mechanics ### 373 | 374 | def hp_mechanic(): 375 | global hp 376 | global max_hp 377 | if hp > max_hp: 378 | hp = max_hp 379 | print('You have max HP.') 380 | if hp < 1: 381 | hp = 0 382 | death() 383 | 384 | def gold_mechanic(): 385 | global gold 386 | global max_gold 387 | if gold < 1: 388 | gold = 0 389 | if gold > max_gold: 390 | gold = max_gold 391 | print('You have completely filled your coin purse.') 392 | if gold < 1: 393 | gold = 0 394 | 395 | def food_mechanic(): 396 | global food 397 | global max_food 398 | if food > max_food: 399 | food = max_food 400 | print('You have maxed out your food supply.') 401 | if food < 1: 402 | food = 0 403 | 404 | def arrows_mechanic(): 405 | global arrows 406 | global max_arrows 407 | if arrows < 1: 408 | arrows = 0 409 | if arrows > max_arrows: 410 | arrows = max_arrows 411 | print('You have maxed out your arrow count.') 412 | if arrows < 1: 413 | arrows = 0 414 | 415 | ### Character Menu ### 416 | def char_menu(): 417 | os.system('cls') 418 | global name 419 | global hp 420 | global max_hp 421 | global martial_prowess 422 | global consumption_rate 423 | global endurance 424 | global food 425 | global max_food 426 | global race 427 | global luck 428 | global arrows 429 | global max_arrows 430 | global speed 431 | global occupation 432 | global illness 433 | global illness_chance 434 | global gold 435 | global max_gold 436 | global weapon 437 | 438 | print('######################') 439 | print('Name: ' + name + '') 440 | print('Race: ' + race + '') 441 | print('Occupation: ' + occupation + '') 442 | print('######################') 443 | print('HP: ' + str(hp) + '/' + str(max_hp) + '') 444 | print('Martial Prowess: ' + str(martial_prowess) + '') 445 | print('Weapon: ' + weapon + '') 446 | print('######################') 447 | print('Consumption Rate: ' + str(consumption_rate) + '') 448 | print('Food: ' + str(food) + '/' + str(max_food) + '') 449 | print('Endurance: ' + str(endurance) + '') 450 | print('Arrows: ' + str(arrows) + '/' + str(max_arrows) + '') 451 | print('######################') 452 | #print('Luck: ' + str(luck) + '') 453 | #print('Speed: ' + str(speed) + '\n') 454 | #print('Illness: ' + illness + '') 455 | print('Gold: ' + str(gold) + '/' + str(max_gold) + '') 456 | print('######################\n') 457 | selection = input('Press enter to continue') 458 | 459 | 460 | ### Adventure Menu ### 461 | def adventure_menu(): 462 | global hp 463 | global max_hp 464 | global martial_prowess 465 | global consumption_rate 466 | global endurance 467 | global food 468 | global max_food 469 | global arrows 470 | global max_arrows 471 | global gold 472 | global max_gold 473 | global weapon 474 | 475 | os.system('cls') 476 | print('######################') 477 | print('HP: ' + str(hp) + '/' + str(max_hp) + '') 478 | print('Food: ' + str(food) + '/' + str(max_food) + '') 479 | print('Arrows: ' + str(arrows) + '/' + str(max_arrows) + '') 480 | print('Gold: ' + str(gold) + '/' + str(max_gold) + '') 481 | print('Endurance: ' + str(endurance) + '') 482 | print('######################') 483 | print('Martial Prowess: ' + str(martial_prowess) + '') 484 | print('Weapon: ' + weapon + '') 485 | print('Consumption Rate: ' + str(consumption_rate) + '') 486 | print('######################\n') 487 | 488 | ### Map ### Update this to turn X into another symbol when that location is active 489 | def the_map(): 490 | #print('Key: T = Town; C = City; etc.) 491 | 492 | if location == 'Goodshire': 493 | 494 | print('-----------------') 495 | print('| G | | | |') 496 | print('+---+---+---+---+') 497 | print('| X | | | |') 498 | print('+---+---+---+---+') 499 | print('| | X | | |') 500 | print('+---+---+---+---+') 501 | print('| | X | X | |') 502 | print('+---+---+---+---+') 503 | print('| | | | X |') 504 | print('+---------------+\n') 505 | 506 | if location == 'Rodez': 507 | 508 | print('-----------------') 509 | print('| G | | | |') 510 | print('+---+---+---+---+') 511 | print('| R | | | |') 512 | print('+---+---+---+---+') 513 | print('| | X | | |') 514 | print('+---+---+---+---+') 515 | print('| | X | X | |') 516 | print('+---+---+---+---+') 517 | print('| | | | X |') 518 | print('+---------------+\n') 519 | 520 | 521 | if location == 'Oristano': 522 | 523 | print('-----------------') 524 | print('| G | | | |') 525 | print('+---+---+---+---+') 526 | print('| R | | | |') 527 | print('+---+---+---+---+') 528 | print('| | O | | |') 529 | print('+---+---+---+---+') 530 | print('| | X | X | |') 531 | print('+---+---+---+---+') 532 | print('| | | | X |') 533 | print('+---------------+\n') 534 | 535 | if location == 'Thasos': 536 | 537 | print('-----------------') 538 | print('| G | | | |') 539 | print('+---+---+---+---+') 540 | print('| R | | | |') 541 | print('+---+---+---+---+') 542 | print('| | O | | |') 543 | print('+---+---+---+---+') 544 | print('| | T | X | |') 545 | print('+---+---+---+---+') 546 | print('| | | | X |') 547 | print('+---------------+\n') 548 | 549 | if location == 'Karabuk': 550 | 551 | print('-----------------') 552 | print('| G | | | |') 553 | print('+---+---+---+---+') 554 | print('| R | | | |') 555 | print('+---+---+---+---+') 556 | print('| | O | | |') 557 | print('+---+---+---+---+') 558 | print('| | T | K | |') 559 | print('+---+---+---+---+') 560 | print('| | | | X |') 561 | print('+---------------+\n') 562 | 563 | if location == 'Salem': 564 | 565 | print('-----------------') 566 | print('| G | | | |') 567 | print('+---+---+---+---+') 568 | print('| R | | | |') 569 | print('+---+---+---+---+') 570 | print('| | O | | |') 571 | print('+---+---+---+---+') 572 | print('| | T | K | |') 573 | print('+---+---+---+---+') 574 | print('| | | | S |') 575 | print('+---------------+\n') 576 | 577 | days_to_go() 578 | 579 | ### Days to Go ### 580 | def days_to_go(): 581 | global location 582 | global counter 583 | global counter_set 584 | global adventure_state 585 | 586 | if location == 'Goodshire': 587 | if adventure_state == False: 588 | counter_set = 7 589 | counter = 7 590 | print('You will brave the wilds for ' + str(counter_set) + ' days.') 591 | print('1 Continue\n2 Back') 592 | selection = input('>: ') 593 | if selection == '1': 594 | input('Press enter to continue') 595 | adventuring() 596 | 597 | elif selection == '2': 598 | town() 599 | else: 600 | town() 601 | if adventure_state == True: 602 | print('You have ' + str(counter) + ' days to go.') 603 | input('Press enter to continue') 604 | 605 | if location == 'Rodez': 606 | if adventure_state == False: 607 | counter_set = 11 608 | counter = 11 609 | print('You will brave the wilds for ' + str(counter_set) + ' days.') 610 | print('1 Continue\n2 Back') 611 | selection = input('>: ') 612 | if selection == '1': 613 | input('Press enter to continue') 614 | adventuring() 615 | 616 | if selection == '2': 617 | town() 618 | else: 619 | town() 620 | if adventure_state == True: 621 | print('You have ' + str(counter) + ' days to go.') 622 | input('Press enter to continue') 623 | if location == 'Oristano': 624 | if adventure_state == False: 625 | counter_set = 15 626 | counter = 15 627 | print('You will brave the wilds for ' + str(counter_set) + ' days.') 628 | print('1 Continue\n2 Back') 629 | selection = input('>: ') 630 | if selection == '1': 631 | input('Press enter to continue') 632 | adventuring() 633 | 634 | if selection == '2': 635 | town() 636 | else: 637 | town() 638 | if adventure_state == True: 639 | print('You have ' + str(counter) + ' days to go.') 640 | input('Press enter to continue') 641 | if location == 'Thasos': 642 | if adventure_state == False: 643 | counter_set = 19 644 | counter = 19 645 | print('You will brave the wilds for ' + str(counter_set) + ' days.') 646 | print('1 Continue\n2 Back') 647 | selection = input('>: ') 648 | if selection == '1': 649 | input('Press enter to continue') 650 | adventuring() 651 | 652 | if selection == '2': 653 | town() 654 | else: 655 | town() 656 | if adventure_state == True: 657 | print('You have ' + str(counter) + ' days to go.') 658 | input('Press enter to continue') 659 | if location == 'Karabuk': 660 | if adventure_state == False: 661 | counter_set = 25 662 | counter = 25 663 | print('You will brave the wilds for ' + str(counter_set) + ' days.') 664 | print('1 Continue\n2 Back') 665 | selection = input('>: ') 666 | if selection == '1': 667 | input('Press enter to continue') 668 | adventuring() 669 | 670 | if selection == '2': 671 | town() 672 | else: 673 | town() 674 | if adventure_state == True: 675 | print('You have ' + str(counter) + ' days to go.') 676 | input('Press enter to continue') 677 | if location == 'Last Refuge': 678 | if adventure_state == False: 679 | counter_set = 25 680 | counter = 25 681 | print('You will brave the wilds for ' + str(counter_set) + ' days.') 682 | print('1 Continue\n2 Back') 683 | selection = input('>: ') 684 | if selection == '1': 685 | input('Press enter to continue') 686 | adventuring() 687 | 688 | if selection == '2': 689 | town() 690 | else: 691 | town() 692 | if adventure_state == True: 693 | print('You have ' + str(counter) + ' days to go.') 694 | input('Press enter to continue') 695 | 696 | ### Treasure Generator ### 697 | #def treasure_generator(): 698 | # v = random.randint(0, 3) 699 | # print('You found ' + str(v) + ' treasures on this leg of the journey.') 700 | 701 | 702 | ### Location Changer ### 703 | def location_changer(): 704 | global location 705 | global adventure_state 706 | 707 | adventure_state == False 708 | 709 | if location == 'Goodshire': 710 | location = 'Rodez' 711 | blacksmith_price_generator() 712 | #treasure_generator() 713 | town() 714 | if location == 'Rodez': 715 | location = 'Oristano' 716 | blacksmith_price_generator() 717 | town() 718 | if location == 'Oristano': 719 | location = 'Thasos' 720 | blacksmith_price_generator() 721 | town() 722 | if location == 'Thasos': 723 | location = 'Karabuk' 724 | blacksmith_price_generator() 725 | town() 726 | if location == 'Karabuk': 727 | location = 'Salem' 728 | blacksmith_price_generator() 729 | salem() 730 | if location == 'Last Refuge': 731 | location = 'Rodez' 732 | blacksmith_price_generator() 733 | #end_game() 734 | 735 | #town() 736 | 737 | ### Town Description ### 738 | def town_description(): 739 | global location 740 | 741 | if location == 'Goodshire': 742 | print('The sun shines brightly on the lazy Halfling natives.') 743 | elif location == 'Rodez': 744 | print('The sky is overcast, and your feet squelch in the mud from a recent rain.') 745 | elif location == 'Oristano': 746 | print('The surrounding trees loom over the town like giants, and block the sun\'s rays.') 747 | elif location == 'Thasos': 748 | print('A hot, dry wind blows clouds across the yellow sun, and you feel hot.') 749 | elif location == 'Karabuk': 750 | print('There is a foul stench in the air, and the ground is covered bubbling puddles of unknown origin.') 751 | 752 | ### Start Game ### 753 | def start_game(): 754 | global location 755 | location = 'Goodshire' 756 | blacksmith_price_generator() 757 | enemy_locater_generator() 758 | town() 759 | 760 | ### Town ### 761 | def town(): 762 | global counter 763 | global adventure_state 764 | os.system('cls') 765 | adventure_state == False 766 | print('You are in ' + location + '.') 767 | town_description() 768 | print() 769 | print('1 Tavern\n2 Blacksmith\n3 Character\n4 Adventure') 770 | selection = input('>: ') 771 | if selection == '1': 772 | os.system('cls') 773 | tavern() 774 | if selection == '4': 775 | os.system('cls') 776 | counter = 0 777 | the_map() 778 | print('You will brave the wilds for 5 days.') 779 | input('Press enter to continue') 780 | adventuring() 781 | 782 | if selection == '2': 783 | os.system('cls') 784 | blacksmith() 785 | if selection == '3': 786 | os.system('cls') 787 | char_menu() 788 | town() 789 | else: 790 | town() 791 | 792 | ### Tavern ### 793 | def tavern(): 794 | global food 795 | global consumption_rate 796 | global gold 797 | global hp 798 | global location 799 | 800 | os.system('cls') 801 | print('######################') 802 | print('Gold: ' + str(gold) + '/' + str(max_gold) + '') 803 | print('HP: ' + str(hp) + '/' + str(max_hp) + '') 804 | print('Food: ' + str(food) + '/' + str(max_food) + '') 805 | print('######################\n') 806 | print('"Welcome to the ' + location + ' Inn. How may I serve you?"\n') 807 | print('1 Rest (1 gold)\n2 Buy Food (5 gold)\n3 Sell Food (3 gold)\n4 Speak with random patron\n5 Back') 808 | selection = input('>: ') 809 | if selection == '1': 810 | if gold < 1: 811 | print('You cannot afford a bed here.') 812 | input('Press enter to continue.') 813 | tavern() 814 | else: 815 | print('You slept like a rock.') 816 | hp = hp + 99999 817 | hp_mechanic() 818 | gold = gold - 1 819 | input('Press enter to continue.') 820 | tavern() 821 | 822 | if selection == '2': 823 | print('How much food do you want to buy?') 824 | total_cost = 0 825 | food_price = 5 826 | n = input('>: ') 827 | if n == '0': 828 | tavern() 829 | n = int(n) 830 | total_cost = n * food_price 831 | if total_cost > gold: 832 | print('You do not have enough gold to buy ' + str(n) + ' food.') 833 | input('Press enter to continue') 834 | tavern() 835 | elif total_cost <= gold: 836 | food = food + n 837 | food_mechanic() 838 | gold = gold - total_cost 839 | print('You complete the transaction') 840 | input('Press enter to continue') 841 | tavern() 842 | if selection == '3': 843 | print('How much food do you want to sell?') 844 | total_sell = 0 845 | food_sell = 3 846 | n = input('>: ') 847 | if n == '0': 848 | tavern() 849 | n = int(n) 850 | total_sell = n * food_sell 851 | if food < n: 852 | print('You do not have that much food.') 853 | input('Press enter to continue') 854 | blacksmith() 855 | if food >= n: 856 | food = food - n 857 | gold = gold + total_sell 858 | print('You complete the transaction') 859 | gold_mechanic() 860 | input('Press enter to continue') 861 | os.system('cls') 862 | tavern() 863 | if selection == '4': 864 | talk() 865 | tavern() 866 | if selection == '5': 867 | town() 868 | else: 869 | tavern() 870 | 871 | # Talk # 872 | def talk(): 873 | dialogue = random.randint(1, 10) 874 | part = '' 875 | if dialogue == 1: 876 | print('I don\'t take too kindly to travelers.') 877 | if dialogue == 2: 878 | print('I\'m too scared to leave ' + location + '. I don\'t know how you survive out there.') 879 | if dialogue == 3: 880 | print('The ' + location + ' Inn is the best tavern in the world. Not that I would know.') 881 | if dialogue == 4: 882 | print('There\'s nasty things where you\'re headed.') 883 | if dialogue == 5: 884 | print('Someone I know was killed looking inside a hollow tree. You wouldn\'t want that happening to you.') 885 | if dialogue == 6: 886 | print('If you run out of food and arrows in the wilds, how will you survive? On pure endurance?') 887 | if dialogue == 7: 888 | print('If you want stronger equipment, I recommend going to the blacksmith.') 889 | if dialogue == 8: 890 | n = random.randint(1, 8) 891 | if n == 1: 892 | part = 'arm' 893 | if n == 2: 894 | part = 'leg' 895 | if n == 3: 896 | part = 'hand' 897 | if n == 4: 898 | part = 'foot' 899 | if n == 5: 900 | part = 'eye' 901 | if n == 6: 902 | part = 'ear' 903 | if n == 7: 904 | part = 'finger' 905 | if n == 8: 906 | part = 'toe' 907 | print('In the wilds, I got caught in a hunter\'s trap. That\'s how I lost my ' + part + '.') 908 | if dialogue == 9: 909 | print('Tales of the beasts and Satanic denizens in the wilds have kept me inside the city walls.') 910 | if dialogue == 10: 911 | print('The good thing about resting at ' + location + ' Inn is that you get a complimentary meal.') 912 | input('Press enter to continue') 913 | tavern() 914 | ### Blacksmith ### 915 | def blacksmith(): 916 | global weapon 917 | global weapon_type 918 | global gold 919 | global max_gold 920 | global blacksmith_price 921 | global martial_prowess 922 | global arrows 923 | global max_arrows 924 | 925 | os.system('cls') 926 | print('######################') 927 | print('Gold: ' + str(gold) + '/' + str(max_gold) + '') 928 | print('Arrows: ' + str(arrows) + '/' + str(max_arrows) + '') 929 | print('Martial Prowess: ' + str(martial_prowess) + '') 930 | print('######################\n') 931 | print('"What can I do for you, traveler?"') 932 | print('1 Upgrade your ' + weapon + ' (' + str(blacksmith_price) + ') gold.\n2 Buy Arrows (5 gold)\n3 Sell Arrows (3 gold) \n4 Back') 933 | selection = input('>: ') 934 | if selection == '1': 935 | if gold < blacksmith_price: 936 | print('You do not have enough gold to upgrade your ' + weapon_type + '.') 937 | input('Press enter to continue') 938 | blacksmith() 939 | else: 940 | gold = gold - blacksmith_price 941 | gold_mechanic() 942 | v = random.randint(10, 30) 943 | martial_prowess = martial_prowess + v 944 | print('Your martial prowess increases by ' + str(v) + '.') 945 | input('Press enter to continue') 946 | blacksmith() 947 | if selection == '2': 948 | print('How many arrows do you want to buy?') 949 | total_cost = 0 950 | arrow_price = 5 951 | n = input('>: ') 952 | n = int(n) 953 | total_cost = n * arrow_price 954 | if total_cost > gold: 955 | print('You do not have enough gold to buy ' + str(n) + ' arrows.') 956 | input('Press enter to continue') 957 | blacksmith() 958 | if total_cost <= gold: 959 | arrows = arrows + n 960 | arrows_mechanic() 961 | gold = gold - total_cost 962 | print('You complete the transaction') 963 | input('Press enter to continue') 964 | blacksmith() 965 | if selection == '3': 966 | print('How many arrows do you want to sell?') 967 | total_sell = 0 968 | arrow_sell = 3 969 | n = input('>: ') 970 | n = int(n) 971 | total_sell = n * arrow_sell 972 | if arrows < n: 973 | print('You do not have that many arrows.') 974 | input('Press enter to continue') 975 | blacksmith() 976 | if arrows >= n: 977 | arrows = arrows - n 978 | gold = gold + total_sell 979 | print('You complete the transaction') 980 | gold_mechanic() 981 | input('Press enter to continue') 982 | os.system('cls') 983 | blacksmith() 984 | 985 | if selection == '4': 986 | town() 987 | else: 988 | blacksmith() 989 | 990 | 991 | ### Blacksmith Price Generator ### 992 | def blacksmith_price_generator(): 993 | global gold 994 | global location 995 | global blacksmith_price 996 | 997 | blacksmith_price = random.randint(51, 75) 998 | if location == 'Rodez': 999 | blacksmith_price = blacksmith_price + 25 1000 | if location == 'Oristano': 1001 | blacksmith_price = blacksmith_price + 45 1002 | if location == 'Thasos': 1003 | blacksmith_price = blacksmith_price + 65 1004 | if location == 'Karabuk': 1005 | blacksmith_price = blacksmith_price + 85 1006 | if location == 'Last Refuge': 1007 | blacksmith_price = blacksmith_price + 105 1008 | 1009 | 1010 | ### Adventuring ### 1011 | def adventuring(): 1012 | global name 1013 | global hp 1014 | global max_hp 1015 | global martial_prowess 1016 | global consumption_rate 1017 | global endurance 1018 | global food 1019 | global max_food 1020 | global race 1021 | global luck 1022 | global arrows 1023 | global max_arrows 1024 | global speed 1025 | global occupation 1026 | global illness 1027 | global gold 1028 | global max_gold 1029 | global weapon 1030 | global counter 1031 | global location 1032 | global adventure_state 1033 | 1034 | adventure_state == True 1035 | while counter != 0: 1036 | adventure_state = True 1037 | if hp > 0: 1038 | adventure_menu() 1039 | print('1 Continue\n2 Hunt\n3 Rest\n4 Map\n') 1040 | selection = input('>: ') 1041 | os.system('cls') 1042 | if selection == '1': 1043 | food_endurance_mechanic() 1044 | adventure_menu() 1045 | random_event() 1046 | counter = counter - 1 1047 | if selection == '2': 1048 | hunt() 1049 | if selection == '3': 1050 | rest() 1051 | if selection == '4': 1052 | the_map() 1053 | else: 1054 | adventuring() 1055 | else: 1056 | death() 1057 | counter = 0 1058 | os.system('cls') 1059 | adventure_menu() 1060 | print('You have survived the trip.') 1061 | adventure_state = False 1062 | print('Enter 0 to continue.') 1063 | selection = input('>: ') 1064 | if selection == '0': 1065 | location_changer() 1066 | else: 1067 | adventuring() #was location_changer() 1068 | 1069 | ### Rest ### 1070 | def rest(): 1071 | global hp 1072 | global max_hp 1073 | global food 1074 | 1075 | x = random.randint(15, 25) 1076 | food_endurance_mechanic() 1077 | 1078 | if hp == max_hp: 1079 | print('You rest for one day. Your HP is already maxed out.') 1080 | 1081 | input('Press enter to continue') 1082 | adventuring() 1083 | 1084 | print('You rest for one day, gaining ' + str(x) + ' HP.') 1085 | hp = hp + x 1086 | hp_mechanic() 1087 | 1088 | input('Press enter to continue') 1089 | 1090 | ### Hunt ### 1091 | def hunt(): 1092 | global arrows 1093 | global food 1094 | x = random.randint(1, 10) 1095 | y = random.randint(1, 25) 1096 | 1097 | if arrows == 0: 1098 | print('You do not have any arrows to hunt with.') 1099 | input('Press enter to continue') 1100 | adventuring() 1101 | 1102 | elif arrows < x: 1103 | adventure_menu() 1104 | x = arrows 1105 | arrows = arrows - x 1106 | food = food + y 1107 | arrows_mechanic() 1108 | print('You shot ' + str(x) + ' arrows, and gained ' + str(y) + ' food.') 1109 | food_mechanic() 1110 | 1111 | else: 1112 | adventure_menu() 1113 | arrows = arrows - x 1114 | food = food + y 1115 | arrows_mechanic() 1116 | food_mechanic() 1117 | print('You shot ' + str(x) + ' arrows, and gained ' + str(y) + ' food.') 1118 | 1119 | input('Press enter to continue') 1120 | 1121 | 1122 | ######################################################################## 1123 | ########################### Random Events ############################## 1124 | ######################################################################## 1125 | def random_event(): 1126 | n = random.randint(1, 20) 1127 | if n == 1: 1128 | chest() 1129 | if n == 2: 1130 | fight() 1131 | if n == 3: 1132 | robbed() 1133 | if n == 4: 1134 | traveller() 1135 | if n == 5: 1136 | damaged() 1137 | if n == 6: 1138 | miracle() 1139 | if n == 7: 1140 | mushroom() 1141 | if n == 8: 1142 | nothing() 1143 | if n == 9: 1144 | fight() 1145 | if n == 10: 1146 | fight() 1147 | if n == 11: 1148 | chest() 1149 | if n == 12: 1150 | fight() 1151 | if n == 13: 1152 | robbed() 1153 | if n == 14: 1154 | traveller() 1155 | if n == 15: 1156 | damaged() 1157 | if n == 16: 1158 | mystic() 1159 | if n == 17: 1160 | bigger_bag() 1161 | if n == 18: 1162 | lose_day() 1163 | if n == 19: 1164 | fight() 1165 | if n == 20: 1166 | fight() 1167 | 1168 | ### Mushroom ### 1169 | def mushroom(): 1170 | global endurance 1171 | global hp 1172 | global consumption_rate 1173 | global race 1174 | 1175 | print('You see a strange mushroom.') 1176 | print('1 Consume\n2 Leave') 1177 | w = 0 1178 | selection = input('>: ') 1179 | if selection == '1': 1180 | x = random.randint(1, 4) 1181 | if x == 1: 1182 | if race == 'Satyr': 1183 | w = consumption_rate + consumption_rate + consumption_rate 1184 | endurance = endurance + w 1185 | print('You eat the mushroom, and gain ' + str(w) + ' Endurance.') 1186 | else: 1187 | print('You eat the mushroom, and nothing happened.') 1188 | if x == 2: 1189 | if race == 'Satyr': 1190 | w = consumption_rate + consumption_rate + consumption_rate 1191 | endurance = endurance + w 1192 | print('You eat the mushroom, and gain ' + str(w) + ' Endurance.') 1193 | else: 1194 | print('You eat the mushroom, and it causes you to vomit.') 1195 | food_endurance_mechanic() 1196 | if x == 3: 1197 | w = consumption_rate + consumption_rate 1198 | endurance = endurance + w 1199 | print('You eat the mushroom, and gain ' + str(w) + ' Endurance.') 1200 | if x == 4: 1201 | if race == 'Satyr': 1202 | w = consumption_rate + consumption_rate 1203 | endurance = endurance + w 1204 | print('You eat the mushroom, and gain ' + str(w) + ' Endurance.') 1205 | else: 1206 | hp = 0 1207 | endurance = 0 1208 | print('You eat the mushroom, and then fall to the ground, foaming at the mouth.') 1209 | input('Press enter to continue') 1210 | death() 1211 | 1212 | elif selection == '2': 1213 | print('You leave the mushroom.') 1214 | else: 1215 | mushroom() 1216 | input('Press enter to continue') 1217 | 1218 | ### Miracle ### 1219 | def miracle(): 1220 | global race 1221 | global food 1222 | global max_food 1223 | global arrows 1224 | global max_arrows 1225 | global gold 1226 | global max_gold 1227 | global hp 1228 | global max_hp 1229 | 1230 | if race == 'Halfling': 1231 | print('You see an old wizard, and the wizard beckons you over.') 1232 | print('"Ho, there, traveler!"') 1233 | print('"I did not expect to see a Halfing out in the wilderness."') 1234 | print('"This is delightful. Here, have a gift."') 1235 | print('Fill:\n1 Food\n2 Arrows\n3 Gold\n4 HP') 1236 | selection = input('>: ') 1237 | if selection == '1': 1238 | food = max_food 1239 | food_mechanic 1240 | if selection == '2': 1241 | arrows = max_arrows 1242 | arrows_mechanic 1243 | if selection == '3': 1244 | gold = max_gold 1245 | gold_mechanic 1246 | if selection == '4': 1247 | hp = max_hp 1248 | hp_mechanic 1249 | input('Press enter to continue') 1250 | else: 1251 | nothing() 1252 | 1253 | ### Bigger Bag ### 1254 | def bigger_bag(): 1255 | global max_food 1256 | global max_arrows 1257 | global max_gold 1258 | 1259 | y = random.randint(1, 3) 1260 | if y == 1: 1261 | max_food = max_food + 10 1262 | print('You find an empty food storage container on the side of the path, and it holds more food than your current one.') 1263 | input('Press enter to take\n') 1264 | print('Max food increased by 10.') 1265 | if y == 2: 1266 | max_arrows = max_arrows + 10 1267 | print('You spot an empty quiver on the side of the path. It holds more arrows than your current one.') 1268 | input('Press enter to take\n') 1269 | print('Max arrows increased by 10.') 1270 | if y == 3: 1271 | max_gold = max_gold + 100 1272 | print('You discover an empty coin purse on the side of the path. It holds more gold than your current one.') 1273 | input('Press enter to take\n') 1274 | print('Max gold increased by 100.') 1275 | print() 1276 | input('Press enter to continue') 1277 | 1278 | ### Lose a Day ### 1279 | def lose_day(): 1280 | global counter 1281 | global location 1282 | v = random.randint(1, 3) 1283 | #y = random.randint(1, 2) 1284 | #k = random.randint(1, 100) 1285 | counter = counter + v 1286 | #if y == 1: 1287 | 1288 | print('You realize that you are lost. It will take you ' + str(v) + ' days to get back on the right path.') 1289 | #if y == 2: 1290 | #if location == 'Goodshire' or 'Rodez': 1291 | #print('You arrive at a bridge spanning a massive whitewater river that is guarded by a score of bandits. One bandit approaches you.') 1292 | #elif location == 'Oristano' or 'Thasos' or 'Karabuk': 1293 | #print('You arrive at a bridge spanning an enormous chasm that is guarded by a score of bandits. One bandit approaches you.') 1294 | #print('"If you want to cross this bridge, you have to pay us, ' + str(k) 'gold.\n') 1295 | # print('1 Pay gold\n2 Take a detour\n') 1296 | ## selection = input('>: ') 1297 | # if selection == '1': 1298 | # if k > gold: 1299 | # print('"That is not enough to cross, but we will keep what you gave us, and you can find another way around. Have fun out there."') 1300 | # gold = 0 1301 | ## else: 1302 | # gold = gold - k 1303 | # print('You gave the bandit ' + str(k) + ' gold, and they let you cross the bridge.') 1304 | # elif selection == '2' 1305 | # else: 1306 | # selection = input('>: ') 1307 | 1308 | 1309 | input('Press enter to continue') 1310 | 1311 | ### Mystic ### 1312 | def mystic(): 1313 | global name 1314 | global hp 1315 | global max_hp 1316 | global martial_prowess 1317 | global consumption_rate 1318 | global endurance 1319 | global food 1320 | global max_food 1321 | global race 1322 | global luck 1323 | global arrows 1324 | global max_arrows 1325 | global speed 1326 | global occupation 1327 | global illness 1328 | global illness_chance 1329 | global gold 1330 | global max_gold 1331 | global weapon 1332 | global consumption_rate 1333 | 1334 | 1335 | 1336 | print('You come upon a roaming mystic.') 1337 | print('The mystic offers you a blessing.\n') 1338 | print('Increase:\n1 Max HP\n2 Endurance\n3 Martial Prowess\n') 1339 | #print('Fill: ') 1340 | selection = input('>: ') 1341 | os.system('cls') 1342 | if selection == '1': 1343 | max_hp = max_hp + 10 1344 | hp = hp + 10 1345 | print('Your max HP increases by 10.') 1346 | input('Press enter to continue') 1347 | elif selection == '2': 1348 | endurance = endurance + consumption_rate 1349 | print('Your endurance increases by ' + str(consumption_rate) + '.') 1350 | input('Press enter to continue') 1351 | elif selection == '3': 1352 | martial_prowess = martial_prowess + 10 1353 | print('Your martial prowess increases by 10.') 1354 | input('Press enter to continue') 1355 | else: 1356 | mystic() 1357 | 1358 | 1359 | ### Nothing ### 1360 | def nothing(): 1361 | print('Nothing notable happens.') 1362 | input('Press enter to continue') 1363 | 1364 | ### Damaged (Random Event) ### 1365 | def damaged(): 1366 | global hp 1367 | global gold 1368 | global food 1369 | global arrows 1370 | #adventure_menu() 1371 | v = random.randint(1, 20) 1372 | n = random.randint(1, 3) 1373 | hp = hp - v 1374 | 1375 | if n == 1: 1376 | g = random.randint(1, 20) 1377 | gold = gold + g 1378 | print('You sprain your ankle in a divot, taking ' + str(v) + ' damage.') 1379 | print('However, you find ' + str(g) + ' gold on the ground.') 1380 | gold_mechanic() 1381 | if n == 2: 1382 | f = random.randint(1, 20) 1383 | food = food + f 1384 | print('You are stung by a swarm of bees, taking ' + str(v) + ' damage.') 1385 | print('However, you manage to take ' + str(f) + ' honey before you flee.') 1386 | food_mechanic() 1387 | 1388 | if n == 3: 1389 | a = random.randint(1, 20) 1390 | arrows = arrows + a 1391 | print('You walk into an hunter\'s trap, taking ' + str(v) + ' damage.') 1392 | print('However, you find ' + str(a) + ' arrows nearby.') 1393 | arrows_mechanic() 1394 | 1395 | 1396 | input('Press enter to continue') 1397 | hp_mechanic() 1398 | 1399 | ### Traveller ### 1400 | def traveller(): 1401 | global gold 1402 | global arrows 1403 | global food 1404 | global hp 1405 | print('A friendly adventurer approaches you and wants to trade.') 1406 | n = random.randint(1, 3) 1407 | if n == 1: 1408 | print('"Good morning, traveler."\n') 1409 | if n == 2: 1410 | print('"Good evening, traveler."\n') 1411 | if n == 3: 1412 | print('"Good afternoon, traveler."\n') 1413 | 1414 | traveller_values() 1415 | 1416 | # Traveller Values # 1417 | def traveller_values(): 1418 | 1419 | traveller_generation() 1420 | input('Press enter to continue') 1421 | 1422 | 1423 | 1424 | #### Traveller Generation #### 1425 | def traveller_generation(): 1426 | global gold 1427 | global arrows 1428 | global food 1429 | global hp 1430 | x = random.randint(1, 50) # how much trader wants 1431 | v = random.randint(1, 100) #how much trader is willing to give 1432 | c = random.randint(1, 4) # what trader wants 1433 | 1434 | if c == 1: 1435 | print('The trader wants ' + str(x) + ' food.') 1436 | p = random.randint(1, 3) # what trader is giving 1437 | if p == 1: 1438 | print('The trader is willing to give ' + str(v) + ' arrows.') 1439 | print('1 Accept\n2 Decline') 1440 | selection = input('>: ') 1441 | if selection == '1': 1442 | if food < x: 1443 | print('You cannot afford the trade.') 1444 | else: 1445 | food = food - x 1446 | arrows = arrows + v 1447 | print('You accept the trade.') 1448 | arrows_mechanic() 1449 | 1450 | else: 1451 | print('You decline the trade.') 1452 | 1453 | if p == 2: 1454 | print('The trader is willing to pay ' + str(v) + ' gold.') 1455 | print('1 Accept\n2 Decline') 1456 | selection = input('>: ') 1457 | if selection == '1': 1458 | if food < x: 1459 | print('You cannot afford the trade.') 1460 | else: 1461 | food = food - x 1462 | gold = gold + v 1463 | print('You accept the trade.') 1464 | gold_mechanic() 1465 | 1466 | else: 1467 | print('You decline the trade.') 1468 | 1469 | if p == 3: 1470 | print('The trader is willing to heal you ' + str(v) + ' HP.') 1471 | print('1 Accept\n2 Decline') 1472 | selection = input('>: ') 1473 | if selection == '1': 1474 | if food < x: 1475 | print('You cannot afford the trade.') 1476 | else: 1477 | food = food - x 1478 | hp = hp + v 1479 | print('You accept the trade.') 1480 | hp_mechanic() 1481 | 1482 | else: 1483 | print('You decline the trade.') 1484 | if c == 2: 1485 | print('The trader wants ' + str(x) + ' arrows.') 1486 | p = random.randint(1, 3) # what trader is giving 1487 | if p == 1: 1488 | print('The trader is willing to give ' + str(v) + ' food.') 1489 | print('1 Accept\n2 Decline') 1490 | selection = input('>: ') 1491 | if selection == '1': 1492 | if arrows < x: 1493 | print('You cannot afford the trade.') 1494 | else: 1495 | arrows = arrows - x 1496 | food = food + v 1497 | print('You accept the trade.') 1498 | food_mechanic() 1499 | 1500 | else: 1501 | print('You decline the trade.') 1502 | if p == 2: 1503 | print('The trader is willing to give ' + str(v) + ' gold.') 1504 | print('1 Accept\n2 Decline') 1505 | selection = input('>: ') 1506 | if selection == '1': 1507 | if arrows < x: 1508 | print('You cannot afford the trade.') 1509 | else: 1510 | arrows = arrows - x 1511 | gold = gold + v 1512 | print('You accept the trade.') 1513 | gold_mechanic() 1514 | 1515 | else: 1516 | print('You decline the trade.') 1517 | if p == 3: 1518 | print('The trader is willing to heal you for ' + str(v) + ' HP.') 1519 | print('1 Accept\n2 Decline') 1520 | selection = input('>: ') 1521 | if selection == '1': 1522 | if arrows < x: 1523 | print('You cannot afford the trade.') 1524 | else: 1525 | arrows = arrows - x 1526 | hp = hp + v 1527 | print('You accept the trade.') 1528 | hp_mechanic() 1529 | 1530 | else: 1531 | print('You decline the trade.') 1532 | if c == 3: 1533 | print('The trader wants ' + str(x) + ' gold.') 1534 | p = random.randint(1, 3) # what trader is giving 1535 | if p == 1: 1536 | print('The trader is willing to give ' + str(v) + ' food.') 1537 | print('1 Accept\n2 Decline') 1538 | selection = input('>: ') 1539 | if selection == '1': 1540 | if gold < x: 1541 | print('You cannot afford the trade.') 1542 | else: 1543 | gold = gold - x 1544 | food = food + v 1545 | print('You accept the trade.') 1546 | food_mechanic() 1547 | 1548 | else: 1549 | print('You decline the trade.') 1550 | if p == 2: 1551 | print('The trader is willing to give ' + str(v) + ' arrows.') 1552 | print('1 Accept\n2 Decline') 1553 | selection = input('>: ') 1554 | if selection == '1': 1555 | if gold < x: 1556 | print('You cannot afford the trade.') 1557 | else: 1558 | gold = gold - x 1559 | arrows = arrows + v 1560 | print('You accept the trade.') 1561 | arrows_mechanic() 1562 | 1563 | else: 1564 | print('You decline the trade.') 1565 | 1566 | if p == 3: 1567 | print('The trader is willing to heal you ' + str(v) + ' HP.') 1568 | print('1 Accept\n2 Decline') 1569 | selection = input('>: ') 1570 | if selection == '1': 1571 | if gold < x: 1572 | print('You cannot afford the trade.') 1573 | else: 1574 | gold = gold - x 1575 | hp = hp + v 1576 | print('You accept the trade.') 1577 | hp_mechanic() 1578 | 1579 | else: 1580 | print('You decline the trade.') 1581 | if c == 4: 1582 | print('The trader wants your blood. Specifically, ' + str(x) + ' HP.') 1583 | p = random.randint(1, 3) # what trader is giving 1584 | if p == 1: 1585 | print('The trader is willing to give ' + str(v) + ' food.') 1586 | print('1 Accept\n2 Decline') 1587 | selection = input('>: ') 1588 | if selection == '1': 1589 | if hp < x: 1590 | print('You cannot afford the trade, but the trader will accept what you have.') 1591 | hp = hp - x 1592 | food = food + v 1593 | food_mechanic() 1594 | else: 1595 | hp = hp - x 1596 | food = food + v 1597 | print('You accept the trade.') 1598 | food_mechanic() 1599 | 1600 | else: 1601 | print('You decline the trade.') 1602 | if p == 2: 1603 | print('The trader is willing to give ' + str(v) + ' arrows.') 1604 | print('1 Accept\n2 Decline') 1605 | selection = input('>: ') 1606 | if selection == '1': 1607 | if hp < x: 1608 | print('You cannot afford the trade, but the trader is willing to let you slide, this time.') 1609 | hp = hp - x 1610 | food = food + v 1611 | food_mechanic() 1612 | else: 1613 | hp = hp - x 1614 | arrows = arrows + v 1615 | print('You accept the trade.') 1616 | arrows_mechanic() 1617 | 1618 | else: 1619 | print('You decline the trade.') 1620 | if p == 3: 1621 | print('The trader is willing to give ' + str(v) + ' gold.') 1622 | print('1 Accept\n2 Decline') 1623 | selection = input('>: ') 1624 | if selection == '1': 1625 | if hp < x: 1626 | print('You cannot afford the trade, but the trader is willing to let you slide, this time.') 1627 | hp = hp - x 1628 | food = food + v 1629 | food_mechanic() 1630 | else: 1631 | hp = hp - x 1632 | gold = gold + v 1633 | print('You accept the trade.') 1634 | gold_mechanic() 1635 | 1636 | else: 1637 | print('You decline the trade.') 1638 | 1639 | 1640 | 1641 | ### Robbed ### 1642 | def robbed(): 1643 | global gold 1644 | global arrows 1645 | global food 1646 | 1647 | x = random.randint(1, 3) 1648 | if food == 0 and arrows == 0 and gold == 0: 1649 | nothing() 1650 | elif x == 1: 1651 | v = random.randint(1, 50) 1652 | if food < v: 1653 | v = food 1654 | 1655 | food = food - v 1656 | food_mechanic() 1657 | y = random.randint(1, 2) 1658 | #adventure_menu() 1659 | if y == 1: 1660 | print('During the night, a shadowy figure stole ' + str(v) + ' of your food.') 1661 | elif y == 2: 1662 | print('You check your food supply and find that ' + str(v) + ' food is missing.') 1663 | elif x == 2: 1664 | v = random.randint(1, 50) 1665 | if arrows < v: 1666 | v = arrows 1667 | arrows = arrows - v 1668 | arrows_mechanic() 1669 | y = random.randint(1, 2) 1670 | #adventure_menu() 1671 | if y == 1: 1672 | print('During the night, a shadowy figure stole ' + str(v) + ' of your arrows.') 1673 | elif y == 2: 1674 | print('You check your arrow quill, and find that ' + str(v) + ' arrows are missing.') 1675 | 1676 | elif x == 3: 1677 | v = random.randint(1, 50) 1678 | if gold < v: 1679 | v = gold 1680 | gold = gold - v 1681 | gold_mechanic() 1682 | y = random.randint(1, 2) 1683 | #adventure_menu() 1684 | if y == 1: 1685 | print('During the night, a shadowy figure stole ' + str(v) + ' of your gold.') 1686 | elif y == 2: 1687 | print('You check your coin purse, and find that ' + str(v) + ' gold is missing.') 1688 | 1689 | v = 0 1690 | x = 0 1691 | 1692 | input('Press enter to continue') 1693 | 1694 | # Doppelganger # 1695 | def doppelganger(): 1696 | global enemy_type 1697 | global weapon 1698 | global name 1699 | 1700 | if enemy_type == 'Doppelganger': 1701 | print('The doppelganger is wielding a ' + weapon + ' exactly like yours.') 1702 | 1703 | ### Fight ### 1704 | def fight(): 1705 | global hp 1706 | global martial_prowess 1707 | global weapon 1708 | global durability 1709 | global gold 1710 | global enemy_adjective 1711 | global enemy_type 1712 | global enemy_battlescore 1713 | global enemy_gold 1714 | global counter 1715 | 1716 | 1717 | enemy_generator() 1718 | print('You see a ' + enemy_adjective + ' ' + enemy_type + ' approaching.') 1719 | doppelganger() 1720 | print('1 Fight\n2 Flee') 1721 | selection = input('>: ') 1722 | if selection == '1': 1723 | fight_simulation() 1724 | counter = counter - 1 1725 | adventuring() 1726 | 1727 | if selection == '2': 1728 | flee_fight() 1729 | counter = counter - 1 1730 | adventuring() 1731 | 1732 | else: 1733 | flee_fight() 1734 | counter = counter - 1 1735 | adventuring() 1736 | 1737 | # Fight Simulation # 1738 | def fight_simulation(): 1739 | global hp 1740 | global martial_prowess 1741 | global weapon 1742 | global gold 1743 | global enemy_adjective 1744 | global enemy_type 1745 | global enemy_battlescore 1746 | global enemy_gold 1747 | global enemy_arrows 1748 | global enemy_food 1749 | global damage_taken 1750 | 1751 | your_damage_taken() 1752 | enemy_loot() 1753 | 1754 | input('Press enter to continue') 1755 | #adventure_menu() 1756 | 1757 | # Enemy Loot # 1758 | def enemy_loot(): 1759 | global gold 1760 | global arrows 1761 | global food 1762 | global enemy_gold 1763 | global enemy_arrows 1764 | global enemy_food 1765 | 1766 | f = random.randint(1, 10) 1767 | enemy_food = enemy_food + f 1768 | food = food + enemy_food 1769 | a = random.randint(1, 5) 1770 | enemy_arrows = enemy_arrows + a 1771 | arrows = arrows + enemy_arrows 1772 | g = random.randint(1, 10) 1773 | enemy_gold = enemy_gold + g 1774 | gold = gold + enemy_gold 1775 | print('You found ' + str(enemy_food) + ' food, ' + str(enemy_arrows) + ' arrows, and ' + str(enemy_gold) + ' gold on the corpse.') 1776 | food_mechanic() 1777 | arrows_mechanic() 1778 | gold_mechanic() 1779 | 1780 | # Your Damage Taken # 1781 | def your_damage_taken(): 1782 | global hp 1783 | global martial_prowess 1784 | global enemy_battlescore 1785 | global damage_taken 1786 | 1787 | damage_taken = enemy_battlescore - martial_prowess 1788 | hp = int(hp - damage_taken) 1789 | if damage_taken < 1: 1790 | hp = hp + damage_taken 1791 | damage_taken = 0 1792 | print('The enemy was slain, and you took no damage.') 1793 | else: 1794 | print('The enemy was slain, but you took ' + str(damage_taken) + ' damage.') 1795 | 1796 | # Flee Fight # 1797 | def flee_fight(): 1798 | n = random.randint(1, 2) 1799 | if n == 1: 1800 | print('You escaped the fight.') 1801 | input('Press enter to continue') 1802 | adventure_menu() 1803 | elif n == 2: 1804 | print('You failed to flee the fight.') 1805 | input('Press enter to continue') 1806 | fight_simulation() 1807 | 1808 | # Enemy Generator # 1809 | def enemy_generator(): 1810 | global enemy_adjective 1811 | global enemy_type 1812 | global enemy_battlescore 1813 | 1814 | enemy_resetter() 1815 | enemy_adjective_generator() 1816 | enemy_type_generator() 1817 | 1818 | # Enemy Resetter # 1819 | def enemy_resetter(): 1820 | global enemy_type 1821 | global enemy_battlescore 1822 | global enemy_gold 1823 | global enemy_food 1824 | global enemy_arrows 1825 | global enemy_specific_gold 1826 | global enemy_specific_arrows 1827 | global enemy_specific_food 1828 | 1829 | enemy_type = '' 1830 | enemy_food = 0 1831 | enemy_arrows = 0 1832 | enemy_gold = 0 1833 | enemy_specific_gold = 0 1834 | enemy_specific_arrows = 0 1835 | enemy_specific_food = 0 1836 | enemy_battlescore = 0 1837 | enemy_adjective = '' 1838 | 1839 | ### Enemy Locater and Excluder Generator ### 1840 | def enemy_locater_generator(): 1841 | global enemy_locater 1842 | global location 1843 | global enemy_exclude 1844 | global enemy_number 1845 | 1846 | if location == 'Goodshire': 1847 | enemy_locater = 'Goodshire' 1848 | enemy_exclude = [3,4,5] 1849 | if location == 'Rodez': 1850 | enemy_locater = 'Rodez' 1851 | enemy_exclude = [2,4,5] 1852 | if location == 'Oristano': 1853 | enemy_locater = 'Oristano' 1854 | enemy_exclude = [1,2,5] 1855 | if location == 'Thasos': 1856 | enemy_locater = 'Thasos' 1857 | enemy_exclude = [1,2] 1858 | if location == 'Karabuk': 1859 | enemy_locater = 'Karabuk' 1860 | enemy_exclude = [1,2,3] 1861 | if location == 'Last Refuge': 1862 | enemy_locater = 'Last Refuge' 1863 | enemy_exclude = [2,3] 1864 | enemy_number = random.randint(1, 5) 1865 | while enemy_number in enemy_exclude: 1866 | enemy_number = random.randint(1, 5) 1867 | 1868 | # Enemy Type Generator # 1869 | def enemy_type_generator(): 1870 | global enemy_type 1871 | global enemy_battlescore 1872 | global enemy_gold 1873 | global enemy_food 1874 | global enemy_arrows 1875 | global enemy_specific_gold 1876 | global enemy_specific_arrows 1877 | global enemy_specific_food 1878 | global enemy_locater 1879 | global enemy_exclude 1880 | global enemy_number 1881 | 1882 | enemy_locater_generator() 1883 | 1884 | if enemy_number == 1: 1885 | enemy_type = 'Lone Wolf' 1886 | enemy_battlescore = enemy_battlescore + 35 1887 | enemy_specific_food = 2 1888 | enemy_specific_arrows = 0 1889 | enemy_specific_gold = 0 1890 | enemy_food = enemy_food + enemy_specific_food 1891 | enemy_arrows = enemy_arrows + enemy_specific_arrows 1892 | enemy_gold = enemy_gold + enemy_specific_gold 1893 | 1894 | 1895 | if enemy_number == 2: 1896 | enemy_type = 'Large Maggot' 1897 | enemy_battlescore = enemy_battlescore + 15 1898 | enemy_specific_food = 1 1899 | enemy_specific_arrows = 0 1900 | enemy_specific_gold = 0 1901 | enemy_food = enemy_food + enemy_specific_food 1902 | enemy_arrows = enemy_arrows + enemy_specific_arrows 1903 | enemy_gold = enemy_gold + enemy_specific_gold 1904 | 1905 | if enemy_number == 3: 1906 | enemy_type = 'Rogue Vampire' 1907 | enemy_battlescore = enemy_battlescore + 55 1908 | enemy_specific_food = 0 1909 | enemy_specific_arrows = 0 1910 | enemy_specific_gold = 5 1911 | enemy_food = enemy_food + enemy_specific_food 1912 | enemy_arrows = enemy_arrows + enemy_specific_arrows 1913 | enemy_gold = enemy_gold + enemy_specific_gold 1914 | 1915 | 1916 | if enemy_number == 4: 1917 | enemy_type = 'Dark Cultist' 1918 | enemy_battlescore = enemy_battlescore + 85 1919 | enemy_specific_food = 10 1920 | enemy_specific_arrows = 0 1921 | enemy_specific_gold = 10 1922 | enemy_food = enemy_food + enemy_specific_food 1923 | enemy_arrows = enemy_arrows + enemy_specific_arrows 1924 | enemy_gold = enemy_gold + enemy_specific_gold 1925 | 1926 | if enemy_number == 5: 1927 | enemy_type = 'Doppelganger' 1928 | enemy_battlescore = enemy_battlescore + 105 1929 | enemy_specific_food = 10 1930 | enemy_specific_arrows = 0 1931 | enemy_specific_gold = 10 1932 | enemy_food = enemy_food + enemy_specific_food 1933 | enemy_arrows = enemy_arrows + enemy_specific_arrows 1934 | enemy_gold = enemy_gold + enemy_specific_gold 1935 | 1936 | 1937 | 1938 | # Enemy Adjective Generator # 1939 | def enemy_adjective_generator(): 1940 | global enemy_adjective 1941 | global enemy_battlescore 1942 | 1943 | j = random.randint(1, 3) 1944 | if j == 1: 1945 | enemy_adjective = 'Bloodthirsty' 1946 | enemy_battlescore = enemy_battlescore + 35 1947 | if j == 2: 1948 | enemy_adjective = 'Regular' 1949 | enemy_battlescore = enemy_battlescore + 0 1950 | if j == 3: 1951 | enemy_adjective = 'Starved' 1952 | enemy_battlescore = enemy_battlescore - 10 1953 | 1954 | ### Chest ### 1955 | def chest(): 1956 | global hp 1957 | global max_hp 1958 | 1959 | p = random.randint(1, 2) 1960 | if p == 1: 1961 | print('You see a treasure chest.') 1962 | if p == 2: 1963 | print('You see a large hollow tree.') 1964 | print('1 Inspect\n2 Avoid') 1965 | selection = input('>: ') 1966 | if selection == '1': 1967 | a = random.randint(1, 3) 1968 | if a == 1: 1969 | print('It is empty. Nothing but cobwebs remain.') 1970 | input('Press enter to continue') 1971 | adventure_menu() 1972 | if a == 2: 1973 | print('It was booby trapped. A dart flies out and hits you for 20 damage.') 1974 | hp = hp - 20 1975 | input('Press enter to continue') 1976 | hp_mechanic() 1977 | adventure_menu() 1978 | #if a == 2 and luck > 0: 1979 | #print('It was booby trapped. A dart flies out and hits you for 20 damage.') 1980 | #chestloot() 1981 | if a == 3: 1982 | chest_loot() 1983 | 1984 | elif selection == '2': 1985 | print() 1986 | 1987 | else: 1988 | chest() 1989 | 1990 | # Chest Loot # 1991 | def chest_loot(): 1992 | global gold 1993 | global arrows 1994 | global food 1995 | global max_food 1996 | 1997 | x = random.randint(1, 3) 1998 | if x == 1: 1999 | v = random.randint(50, 100) 2000 | food = food + v 2001 | print('Inside, you found ' + str(v) + ' food.') 2002 | food_mechanic() 2003 | if x == 2: 2004 | v = random.randint(50, 100) 2005 | arrows = arrows + v 2006 | print('Inside, you found ' + str(v) + ' arrows.') 2007 | arrows_mechanic() 2008 | if x == 3: 2009 | v = random.randint(50, 100) 2010 | gold = gold + v 2011 | print('Inside, you found ' + str(v) + ' gold.') 2012 | gold_mechanic() 2013 | 2014 | v = 0 2015 | input('Press enter to continue') 2016 | adventure_menu() 2017 | 2018 | ####### Salem ####### 2019 | def salem(): 2020 | global counter 2021 | global adventure_state 2022 | global damage_taken 2023 | global enemy_battlescore 2024 | global martial_prowess 2025 | global hp 2026 | 2027 | os.system('cls') 2028 | print('-----------------') 2029 | print('| G | | | |') 2030 | print('+---+---+---+---+') 2031 | print('| R | | | |') 2032 | print('+---+---+---+---+') 2033 | print('| | O | | |') 2034 | print('+---+---+---+---+') 2035 | print('| | T | K | |') 2036 | print('+---+---+---+---+') 2037 | print('| | | | S |') 2038 | print('+---------------+\n') 2039 | print('Salem\n') 2040 | input('Press enter to continue') 2041 | os.system('cls') 2042 | 2043 | print('You enter the ancient city of Salem, now blackened with fire and as silent as a graveyard, and see a man who looks like a commoner lounging upon a throne of skeletons in the courtyard.') 2044 | print('"Ah, ' + name + '", I was expecting you."\n') 2045 | print('Type \'who are you?\'') 2046 | input('>: ') 2047 | 2048 | os.system('cls') 2049 | print('"I am the called by your order the Antipope or the Prince of Darkness, but my birth name is Chernobog."') 2050 | print('"As you can see, I have already razed Salem. Your sacred temples and artifacts are totally destroyed. You have failed."') 2051 | print('"But I admire your willpower and resourcefulness to make it all the way here from Goodshire."') 2052 | print('"I want to make you an offer. Join me, and become my champion. Together, we will forge a New Dawn."') 2053 | print('"Your old ways are gone. You have failed your order, and they will no longer accept you."') 2054 | print('"If you decline, I won\'t kill you, but I will beat you within an inch of your life and enslave you for eternity."\n') 2055 | print('"The choice is yours, ' + name + '."\n') 2056 | print('1 Accept offer\n2 Decline offer\n') 2057 | selection = input('>: ') 2058 | os.system('cls') 2059 | 2060 | if selection == '1': 2061 | char_menu() 2062 | print('You join the forces of Chernobog, the Prince of Darkness, and forsake your old way of life. You both combine your powers and forge a New Dawn.') 2063 | print() 2064 | input('Press enter to end game') 2065 | title_screen() 2066 | 2067 | elif selection == '2': 2068 | print('"Very well, then." Chernobog stands up.') 2069 | input('Press enter to fight') 2070 | 2071 | enemy_battlescore = 170 2072 | damage_taken = enemy_battlescore - martial_prowess 2073 | hp = int(hp - damage_taken) 2074 | if hp > 0: 2075 | print('You have slain the Antipope. His body magically lights on fire, and leaves ashes on the ground.') 2076 | print('Your surroundings shimmer, and the city of Salem transforms from its ruined state to its former glory. You have succeeded in every goal.') 2077 | input('Press enter to continue') 2078 | char_menu() 2079 | os.system('cls') 2080 | print('You win!') 2081 | 2082 | print('Occupation: ' + occupation + '') 2083 | input('Press enter to end game') 2084 | title_screen() 2085 | 2086 | else: 2087 | hp = 0.1 2088 | char_menu() 2089 | print() 2090 | print('You have lost the fight, letting Chernobog win. He enslaves you for all eternity, and he takes over the world.\n') 2091 | input('Press enter to end game') 2092 | title_screen() 2093 | 2094 | else: 2095 | salem() 2096 | 2097 | 2098 | title_screen() 2099 | --------------------------------------------------------------------------------