-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRevolution_main.py
158 lines (131 loc) · 3.42 KB
/
Revolution_main.py
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import sys
import os
import random
import pickle
import math
import time
Weapons = {'Sword': 40,
'Dagger': 30,
'Axe': 100,
'Pickaxe': 150,
'Knive': 350,
'Club': 50,
}
Items = {"Potions": 30
}
Magic = {"Fireball",
"Ice Shards",
"Ghoul"}
class Player:
def __init__(self, name):
self.name = name
self.maxhealth = 100
self.health = self.maxhealth
self.base_attack = 25
self.gold = 0
self.pot = 2
self.weapon = ["Rusty Sword"]
self.curweap = ["Rusty Sword"]
self.lvl = 1
self.xp = 0
@property
def attack(self):
attack = self.base_attack
if self.curweap == 'Rusty Sword':
attack += 5
if self.curweap == 'Sword':
attack += 15
if self.curweap == 'Axe':
attack += 20
if self.curweap == "Pickaxe":
attack += 40
if self.curweap == "Knive":
attack += 100
return attack
class Monster:
def __init__(self, name, class_, attack, gold, exp):
self.name = name
self.class_ = class_
self.maxhealth = 100
self.health = self.maxhealth
self.attack = attack
self.goldgain = gold
self.exp = exp
# Use the stats property to view all the stats of the Character
self.stats = [
self.name,
self.class_,
self.maxhealth,
self.attack,
self.goldgain,
self.exp,
]
# Enemy Names(add new monster names here)
Beast_names = [
'Goblin',
'Skeletons',
'Dragon',
'Golem',
'Wolf'
]
Attr = [
"Fire",
"Earth",
"Magic",
"Warrior",
]
# Fight System **Work in Progress**
def fight():
global Monster
goblin = Monster(Beast_names[0], Attr[3], "30", "50", "5")
print(goblin.stats)
def start1():
pass
# First page when player starts the game
def main():
os.system('cls')
print("Hello what is your name?")
option1 = input("> ")
global PlayerIG
if len(option1) <= 0:
os.system('cls')
print("Please input something.")
start()
if option1 == 'frisk':
print("Do you want to continue with this name?\nYour life will be a living hell!")
option = input('> ')
if option == 'yes':
hard()
else:
start()
else:
PlayerIG = Player(option1)
start()
# Leveling system for the game
def uplvl():
pass
def store():
print(f"Hello {PlayerIG.name}! Welcome to Gary's .\nYou currently have {PlayerIG.gold} Gold.")
print("**********")
# Shows a list of weapons available
for weapon in Weapons:
print(weapon + ":", str(Weapons[weapon])+" Gold")
print("**********\n")
option = input("What would you like to buy today?\n> ")
# Home Page to navigate around everywhere
def start():
uplvl()
# Displays the Stats of the Player
print(
f"Name: {PlayerIG.name}\nAttack: {PlayerIG.attack}\nCurrent Weapon: {PlayerIG.curweap}\nHealth: {PlayerIG.health}/{PlayerIG.maxhealth}\nGold: {PlayerIG.gold}\nLevel: {PlayerIG.lvl}\nExp: {PlayerIG.xp}"
)
decision = input("1. Fight\n2. Store\n3. Save and Quit\n> ")
if decision == '1':
fight()
if decision == '2':
store()
if decision == '3':
save()
else:
start()
main()