-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ladder.py
76 lines (69 loc) · 2.31 KB
/
Ladder.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
import Game
import General
#The Ladder
class LadderRunner(Game.PlaceRunner1D):
def __init__(self, game:Game.Game):
super().__init__(game, 'y', 'up', 'down')
def onTravel(self, previndex:int):
if previndex == self.index:
print("Null travel error ? ignoring")
if previndex > self.index:
self.game.showtext("{LADDER_GO_DOWN}")
if previndex < self.index:
self.game.showtext("{LADDER_GO_UP}")
#check for section passage
def runaction(self, action):
status = self.game.updateCounter("reactorC", -1)
if status == "death":
self.running = False
return
super().runaction(action)
def Start(game:Game.Game):
T = Game.Gettexter(game)
runner = LadderRunner(game)
def goto(place):
runner.stop()
game.place = place
def core():
game.showtext("{LADDER_TO_CORE}")
goto("core")
def inner():
game.showtext("{LADDER_TO_INNER}")
goto("inner")
def middle():
game.showtext("{LADDER_TO_MID}")
goto("middle")
def outer():
game.showtext("{LADDER_TO_OUT}")
goto("outer")
def setupRunner():
r0 = 0
from untitled_const import NAV_INNER_RADIUS as r1
from untitled_const import NAV_MIDDLE_RADIUS as r2
from untitled_const import NAV_OUTER_RADIUS as r3
from untitled_const import TAU
rot = 6/16 * TAU
runner.nodes = [
Game.PlaceNode(game, "TO_CORE",T("AREANAME_TO-CORE"), r0, rot ,[
("_", T("LADDER_CORE_QUEST"), core),
]),
Game.PlaceNode(game, "TO_INNER",T("AREANAME_TO-INNER"), r1, rot ,[
("_", T("LADDER_INNER_QUEST"), inner),
]),
Game.PlaceNode(game, "TO_MID",T("AREANAME_TO-MIDDLE"), r2, rot ,[
("_", T("LADDER_MID_QUEST"), middle),
]),
Game.PlaceNode(game, "TO_OUT",T("AREANAME_TO-OUTER"), r3, rot ,[
("_", T("LADDER_OUT_QUEST"), outer),
]),
]
game.rollArt("ladderart", 0.05)
setupRunner()
runner.index = (
{
"core":"TO_CORE",
"inner":"TO_INNER",
"middle":"TO_MID",
"outer":"TO_OUT",
}.get(game.prevPlace, 0))
runner.run()