mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Merge pull request #11365 from Kyep/id_card_tracking
Upgrades ID Computer
This commit is contained in:
@@ -256,6 +256,8 @@
|
||||
|
||||
if(H.mind && H.mind.initial_account)
|
||||
C.associated_account_number = H.mind.initial_account.account_number
|
||||
C.owner_uid = H.UID()
|
||||
C.owner_ckey = H.ckey
|
||||
|
||||
/datum/outfit/job/proc/imprint_pda(mob/living/carbon/human/H)
|
||||
var/obj/item/pda/PDA = H.wear_pda
|
||||
@@ -265,3 +267,10 @@
|
||||
PDA.ownjob = C.assignment
|
||||
PDA.ownrank = C.rank
|
||||
PDA.name = "PDA-[H.real_name] ([PDA.ownjob])"
|
||||
|
||||
/datum/job/proc/would_accept_job_transfer_from_player(mob/player)
|
||||
if(!guest_jobbans(title)) // actually checks if job is a whitelisted position
|
||||
return TRUE
|
||||
if(!istype(player))
|
||||
return FALSE
|
||||
return is_job_whitelisted(player, title)
|
||||
|
||||
@@ -257,13 +257,14 @@ var/global/list/role_playtime_requirements = list(
|
||||
play_records[rtype] = text2num(read_records[rtype])
|
||||
else
|
||||
play_records[rtype] = 0
|
||||
if(mob.stat == CONSCIOUS && mob.mind.assigned_role)
|
||||
var/myrole = mob.mind.playtime_role ? mob.mind.playtime_role : mob.mind.assigned_role
|
||||
if(mob.stat == CONSCIOUS && myrole)
|
||||
play_records[EXP_TYPE_LIVING] += minutes
|
||||
if(announce_changes)
|
||||
to_chat(mob,"<span class='notice'>You got: [minutes] Living EXP!")
|
||||
for(var/category in exp_jobsmap)
|
||||
if(exp_jobsmap[category]["titles"])
|
||||
if(mob.mind.assigned_role in exp_jobsmap[category]["titles"])
|
||||
if(myrole in exp_jobsmap[category]["titles"])
|
||||
play_records[category] += minutes
|
||||
if(announce_changes)
|
||||
to_chat(mob,"<span class='notice'>You got: [minutes] [category] EXP!")
|
||||
|
||||
@@ -66,14 +66,15 @@ var/time_last_changed_position = 0
|
||||
/obj/machinery/computer/card/proc/get_target_rank()
|
||||
return modify && modify.assignment ? modify.assignment : "Unassigned"
|
||||
|
||||
/obj/machinery/computer/card/proc/format_jobs(list/jobs)
|
||||
/obj/machinery/computer/card/proc/format_jobs(list/jobs, targetrank, list/jobformats)
|
||||
var/list/formatted = list()
|
||||
for(var/job in jobs)
|
||||
if(job_in_department(SSjobs.GetJob(job)))
|
||||
formatted.Add(list(list(
|
||||
"display_name" = replacetext(job, " ", " "),
|
||||
"target_rank" = get_target_rank(),
|
||||
"job" = job)))
|
||||
"target_rank" = targetrank,
|
||||
"job" = job,
|
||||
"jlinkformat" = jobformats[job] ? jobformats[job] : null)))
|
||||
|
||||
return formatted
|
||||
|
||||
@@ -246,6 +247,7 @@ var/time_last_changed_position = 0
|
||||
data["target_owner"] = modify && modify.registered_name ? modify.registered_name : "-----"
|
||||
data["target_rank"] = get_target_rank()
|
||||
data["scan_name"] = scan ? scan.name : "-----"
|
||||
data["scan_owner"] = scan && scan.registered_name ? scan.registered_name : null
|
||||
data["authenticated"] = is_authenticated(user)
|
||||
data["has_modify"] = !!modify
|
||||
data["account_number"] = modify ? modify.associated_account_number : null
|
||||
@@ -253,15 +255,19 @@ var/time_last_changed_position = 0
|
||||
data["all_centcom_access"] = null
|
||||
data["regions"] = null
|
||||
data["target_dept"] = target_dept
|
||||
data["card_is_owned"] = modify && modify.owner_ckey
|
||||
|
||||
data["engineering_jobs"] = format_jobs(engineering_positions)
|
||||
data["medical_jobs"] = format_jobs(medical_positions)
|
||||
data["science_jobs"] = format_jobs(science_positions)
|
||||
data["security_jobs"] = format_jobs(security_positions)
|
||||
data["support_jobs"] = format_jobs(support_positions)
|
||||
data["civilian_jobs"] = format_jobs(civilian_positions)
|
||||
data["special_jobs"] = format_jobs(whitelisted_positions)
|
||||
data["centcom_jobs"] = format_jobs(get_all_centcom_jobs())
|
||||
var/list/job_formats = SSjobs.format_jobs_for_id_computer(modify)
|
||||
|
||||
data["top_jobs"] = format_jobs(list("Captain", "Custom"), data["target_rank"], job_formats)
|
||||
data["engineering_jobs"] = format_jobs(engineering_positions, data["target_rank"], job_formats)
|
||||
data["medical_jobs"] = format_jobs(medical_positions, data["target_rank"], job_formats)
|
||||
data["science_jobs"] = format_jobs(science_positions, data["target_rank"], job_formats)
|
||||
data["security_jobs"] = format_jobs(security_positions, data["target_rank"], job_formats)
|
||||
data["support_jobs"] = format_jobs(support_positions, data["target_rank"], job_formats)
|
||||
data["civilian_jobs"] = format_jobs(civilian_positions, data["target_rank"], job_formats)
|
||||
data["special_jobs"] = format_jobs(whitelisted_positions, data["target_rank"], job_formats)
|
||||
data["centcom_jobs"] = format_jobs(get_all_centcom_jobs(), data["target_rank"], job_formats)
|
||||
data["card_skins"] = format_card_skins(get_station_card_skins())
|
||||
|
||||
data["job_slots"] = format_job_slots()
|
||||
@@ -272,6 +278,9 @@ var/time_last_changed_position = 0
|
||||
data["cooldown_mins"] = mins
|
||||
data["cooldown_secs"] = (seconds < 10) ? "0[seconds]" : seconds
|
||||
|
||||
if(mode == 3 && is_authenticated(user))
|
||||
data["id_change_html"] = SSjobs.fetch_transfer_record_html(is_centcom())
|
||||
|
||||
if(modify)
|
||||
data["current_skin"] = modify.icon_state
|
||||
|
||||
@@ -371,7 +380,7 @@ var/time_last_changed_position = 0
|
||||
if("assign")
|
||||
if(is_authenticated(usr) && modify)
|
||||
var/t1 = href_list["assign_target"]
|
||||
if(target_dept && modify.assignment == "Unassigned")
|
||||
if(target_dept && modify.assignment == "Demoted")
|
||||
visible_message("<span class='notice'>[src]: Demoted individuals must see the HoP for a new job.</span>")
|
||||
return 0
|
||||
if(!job_in_department(SSjobs.GetJob(modify.rank), FALSE))
|
||||
@@ -383,11 +392,12 @@ var/time_last_changed_position = 0
|
||||
var/temp_t = sanitize(copytext(input("Enter a custom job assignment.","Assignment"),1,MAX_MESSAGE_LEN))
|
||||
//let custom jobs function as an impromptu alt title, mainly for sechuds
|
||||
if(temp_t && modify)
|
||||
SSjobs.log_job_transfer(modify.registered_name, modify.getRankAndAssignment(), temp_t, scan.registered_name)
|
||||
modify.assignment = temp_t
|
||||
log_game("[key_name(usr)] has given \"[modify.registered_name]\" the custom job title \"[temp_t]\".")
|
||||
else
|
||||
var/list/access = list()
|
||||
if(is_centcom())
|
||||
if(is_centcom() && islist(get_centcom_access(t1)))
|
||||
access = get_centcom_access(t1)
|
||||
else
|
||||
var/datum/job/jobdatum
|
||||
@@ -407,6 +417,16 @@ var/time_last_changed_position = 0
|
||||
if(t1 == "Civilian")
|
||||
message_admins("[key_name_admin(usr)] has reassigned \"[modify.registered_name]\" from \"[jobnamedata]\" to \"[t1]\".")
|
||||
|
||||
SSjobs.log_job_transfer(modify.registered_name, jobnamedata, t1, scan.registered_name)
|
||||
SSjobs.slot_job_transfer(modify.rank, t1)
|
||||
|
||||
var/mob/living/carbon/human/H = modify.getPlayer()
|
||||
if(istype(H))
|
||||
if(jobban_isbanned(H, t1))
|
||||
message_admins("[ADMIN_FULLMONTY(H)] has been assigned the job [t1], in possible violation of their job ban.")
|
||||
if(H.mind)
|
||||
H.mind.playtime_role = t1
|
||||
|
||||
modify.access = access
|
||||
modify.rank = t1
|
||||
modify.assignment = t1
|
||||
@@ -436,6 +456,20 @@ var/time_last_changed_position = 0
|
||||
if("mode")
|
||||
mode = text2num(href_list["mode_target"])
|
||||
|
||||
if("wipe_my_logs")
|
||||
if(is_authenticated(usr) && is_centcom())
|
||||
var/delcount = SSjobs.delete_log_records(scan.registered_name, FALSE)
|
||||
if(delcount)
|
||||
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
|
||||
SSnanoui.update_uis(src)
|
||||
|
||||
if("wipe_all_logs")
|
||||
if(is_authenticated(usr) && !target_dept)
|
||||
var/delcount = SSjobs.delete_log_records(scan.registered_name, TRUE)
|
||||
if(delcount)
|
||||
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
|
||||
SSnanoui.update_uis(src)
|
||||
|
||||
if("print")
|
||||
if(!printing && !target_dept)
|
||||
printing = 1
|
||||
@@ -474,14 +508,15 @@ var/time_last_changed_position = 0
|
||||
var/jobnamedata = modify.getRankAndAssignment()
|
||||
log_game("[key_name(usr)] has terminated the employment of \"[modify.registered_name]\" the \"[jobnamedata]\".")
|
||||
message_admins("[key_name_admin(usr)] has terminated the employment of \"[modify.registered_name]\" the \"[jobnamedata]\".")
|
||||
SSjobs.log_job_transfer(modify.registered_name, jobnamedata, "Terminated", scan.registered_name)
|
||||
modify.assignment = "Terminated"
|
||||
modify.access = list()
|
||||
callHook("terminate_employee", list(modify))
|
||||
|
||||
if("demote")
|
||||
if(is_authenticated(usr))
|
||||
if(modify.assignment == "Unassigned")
|
||||
visible_message("<span class='notice'>[src]: Unassigned crew cannot be demoted any further. If further action is warranted, ask the Captain about Termination.</span>")
|
||||
if(modify.assignment == "Demoted")
|
||||
visible_message("<span class='notice'>[src]: Demoted crew cannot be demoted any further. If further action is warranted, ask the Captain about Termination.</span>")
|
||||
return 0
|
||||
if(!job_in_department(SSjobs.GetJob(modify.rank), FALSE))
|
||||
visible_message("<span class='notice'>[src]: Heads may only demote members of their own department.</span>")
|
||||
@@ -492,12 +527,13 @@ var/time_last_changed_position = 0
|
||||
access = jobdatum.get_access()
|
||||
|
||||
var/jobnamedata = modify.getRankAndAssignment()
|
||||
log_game("[key_name(usr)] has demoted \"[modify.registered_name]\" the \"[jobnamedata]\" to \"Civilian (Unassigned)\".")
|
||||
message_admins("[key_name_admin(usr)] has demoted \"[modify.registered_name]\" the \"[jobnamedata]\" to \"Civilian (Unassigned)\".")
|
||||
log_game("[key_name(usr)] has demoted \"[modify.registered_name]\" the \"[jobnamedata]\" to \"Civilian (Demoted)\".")
|
||||
message_admins("[key_name_admin(usr)] has demoted \"[modify.registered_name]\" the \"[jobnamedata]\" to \"Civilian (Demoted)\".")
|
||||
SSjobs.log_job_transfer(modify.registered_name, jobnamedata, "Demoted", scan.registered_name)
|
||||
|
||||
modify.access = access
|
||||
modify.rank = "Civilian"
|
||||
modify.assignment = "Unassigned"
|
||||
modify.assignment = "Demoted"
|
||||
modify.icon_state = "id"
|
||||
|
||||
if("make_job_available")
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
//alt titles are handled a bit weirdly in order to unobtrusively integrate into existing ID system
|
||||
var/assignment = null //can be alt title or the actual job
|
||||
var/rank = null //actual job
|
||||
var/owner_uid
|
||||
var/owner_ckey
|
||||
var/dorm = 0 // determines if this ID has claimed a dorm already
|
||||
|
||||
var/sex
|
||||
@@ -195,6 +197,19 @@
|
||||
jobnamedata += " (" + assignment + ")"
|
||||
return jobnamedata
|
||||
|
||||
/obj/item/card/id/proc/getPlayer()
|
||||
if(owner_uid)
|
||||
var/mob/living/carbon/human/H = locateUID(owner_uid)
|
||||
if(istype(H) && H.ckey == owner_ckey)
|
||||
return H
|
||||
owner_uid = null
|
||||
if(owner_ckey)
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(M.ckey && M.ckey == owner_ckey)
|
||||
owner_uid = M.UID()
|
||||
return M
|
||||
owner_ckey = null
|
||||
|
||||
/obj/item/card/id/proc/is_untrackable()
|
||||
return untrackable
|
||||
|
||||
|
||||
Reference in New Issue
Block a user