-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinner.py
173 lines (148 loc) · 6.97 KB
/
inner.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
import Game
import random
import General
from General import Runner_WheelC_Rings as Runner
from untitled_const import NAV_LIT_INNER_A
from untitled_const import NAV_LIT_INNER_B
def Start(game:Game.Game):
T = Game.Gettexter(game)
runner = Runner(game)
def goto(place):
runner.stop()
game.place = place
#region actions and places
#importing elevator event
elevator = General.elevator(game)
#importing ladder
ladder = General.LadderAccess(game, goto)
def sectionBdoor_pass():
runner.nav.MapLit = NAV_LIT_INNER_B
game.showtext("{PASS_SECTOR_DOORWAY}")
def sectionAdoor_pass():
runner.nav.MapLit = NAV_LIT_INNER_A
game.showtext("{PASS_SECTOR_DOORWAY}")
def sectionBdoor_read():
game.showtext("PLACEHOLDER")
def sectionAdoor_read():
game.showtext("PLACEHOLDER")
def sectionDdoor_read():
game.rolltext("{INNER_SEC_D_DOOR}")
def sectionCdoor_read():
game.rolltext("{INNER_SEC_C_DOOR}")
#groups that can be saved.
#126 people can be saved.
def tubes(num):
def chamberRoom():
key = game.getInventory("KEYCODE")
visited = game.getdata("inner:stasisroom:"+str(num), False)
peopleSaved = game.getdata("stasis:peopleSaved", 0)
if not key:
game.rolltext("{INNER_TUBES_LOCKED}")
game.updateCounter("reactorC", 1) #refunded time cost.
return
elif visited:
game.showtext("{INNER_TUBES_VISITED}")
game.updateCounter("reactorC", 1) #refunded time cost.
else:
if num == 0:
game.rolltext("{INNER_TUBES_1}")
peopleSaved += 1
elif num == 1 or num == 7 or num == 11:
game.rolltext("{INNER_TUBES_2}")
peopleSaved += 17
elif num == 2 or num == 6:
game.rolltext("{INNER_TUBES_3}")
peopleSaved += 0
elif num == 3:
game.rolltext("{INNER_TUBES_4}")
peopleSaved += 5
elif num == 4 or num == 9:
game.rolltext("{INNER_TUBES_5}")
peopleSaved += 0
elif num == 5:
game.rolltext("{INNER_TUBES_6}")
peopleSaved += 45
elif num == 8 or num == 10:
game.rolltext("{INNER_TUBES_7}")
peopleSaved += 12
status = game.updateCounter("reactorC", -1)
if status == "death": #if reactor counter reach 0, and the game ends.
runner.running = False
return
game.setdata("inner:stasisroom:"+str(num), True)
game.setdata("stasis:peopleSaved", peopleSaved)
return chamberRoom
#endregion actions and places
#---------------------------
def setupRunner():
from untitled_const import NAV_INNER_RADIUS as r
from untitled_const import TAU
runner.nodes = []
runner.nodes += [
Game.PlaceNode(game, "TO_SEC_D", T("INNER_NAV_TO_SEC_D"), r, 12/16*TAU, [
("_", T("ACT_READ_SIGN"), sectionDdoor_read)]),
Game.PlaceNode(game, "TO_ROOM_A", T("AREANAME_INNER-ROOM-A"), r, 11/16*TAU+0.05, [
("_", T("INNER_TO_ROOM_QUEST"), tubes(0))]),
Game.PlaceNode(game, "TO_ROOM_B", T("AREANAME_INNER-ROOM-B"), r, 11/16*TAU, [
("_", T("INNER_TO_ROOM_QUEST"), tubes(1))]),
Game.PlaceNode(game, "TO_ROOM_C", T("AREANAME_INNER-ROOM-C"), r, 11/16*TAU-0.05, [
("_", T("INNER_TO_ROOM_QUEST"), tubes(2))]),
Game.PlaceNode(game, "TO_ELEVATOR", T("INNER_NAV_ELE"), r, 10/16 * TAU, [
("_", T("ACT_USE"), elevator)]),
Game.PlaceNode(game, "TO_ROOM_D", T("AREANAME_INNER-ROOM-D"), r, 9/16 * TAU+0.05, [
("_", T("INNER_TO_ROOM_QUEST"), tubes(3))]),
Game.PlaceNode(game, "TO_ROOM_E", T("AREANAME_INNER-ROOM-E"), r, 9/16 * TAU, [
("_", T("INNER_TO_ROOM_QUEST"), tubes(4))]),
Game.PlaceNode(game, "TO_ROOM_F", T("AREANAME_INNER-ROOM-F"), r, 9/16 * TAU-0.05, [
("_", T("INNER_TO_ROOM_QUEST"), tubes(5))]),
Game.PlaceNode(game, "TO_SEC_B", T("INNER_NAV_TO_SEC_B"), r, 8/16 * TAU+0.05, [
("_", T("ACT_READ_SIGN"), sectionBdoor_read )]),
Game.PlaceNode(game, "TO_SEC_A", T("INNER_NAV_TO_SEC_A"), r, 8/16 * TAU-0.05, [
("_", T("ACT_READ_SIGN"), sectionAdoor_read )]),
Game.PlaceNode(game, "TO_ROOM_G", T("AREANAME_INNER-ROOM-G"), r, 7/16 * TAU+0.05, [
("_", T("INNER_TO_ROOM_QUEST"), tubes(6))]),
Game.PlaceNode(game, "TO_ROOM_H", T("AREANAME_INNER-ROOM-H"), r, 7/16 * TAU, [
("_", T("INNER_TO_ROOM_QUEST"), tubes(7))]),
Game.PlaceNode(game, "TO_ROOM_I", T("AREANAME_INNER-ROOM-I"), r, 7/16 * TAU-0.05, [
("_", T("INNER_TO_ROOM_QUEST"), tubes(8))]),
Game.PlaceNode(game, "TO_LADDER", T("INNER_NAV_LADDER"), r, 6/16 * TAU, [
("_", T("ACT_USE"), ladder)]),
Game.PlaceNode(game, "TO_ROOM_J", T("AREANAME_INNER-ROOM-J"), r, 5/16 * TAU, [
("_", T("INNER_TO_ROOM_QUEST"), tubes(9))]),
Game.PlaceNode(game, "TO_ROOM_K", T("AREANAME_INNER-ROOM-K"), r, 5/16 * TAU, [
("_", T("INNER_TO_ROOM_QUEST"), tubes(10))]),
Game.PlaceNode(game, "TO_ROOM_L", T("AREANAME_INNER-ROOM-L"), r, 5/16 * TAU, [
("_", T("INNER_TO_ROOM_QUEST"), tubes(11))]),
Game.PlaceNode(game, "TO_SEC_C", T("INNER_NAV_TO_SEC_C"), r, 4/16 * TAU+0.05, [
("_", T("ACT_READ_SIGN"), sectionCdoor_read )]),
]
runner.passActs = [
("TO_SEC_B","TO_SEC_A", sectionBdoor_pass),
("TO_SEC_A","TO_SEC_B", sectionAdoor_pass)
]
runner.index, intro = {
"ladder" : ("TO_LADDER","{INNER_INTRO_2}"),
}.get(game.prevPlace, ("TO_SEC_C", "{INNER_INTRO_1}"))
if runner.index > runner.indexofnode("TO_SEC_B"):
runner.nav.MapLit = NAV_LIT_INNER_B
else:
runner.nav.MapLit = NAV_LIT_INNER_A
game.rolltext(intro)
setupRunner()
runner.run()
#This is the testcode for the module.
#Testers - feel free to edit this code to fit whatever test you need.
if __name__ == "__main__":
import tkinter
from main import VERSION
from main import _testloop
tkRoot = tkinter.Tk(screenName="TEST! inner ring")
game:Game.Game = Game.Game(tkRoot, VERSION, "english")
def testdata():
game.newgame()
#setting prevplace and place
game.place = "ladder"
game.place = "inner"
#if game.yesno(message="..."):
# pass
_testloop(game, Start, testdata, "INNER RING")