/client/proc/spawn_duty_officer()
set category = "Special Verbs"
set name = "Spawn CCIA Agent"
set desc = "Spawns a CCIA Agent to agent around."
if(!check_rights(R_CCIAA)) return
if(!holder)
return //how did they get here?
if(!ROUND_IS_STARTED)
src << "The game hasn't started yet!"
return
if(istype(mob, /mob/new_player))
src << "You can't be in the lobby to join as a duty officer."
return
if (alert(usr, "Do you want to cancel or proceed?", "Are you sure?", "Proceed", "Cancel") == "Cancel")
src << "Cancelled."
return
if(mob.mind && mob.mind.special_role == "CCIA Agent")
src << "You are already a CCIA Agent."
verbs += /client/proc/returntobody
return
var/wasLiving = 0
if(istype(mob, /mob/living))
holder.original_mob = mob
wasLiving = 1
for (var/obj/effect/landmark/L in landmarks_list)
if(L.name == "CCIAAgent")
var/new_name = input(usr, "Pick a name","Name") as text
var/mob/living/carbon/human/M = new(null)
M.check_dna(M)
M.real_name = new_name
M.name = new_name
M.age = input("Enter your characters age:","Num") as num
if(!M.age)
M.age = rand(35,50)
if(M.age < 33 || M.age > 60)
src << "The age you selected was not in a valid range for a Duty Officer."
if(M.age < 33)
M.age = 33
else
M.age = 60
src << "Your age has been set to [M.age]."
M.dna.ready_dna(M)
//Creates mind stuff.
M.mind = new
M.mind.current = M
M.mind.original = M
if(wasLiving)
M.mind.admin_mob_placeholder = mob
M.mind.assigned_role = "Central Command Internal Affairs Agent"
M.mind.special_role = "CCIA Agent"
M.loc = L.loc
M.key = key
M.change_appearance(APPEARANCE_ALL, M.loc, check_species_whitelist = 1)
if(wasLiving)
clear_cciaa_job(holder.original_mob)
spawn(1)
holder.original_mob.key = "@[key]"
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/laceup(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/white(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/device/radio/headset/ert/ccia(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses/sechud(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/clothing/head/beret/centcom/officer(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/spray/pepper(M), slot_l_store)
M.equip_to_slot_or_del(new /obj/item/device/taperecorder/cciaa(M), slot_r_store)
var/obj/item/clothing/suit/storage/toggle/internalaffairs/suit = new(M)
suit.name = "central command internal affairs jacket"
M.equip_to_slot_or_del(suit, slot_wear_suit)
var/obj/item/weapon/storage/backpack/satchel/bag = new(M)
bag.name = "officer's leather satchel"
bag.desc = "A well cared for leather satchel for Nanotrasen officers."
M.equip_to_slot_or_del(bag, slot_back)
if(M.backbag == 1)
M.equip_to_slot_or_del(new /obj/item/weapon/stamp/centcomm(M), slot_in_backpack)
var /obj/item/weapon/storage/lockbox/lockbox = new(M)
lockbox.req_access = list(access_cent_captain)
lockbox.name = "CCIA agent briefcase"
lockbox.desc = "A smart looking briefcase with a NT logo on the side"
lockbox.storage_slots = 8
lockbox.max_storage_space = 16
M.equip_to_slot_or_del(lockbox, slot_l_hand)
var/obj/item/device/pda/central/pda = new(M)
pda.owner = M.real_name
pda.ownjob = "Central Command Internal Affairs Agent"
pda.name = "PDA-[M.real_name] ([pda.ownjob])"
M.equip_to_slot_or_del(pda, slot_belt)
M.implant_loyalty(M, 1)
var/obj/item/weapon/card/id/centcom/W = new(M)
W.name = "[M.real_name]'s ID Card"
W.item_state = "id_inv"
W.access = get_all_accesses() + get_centcom_access("CCIA Agent")
W.assignment = "Central Command Internal Affairs Agent"
W.registered_name = M.real_name
M.equip_to_slot_or_del(W, slot_wear_id)
verbs += /client/proc/returntobody
break
/client/proc/returntobody()
set name = "Return to mob"
set desc = "The Agent's work is done, return to your original mob"
set category = "Special Verbs"
if(!check_rights(0)) return
if(!mob.mind || mob.mind.special_role != "CCIA Agent")
verbs -= /client/proc/returntobody
return
if(!holder) return
var/mob/M = mob
var/area/A = get_area(M)
if(M.stat == DEAD)
if(holder.original_mob)
if(holder.original_mob.client)
if(alert(src, "There is someone else in your old body.\nWould you like to ghost instead?", "There is someone else in your old body, you will be ghosted", "Yes", "No") == "Yes")
M.mind.special_role = null
mob.ghostize(1)
return
else
return
holder.original_mob.key = key
holder.original_mob = null
return
M.mind.special_role = null
mob.ghostize(1)
return
if(!is_type_in_list(A,centcom_areas))
src << "You need to be back at central to do this."
return
if(holder.original_mob)
if(holder.original_mob == M)
verbs -= /client/proc/returntobody
return
if(holder.original_mob.client)
if(alert(src, "There is someone else in your old body.\nWould you like to ghost instead?", "There is someone else in your old body, you will be ghosted", "Yes", "No") == "Yes")
M.mind.special_role = null
mob.ghostize(0)
else
return
else
holder.original_mob.key = key
holder.original_mob = null
else
if(mob.mind.admin_mob_placeholder)
if(mob.mind.admin_mob_placeholder.client)
if(alert(src, "There is someone else in your old body.\nWould you like to ghost instead?", "There is someone else in your old body, you will be ghosted", "Yes", "No") == "Yes")
M.mind.special_role = null
mob.ghostize(0)
else
return
else
mob.mind.admin_mob_placeholder.key = key
M.mind.admin_mob_placeholder = null
else
M.mind.special_role = null
mob.ghostize(0)
verbs -= /client/proc/returntobody
qdel(M)
/proc/clear_cciaa_job(var/mob/living/carbon/human/M)
addtimer(CALLBACK(GLOBAL_PROC, /proc/actual_clear_ccia_job, M), 9000)
/proc/actual_clear_ccia_job(mob/living/carbon/human/H)
if (!H.client)
var/oldjob = H.mind.assigned_role
SSjobs.FreeRole(oldjob)
/datum/admins/proc/create_admin_fax(var/department in alldepartments)
set name = "Send admin fax"
set desc = "Send a fax from Central Command"
set category = "Special Verbs"
if (!check_rights(R_ADMIN|R_CCIAA|R_FUN))
usr << "You do not have enough powers to do this."
return
if (!department)
usr << "No target department specified!"
return
var/obj/machinery/photocopier/faxmachine/fax = null
for (var/obj/machinery/photocopier/faxmachine/F in allfaxes)
if (F.department == department)
fax = F
break
if (!fax)
usr << "Couldn't find a fax machine to send this to!"
return
//todo: sanitize
var/input = input(usr, "Please enter a message to reply to via secure connection. NOTE: BBCode does not work, but HTML tags do! Use
for line breaks.", "Outgoing message from Centcomm", "") as message|null
if (!input)
usr << "Cancelled."
return
var/customname = input(usr, "Pick a title for the report", "Title") as text|null
if (!customname)
usr << "Cancelled."
return
var/announce = alert(user, "Do you wish to announce the fax being sent?", "Announce Fax", "Yes", "No")
if(announce == "Yes")
announce = 1
// Create the reply message
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( null ) //hopefully the null loc won't cause trouble for us
P.name = "[current_map.boss_name] - [customname]"
P.info = input
P.update_icon()
// Stamps
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
stampoverlay.icon_state = "paper_stamp-cent"
if(!P.stamped)
P.stamped = new
P.stamped += /obj/item/weapon/stamp
P.overlays += stampoverlay
P.stamps += "