-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
100 lines (77 loc) · 2.43 KB
/
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
import time
import random
from entity import Entity
from location import Location
terrain = {"rough": .75, "normal": 1, "easy": 1.5}
def describeScene(clock, location):
print("A %s %s." % (checkWeather(location), checkTime(clock, location)))
def checkTime(clock, location):
timeOfDay = ["small hours", "morning", "afternoon", "night"]
# 12-6 6-12 12-6 6-12
#TODO: iterate
if clock < 6:
weatherUpdate(location)
return timeOfDay[0]
elif clock < 12:
weatherUpdate(location)
return timeOfDay[1]
elif clock < 18:
weatherUpdate(location)
return timeOfDay[2]
elif clock < 24:
weatherUpdate(location)
return timeOfDay[3]
else:
print("WE ARE N O W H E N")
# elif: clock > 24; clock -= 24
# need clock function to reset
def clockUpdate(clock):
# % it up
hour = 0
day = 0 # 24
month = 0 # 720
year = 0 # 8760 hours
# if clock > 8760
# year = clock % 8760
# if year != 0:
# clock / 8760
if clock % 8760 == 0:
year = clock / 8760
def checkWeather(location):
#check = random.randint(0, 143)
if location.weather < 72:
return "precipitation"
else:
return "clear"
def weatherUpdate(location):
location.weather = random.randint(0, 143)
def march(entity, pace, duration, clock):
distance_travelled = (pace * duration)
entity.location += distance_travelled
entity.resource_a -= distance_travelled
clock += duration
def main():
player = Entity("Anu", 0)
location = Location("Nirn")
clock = 0
distance = 0
speedBase = 1.5
play = True
while play == True:
clockUpdate(clock)
print("\n")
print("Time: %i\nLocation: %i\nresource_a: %i" % (clock, player.location, player.resource_a))
choice = input("\nchoices: \n%s\n%s\n%s\n" % ("1- scene", "2- march", "3- pace")) #list choices
time.sleep(.1)
if choice == "1":
describeScene(clock, location)
#input()
elif choice == "2":
# Change to Action menu?
clock += 1
march(player, int(input("How fast? ")), 1, clock)
elif choice == "quit":
quit()
else:
print("ivalid input")
main()