-
Notifications
You must be signed in to change notification settings - Fork 0
/
Core.py
144 lines (132 loc) · 5.37 KB
/
Core.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
import Game
import General
from untitled_const import NAV_LIT_CORE
def Core(game:Game.Game):
navdata:Game.Navdata = game.Navdata
T = Game.Gettexter(game)
navdata.AreaName = T("AREANAME_CORE")
navdata.MapRadians = 0
navdata.MapRadius = 0
navdata.MapLit = NAV_LIT_CORE
#importing elevator from General
elevator = General.elevator(game)
frags = {}
intro = ""
prevplave = game.prevPlace
if(prevplave == "ladder"):
intro = "{CORE_INTRO_1}"
else:
intro = "{CORE_INTRO_2}"
game.rolltext(intro)
choices = (
("WINDOW", T("CORE_OPTION_WINDOW")),
("ELEVATOR_SEC_A", T("CORE_OPTION_SEC_A")),
("LADDER_SEC_B", T("CORE_OPTION_SEC_B")),
("ELEVATOR_SEC_C", T("CORE_OPTION_SEC_C")),
("LADDER_SEC_D", T("CORE_OPTION_SEC_D")),
("AIRLOCK", T("CORE_OPTION_AIRLOCK")),
)
running = True
while running:
navdata.AreaName = T("AREANAME_CORE")
game.choose(choices, T("CORE_QUEST"))
data:Game.ActDataInput = game.wait()
if not data or data.Type != "action":
continue
elif data.tag == "WINDOW":
if game.getdata("core:window", False):
game.rolltext("{CORE_WINDOW_2}", frags = frags)
else: #CORE_WINDOW_1
navdata.AreaName = T("AREANAME_CORE-WINDOW")
if(game.getdata("apartment:window")):
frags["_WINDOW_PART"] = "{CORE_WINDOW_1_PART_A}"
else:
frags["_WINDOW_PART"] = "{CORE_WINDOW_1_PART_B}"
game.rolltext("{CORE_WINDOW_1}", frags = frags)
game.setdata("core:window", True)
elif data.tag == "ELEVATOR_SEC_A":
navdata.AreaName = T("AREANAME_CORE-ELEVATOR_A")
game.rolltext("{CORE_TO_ELE_A}")
if(game.yesno("{FLOAT_TO_QUEST}")):
elevator()
elif data.tag == "ELEVATOR_SEC_C":
navdata.AreaName = T("AREANAME_CORE-ELEVATOR_C")
game.rolltext("{CORE_TO_ELE_C}")
if(game.yesno("{FLOAT_TO_QUEST}")):
game.rolltext("{CORE_ELE_C}")
elif data.tag == "LADDER_SEC_B":
navdata.AreaName = T("AREANAME_CORE-LADDER_B")
game.rolltext("{CORE_TO_LADDER_B}")
if(game.yesno("{FLOAT_TO_QUEST}")):
game.place = "ladder"
running = False
elif data.tag == "LADDER_SEC_D":
navdata.AreaName = T("AREANAME_CORE-LADDER_D")
game.rolltext("{CORE_TO_LADDER_D}")
if(game.yesno("{FLOAT_TO_QUEST}")):
game.rolltext("{CORE_LADDER_D}")
elif data.tag == "AIRLOCK":
navdata.AreaName = T("AREANAME_CORE-AIRLOCK")
game.rolltext("{CORE_AIRLOCK_1}")
if not game.yesno("{CORE_AIRLOCK_1_QUEST}"):
continue
game.rolltext("{CORE_AIRLOCK_2}")
if not game.yesno("{CORE_AIRLOCK_2_QUEST}"):
game.rolltext("{CORE_AIRLOCK_3B}")
continue
game.rolltext("{CORE_AIRLOCK_3A}")
game.place = "cargobay"
running = False
return
status = game.updateCounter("reactorC", -1)
if status == "death": #if reactor counter reach 0, and the game ends.
running = False
#end of loop
def Cargobay(game:Game.Game):
#TODO: Rewrite needed!
T = Game.Gettexter(game)
navdata = game.Navdata
navdata.AreaName = T("AREANAME_CARGOBAY")
navdata.MapForceUnknown = True
navdata.MapLit = NAV_LIT_CORE
frags = {}
reactorFixed = game.getdata("reactorC:fixed", False)
peopleSaved = game.getdata("stasis:peopleSaved", 0)
prevcontact = game.getdata("auxcom:cargo", False)
frags["_NUM_PEOPLE_SAVED"] = str(peopleSaved)
if prevcontact:
frags["_P"] = game.PlayerName
else:
if game.PlayerGender == "male":
frags["_P"] = T("GENDERED_1_MALE")
else:
frags["_P"] = T("GENDERED_1_FEMALE")
if prevcontact:
frags["_INTRO_PART"] = "{CARGOBAY_INTRO_PART_A}"
if(peopleSaved > 120):
frags["_REACTION"] = "{CARGOBAY_REACTION_B}"
frags["_FOLLOWUP"] = "{CARGOBAY_FOLLOWUP_A}"
frags["_END"] = "{CARGOBAY_ENDING_C}"
elif(peopleSaved > 0):
frags["_REACTION"] = "{CARGOBAY_REACTION_A}"
frags["_FOLLOWUP"] = "{CARGOBAY_FOLLOWUP_A}"
frags["_END"] = "{CARGOBAY_ENDING_B}"
elif(reactorFixed):
frags["_REACTION"] = "{CARGOBAY_REACTION_C}"
frags["_FOLLOWUP"] = "{CARGOBAY_FOLLOWUP_B}"
frags["_END"] = "{CARGOBAY_ENDING_A}"
else:
frags["_REACTION"] = "{CARGOBAY_REACTION_D}"
frags["_FOLLOWUP"] = "{CARGOBAY_FOLLOWUP_B}"
frags["_END"] = "{CARGOBAY_ENDING_A}"
else:
frags["_INTRO_PART"] = "{CARGOBAY_INTRO_PART_B}"
frags["_REACTION"] = "{CARGOBAY_REACTION_D}"
frags["_FOLLOWUP"] = "{CARGOBAY_FOLLOWUP_B}"
frags["_END"] = "{CARGOBAY_ENDING_D}"
game.rolltext("{CARGOBAY_ENDING}", frags = frags)
game.setGameover("End of the story, so far!")
if __name__ == "__main__":
#testers, feel free to enter your testcode here.
#if your only change is in this code-block, feel free to commit.
print("Testcode for this room is not written yet.\nPlease run from main.py instead.")