Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- #Values
- shipwreckloot = 0
- encounter = 0
- escape = "nothing"
- combat = 0
- complayer = "nothing"
- RNG_heal = 0
- RNG_stun = 0
- #Enemies
- slime_hp = 50
- slime_attacks = random.choice(["Slime ball","Healing gel","Slime stomp"])
- #player stats and items
- numhunger = 100
- numhealth = 100
- medicine = 0
- food = 0
- ship_parts = 0
- #Start of game
- print("Welcome to adventure land!")
- print("Only use yes, and no to make decisions also use fight, and flee when needed.")
- print("Type eat or medicine to use items.")
- PlayerName = input("What is your name adventurer: ")
- print("You've shipwrecked on this strange island",PlayerName,"all you have is the clothes on your back. Now it's your job to find your way off this island alive!")
- print("As you regain consciousness you find yourself on a beach next to your ship. Now resorted to a pile of rubble, maybe you can scavenge whats left inside")
- print("for any tools or items that could come in use. But there could be things inside that could also be dangerous.")
- print("You have",numhunger,"hunger left and you have",numhealth,"health")
- player = input("Should you try to search the shipwreck for any goods?: ")
- if player == "yes":
- shipwreck = random.randint(1, 10)
- shipwreckloot = random.randint(1, 5)
- shipwreckamount = random.randint(1, 2)
- if shipwreck < 10:
- if shipwreckloot == 1:
- print("You found 2 medicine in the shipwreck!")
- medicine += 2
- elif shipwreckloot == 2 or 5:
- print("You found 2 food in the shipwreck!")
- food += 2
- elif shipwreckloot == 3 or 4:
- print("You found nothing useful in the shipwreck")
- else:
- print("The shipwreck collapses with you in it taking 10 health of damage!")
- numhealth -= 10
- #Types of encounters
- while escape != "win":
- if numhealth <= 0:
- print("You ran out of health and died!")
- print("You lose!")
- break
- numhunger -=20
- if numhunger <= 0:
- numhunger = 0
- if numhunger > 100:
- numhunger = 100
- print("You have",medicine,"medicine",food,"food",ship_parts,"ship parts")
- print("You have",numhunger,"hunger left and you have",numhealth,"health")
- UI = input("Do you want to eat or use anything?: ")
- if UI == "eat":
- if food >= 1:
- if numhunger != 100:
- food -=1
- numhunger +=35
- if UI == "medicine":
- if medicine >= 1:
- if numhealth != 100:
- medicine -= 1
- numhealth =+ 20
- if numhealth > 100:
- numhealth == 100
- encounter = random.randint(3,3)
- if encounter == 1:
- print("As your walking through the forest you come across an abundance of berries")
- player = input("Should you harvest the berries?: ")
- if player == "yes":
- RNG = random.randint(1,5)
- if RNG <= 3:
- food += 1
- print("You harvested one food worth of berries")
- if RNG == 4:
- food += 2
- print("You got lucky and were able to harvest two food from the berries")
- if RNG == 5:
- print("While you were harvesting the berries a wild slime attacks")
- complayer = input("fight or flee?: ")
- if player == "no":
- print("You decide not to harvest the berries and continue on")
- if encounter == 2:
- print("While you are looking for means of survival in the forest you find an abandon house")
- player = input("Should you search the house?: ")
- if encounter == 3:
- combat == 1
- print("A wild slime attacks while you were looking for food")
- complayer = input("fight or flee?: ")
- if encounter == 4:
- print("While searching for anything to aid in survival you find nothing")
- if encounter == 5:
- print("You stumble upon some suspicious plants")
- player = input("Should you eat the plants?: ")
- #Combat function
- if complayer == "flee":
- PL_flee = random.randint(1, 2)
- PL_flee2 = random.randint(2, 3)
- if food and medicine == 0:
- print("You lost nothing while you fled!")
- elif PL_flee == 1 and food >= 1:
- food -= 1
- print("While you fled you lost 1 food!")
- elif PL_flee2 == 3 and medicine >= 1:
- medicine -= 1
- print("While you fled you lost 1 medicine!")
- elif PL_flee == 1 and PL_flee2 == 3 and food and medicine >= 1:
- print("While you fled you lost 1 food and 1 medicine!")
- elif PL_flee and PL_flee2 == 2:
- print("You lost nothing while you fled!")
- if complayer == "fight":
- print("The slime has 50hp")
- while slime_hp >= 1:
- #Attacks
- if RNG_stun >= 1:
- RNG_stun -= 1
- print("The slimes hit chance is decreased for",RNG_stun,"more turns!")
- print("You have",numhealth,"health left and",medicine,"medicine")
- player = input("What item or attack do you want to use? throw rock, punch, kick up dirt: ")
- if player == "medicine":
- if medicine >= 1:
- if numhealth != 100:
- medicine -= 1
- numhealth =+ 20
- if numhealth > 100:
- numhealth == 100
- if player == "throw rock" or "rock":
- RNG = random.randint(10,25)
- miss_one = random.randint(1,10)
- if miss_one >= 7:
- RNG = 0
- print("You missed and did no damage!")
- if player == "punch":
- RNG = random.randint(5,15)
- miss_two = random.randint(1,10)
- if miss_two >= 8:
- RNG = 0
- print("You missed and did no damage!")
- if player == "kick up dirt" or "kick" or "kick up":
- RNG_stun = random.randint(1,3)
- miss_three = random.randint(1,3)
- if miss_three == 1:
- print("You missed and didn't stun the enemy!")
- if miss_three >= 2 or 3:
- print("The attack was successful!")
- print("The slimes hit chance has decreased for",RNG_stun,"turns!")
- if slime_hp <= 0:
- print("You defeated the slime!")
- elif RNG != 0:
- slime_hp -= (RNG)
- print("You did",RNG,"damage!")
- print("Slime has",slime_hp,"health left")
- RNG = 0
- if slime_hp <= 0:
- break
- if slime_hp >= 50:
- Slime_attacks = random.choice(["slime ball","slime stomp"])
- else:
- slime_attacks = random.choice(["slime ball","healing gel","slime stomp"])
- if slime_attacks == "slime ball":
- print("Slime attacks with slime ball!")
- RNG = random.randint(10,18)
- miss_enemy = random.randint(11,21)
- if RNG_stun == 1:
- if miss_enemy >= 17:
- RNG = 0
- print("The slime missed you and did no damage")
- else:
- miss_enemy >= 16
- RNG = 0
- print("The slime missed you and did no damage")
- if slime_attacks == "healing gel":
- RNG_heal = random.randint(5,15)
- miss_enemy = random.randint(1,10)
- print("Slime uses healing gel")
- if miss_enemy == 1:
- RNG_heal = 0
- print("The slime failed to heal")
- else:
- slime_hp += (RNG_heal)
- print("Slime healed",RNG_heal,"health")
- if slime_attacks == "slime stomp":
- print("Slime attacks with slime stomp!")
- RNG = random.randint(5,15)
- miss_enemy = random.randint(1,10)
- if RNG_stun == 1:
- if miss_enemy >= 7:
- RNG = 0
- print("The slime missed you and did no damage")
- else:
- if miss_enemy >= 6:
- RNG = 0
- print("The slime missed you and did no damage")
- if RNG != 0:
- numhealth -= (RNG)
- print("You took",RNG,"damage!")
- RNG == 0
- if numhealth <= 0:
- print("You ran out of health and died!")
- print("You lose!")
- break
- if ship_parts == 10:
- print("You managed to build a boat from what you found on the island and escaped!")
- print("You win!")
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement