Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 21e0c73

Browse files
committed
Who thought it was a good idea to name those fields that?
1 parent 3a611d6 commit 21e0c73

File tree

4 files changed

+80
-18
lines changed

4 files changed

+80
-18
lines changed

code/modules/mob/living/silicon/pai/pai.dm

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,6 @@
4141

4242
// Various software-specific vars
4343

44-
var/temp // General error reporting text contained here will typically be shown once and cleared
45-
var/screen // Which screen our main window displays
46-
var/subscreen // Which specific function of the main screen is being displayed
47-
48-
var/secHUD = 0 // Toggles whether the Security HUD is active or not
49-
var/medHUD = 0 // Toggles whether the Medical HUD is active or not
50-
51-
var/datum/data/record/medicalActive1 // Datacore record declarations for record software
52-
var/datum/data/record/medicalActive2
53-
54-
var/datum/data/record/securityActive1 // Could probably just combine all these into one
55-
var/datum/data/record/securityActive2
56-
5744
var/obj/machinery/door/hackdoor // The airlock being hacked
5845
var/hackprogress = 0 // Possible values: 0 - 100, >= 100 means the hack is complete and will be reset upon next check
5946

@@ -64,10 +51,14 @@
6451
var/obj/machinery/newscaster //pAI Newscaster
6552
var/obj/item/healthanalyzer/hostscan //pAI healthanalyzer
6653

54+
//Whether the pAI has bought the encryption slot module or not
6755
var/encryptmod = FALSE
6856
var/holoform = FALSE
57+
//Can pAI use their holoprojector?
6958
var/canholo = TRUE
59+
//Can pAI transmit radio messages?
7060
var/can_transmit = TRUE
61+
//Can pAI receive radio messages?
7162
var/can_receive = TRUE
7263
var/obj/item/card/id/access_card = null
7364
var/chassis = "repairbot"
@@ -153,7 +144,6 @@
153144
if(cable && cable.machine && istype(cable.machine, /obj/machinery/door) && cable.machine == hackdoor && get_dist(src, hackdoor) <= 1)
154145
hackprogress = clamp(hackprogress + 20, 0, 100)
155146
else
156-
temp = "Door Jack: Connection to airlock has been lost. Hack aborted."
157147
hackprogress = 0
158148
hacking = FALSE
159149
hackdoor = null
@@ -283,6 +273,10 @@
283273
/mob/living/silicon/pai/examine(mob/user)
284274
. = ..()
285275
. += "A personal AI in holochassis mode. Its master ID string seems to be [master]."
276+
if(software && isobserver(user))
277+
. += "<b>[src] has the following modules:"
278+
for(var/list/module in software)
279+
. += "[module["module_name"]]"
286280

287281
/mob/living/silicon/pai/Life(seconds_per_tick = SSMOBS_DT, times_fired)
288282
if(stat == DEAD)
@@ -307,7 +301,7 @@
307301
emitterhealth = clamp((emitterhealth + (emitter_regen_per_second * delta_time)), -50, emittermaxhealth)
308302

309303
/obj/item/computer_hardware/paicard/attackby(obj/item/W, mob/user, params)
310-
..()
304+
. = ..()
311305
user.set_machine(src)
312306
if(pai.encryptmod == TRUE)
313307
if(W.tool_behaviour == TOOL_SCREWDRIVER)

code/modules/mob/living/silicon/pai/software.dm

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
list("module_name" = "atmosphere sensor", "tab"=TRUE, "title"="Atmospheric sensor", "cost" = 5),
1616
list("module_name" = "photography module", "tab"=FALSE, "cost" = 5),
1717
list("module_name" = "remote signaller", "tab"=TRUE, "title"="Remote signaller", "cost" = 10),
18-
//list("module_name" = "medical records", "tab"=TRUE, "title"="Medical records", "cost" = 10),
19-
//list("module_name" = "security records", "tab"=TRUE, "title"="Security records", "cost" = 10),
18+
list("module_name" = "medical records", "tab"=TRUE, "title"="Medical records", "cost" = 10),
19+
list("module_name" = "security records", "tab"=TRUE, "title"="Security records", "cost" = 10),
2020
list("module_name" = "camera zoom", "tab"=FALSE, "cost" = 10),
2121
list("module_name" = "host scan", "tab"=TRUE, "title"="Host Bioscan settings", "cost" = 10),
2222
//"camera jack" = 10,
@@ -41,6 +41,9 @@
4141

4242
/mob/living/silicon/pai/var/cable_status = "Retracted"
4343

44+
/mob/living/silicon/pai/var/med_record = list()
45+
/mob/living/silicon/pai/var/sec_record = list()
46+
4447
/mob/living/silicon/pai/ui_interact(mob/user, datum/tgui/ui)
4548
ui = SStgui.try_update_ui(user, src, ui)
4649
if(!ui)
@@ -78,6 +81,30 @@
7881
data["minFrequency"] = MIN_FREE_FREQ
7982
data["maxFrequency"] = MAX_FREE_FREQ
8083
data["color"] = signaler.label_color
84+
if(GLOB.data_core.general && GLOB.data_core.medical)
85+
for(var/datum/data/record/M in sortRecord(GLOB.data_core.medical))
86+
for(var/datum/data/record/R in sortRecord(GLOB.data_core.general))
87+
if(R.fields["name"] == M.fields["name"])
88+
var/new_record = list("name" = R.fields["name"], "id" = R.fields["id"], "gender" = R.fields["gender"], "age" = R.fields["age"], "fingerprint" = R.fields["fingerprint"], "p_state" = R.fields["p_state"], "m_state" = R.fields["m_state"], "blood_type" = M.fields["blood_type"], "dna" = M.fields["b_dna"], "minor_disabilities" = M.fields["mi_dis"], "minor_disabilities_details" = M.fields["mi_dis_d"], "major_disabilities" = M.fields["ma_dis"], "major_disabilities_details" = M.fields["ma_dis_d"], "allergies" = M.fields["alg"], "allergies_details" = M.fields["alg_d"], "current_diseases" = M.fields["cdi"], "current_diseases_details" = M.fields["cdi_d"], "important_notes" = M.fields["notes"])
89+
med_record += list(new_record)
90+
qdel(new_record)
91+
break
92+
if(GLOB.data_core.general && GLOB.data_core.security)
93+
for(var/datum/data/record/S in sortRecord(GLOB.data_core.security))
94+
for(var/datum/data/record/R in sortRecord(GLOB.data_core.general))
95+
if(R.fields["name"] == S.fields["name"])
96+
var/list/crimes = list()
97+
for(var/datum/data/crime/crime in S.fields["crimes"])
98+
crimes += list("[crime.crimeName]: [crime.crimeDetails]")
99+
var/list/comments = list()
100+
for(var/datum/data/comment/comment in S.fields["comments"])
101+
comments += list("[comment.commentText] - [comment.author] [comment.time]")
102+
var/new_record = list("name" = R.fields["name"], "id" = R.fields["id"], "gender" = R.fields["gender"], "age" = R.fields["age"], "rank" = R.fields["rank"], "fingerprint" = R.fields["fingerprint"], "p_state" = R.fields["p_state"], "criminal_status" = S.fields["criminal"], "crimes" = crimes, "important_notes" = S.fields["notes"], "comments" = comments)
103+
sec_record += list(new_record)
104+
qdel(new_record)
105+
break
106+
data["med_records"] = med_record
107+
data["sec_records"] = sec_record
81108
return data
82109

83110
/mob/living/silicon/pai/ui_act(action, params)

code/modules/modular_computers/hardware/paicard.dm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
if("wipe")
8989
var/confirm = tgui_alert(usr, "Are you CERTAIN you wish to delete the current personality? This action cannot be undone.", "Personality Wipe", list("Yes", "No"))
9090
if(confirm == "Yes")
91+
candidates_ready = null
9192
if(pai)
9293
to_chat(pai, span_warning("You feel yourself slipping away from reality."))
9394
to_chat(pai, span_danger("Byte by byte you lose your sense of self."))
@@ -117,8 +118,9 @@
117118
pai.key = candidate.key
118119

119120
card.setPersonality(pai)
121+
candidates.Remove(candidate)
120122
candidate = list("name" = candidate.name, "description"=candidate.description, "prefrole"=candidate.role, "ooccomments"=candidate.comments)
121-
candidates.Remove(list(candidate))
123+
SSpai.candidates.Remove(candidate)
122124
if("setlaws")
123125
var/newlaw = stripped_multiline_input(usr, "Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.laws.supplied[1], MAX_MESSAGE_LEN)
124126
if(newlaw && pai)

tgui/packages/tgui/interfaces/PaiInterface.tsx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,43 @@ type Module = {
1010
cost: number;
1111
}
1212

13+
type MedRecord = { /* This should probably be cut down, but it's all valid medical record information */
14+
name: string;
15+
id: string;
16+
gender: string;
17+
age: number;
18+
fingerprint: string;
19+
p_state: string;
20+
m_state: string;
21+
blood_type: string;
22+
dna: string;
23+
minor_disabilities: string;
24+
minor_disabilities_details: string;
25+
major_disabilities: string;
26+
major_disabilities_details: string;
27+
allergies: string;
28+
allergies_details: string;
29+
current_diseases: string;
30+
current_diseases_details: string;
31+
important_notes: string;
32+
comments: string[];
33+
}
34+
35+
type SecRecord = {
36+
name: string;
37+
id: string;
38+
gender: string;
39+
age: number;
40+
rank: string;
41+
fingerprint: string;
42+
p_state: string;
43+
m_state: string;
44+
criminal_status: string;
45+
crimes: string[];
46+
important_notes: string;
47+
comments: string[];
48+
}
49+
1350
type Data = {
1451
modules: Data[];
1552
modules_list: Module[];
@@ -31,6 +68,8 @@ type Data = {
3168
minFrequency: number;
3269
maxFrequency: number;
3370
color: string;
71+
med_records: MedRecord[];
72+
sec_records: SecRecord[];
3473
}
3574

3675
export const AirlockJackTextSwitch = params => {

0 commit comments

Comments
 (0)