forked from cryptoboxcomics/python-adventure
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.py
More file actions
136 lines (102 loc) · 3.51 KB
/
game.py
File metadata and controls
136 lines (102 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
####################################
# Author: Amber Lee #
# Email: [email protected] #
# Info: A choose-your-own #
# adventure game #
####################################
####################################
# Imports #
####################################
import time
####################################
# Player Assets #
####################################
player_name = ""
player_health = 100
player_money = 50
player_species = "Human"
player_weapons = []
player_items = []
####################################
# Game Start! #
####################################
### Introduction ###
print()
print()
print(" ####################################################")
print(" # Hello! This is a choose-your-own-adventure game. #")
print(" # You are a hero trying to save your kingdom of #")
print(" # Kanbal from the evil King Rogsam. #")
print(" ####################################################")
print()
print()
while(player_name == ""):
player_name = input("What is your name, Hero? : ")
print()
print("Hi, " + player_name + "! You are our hero and savior! Please save the Kanbalese mountain people from the evil King Rogsam.")
print("You start off with no weapons or items, but if you make the right choices, you might survive.")
print()
# ---Section Author: <your name>--- #
print("You pass by a traveler who looks injured by the woods. What do you do?")
print("1. Ignore him")
print("2. Try to help him")
decision = ""
while(decision == ""):
decision = input("Pick a number: ")
print()
if (decision == "1"):
print("You try to leave, but trip over a rock and hit your head!")
player_health = player_health - 10
print("Your health now: ")
print(player_health)
elif (decision == "2"):
print("He appreciates that you helped him, and he gives you a potion! A potion heals 20 health points.")
player_items.append("Potion")
print("Your items now: ")
print(player_items)
print()
time.sleep(1)
# ---section end--- #
# ---Section Author: Oleg--- #
print("The Kanbalese police stop you and tries to fine you for being outside during coronavirus!")
print("1. Run away")
print("2. Sign the ticket")
print()
decision = ""
while(decision == ""):
decision = input("Pick a number: ")
print()
if (decision == "1"):
print("You ran but police shoot you with rubber bullets")
player_health -= 10
print("Your health now: ")
print(player_health)
elif (decision == "2"):
print("You signed your ticket and got sent on you way with 10 ticket")
print("Now you need to hide and wait till it is safe to walk on the street")
player_money -= 10
print("Your money now: ")
print(player_money)
print()
time.sleep(1)
# ---section end--- #
# ---section Auther james--- #
print("there is a ambush!")
print("1. run away")
print("2. stay and fight!")
print()
decision = ""
while(decision == ""):
decision = input(" pick a number: ")
print()
if (decision == "1")
print(" you lose 50 percent of health for being a coward!!")
player_health = 50
print("your health now:")
print(player_health)
elif (decision == "2"):
print(" you stayed and fight bravery player boost
player_health = 120
print("your health now:")
print()
timesleep(1)