-
Notifications
You must be signed in to change notification settings - Fork 555
/
cards_ids.dm
428 lines (348 loc) · 12.9 KB
/
cards_ids.dm
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
/* Cards
* Contains:
* DATA CARD
* ID CARD
* FINGERPRINT CARD HOLDER
* FINGERPRINT CARD
*/
/*
* DATA CARDS - Used for the teleporter
*/
/obj/item/card
name = "card"
desc = "Does card things."
icon = 'icons/obj/items/card.dmi'
w_class = SIZE_TINY
var/associated_account_number = 0
var/list/files = list( )
/obj/item/card/data
name = "data disk"
desc = "A disk of data."
icon_state = "data"
var/function = "storage"
var/data = "null"
var/special = null
item_state = "card-id"
/obj/item/card/data/verb/label(t as text)
set name = "Label Disk"
set category = "Object"
set src in usr
if (t)
src.name = text("data disk- '[]'", t)
else
src.name = "data disk"
src.add_fingerprint(usr)
return
/obj/item/card/data/clown
name = "\proper the coordinates to clown planet"
icon_state = "data"
item_state = "card-id"
layer = OBJ_LAYER
level = 2
desc = "This card contains coordinates to the fabled Clown Planet. Handle with care."
function = "teleporter"
data = "Clown Land"
black_market_value = 50
/*
* ID CARDS
*/
/obj/item/card/id
name = "identification holo-badge"
desc = "A slice of encoded compressed fiber glass. Used for identification and access control."
icon_state = "id"
item_state = "card-id"
var/access = list()
var/faction = FACTION_NEUTRAL
var/list/faction_group
/// The name registered_name on the card
var/registered_name = "Unknown"
var/datum/weakref/registered_ref = null
var/registered_gid = 0
flags_equip_slot = SLOT_ID
var/blood_type = "\[UNSET\]"
//alt titles are handled a bit weirdly in order to unobtrusively integrate into existing ID system
/// can be alt title or the actual job
var/assignment = null
/// actual job
var/rank = null
/// Marine's paygrade
var/paygrade = PAY_SHORT_CIV
/// For medics and engineers to 'claim' a locker
var/claimedgear = 1
var/list/uniform_sets = null
var/list/vended_items
/// whether the id's onmob overlay only appear when wearing a uniform
var/pinned_on_uniform = TRUE
var/modification_log = list()
/obj/item/card/id/Destroy()
. = ..()
screen_loc = null
/obj/item/card/id/proc/GetJobName() //Used in secHUD icon generation
var/job_icons = get_all_job_icons()
var/centcom = get_all_centcom_jobs()
if(assignment in job_icons)
return assignment//Check if the job has a hud icon
if(rank in job_icons)
return rank
if(assignment in centcom)
return "Centcom"//Return with the NT logo if it is a Centcom job
if(rank in centcom)
return "Centcom"
return "Unknown" //Return unknown if none of the above apply
/obj/item/card/id/attack_self(mob/user as mob)
..()
user.visible_message("[user] shows you: [icon2html(src, viewers(user))] [name]: assignment: [assignment]")
src.add_fingerprint(user)
/obj/item/card/id/proc/set_user_data(mob/living/carbon/human/H)
if(!istype(H))
return
registered_name = H.real_name
registered_ref = WEAKREF(H)
registered_gid = H.gid
blood_type = H.blood_type
/obj/item/card/id/proc/set_assignment(new_assignment)
assignment = new_assignment
name = "[registered_name]'s ID Card ([assignment])"
/obj/item/card/id/GetAccess()
return access
/obj/item/card/id/GetID()
return src
/obj/item/card/id/verb/read()
set name = "Read ID Card"
set category = "Object"
set src in usr
to_chat(usr, "[icon2html(src, usr)] [name]: The current assignment on the card is [assignment]")
to_chat(usr, "The blood type on the card is [blood_type].")
/obj/item/card/id/proc/check_biometrics(mob/living/carbon/human/target)
if(registered_ref && (registered_ref != WEAKREF(target)))
return FALSE
if(target.real_name != registered_name)
return FALSE
return TRUE
/obj/item/card/id/data
name = "identification holo-badge"
desc = "A plain, mass produced holo-badge."
icon_state = "data"
/obj/item/card/id/lanyard
name = "identification holo-lanyard"
desc = "A crude holo-lanyard. As cheap as they come."
icon_state = "lanyard"
/obj/item/card/id/silver
name = "identification holo-badge"
desc = "A silver plated holo-badge which shows honour and dedication."
icon_state = "silver"
item_state = "silver_id"
/obj/item/card/id/silver/clearance_badge
name = "corporate doctor badge"
desc = "A corporate holo-badge. It is fingerprint locked with clearance level 3 access. It is commonly held by corporate doctors."
icon_state = "clearance"
var/clearance_access = 3
/obj/item/card/id/silver/clearance_badge/scientist
name = "corporate scientist badge"
desc = "A corporate holo-badge. It is fingerprint locked with clearance level 4 access. It is commonly held by corporate scientists."
clearance_access = 4
/obj/item/card/id/silver/clearance_badge/cl
name = "corporate liaison badge"
desc = "A corporate holo-badge in unique corporate orange and white. It is fingerprint locked with clearance level 5 access. It is commonly held by corporate liaisons."
icon_state = "cl"
clearance_access = 5
/obj/item/card/id/silver/clearance_badge/manager
name = "corporate manager badge"
desc = "A corporate holo-badge in standard corporate orange and white. It has a unique uncapped bottom. It is fingerprint locked with 5-X clearance level. Commonly held by corporate managers."
icon_state = "pmc"
clearance_access = 6
/obj/item/card/id/pizza
name = "pizza guy badge"
desc = "It reads: 'Pizza-guy local union No. 217','We always deliver!'"
icon_state = "pizza"
item_state = "gold_id"
/obj/item/card/id/souto
name = "Souto Man"
desc = "It reads: 'The one and only!'"
icon_state = "gold"
item_state = "gold_id"
/obj/item/card/id/gold
name = "identification holo-badge"
desc = "A gold plated holo-badge which shows power and might."
icon_state = "gold"
item_state = "gold_id"
/obj/item/card/id/visa
name = "battered-up visa card"
desc = "A corporate holo-badge. It's a unique Corporate orange and white."
icon_state = "visa"
/obj/item/card/id/silver/cl
name = "corporate holo-badge"
desc = "A corporate holo-badge. It's a unique Corporate orange and white."
icon_state = "cl"
/obj/item/card/id/gold/council
name = "identification holo-badge"
desc = "A real bronze gold Colonel's holo-badge. Commands respect, authority, and it makes an excellent paperweight."
icon_state = "commodore"
/obj/item/card/id/pmc
name = "\improper PMC holo-badge"
desc = "A corporate holo-badge. It has a unique uncapped bottom."
icon_state = "pmc"
registered_name = "The Corporation"
assignment = "Corporate Mercenary"
/obj/item/card/id/pmc/New()
access = get_access(ACCESS_LIST_WY_ALL)
..()
/obj/item/card/id/pmc/ds
name = "\improper Corporate holo-badge"
desc = "It lists a callsign and a blood type. Issued to Whiteout protocol teams only."
icon_state = "ds"
/obj/item/card/id/marshal
name = "\improper CMB marshal gold badge"
desc = "A coveted gold badge signifying that the wearer is one of the few CMB Marshals patroling the outer rim. It is a sign of justice, authority, and protection. Protecting those who can't. This badge represents a commitment to a sworn oath always kept."
icon_state = "cmbmar"
paygrade = PAY_SHORT_CMBM
/obj/item/card/id/deputy
name = "\improper CMB deputy silver badge"
desc = "The silver badge which represents that the wearer is a CMB Deputy. It is a sign of justice, authority, and protection. Protecting those who can't. This badge represents a commitment to a sworn oath always kept."
icon_state = "cmbdep"
paygrade = PAY_SHORT_CMBD
/obj/item/card/id/general
name = "general officer holo-badge"
desc = "Top brass of the top brass. Issued to only the most dedicated."
icon_state = "general"
registered_name = "The USCM"
assignment = "General"
/obj/item/card/id/general/New()
access = get_access(ACCESS_LIST_MARINE_ALL)
/obj/item/card/id/provost
name = "provost holo-badge"
desc = "Issued to members of the Provost Office."
icon_state = "provost"
registered_name = "Provost Office"
assignment = "Provost"
/obj/item/card/id/provost/New()
access = get_access(ACCESS_LIST_MARINE_ALL)
/obj/item/card/id/adaptive
name = "agent card"
access = list(ACCESS_ILLEGAL_PIRATE)
/obj/item/card/id/adaptive/New(mob/user as mob)
..()
if(!QDELETED(user)) // Runtime prevention on laggy starts or where users log out because of lag at round start.
registered_name = ishuman(user) ? user.real_name : "Unknown"
assignment = "Agent"
name = "[registered_name]'s ID Card ([assignment])"
/obj/item/card/id/adaptive/afterattack(obj/item/O as obj, mob/user as mob, proximity)
if(!proximity)
return
if(istype(O, /obj/item/card/id))
var/obj/item/card/id/target_id = O
access |= target_id.access
if(ishuman(user))
to_chat(user, SPAN_NOTICE("The card's microscanners activate as you pass it over the ID, copying its access."))
/obj/item/card/id/adaptive/attack_self(mob/user as mob)
switch(alert("Would you like to display the ID, or retitle it?","Choose.","Rename","Show"))
if("Rename")
var/new_name = strip_html(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name),26)
if(!new_name || new_name == "Unknown" || new_name == "floor" || new_name == "wall" || new_name == "r-wall") //Same as mob/new_player/prefrences.dm
to_chat(user, SPAN_WARNING("Invalid Name."))
return
var/new_job = strip_html(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Assistant"))
if(!new_job)
to_chat(user, SPAN_WARNING("Invalid Assignment."))
return
var/new_rank = strip_html(input(user, "What paygrade do would you like to put on this card?\nNote: This must be the shorthand version of the grade, I.E CIV for Civillian or ME1 for Marine Private", "Agent card paygrade assignment", PAY_SHORT_CIV))
if(!new_rank || !(new_rank in GLOB.paygrades))
to_chat(user, SPAN_WARNING("Invalid Paygrade."))
return
registered_name = new_name
assignment = new_job
name = "[registered_name]'s ID Card ([assignment])"
paygrade = new_rank
to_chat(user, SPAN_NOTICE("You successfully forge the ID card."))
return
..()
/obj/item/card/id/captains_spare
name = "captain's spare ID"
desc = "The spare ID of the High Lord himself."
icon_state = "gold"
item_state = "gold_id"
registered_name = "Captain"
assignment = "Captain"
/obj/item/card/id/captains_spare/New()
access = get_access(ACCESS_LIST_MARINE_ALL)
..()
/obj/item/card/id/centcom
name = "\improper CentCom. ID"
desc = "An ID straight from Cent. Com."
icon_state = "centcom"
registered_name = "Central Command"
assignment = "General"
/obj/item/card/id/centcom/New()
access = get_access(ACCESS_LIST_WY_ALL)
..()
/obj/item/card/id/equipped(mob/living/carbon/human/H, slot)
if(istype(H))
H.update_inv_head() //updating marine helmet squad coloring
H.update_inv_wear_suit()
..()
/obj/item/card/id/dropped(mob/user)
if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user
H.update_inv_head() //Don't do a full update yet
H.update_inv_wear_suit()
..()
/obj/item/card/id/dogtag
name = "dog tag"
desc = "A marine dog tag."
icon_state = "dogtag"
item_state = "dogtag"
pinned_on_uniform = FALSE
var/dogtag_taken = FALSE
/obj/item/card/id/dogtag/get_examine_text(mob/user)
. = ..()
if(ishuman(user))
. += SPAN_NOTICE("It reads \"[registered_name] - [assignment] - [blood_type]\"")
/obj/item/dogtag
name = "information dog tag"
desc = "A fallen marine's information dog tag."
icon_state = "dogtag_taken"
icon = 'icons/obj/items/card.dmi'
w_class = SIZE_TINY
var/list/fallen_names
var/list/fallen_blood_types
var/list/fallen_assgns
/obj/item/dogtag/Initialize()
. = ..()
fallen_names = list()
fallen_blood_types = list()
fallen_assgns = list()
/obj/item/dogtag/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/dogtag))
var/obj/item/dogtag/D = I
to_chat(user, SPAN_NOTICE("You join the [fallen_names.len>1 ? "tags":"two tags"] together."))
name = "information dog tags"
if(D.fallen_names)
fallen_names += D.fallen_names
fallen_blood_types += D.fallen_blood_types
fallen_assgns += D.fallen_assgns
qdel(D)
return TRUE
else
. = ..()
/obj/item/dogtag/get_examine_text(mob/user)
. = ..()
if(ishuman(user) && fallen_names && fallen_names.len)
var/msg = "There [fallen_names.len>1 ? \
"are [fallen_names.len] tags.<br>They read":\
"is one ID tag.<br>It reads"]:"
for (var/i=1 to fallen_names.len)
msg += "<br>[i]. \"[fallen_names[i]] - [fallen_assgns[i]] - [fallen_blood_types[i]]\""
. += SPAN_NOTICE("[msg]")
// Used to authenticate to CORSAT machines. Doesn't do anything except have its type variable
/obj/item/card/data/corsat
name = "CORSAT administration code"
desc = "A disk of data containing one of the CORSAT administration authentication codes necessary to lift the biohazard lockdown."
icon_state = "data"
item_state = "card-id"
unacidable = 1
/obj/item/card/data/prison
name = "prison lockdown administration code"
desc = "A disk of data containing one of the prison station administration authentication codes necessary to lift the security lockdown."
icon_state = "data"
item_state = "card-id"
unacidable = 1