forked from kronosaur/Transcendence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
KronosaurusMission01.xml
219 lines (190 loc) · 6.46 KB
/
KronosaurusMission01.xml
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<?xml version="1.0" ?>
<TranscendenceModule>
<!-- Mission: Kronosaurus ==================================================
The Kronosaurus hunts the player
EXTRA DATA
targetID: ID of the Kronosaurus
destroyedByPlayer: True if player destroyed the Kronosaurus
destroyedBy: Name of ship which destroyed Kronosaurus
======================================================================== -->
<MissionType UNID="&msKronosaurus;"
name= "The Kronosaurus"
attributes= "korolov, special"
maxAppearing= "1"
>
<Events>
<OnCreate>
; No mission if the Kronosaurus is unavailable
(if (not (rpgCharacterIsAliveAndWell &unidKronosaurus;))
(msnDestroy gSource)
)
</OnCreate>
<OnStarted>
(block (
(korolovObj (sysFindObject Nil "TN +korolovShipping;"))
kronosaurus
)
; Create the Kronosaurus
(setq kronosaurus
(rpgCharacterCreateShip
&unidKronosaurus;
&scCharonFrigateKronosaurus;
(sysFindObject gPlayerShip "GR -uncharted;")
{ repairAll:True }
)
)
; Order the Kronosaurus to attack the player
(shpCancelOrders kronosaurus)
(shpOrder kronosaurus 'attack gPlayerShip)
(objSetProperty kronosaurus 'dockingEnabled Nil)
(msnSetData gSource 'targetID (objGetID kronosaurus))
(msnRegisterForEvents gSource kronosaurus)
(msnRegisterForEvents gSource gPlayerShip)
; We debrief at the nearest Korolov station
(if korolovObj
(msnSetProperty gSource 'debrieferID (objGetID korolovObj))
)
)
</OnStarted>
<OnObjDestroyed>
(switch
(or (= aDestroyReason 'enteredStargate) (= aDestroyReason 'ascended))
Nil
(= aObjDestroyed gPlayerShip)
(block Nil
(msnFailure gSource)
; suppress the debrief until we add a failure screen
; probably only possible if player has insurance
(msnSetProperty gSource 'isDebriefed True)
)
(= (objGetID aObjDestroyed) (msnGetData gSource 'targetID))
(block Nil
(rpgCharacterSetStatus &unidKronosaurus; 'dead)
(msnSetData gSource 'destroyedByPlayer (= aOrderGiver gPlayerShip))
(msnSetData gSource 'destroyedBy (objGetName aOrderGiver 0x04))
(msnSuccess gSource)
)
)
</OnObjDestroyed>
<OnGetNextScreen>
(if (and (= aScreenType 'SuccessFollowUp) (msnGetData gSource 'destroyedByPlayer))
{
nextScreen: &dsRPGWingmanEncounter;
nextScreenData: {wingman: &scWolfenVolkov;}
}
)
</OnGetNextScreen>
<OnReward>
(if (msnGetData gSource 'destroyedByPlayer)
(block Nil
(typSetGlobalData &unidKorolovShipping; 'level 4)
(typSetGlobalData &unidKorolovShipping; 'xp 5000)
)
)
</OnReward>
<OnPlayerEnteredSystem>
(block (korolovObj)
; If the Kronosaurus is here then restore the ship and attack player
(if (and (= (sysGetNode) (typGetData &unidKronosaurus; 'lastNodeID))
(rpgCharacterIsAliveAndWell &unidKronosaurus;)
)
(block (kronosaurus)
; Note - this doesn't add the Kronosaurus until the player has arrived i.e.
; if Kronosaurus is in SRS range it will appear on screen the same time as
; player. We could move the rpgCharacterCreateShip to OnGlobalSystemStarted
; but that requires extra checks, and we need to order the ship here
(setq kronosaurus (rpgCharacterCreateShip &unidKronosaurus; &scCharonFrigateKronosaurus;))
(objSetProperty kronosaurus 'dockingEnabled Nil)
(shpCancelOrders kronosaurus)
(shpOrder kronosaurus 'attack gPlayerShip)
(msnSetData gSource 'targetID (objGetID kronosaurus))
(msnRegisterForEvents gSource kronosaurus)
)
)
; We can debrief at any Korolov so reset debrieferID everytime we change system
; Note - this means we can't have more than one Korolov station per system, but
; we could use GetGlobalDockScreen instead
(if (setq korolovObj (sysFindObject Nil "TN +korolovShipping;"))
(msnSetProperty gSource 'debrieferID (objGetID korolovObj))
)
)
</OnPlayerEnteredSystem>
<GetGlobalAchievements>
(block (
(theMission (@ (msnFind "r +unid:&msKronosaurus;; +property:isCompleted;") 0))
)
(switch
(not theMission)
Nil
(msnGetProperty theMission 'isFailure)
(list (list
"Defeated by the Kronosaurus"
Nil
"achievements & regrets"
))
(and (msnGetProperty theMission 'isSuccess) (msnGetData theMission 'destroyedByPlayer))
(list (list
"Defeated the Kronosaurus"
Nil
"achievements & regrets"
))
(msnGetProperty theMission 'isSuccess)
(list (list
"Evaded the Kronosaurus"
Nil
"achievements & regrets"
))
Nil
)
)
</GetGlobalAchievements>
</Events>
<Language>
<Text id="Name">
"Defeat the Kronosaurus"
</Text>
<Text id="Summary">
(cat
"By destroying several Charon frigates you have alarmed the pirates. "
"They're sending the Kronosaurus after you! It is the deadliest frigate "
"in the Charon fleet and it will not stop until you are destroyed.\n\n"
"System: " (sysGetName) "\n"
"Payment: None"
)
</Text>
<Text id="InProgress">
(cat
"\"Sorry, captain, but the Kronosaurus is hunting you! No freighter crew "
"will dare to travel with you while that frigate is in system. Good Luck!\""
)
</Text>
<Text id="SuccessMsg">
"Mission complete!"
</Text>
<Text id="SuccessDebrief">
(if (msnGetData gSource 'destroyedByPlayer)
(msnTranslate gSource "SuccessDebrief:player")
(msnTranslate gSource "SuccessDebrief:other")
)
</Text>
<Text id="SuccessDebrief:player">
(cat
"A crowd gathers around you as you enter the docking bay. "
"Assistant Director "
(objGetData (objGetObjByID (msnGetProperty gSource 'debrieferID)) 'assistantDirector)
" shakes your hand:\n\n"
"\"I never thought I'd see the day! You've destroyed the Kronosaurus! The deadliest ship in the Charon fleet! "
"This day and your accomplishments will be remembered always.\""
)
</Text>
<Text id="SuccessDebrief:other">
(cat
"There is a crowd celebrating in the main hall. "
"One of the freighter captains approaches you:\n\n"
"\"Did you hear, the Kronosaurus has been destroyed by "
(msnGetData gSource 'destroyedBy) "!\""
)
</Text>
</Language>
</MissionType>
</TranscendenceModule>