mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* Update Smes.js * teleporter * timer * mining * infra + prox * uplink * apc * laser * compile * ui_x and ui_y and custom_materials * 512 * smart asset cache * vending machines * Fixes missing icons. Removes rasta beanie * cargo * MULE + Intelli + Shuttle + Preferences * AI fixer * robot * thing * thing x2 * mecha * compile * oops * Mining Vendor Fix * Update traitordevices.dm * Update proximity.dm * Update EmergencyShuttleConsole.js * rebuild * uwu * Revert "uwu" This reverts commitde3ab5ff76. * Update autodrobe.dm * Update Vending.js * Update _vending.dm * Update Vending.js * Update _vending.dm * Build * Update _vending.dm * rebuild * Update _vending.dm * laser * shuttle * gigas * signaller * launchpad * Update Vending.js * eigthball * pad * ntnet relay * labor stuff * solar * contrcators * sprite fix * Fixes contractor runtime (#45932) * fix * word change * fixes contractor tablet (#47559) * contractor * ntos card console thing * fixes * dna console * tweaks * byondUI * cargo hold * fixes * robit * malf picker * compile * dependencies * electropack * transfer valve * canvas * fixes * uplni stuff * dna * e * tgui * Octet separators in DNA Console genome sequencer. (#50516) * Octet separators for the octet separator god. * Code review changes * REMOVES TGUI * KNOB * r * tgui 3.0 * compile * fixes * fixes * crafting fixes * canister * refactors * bio gen * MIT license * seed * Update NaniteCloudControl.js * Update Uplink.js * uwu * oops * fixes * nanites * Fixes nanite deactivation timer * Revert "Fixes nanite deactivation timer" This reverts commitc5fcfd34de. * Revert "nanites" This reverts commiteade3a61f4. * various fixes * compile * turdis * Update build_tgui.sh * akwrard * ha * haha, HAHAHA!! * compile * fixes * quick fix * gps + dna fixes * Compile * DNA * fixes * sleeper + optable * fixes * mulebot * Update cloning.dm * Update cloning.dm * Update ClockworkSlab.js * Update Operating.dm * Update nanite_chamber.dm * Update nanites.dm * Update nanites.dm * Update stasis.dm * Update asset_list_items.dm * Update ClockworkSlab.js * uwu * oof * Various FIxes + clockwork UI * compile * Sleeper fix * Crew console * AWKWARD * PsiWeb * uwu * uwu * psi web * TGUI GONE * compile * autolethe * Gulag + Solar * Canister * build * private sale * compile * Update ntnrc_client.dm * uwu * canvas * uwu * uwu * uwu * uwu * uwu * uwu * uwu * uwu * compile * rust_g 0.4.3 * rust_g 0.4.4 * paint * fixed * icons * Update easter.dm * Update yogstation.dme * asset cache * Update asset_cache.dm * opops * hmm * hm * oh no * awkward * Update asset_list_items.dm * hey * Update asset_list_items.dm * Update asset_cache_item.dm * last try * Update asset_list_items.dm * fuck it * hmm * Update asset_list_items.dm * uwu * Update client_procs.dm * Update PDA.dm * no i didn't * Update guardianbuilder.dm * Update solar.dm * Update minimap.dm * Update _vending.dm * tgui * Update skin.dmf * Update tgui.bundle.js * Fixes * Update borg_monitor.dm * nanite fix * Update rust_g.dll Co-authored-by: Neo <26365368+Neo-0@users.noreply.github.com> Co-authored-by: Arkatos1 <43862960+Arkatos1@users.noreply.github.com> Co-authored-by: Rob Bailey <actioninja@gmail.com> Co-authored-by: nightred <nightred@gmail.com> Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com> Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com> Co-authored-by: zxaber <37497534+zxaber@users.noreply.github.com> Co-authored-by: skoglol <33292112+kriskog@users.noreply.github.com> Co-authored-by: TheChosenEvilOne <34602646+TheChosenEvilOne@users.noreply.github.com> Co-authored-by: Jordie <4343468+Jordie0608@users.noreply.github.com> Co-authored-by: 81Denton <32391752+81Denton@users.noreply.github.com> Co-authored-by: MrPerson <spamtaffic@gmail.com> Co-authored-by: Akrilla <mrtactical@hotmail.co.uk> Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk> Co-authored-by: Aleksej Komarov <stylemistake@gmail.com> Co-authored-by: spookydonut <github@spooksoftware.com> Co-authored-by: AnturK <AnturK@users.noreply.github.com> Co-authored-by: oranges <email@oranges.net.nz> Co-authored-by: WarlockD <warlockd@gmail.com> Co-authored-by: XDTM <heliumt@yahoo.it> Co-authored-by: Sanator <39862806+Sanator@users.noreply.github.com> Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Co-authored-by: Kelenius <kelenius@ya.ru>
373 lines
12 KiB
Plaintext
373 lines
12 KiB
Plaintext
|
|
/datum/datacore
|
|
var/list/medical = list()
|
|
var/medicalPrintCount = 0
|
|
var/list/general = list()
|
|
var/list/security = list()
|
|
var/securityPrintCount = 0
|
|
var/securityCrimeCounter = 0
|
|
//This list tracks characters spawned in the world and cannot be modified in-game. Currently referenced by respawn_character().
|
|
var/list/locked = list()
|
|
|
|
/datum/data
|
|
var/name = "data"
|
|
|
|
/datum/data/record
|
|
name = "record"
|
|
var/list/fields = list()
|
|
|
|
/datum/data/record/Destroy()
|
|
if(src in GLOB.data_core.medical)
|
|
GLOB.data_core.medical -= src
|
|
if(src in GLOB.data_core.security)
|
|
GLOB.data_core.security -= src
|
|
if(src in GLOB.data_core.general)
|
|
GLOB.data_core.general -= src
|
|
if(src in GLOB.data_core.locked)
|
|
GLOB.data_core.locked -= src
|
|
. = ..()
|
|
|
|
/datum/data/crime
|
|
name = "crime"
|
|
var/crimeName = ""
|
|
var/crimeDetails = ""
|
|
var/author = ""
|
|
var/time = ""
|
|
var/fine = 0
|
|
var/paid = 0
|
|
var/dataId = 0
|
|
|
|
/datum/datacore/proc/createCrimeEntry(cname = "", cdetails = "", author = "", time = "", fine = 0)
|
|
var/datum/data/crime/c = new /datum/data/crime
|
|
c.crimeName = cname
|
|
c.crimeDetails = cdetails
|
|
c.author = author
|
|
c.time = time
|
|
c.fine = fine
|
|
c.paid = 0
|
|
c.dataId = ++securityCrimeCounter
|
|
return c
|
|
|
|
/datum/datacore/proc/addCitation(id = "", datum/data/crime/crime)
|
|
for(var/datum/data/record/R in security)
|
|
if(R.fields["id"] == id)
|
|
var/list/crimes = R.fields["citation"]
|
|
crimes |= crime
|
|
return
|
|
|
|
/datum/datacore/proc/removeCitation(id, cDataId)
|
|
for(var/datum/data/record/R in security)
|
|
if(R.fields["id"] == id)
|
|
var/list/crimes = R.fields["citation"]
|
|
for(var/datum/data/crime/crime in crimes)
|
|
if(crime.dataId == text2num(cDataId))
|
|
crimes -= crime
|
|
return
|
|
|
|
/datum/datacore/proc/payCitation(id, cDataId, amount)
|
|
for(var/datum/data/record/R in security)
|
|
if(R.fields["id"] == id)
|
|
var/list/crimes = R.fields["citation"]
|
|
for(var/datum/data/crime/crime in crimes)
|
|
if(crime.dataId == text2num(cDataId))
|
|
crime.paid = crime.paid + amount
|
|
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_SEC)
|
|
D.adjust_money(amount)
|
|
return
|
|
|
|
/datum/datacore/proc/addMinorCrime(id = "", datum/data/crime/crime)
|
|
for(var/datum/data/record/R in security)
|
|
if(R.fields["id"] == id)
|
|
var/list/crimes = R.fields["mi_crim"]
|
|
crimes |= crime
|
|
return
|
|
|
|
/datum/datacore/proc/removeMinorCrime(id, cDataId)
|
|
for(var/datum/data/record/R in security)
|
|
if(R.fields["id"] == id)
|
|
var/list/crimes = R.fields["mi_crim"]
|
|
for(var/datum/data/crime/crime in crimes)
|
|
if(crime.dataId == text2num(cDataId))
|
|
crimes -= crime
|
|
return
|
|
|
|
/datum/datacore/proc/removeMajorCrime(id, cDataId)
|
|
for(var/datum/data/record/R in security)
|
|
if(R.fields["id"] == id)
|
|
var/list/crimes = R.fields["ma_crim"]
|
|
for(var/datum/data/crime/crime in crimes)
|
|
if(crime.dataId == text2num(cDataId))
|
|
crimes -= crime
|
|
return
|
|
|
|
/datum/datacore/proc/addMajorCrime(id = "", datum/data/crime/crime)
|
|
for(var/datum/data/record/R in security)
|
|
if(R.fields["id"] == id)
|
|
var/list/crimes = R.fields["ma_crim"]
|
|
crimes |= crime
|
|
return
|
|
|
|
/datum/datacore/proc/manifest()
|
|
for(var/mob/dead/new_player/N in GLOB.player_list)
|
|
if(N.new_character)
|
|
log_manifest(N.ckey,N.new_character.mind,N.new_character)
|
|
if(ishuman(N.new_character))
|
|
manifest_inject(N.new_character, N.client)
|
|
CHECK_TICK
|
|
|
|
/datum/datacore/proc/manifest_modify(name, assignment)
|
|
var/datum/data/record/foundrecord = find_record("name", name, GLOB.data_core.general)
|
|
if(foundrecord)
|
|
foundrecord.fields["rank"] = assignment
|
|
|
|
/datum/datacore/proc/get_manifest()
|
|
var/list/manifest_out = list()
|
|
var/list/departments = list(
|
|
"Command" = GLOB.command_positions,
|
|
"Security" = GLOB.security_positions,
|
|
"Engineering" = GLOB.engineering_positions,
|
|
"Medical" = GLOB.medical_positions,
|
|
"Science" = GLOB.science_positions,
|
|
"Supply" = GLOB.supply_positions,
|
|
"Civilian" = GLOB.civilian_positions,
|
|
"Silicon" = GLOB.nonhuman_positions
|
|
)
|
|
for(var/datum/data/record/t in GLOB.data_core.general)
|
|
var/name = t.fields["name"]
|
|
var/rank = t.fields["rank"]
|
|
var/has_department = FALSE
|
|
for(var/department in departments)
|
|
var/list/jobs = departments[department]
|
|
if(rank in jobs)
|
|
if(!manifest_out[department])
|
|
manifest_out[department] = list()
|
|
manifest_out[department] += list(list(
|
|
"name" = name,
|
|
"rank" = rank
|
|
))
|
|
has_department = TRUE
|
|
break
|
|
if(!has_department)
|
|
if(!manifest_out["Misc"])
|
|
manifest_out["Misc"] = list()
|
|
manifest_out["Misc"] += list(list(
|
|
"name" = name,
|
|
"rank" = rank
|
|
))
|
|
return manifest_out
|
|
|
|
/datum/datacore/proc/get_manifest_html(monochrome = FALSE)
|
|
var/list/heads = list()
|
|
var/list/sec = list()
|
|
var/list/eng = list()
|
|
var/list/med = list()
|
|
var/list/sci = list()
|
|
var/list/sup = list()
|
|
var/list/civ = list()
|
|
var/list/bot = list()
|
|
var/list/misc = list()
|
|
var/dat = {"
|
|
<head><style>
|
|
.manifest {border-collapse:collapse;}
|
|
.manifest td, th {border:1px solid [monochrome?"black":"#DEF; background-color:white; color:black"]; padding:.25em}
|
|
.manifest th {height: 2em; [monochrome?"border-top-width: 3px":"background-color: #48C; color:white"]}
|
|
.manifest tr.head th { [monochrome?"border-top-width: 1px":"background-color: #488;"] }
|
|
.manifest tr.alt td {[monochrome?"border-top-width: 2px":"background-color: #DEF"]}
|
|
</style></head>
|
|
<table class="manifest" width='350px'>
|
|
<tr class='head'><th>Name</th><th>Rank</th></tr>
|
|
"}
|
|
var/even = 0
|
|
// sort mobs
|
|
for(var/datum/data/record/t in GLOB.data_core.general)
|
|
var/name = t.fields["name"]
|
|
var/rank = t.fields["rank"]
|
|
var/department = 0
|
|
if(rank in GLOB.command_positions)
|
|
heads[name] = rank
|
|
department = 1
|
|
if(rank in GLOB.security_positions)
|
|
sec[name] = rank
|
|
department = 1
|
|
if(rank in GLOB.engineering_positions)
|
|
eng[name] = rank
|
|
department = 1
|
|
if(rank in GLOB.medical_positions)
|
|
med[name] = rank
|
|
department = 1
|
|
if(rank in GLOB.science_positions)
|
|
sci[name] = rank
|
|
department = 1
|
|
if(rank in GLOB.supply_positions)
|
|
sup[name] = rank
|
|
department = 1
|
|
if(rank in GLOB.civilian_positions)
|
|
civ[name] = rank
|
|
department = 1
|
|
if(rank in GLOB.nonhuman_positions)
|
|
bot[name] = rank
|
|
department = 1
|
|
if(!department && !(name in heads))
|
|
misc[name] = rank
|
|
if(heads.len > 0)
|
|
dat += "<tr><th colspan=3>Heads</th></tr>"
|
|
for(var/name in heads)
|
|
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[heads[name]]</td></tr>"
|
|
even = !even
|
|
if(sec.len > 0)
|
|
dat += "<tr><th colspan=3>Security</th></tr>"
|
|
for(var/name in sec)
|
|
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[sec[name]]</td></tr>"
|
|
even = !even
|
|
if(eng.len > 0)
|
|
dat += "<tr><th colspan=3>Engineering</th></tr>"
|
|
for(var/name in eng)
|
|
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[eng[name]]</td></tr>"
|
|
even = !even
|
|
if(med.len > 0)
|
|
dat += "<tr><th colspan=3>Medical</th></tr>"
|
|
for(var/name in med)
|
|
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[med[name]]</td></tr>"
|
|
even = !even
|
|
if(sci.len > 0)
|
|
dat += "<tr><th colspan=3>Science</th></tr>"
|
|
for(var/name in sci)
|
|
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[sci[name]]</td></tr>"
|
|
even = !even
|
|
if(sup.len > 0)
|
|
dat += "<tr><th colspan=3>Supply</th></tr>"
|
|
for(var/name in sup)
|
|
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[sup[name]]</td></tr>"
|
|
even = !even
|
|
if(civ.len > 0)
|
|
dat += "<tr><th colspan=3>Civilian</th></tr>"
|
|
for(var/name in civ)
|
|
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[civ[name]]</td></tr>"
|
|
even = !even
|
|
// in case somebody is insane and added them to the manifest, why not
|
|
if(bot.len > 0)
|
|
dat += "<tr><th colspan=3>Silicon</th></tr>"
|
|
for(var/name in bot)
|
|
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[bot[name]]</td></tr>"
|
|
even = !even
|
|
// misc guys
|
|
if(misc.len > 0)
|
|
dat += "<tr><th colspan=3>Miscellaneous</th></tr>"
|
|
for(var/name in misc)
|
|
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[misc[name]]</td></tr>"
|
|
even = !even
|
|
|
|
dat += "</table>"
|
|
dat = replacetext(dat, "\n", "")
|
|
dat = replacetext(dat, "\t", "")
|
|
return dat
|
|
|
|
/datum/datacore/proc/manifest_inject(mob/living/carbon/human/H, client/C)
|
|
set waitfor = FALSE
|
|
var/static/list/show_directions = list(SOUTH, WEST)
|
|
if(H.mind && (H.mind.assigned_role != H.mind.special_role))
|
|
var/assignment
|
|
if(H.mind.assigned_role)
|
|
assignment = H.mind.assigned_role
|
|
else if(H.job)
|
|
assignment = H.job
|
|
else
|
|
assignment = "Unassigned"
|
|
|
|
var/static/record_id_num = 1001
|
|
var/id = num2hex(record_id_num++,6)
|
|
if(!C)
|
|
C = H.client
|
|
var/image = get_id_photo(H, C, show_directions)
|
|
var/datum/picture/pf = new
|
|
var/datum/picture/ps = new
|
|
pf.picture_name = "[H]"
|
|
ps.picture_name = "[H]"
|
|
pf.picture_desc = "This is [H]."
|
|
ps.picture_desc = "This is [H]."
|
|
pf.picture_image = icon(image, dir = SOUTH)
|
|
ps.picture_image = icon(image, dir = WEST)
|
|
var/obj/item/photo/photo_front = new(null, pf)
|
|
var/obj/item/photo/photo_side = new(null, ps)
|
|
|
|
//These records should ~really~ be merged or something
|
|
//General Record
|
|
var/datum/data/record/G = new()
|
|
G.fields["id"] = id
|
|
G.fields["name"] = H.real_name
|
|
G.fields["rank"] = assignment
|
|
G.fields["age"] = H.age
|
|
G.fields["species"] = H.dna.species.name
|
|
G.fields["fingerprint"] = md5(H.dna.uni_identity)
|
|
G.fields["p_stat"] = "Active"
|
|
G.fields["m_stat"] = "Stable"
|
|
G.fields["gender"] = H.gender
|
|
if(H.gender == "male")
|
|
G.fields["gender"] = "Male"
|
|
else if(H.gender == "female")
|
|
G.fields["gender"] = "Female"
|
|
else
|
|
G.fields["gender"] = "Other"
|
|
G.fields["photo_front"] = photo_front
|
|
G.fields["photo_side"] = photo_side
|
|
general += G
|
|
|
|
//Medical Record
|
|
var/datum/data/record/M = new()
|
|
M.fields["id"] = id
|
|
M.fields["name"] = H.real_name
|
|
M.fields["blood_type"] = H.dna.blood_type
|
|
M.fields["b_dna"] = H.dna.unique_enzymes
|
|
M.fields["mi_dis"] = "None"
|
|
M.fields["mi_dis_d"] = "No minor disabilities have been declared."
|
|
M.fields["ma_dis"] = "None"
|
|
M.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
|
|
M.fields["alg"] = "None"
|
|
M.fields["alg_d"] = "No allergies have been detected in this patient."
|
|
M.fields["cdi"] = "None"
|
|
M.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
|
|
M.fields["notes"] = H.get_trait_string(medical)
|
|
medical += M
|
|
|
|
//Security Record
|
|
var/datum/data/record/S = new()
|
|
S.fields["id"] = id
|
|
S.fields["name"] = H.real_name
|
|
S.fields["criminal"] = "None"
|
|
S.fields["citation"] = list()
|
|
S.fields["mi_crim"] = list()
|
|
S.fields["ma_crim"] = list()
|
|
S.fields["notes"] = "No notes."
|
|
security += S
|
|
|
|
//Locked Record
|
|
var/datum/data/record/L = new()
|
|
L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") //surely this should just be id, like the others?
|
|
L.fields["name"] = H.real_name
|
|
L.fields["rank"] = H.mind.assigned_role
|
|
L.fields["age"] = H.age
|
|
L.fields["gender"] = H.gender
|
|
if(H.gender == "male")
|
|
G.fields["gender"] = "Male"
|
|
else if(H.gender == "female")
|
|
G.fields["gender"] = "Female"
|
|
else
|
|
G.fields["gender"] = "Other"
|
|
L.fields["blood_type"] = H.dna.blood_type
|
|
L.fields["b_dna"] = H.dna.unique_enzymes
|
|
L.fields["identity"] = H.dna.uni_identity
|
|
L.fields["species"] = H.dna.species.type
|
|
L.fields["features"] = H.dna.features
|
|
L.fields["image"] = image
|
|
L.fields["mindref"] = H.mind
|
|
locked += L
|
|
return
|
|
|
|
/datum/datacore/proc/get_id_photo(mob/living/carbon/human/H, client/C, show_directions = list(SOUTH))
|
|
var/datum/job/J = SSjob.GetJob(H.mind.assigned_role)
|
|
var/datum/preferences/P
|
|
if(!C)
|
|
C = H.client
|
|
if(C)
|
|
P = C.prefs
|
|
return get_flat_human_icon(null, J, P, DUMMY_HUMAN_SLOT_MANIFEST, show_directions) |