Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- from dataclasses import dataclass
- @dataclass
- class Response:
- # detect player response
- playerResponse: str
- @dataclass
- class Player:
- # player stats
- playerAC: int
- playerMaxHealth: int
- playerHealth: int
- playerStrength: int
- playerMagicka: int
- playerCrit: int
- playerPhysical: int
- playerMagic: int
- def __str__(self):
- return (
- f"\n##YOUR STATS##\n"
- f"AC: {self.playerAC}\n"
- f"Health: {self.playerHealth}/{myPlayer.playerMaxHealth}\n"
- f"Strength: {self.playerStrength}\n"
- f"magicka: {self.playerMagicka}\n"
- f"Crit Chance: {self.playerCrit}\n"
- f"Physical Resistance: {self.playerPhysical}\n"
- f"Magical Resistance: {self.playerMagic}\n"
- )
- @dataclass
- class Ramsey:
- # Ramsey Stats
- ramseyAC: int
- ramseyMaxHealth: int
- ramseyHealth: int
- ramseyStrength: int
- ramseyMagicka: int
- ramseyCrit: int
- ramseyPhysical: int
- ramseyMagic: int
- ramseyClass: str
- ramseyAbility: str
- ramseyTick1: bool
- ramseyTick2: bool
- ramseyTick3: bool
- ramseySanguineTreat: bool
- @dataclass
- class Room:
- # rooms
- room1: bool
- room1pt2: bool
- room2: bool
- room3: bool
- room4: bool
- room4bite: bool
- room4resist: bool
- room5: bool
- room5eat: bool
- room5decline: bool
- room6: bool
- room7: bool
- room8: bool
- room9: bool
- room10: bool
- @dataclass
- class Interactions:
- room4int: int
- firstFight: int
- @dataclass
- class Weapons:
- punch: int
- @dataclass
- class Mechanics:
- playerDamageToDeal: int
- playerDamageDone: int
- enemyDamageToDeal: int
- enemyDamageDone: int
- playerCritHit: int
- enemyCritHit: int
- playerRollToHit: int
- enemyRollToHit: int
- gameStarted: int
- def statsDisplay():
- # display stats to player
- print(myPlayer)
- myResponse.playerResponse = input("What would you like to do next: ")
- print("")
- # rooms and interactions
- def firstFight():
- print("Welcome to your first fight in the Vampire Manor!")
- print("")
- print("##HOW FIGHTS WORK##")
- print("____________________")
- print("Fights are one time and are unescapable, meaning once a fight has started, you must survive, so be careful!")
- print("1. Your enemies stats will be shown so plan out your attack.")
- print(
- "2. Enemies have the same stats as you. Class and Special Ability: The class can help determine what type of enemy you are fighting, the special ability gives you a warning on the enemy's strongest move. AC: AC or armour class is the number you have to get to be able to hit the enemy which will be determined by a random D20 roll. Health: Once the enemy's health is reduced to 0, you win! Strength and Magicka: Strength is the stat that determines how much physical damage they do, and vice versa for magicka, certain weapons use different damage stats, so it's adivsed to build your character around one of these stats. Physical Resistance and Magic Resistance: These are the stats that protect the enemy, or you, from certain attacks, typically one resistance will be much lower than the other, so abuse it! Critical Chance: The higher you or your enemy's crit chance is, the more likely they are to deal double damage in one turn.")
- print("3. Each round, you will have a choice of attacks to choose from, pick wisely, some have cooldowns.")
- print("Good Luck!")
- myInteraction.firstFight = True
- def playRoom1():
- myRoom.room1 = True
- print("__________________________________________")
- print("")
- print(
- "You awake from a coarse slumber, sat wreathed in your own blood. Your face feels cold and lifeless, your skin, a pale blue, and an intense hunger rages deep inside you. You lay inside an enclosed space, the walls are laid with soft pillow that feels quite comfortable, apart from the warm stickiness of your own blood, you’re locked in a coffin. Despite the stark appearance of your body, you feel unparalleled strength, hopefully enough to break yourself out.")
- print("")
- print("Enter: attack")
- print("")
- myResponse.playerResponse = input()
- def playRoom1pt2():
- myRoom.room1pt2 = True
- print("__________________________________________")
- print("")
- print(
- "As you look around, you see that the coffin you were in is placed in the centre of a small room. The building is cold and has an intricately designed gothic architecture, it’s dark, with small torches illuminating the surrounding area. There is only one exit, to your east.")
- print("")
- print("Exits: E")
- print("")
- print("Enter 'E' or 'east'")
- print("")
- myResponse.playerResponse = input()
- def playRoom2():
- myRoom.room2 = True
- print("__________________________________________")
- print("")
- print(
- "You enter into a large intersection, once again dimly lit with torches. To the south is an open archway that leads to another room. To the east is an open door and to the north is a large, locked gateway, adorned with silver and engraved with a symbol you don’t remember but it still feels familiar.")
- print("")
- print("Exits: E, S")
- print("")
- myResponse.playerResponse = input()
- def playRoom4():
- myRoom.room4 = True
- if myInteraction.room4int == False:
- print("__________________________________________")
- print("")
- print(
- "As you enter this room, a strong smell of flesh wafts over you, and as you look down, you see a lifeless human laying in a pool of their own blood. You feel an intense urge to fulfill your hunger, the body does seem fresh, however you know what you want to do is wrong.")
- print("")
- print("Enter: 'bite' or 'resist'")
- print("")
- myInteraction.room4int = True
- myResponse.playerResponse = input()
- elif myInteraction.room4int == True:
- print("__________________________________________")
- print("")
- print("You're back in this room, the lifeless body lies here, staring blankly into space")
- print("")
- print("Exits: E, W, N")
- print("")
- myResponse.playerResponse = input()
- def playRoom4bite():
- myRoom.room4bite = True
- print("__________________________________________")
- print("")
- print("You dig your fangs into the corpse, and as you do, you start to feel stronger and happier.")
- print("")
- print("Your corruption increases by 20%, but your health increases by 15")
- print("")
- print("Exits: E, W, N")
- print("")
- myResponse.playerResponse = input()
- def playRoom4resist():
- myRoom.room4resist = True
- print("__________________________________________")
- print("")
- print("You resist the urge, the hunger still rages, but you feel slightly more at ease")
- print("")
- print("Exits: E, W, N")
- print("")
- myResponse.playerResponse = input()
- def playRoom5():
- myRoom.room5 = True
- print("__________________________________________")
- print("")
- print(
- "As you enter this room a soft and sweet smell wafts over you. As you look closer, you see a table laid with sanguine cloth and a vase of roses sits in the middle. The table holds an assortment of deserts, some puddings, some cake, some pastries, but all of them seem to have a hint of red.")
- print("")
- print("You see a woman, dressed in chef’s clothes walk towards you.")
- print("")
- print(
- "Lady Ramsey: 'Oh hello newborn, looking for a meal?' She peers closer, her eyes giving an uncanny valley feel. 'They're fresh.'")
- print("")
- print("Enter: 'eat' or 'decline'")
- print("")
- myResponse.playerResponse = input()
- def playRoom5eat():
- myRoom.room5eat = True
- print("__________________________________________")
- print("")
- print("Lady Ramsey: 'Isn’t it tasty? Made fresh with human blood.'")
- print("")
- print("Your corruption increases by 15%, but your max health increases by 10")
- print("")
- print("Exits: E")
- print("")
- myResponse.playerResponse = input()
- def playerDamage():
- attack = input("What attack would you like to do?: ")
- if attack == "punch":
- myMechanics.playerDamageToDeal = myWeapons.punch
- def ramseyDamage():
- ramseyCritChance = random.randint(1, 100)
- if myRamsey.ramseyTick1 == False and myRamsey.ramseyTick2 == False and myRamsey.ramseyTick3 == False:
- myRamsey.ramseySanguineTreat = False
- myRamsey.ramseyTick1 = True
- myMechanics.enemyDamageToDeal = myRamsey.ramseyMagicka
- if ramseyCritChance > myRamsey.ramseyCrit:
- myMechanics.enemyDamageToDeal / 2
- elif myRamsey.ramseyTick1 and myRamsey.ramseyTick2 == False and myRamsey.ramseyTick3 == False:
- myRamsey.ramseyTick2 = True
- myMechanics.enemyDamageToDeal = myRamsey.ramseyMagicka
- if ramseyCritChance > myRamsey.ramseyCrit:
- myMechanics.enemyDamageToDeal / 2
- elif myRamsey.ramseyTick1 and myRamsey.ramseyTick2 and myRamsey.ramseyTick3 == False:
- myRamsey.ramseyTick3 = True
- myMechanics.enemyDamageToDeal = myRamsey.ramseyMagicka
- if ramseyCritChance > myRamsey.ramseyCrit:
- myMechanics.enemyDamageToDeal / 2
- elif myRamsey.ramseyTick1 and myRamsey.ramseyTick2 and myRamsey.ramseyTick3:
- myRamsey.ramseySanguineTreat = True
- myRamsey.ramseyTick1 = False
- myRamsey.ramseyTick2 = False
- myRamsey.ramseyTick3 = False
- def ramseyHealthCheck():
- if myRamsey.ramseyHealth > myRamsey.ramseyMaxHealth:
- myRamsey.ramseyHealth = myRamsey.ramseyMaxHealth
- def ramseyFight():
- while myPlayer.playerHealth > 0 and myRamsey.ramseyHealth > 0:
- playerDamage()
- ramseyDamage()
- myMechanics.playerRollToHit = random.randint(1, 20)
- if myMechanics.playerRollToHit > myRamsey.ramseyAC:
- myRamsey.ramseyHealth = myRamsey.ramseyHealth - myMechanics.playerDamageToDeal
- print("You dealt Ramsey", myMechanics.playerDamageToDeal, "damage!")
- elif myMechanics.playerRollToHit == 1:
- myPlayer.playerHealth = myPlayer.playerHealth - myMechanics.playerDamageToDeal / 2
- print("Critical miss! You dealt yourself", myMechanics.playerDamageToDeal / 2, "damage!")
- elif myMechanics.playerRollToHit == 20:
- myRamsey.ramseyHealth = myRamsey.ramseyHealth - myMechanics.playerDamageToDeal * 1.5
- print("Critical hit! You dealt Ramsey", myMechanics.playerDamageToDeal * 1.5)
- print("")
- if myRamsey.ramseySanguineTreat == True:
- ramseyHeal = myPlayer.playerHealth * 0.2
- myPlayer.playerHealth = myPlayer.playerHealth - myPlayer.playerHealth * 0.2
- myRamsey.ramseyHealth = myRamsey.ramseyHealth + ramseyHeal
- ramseyHealthCheck()
- elif myRamsey.ramseySanguineTreat == False:
- myMechanics.enemyRollToHit = random.randint(1, 20)
- if myMechanics.enemyRollToHit > myPlayer.playerAC:
- myPlayer.playerHealth = myPlayer.playerHealth - myMechanics.enemyDamageToDeal
- print("Ramsey dealt you", myMechanics.enemyDamageToDeal, "damage!")
- elif myMechanics.enemyRollToHit == 1:
- myRamsey.ramseyHealth = myRamsey.ramseyHealth - myMechanics.enemyDamageToDeal / 2
- print("Critical miss! Ramsey dealt herself", myMechanics.enemyDamageToDeal / 2, "damage!")
- elif myMechanics.enemyRollToHit == 20:
- myPlayer.playerHealth = myPlayer.playerHealth - myMechanics.enemyDamageToDeal * 1.5
- print("Critical hit! Ramsey dealt you", myMechanics.enemyDamageToDeal * 1.5, "damage!")
- print("Well done! You have defeated Ramsey the Cook!")
- def playRoom5decline():
- myRoom.room5decline = True
- print("__________________________________________")
- print("")
- print("Lady Ramsey: 'Wrong choice'")
- print("")
- if myInteraction.firstFight == False:
- firstFight()
- ramseyFight()
- elif myInteraction.firstFight == True:
- print("Good Luck!")
- ramseyFight()
- myResponse = Response(playerResponse="")
- myResponse.playerResponse = input(
- "Welcome brave adventurer, to get started enter 'start' but if you wish to familiarize yourself with your character, enter 'stats': ")
- myPlayer = Player(playerAC=14, playerMaxHealth=100, playerHealth=100, playerStrength=30, playerMagicka=30,
- playerCrit=15, playerPhysical=20, playerMagic=5)
- myRamsey = Ramsey(ramseyAC=12, ramseyMaxHealth=90, ramseyHealth=90, ramseyStrength=10, ramseyMagicka=40, ramseyCrit=10,
- ramseyPhysical=5, ramseyMagic=15, ramseyClass="Mage - Cook",
- ramseyAbility="Special Ability: Sanguine Treat – Lady Ramsey throws one of her special treats at her enemy, it deals damage equal to 10% of the enemy's total health and Lady Ramsey heals that much.",
- ramseyTick1=False, ramseyTick2=False, ramseyTick3=False, ramseySanguineTreat=False)
- myRoom = Room(room1=False, room1pt2=False, room2=False, room3=False, room4=False, room4bite=False, room4resist=False,
- room5=False, room5eat=False, room5decline=False, room6=False, room7=False, room8=False, room9=False,
- room10=False)
- myInteraction = Interactions(room4int=False, firstFight=False)
- myWeapons = Weapons(punch=1)
- # weapon calculations
- while myPlayer.playerHealth > 0:
- myWeapons.punch = myWeapons.punch * myPlayer.playerStrength / 2
- myMechanics = Mechanics(playerDamageToDeal=0, playerDamageDone=False, enemyDamageToDeal=0, enemyDamageDone=False,
- playerCritHit=False, enemyCritHit=False, playerRollToHit=0, enemyRollToHit=0, gameStarted=False)
- while myPlayer.playerHealth > 0:
- if myResponse.playerResponse == "stats":
- myResponse.playerResponse = ""
- statsDisplay()
- elif myResponse.playerResponse == "start" and gameStarted == False:
- myResponse.playerResponse = ""
- gameStarted = True
- playRoom1()
- elif myResponse.playerResponse == "attack" and myRoom.room1 == True:
- myResponse.playerResponse = ""
- print("")
- myRoom.room1 = False
- playRoom1pt2()
- elif ((myResponse.playerResponse == "E" or myResponse.playerResponse == "east") and myRoom.room1pt2 == True) or (
- (myResponse.playerResponse == "N" or myResponse.playerResponse == "north") and myRoom.room4 == True):
- myResponse.playerResponse = ""
- print("")
- myRoom.room1pt2 = False
- myRoom.room4 = False
- playRoom2()
- elif ((myResponse.playerResponse == "S" or myResponse.playerResponse == "south") and myRoom.room2 == True) or ((
- myResponse.playerResponse == "E" or myResponse.playerResponse == "east") and myRoom.room5 == True or myRoom.room5eat == True or myRoom.room5decline == True):
- myResponse.playerResponse = ""
- print("")
- myRoom.room2 = False
- myRoom.room5 = False
- playRoom4()
- elif myResponse.playerResponse == "bite" and myRoom.room4 == True:
- myResponse.playerResponse = ""
- print("")
- myRoom.room4 = False
- playRoom4bite()
- elif myResponse.playerResponse == "resist" and myRoom.room4 == True:
- myResponse.playerResponse = ""
- print("")
- myRoom.room4 = False
- playRoom4resist()
- elif ((myResponse.playerResponse == "W" or myResponse.playerResponse == "west") and (
- myRoom.room4 == True or myRoom.room4bite == True or myRoom.room4resist == True)):
- myResponse.playerResponse = ""
- print("")
- myRoom.room4 = False
- myRoom.room4bite = False
- myRoom.room4resist = False
- playRoom5()
- elif myResponse.playerResponse == "eat" and myRoom.room5 == True:
- myResponse.playerResponse = ""
- print("")
- myRoom.room5 = False
- playRoom5eat()
- elif myResponse.playerResponse == "decline" and myRoom.room5 == True:
- myResponse.playerResponse = ""
- print("")
- myRoom.room5 = False
- playRoom5decline()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement