-
Notifications
You must be signed in to change notification settings - Fork 20
/
CorporateInsurance.xml
467 lines (359 loc) · 11.6 KB
/
CorporateInsurance.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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
<?xml version="1.0" encoding="utf-8"?>
<TranscendenceModule>
<!-- Insurance Company
GLOBAL DATA
claims: Number of times player has been resurrected
insured: True if player is insured
-->
<StationType UNID="&stInsuranceCompany;"
name= ":the Clavius Insurance Conglomerate|Clavius Insurance Conglomerate"
sovereign= "&svCorporate;"
inherit= "&baCorporateStation;"
dockScreen= "Main"
abandonedScreen= "&dsAbandonedStation;"
dockingPorts= "8"
canAttack= "true"
multiHull= "true"
armorID= "&itCeralloyArmor;"
hitPoints= "250"
regen= "2"
explosionType= "&vtBlastExplosion2;"
ejectaType= "&vtWreckEjecta;"
attributes= "corporate, corporateCustoms, corporateInsurance, envAir, envEarth, envFire, envWater, friendly, independent, generic, human, populated"
>
<!-- Encounter Info -->
<Encounter
systemCriteria= "+corporateSpace;"
systemAffinity= "+corporateCore;"
levelFrequency= "-rrru r---- ----- ----- -----"
locationCriteria= "+planetary"
enemyExclusionRadius= "50"
unique= "inSystem"
/>
<Image imageID="&rsStations2;" imageX="0" imageY="0" imageWidth="128" imageHeight="256"/>
<Ships>
<Lookup count="1d4+2" table="&tbCommPrivateCrafts;"/>
</Ships>
<Events>
<GetGlobalAchievements>
(append
(if (typGetData &stInsuranceCompany; 'insured)
{
descID: 'insuredBy
value: (typGetProperty gType 'name)
}
)
(switch
(gr (typGetData &stInsuranceCompany; 'claims) 0)
{
descID: 'insuranceClaims
value: (typGetData &stInsuranceCompany; 'claims)
sectionID: 'conducts
}
(typGetData &stInsuranceCompany; 'insured)
{
descID: 'neverClaimedInsurance
sectionID: 'conducts
}
{
descID: 'neverBoughtInsurance
sectionID: 'conducts
}
)
)
</GetGlobalAchievements>
<GetGlobalResurrectPotential>
(switch
; If not insured, we never resurrect
(not (typGetGlobalData &stInsuranceCompany; "insured"))
0
; We never resurrect in Huaramarca or Elysium
(or (eq (sysGetNode) 'Huaramarca)
(eq (sysGetNode) 'Elysium))
0
; If there are corporate stations in the system, then we are highly likely
; to resurrect the player
(sysFindObject Nil "TA +corporate;")
100
; Otherwise, we are not very likely (we'll only resurrect if no one else can help)
1
)
</GetGlobalResurrectPotential>
<OnGlobalResurrect>
(block (rescueObj)
; Increase claims
(typIncGlobalData &stInsuranceCompany; "claims")
(typSetGlobalData &stInsuranceCompany; "insured" Nil)
; Restore the ship
(switch
; If the player ship has custom insurance code, then we
; don't do anything more.
(objFireEvent gPlayerShip 'OnInsuranceClaim)
Nil
; Put the player in a safe place and repair the ship
(rpgRestorePlayer {
portObj: (or
(sysFindObject gPlayerShip "TAFN +corporateInsurance;")
(sysFindObject gPlayerShip "TAFN +populated; +corporate; +majorStation;")
)
})
)
; Create a rescue ship nearby
(setq rescueObj (sysCreateShip
&scCorporateCruiser;
(sysVectorRandom gPlayerShip 5 5 "TA")
&svCorporate;
))
(shpOrder rescueObj 'wait Nil 5)
(shpOrder rescueObj 'gate)
(objSendMessage gPlayerShip rescueObj "Insurance claim processed. Have a better one!")
)
</OnGlobalResurrect>
<OnContractGenerate>
(intGenerateIndustrialRequestContract1)
</OnContractGenerate>
<OnContractQuery>True</OnContractQuery>
</Events>
<DockScreens>
<Main>
<Panes>
<Default>
<OnPaneInit>
(scrSetDescTranslate gScreen 'descWelcome {
systemName: (sysGetName)
})
</OnPaneInit>
<Actions>
<Action id="actionPurchase" default="1">
(switch
(objGetGlobalData gSource "insured")
(scrShowPane gScreen "AlreadyInsured")
(geq (objGetGlobalData gSource "claims") 3)
(scrShowPane gScreen "TooRisky")
(scrShowPane gScreen "BuyInsurance")
)
</Action>
<Action id="actionUndock" cancel="1">
<Exit/>
</Action>
</Actions>
</Default>
<AlreadyInsured descID="descAlreadyInsured">
<Actions>
<Action id="actionContinue" cancel="1" default="1">
<ShowPane pane="Default"/>
</Action>
</Actions>
</AlreadyInsured>
<TooRisky descID="descTooRisky">
<Actions>
<Action id="actionContinue" cancel="1" default="1">
<ShowPane pane="Default"/>
</Action>
</Actions>
</TooRisky>
<BuyInsurance>
<OnPaneInit>
(block (desc claims priceAdj)
(setq claims (objGetGlobalData gSource "claims"))
; Compute the price based on prior claims
(switch
(or (not claims) (eq claims 0))
(setq gCost 10000)
(eq claims 1)
(setq gCost 50000)
(eq claims 2)
(setq gCost 100000)
(setq gCost 1000000)
)
; Include any global adjustments
(if (setq priceAdj (objGetPlayerPriceAdj gSource { type:'corporateInsurance priorClaims:(if claims claims 0) }))
(setq gCost (divide (multiply gCost priceAdj) 100))
)
; Compose text
(scrSetDesc gScreen
(scrTranslate gScreen 'descPurchaseIntro)
"\n\n"
(switch
(not priceAdj)
(scrTranslate gScreen 'descPurchasePrice {
cost: (fmtCurrency 'credit gCost)
})
(eq gCost 0)
(scrTranslate gScreen 'descPurchaseFree)
(scrTranslate gScreen 'descPurchaseDiscount {
cost: (fmtCurrency 'credit gCost)
})
)
(switch
(ls (plyGetCredits gPlayer) gCost)
(cat "\n\n" (scrTranslate gScreen 'descCannotAfford))
)
)
(scrEnableAction gScreen 'actionPurchase (geq (plyGetCredits gPlayer) gCost))
)
</OnPaneInit>
<Actions>
<Action id="actionPurchase" default="1">
(block Nil
(objSetGlobalData gSource "insured" True)
(plyCharge gPlayer gCost)
(scrShowPane gScreen "Done")
)
</Action>
<Action id="actionCancel" cancel="1">
<ShowPane pane="Default"/>
</Action>
</Actions>
</BuyInsurance>
<Done descID="descThankYou">
<Actions>
<Action id="actionContinue" cancel="1" default="1">
<ShowPane pane="Default"/>
</Action>
</Actions>
</Done>
</Panes>
</Main>
</DockScreens>
<DockingPorts>
<Port x="0" y="135" />
<Port x="0" y="-15" />
<Port x="50" y="110" />
<Port x="50" y="10" />
<Port x="75" y="60" />
<Port x="-75" y="60" />
<Port x="-50" y="110" />
<Port x="-50" y="10" />
</DockingPorts>
<Language>
<Text id="actionPurchase">[P]urchase Insurance</Text>
<Text id="descWelcome">
Welcome to the %systemName% branch of the Clavius Insurance Conglomerate.
Since 2071 we have been providing hazard insurance services to freelancers
and entrepreneurs throughout Human Space.
</Text>
<Text id="descPurchaseIntro">
We provide full personal and property coverage against death and
destruction. Claims are settled by full replacement of life and property,
including resuscitation and cloning.
</Text>
<String id="descPurchasePrice">
"Based on your risk profile we can offer you full coverage for %cost%."
</String>
<Text id="descPurchaseFree">
"With your corporate discount we can offer you full coverage
for...let me see...wow, you must have some powerful friends!
"We can offer you full coverage free of charge!"
</Text>
<String id="descPurchaseDiscount">
"With your corporate discount we can offer you full coverage for %cost%."
</String>
<Text id="descCannotAfford">
Unfortunately, you cannot afford the price.
</Text>
<Text id="descAlreadyInsured">
You are already insured by our conglomerate. Rest assured that
you are protected against all losses by the most comprehensive
insurance in the Commonwealth.
</Text>
<Text id="descTooRisky">
Unfortunately, we do not have an insurance product suitable for
the risky lifestyle that you lead.
</Text>
<Text id="descThankYou">
"Thank you for your purchase. We wish you a long and happy life,
secure in the knowledge that the oldest and most powerful
insurance conglomerate stands behind you."
</Text>
<Text id="insuranceClaims">Insurance claims</Text>
<Text id="insuredBy">Insured by</Text>
<Text id="neverBoughtInsurance">Never bought life insurance</Text>
<Text id="neverClaimedInsurance">Never claimed life insurance</Text>
<Text id="core.mapDesc">
Life insurance policies
</Text>
</Language>
</StationType>
<!-- DOCK SCREENS -->
<!-- Insurance Claim on Criminal Liability -->
<DockScreen UNID="&dsInsuranceCriminalLiability;"
inherit="&dsDockScreenBase;"
nestedScreen="true"
>
<InitialPane>
(switch
; Insurance does not cover level 4 crimes
(geq (objGetData gPlayerShip 'corpCrimeSeverity) 4)
"NoInsurance"
"Default"
)
</InitialPane>
<Panes>
<Default>
<OnPaneInit>
(scrSetDescTranslate gScreen 'descDefault {
crime: (objGetData gPlayerShip 'corpCrime)
})
</OnPaneInit>
<Actions>
<Action id="actionContinue" default="1" cancel="1">
(block Nil
; This counts as 3 claims (player can't get more insurance)
(typIncGlobalData &stInsuranceCompany; 'claims 3)
(typSetGlobalData &stInsuranceCompany; 'insured Nil)
; Crime is wiped from the books
(objSetData gPlayerShip 'corpCrimeSeverity Nil)
(objSetData gPlayerShip 'corpCrime Nil)
; Cancel any Corporate cruisers
(enum (sysFindObject Nil "s +corporate; +capitalShip;") theObj
(if (and (= (shpGetOrder theObj) 'attack)
(= (shpGetOrderTarget theObj) gPlayerShip)
)
(shpCancelOrder theObj)
)
)
; Done
(scrExitScreen gScreen)
)
</Action>
</Actions>
</Default>
<NoInsurance>
<OnPaneInit>
(scrSetDescTranslate gScreen 'descNoInsurance {
crime: (objGetData gPlayerShip 'corpCrime)
})
</OnPaneInit>
<Actions>
<Action id="actionContinue" default="1" cancel="1">
(block Nil
; Cancel insurance
(typIncGlobalData &stInsuranceCompany; 'claims 3)
(typSetGlobalData &stInsuranceCompany; 'insured Nil)
; Player imprisoned
(plyDestroyed gPlayer (cat "was imprisoned for " (objGetData gPlayerShip 'corpCrime)))
(scrExitScreen gScreen 'forceUndock)
)
</Action>
</Actions>
</NoInsurance>
</Panes>
<Language>
<Text id="descDefault">
As you enter the station you are surrounded by heavily armed soldiers.
A corporate officer steps in front of them:
"You've been charged with %crime%. Fortunately, your insurance coverage
will handle the claim and pay appropriate restitution to the victims.
"You're free to go."
</Text>
<Text id="descNoInsurance">
As you enter the station you are surrounded by heavily armed soldiers.
A corporate officer approaches you:
"You are under arrest for %crime%. And before you ask, no, your
insurance company does not cover you under these conditions. Read
the fine print."
</Text>
</Language>
</DockScreen>
</TranscendenceModule>