Alternative titles system.

Custom character records.
Different clothing for alternative titles.
This commit is contained in:
Chinsky
2012-10-31 08:40:51 +04:00
parent 9dc654c712
commit a2e83e962d
11 changed files with 101 additions and 45 deletions
+8 -1
View File
@@ -67,7 +67,10 @@
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"] = "No notes."
if(H.med_record && !jobban_isbanned(H, "Records"))
M.fields["notes"] = H.med_record
else
M.fields["notes"] = "No notes found."
medical += M
//Security Record
@@ -80,6 +83,10 @@
S.fields["ma_crim"] = "None"
S.fields["ma_crim_d"] = "No major crime convictions."
S.fields["notes"] = "No notes."
if(H.sec_record && !jobban_isbanned(H, "Records"))
S.fields["notes"] = H.sec_record
else
S.fields["notes"] = "No notes."
security += S
//Locked Record
+6
View File
@@ -496,6 +496,12 @@
var/jobName
var/realJobName
// hack for alt titles
if(istype(loc, /mob))
var/mob/M = loc
if(M.mind.role_alt_title == jobName && M.mind.assigned_role in get_all_jobs())
return M.mind.assigned_role
if(istype(src, /obj/item/device/pda))
if(src:id)
jobName = src:id:assignment
+3
View File
@@ -28,5 +28,8 @@
//the type of the ID the player will have
var/idtype = /obj/item/weapon/card/id
//List of alternate titles, if any
var/list/alt_titles
/datum/job/proc/equip(var/mob/living/carbon/human/H)
return 1
+10 -2
View File
@@ -40,6 +40,7 @@
spawn_positions = 3
supervisors = "the chief medical officer"
selection_color = "#ffeef0"
alt_titles = list("Surgeon", "Emergency Physician")
equip(var/mob/living/carbon/human/H)
@@ -49,10 +50,17 @@
if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/medic(H), slot_back)
if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)
if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform)
if(H.mind.role_alt_title && H.mind.role_alt_title == "Emergency Physician")
H.equip_if_possible(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform)
H.equip_if_possible(new /obj/item/clothing/suit/fr_jacket(H), slot_wear_suit)
else if(H.mind.role_alt_title && H.mind.role_alt_title == "Surgeon")
H.equip_if_possible(new /obj/item/clothing/under/rank/medical/blue(H), slot_w_uniform)
H.equip_if_possible(new /obj/item/clothing/suit/labcoat(H), slot_wear_suit)
else
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/regular(H), slot_l_hand)
H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store)
if(H.backbag == 1)
+8 -4
View File
@@ -84,6 +84,7 @@
spawn_positions = 1
supervisors = "the head of security"
selection_color = "#ffeeee"
alt_titles = list("Forensic Technician")
equip(var/mob/living/carbon/human/H)
@@ -96,12 +97,15 @@
H.equip_to_slot_or_del(new /obj/item/clothing/under/det(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/detective(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/clothing/head/det_hat(H), slot_head)
var/obj/item/clothing/mask/cigarette/CIG = new /obj/item/clothing/mask/cigarette(H)
/* var/obj/item/clothing/mask/cigarette/CIG = new /obj/item/clothing/mask/cigarette(H)
CIG.light("")
H.equip_to_slot_or_del(CIG, slot_wear_mask)
H.equip_to_slot_or_del(CIG, slot_wear_mask) */
H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/det_suit(H), slot_wear_suit)
if(H.mind.role_alt_title && H.mind.role_alt_title == "Forensic Technician")
H.equip_to_slot_or_del(new /obj/item/clothing/suit/forensics/blue(H), slot_wear_suit)
else
H.equip_to_slot_or_del(new /obj/item/clothing/suit/det_suit(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/clothing/head/det_hat(H), slot_head)
H.equip_to_slot_or_del(new /obj/item/weapon/lighter/zippo(H), slot_l_store)
if(H.backbag == 1)//Why cant some of these things spawn in his office?
+14 -4
View File
@@ -44,6 +44,8 @@ var/global/datum/controller/occupations/job_master
if(J.title == rank) return J
return null
proc/GetAltTitle(mob/new_player/player, rank)
return player.preferences.GetAltTitle(GetJob(rank))
proc/AssignRole(var/mob/new_player/player, var/rank, var/latejoin = 0)
Debug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
@@ -57,6 +59,7 @@ var/global/datum/controller/occupations/job_master
if((job.current_positions < position_limit) || position_limit == -1)
Debug("Player: [player] is now Rank: [rank], JCP:[job.current_positions], JPL:[position_limit]")
player.mind.assigned_role = rank
player.mind.role_alt_title = GetAltTitle(player, rank)
unassigned -= player
job.current_positions++
return 1
@@ -296,6 +299,9 @@ var/global/datum/controller/occupations/job_master
H << "Your job is [rank] and the game just can't handle it! Please report this bug to an administrator."
H.job = rank
if(H.mind && H.mind.assigned_role != rank)
H.mind.assigned_role = rank
H.mind.role_alt_title = null
if(!joined_late)
var/obj/S = null
@@ -338,15 +344,19 @@ var/global/datum/controller/occupations/job_master
H << "<B>You are the [rank].</B>"
H << "<b>As the [rank] you answer directly to [job.supervisors]. Special circumstances may change this.</b>"
spawnId(H,rank)
if(H.mind.assigned_role == rank && H.mind.role_alt_title)
spawnId(H, rank, H.mind.role_alt_title)
else
spawnId(H,rank)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset(H), slot_ears)
// H.update_icons()
return 1
proc/spawnId(var/mob/living/carbon/human/H, rank)
proc/spawnId(var/mob/living/carbon/human/H, rank, title)
if(!H) return 0
if(!title) title = rank
var/obj/item/weapon/card/id/C = null
var/datum/job/job = null
@@ -364,9 +374,9 @@ var/global/datum/controller/occupations/job_master
C = new /obj/item/weapon/card/id(H)
if(C)
C.registered_name = H.real_name
C.assignment = rank
C.assignment = title
C.name = "[C.registered_name]'s ID Card ([C.assignment])"
C.access = get_access(C.assignment)
C.access = get_access(rank)
H.equip_to_slot_or_del(C, slot_wear_id)
/* if(prob(50))
H.equip_to_slot_or_del(new /obj/item/weapon/pen(H), slot_r_store)
+7 -1
View File
@@ -112,4 +112,10 @@
name = "suspenders"
desc = "They suspend the illusion of the mime's play."
icon = 'icons/obj/clothing/belts.dmi'
icon_state = "suspenders"
icon_state = "suspenders"
/obj/item/clothing/suit/fr_jacket
name = "first responder jacket"
desc = "A high-visibility jacket worn by medical first responders."
icon_state = "fr_jacket_open"
item_state = "fr_jacket"
+2
View File
@@ -64,6 +64,8 @@
var/real_name = null
// var/original_name = null //Original name is only used in ghost chat! Depracated, now used bb
var/flavor_text = ""
var/med_record = ""
var/sec_record = ""
var/blinded = null
var/bhunger = 0 //Carbon
var/ajourn = 0
+43 -33
View File
@@ -272,7 +272,7 @@ datum/preferences
if(jobban_isbanned(user, "Records"))
dat += "<b>You are banned from using character records.</b><br>"
else
dat += "<b><a href=\"byond://?src=\ref[user];preference=records;task=input\">Character Records</a></b><br><br>"
dat += "<b><a href=\"byond://?src=\ref[user];preference=records;record=1\">Character Records</a></b><br><br>"
dat += "<b>Flavor Text</b><br>"
dat += "<a href='byond://?src=\ref[user];preference=flavor_text;task=input'>Change</a><br>"
@@ -401,14 +401,14 @@ datum/preferences
HTML += "<tt><center>"
HTML += "<b>Set Character Records</b><br>"
HTML += "<a href=\"byond://?src=\ref[user];preferences=1;med_record=1\">Medical Records</a><br>"
HTML += "<a href=\"byond://?src=\ref[user];preference=records;task=med_record\">Medical Records</a><br>"
if(lentext(med_record) <= 40)
HTML += "[med_record]"
else
HTML += "[copytext(med_record, 1, 37)]..."
HTML += "<br><br><a href=\"byond://?src=\ref[user];preferences=1;sec_record=1\">Security Records</a><br>"
HTML += "<br><br><a href=\"byond://?src=\ref[user];preference=records;task=sec_record\">Security Records</a><br>"
if(lentext(sec_record) <= 40)
HTML += "[sec_record]<br>"
@@ -416,7 +416,7 @@ datum/preferences
HTML += "[copytext(sec_record, 1, 37)]...<br>"
HTML += "<br>"
HTML += "<a href=\"byond://?src=\ref[user];preferences=1;records=-1\">\[Done\]</a>"
HTML += "<a href=\"byond://?src=\ref[user];preference=records;records=-1\">\[Done\]</a>"
HTML += "</center></tt>"
user << browse(null, "window=preferences")
@@ -453,7 +453,7 @@ datum/preferences
//The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows.
var/datum/job/lastJob
if (!job_master) return
for(var/datum/job/job in job_master.occupations)
index += 1
@@ -500,6 +500,8 @@ datum/preferences
HTML += " <font color=orange>\[Low]</font>"
else
HTML += " <font color=red>\[NEVER]</font>"
if(job.alt_titles)
HTML += "</a><br> <a href=\"byond://?src=\ref[user];preference=job;task=alt_title;job=\ref[job]\">\[[GetAltTitle(job)]\]</a></td></tr>"
HTML += "</a></td></tr>"
HTML += "</td'></tr></table>"
@@ -625,7 +627,6 @@ datum/preferences
proc/process_link(mob/user, list/href_list)
if(!user) return
if(href_list["preference"] == "job")
switch(href_list["task"])
if("close")
@@ -634,6 +635,14 @@ datum/preferences
if("random")
userandomjob = !userandomjob
SetChoices(user)
if ("alt_title")
var/datum/job/job = locate(href_list["job"])
if (job)
var/choices = list(job.title) + job.alt_titles
var/choice = input("Pick a title for [job.title].", "Character Generation", GetAltTitle(job)) as anything in choices | null
if(choice)
SetAltTitle(job, choice)
SetChoices(user)
if("input")
SetJob(user, href_list["text"])
else
@@ -674,6 +683,32 @@ datum/preferences
SetSkills(user)
return 1
else if(href_list["preference"] == "records")
if(text2num(href_list["record"]) >= 1)
SetRecords(user)
return
else
user << browse(null, "window=records")
if(href_list["task"] == "med_record")
var/medmsg = input(usr,"Set your medical notes here.","Medical Records",html_decode(med_record)) as message
if(medmsg != null)
medmsg = copytext(medmsg, 1, MAX_PAPER_MESSAGE_LEN)
medmsg = html_encode(medmsg)
med_record = medmsg
SetRecords(user)
if(href_list["task"] == "sec_record")
var/secmsg = input(usr,"Set your security notes here.","Security Records",html_decode(sec_record)) as message
if(secmsg != null)
secmsg = copytext(secmsg, 1, MAX_PAPER_MESSAGE_LEN)
secmsg = html_encode(secmsg)
sec_record = secmsg
SetRecords(user)
switch(href_list["task"])
if("random")
switch(href_list["preference"])
@@ -936,33 +971,6 @@ datum/preferences
else
user << browse(null, "window=disabil")
if("records")
if(text2num(href_list["records"]) >= 1)
SetRecords(user)
return
else
user << browse(null, "window=records")
if("med_record")
var/medmsg = input(usr,"Set your medical notes here.","Medical Records",html_decode(med_record)) as message
if(medmsg != null)
medmsg = copytext(medmsg, 1, MAX_PAPER_MESSAGE_LEN)
medmsg = html_encode(medmsg)
med_record = medmsg
SetRecords(user)
if("sec_record")
var/secmsg = input(usr,"Set your security notes here.","Security Records",html_decode(sec_record)) as message
if(secmsg != null)
secmsg = copytext(secmsg, 1, MAX_PAPER_MESSAGE_LEN)
secmsg = html_encode(secmsg)
sec_record = secmsg
SetRecords(user)
if("limbs")
var/limb_name = input(user, "Which limb do you want to change?") as null|anything in list("Left Leg","Right Leg","Left Arm","Right Arm","Left Foot","Right Foot","Left Hand","Right Hand")
if(!limb_name) return
@@ -1139,6 +1147,8 @@ datum/preferences
character.dna.real_name = character.real_name
character.flavor_text = flavor_text
character.med_record = med_record
character.sec_record = sec_record
character.gender = gender
Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 KiB

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB