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
137 lines (123 loc) · 4.16 KB
/
game.py
File metadata and controls
137 lines (123 loc) · 4.16 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
####################################
# 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--- #
print("There is a warrior who stands in your way")
print("1. Fight him!")
print("2. Try negotiation with him")
print()
decision = ""
while(decision == ""):
decision = input("Pick a nubmber: ")
print()
if (decision == "1"):
print("You got injured but you steal his money")
player_health -= 20
print("Your health now")
print(player_health)
elif (decision == "2"):
print("You are able to get him worj with you on your mission")
player_items.append("Warrior")
print("Your items now")
print(player_items)
print()
time.sleep(1)
# --end session-- #
print("There is a dragon want to fire you!")
print("1. Fight him!")
print("2. Try to run and hide under the mountains")
print()
decision = ""
while(decision == ""):
decision = input("Pick a number: ")
print()
if (decision == "1"):
print("You got injured but you cut his one of head")
player_health -= 40
print("Your health now")
print(player_health)
elif (decision == "2"):
print("You are safe but and need to go fight him when dragon sleep")
player_items.append("Warrior")
print("Your items now")
print(player_items)
print()
time.sleep(1)