diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 0aee3c0cf33..aa5f3fac6fb 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -135,1039 +135,952 @@ datum/preferences gear = list() -/datum/preferences - proc/ZeroSkills(var/forced = 0) - for(var/V in SKILLS) for(var/datum/skill/S in SKILLS[V]) - if(!skills.Find(S.ID) || forced) - skills[S.ID] = SKILL_NONE - proc/CalculateSkillPoints() - used_skillpoints = 0 - for(var/V in SKILLS) for(var/datum/skill/S in SKILLS[V]) - var/multiplier = 1 - switch(skills[S.ID]) - if(SKILL_NONE) - used_skillpoints += 0 * multiplier - if(SKILL_BASIC) - used_skillpoints += 1 * multiplier - if(SKILL_ADEPT) - // secondary skills cost less - if(S.secondary) - used_skillpoints += 1 * multiplier - else - used_skillpoints += 3 * multiplier - if(SKILL_EXPERT) - // secondary skills cost less - if(S.secondary) - used_skillpoints += 3 * multiplier - else - used_skillpoints += 6 * multiplier +/datum/preferences/proc/ZeroSkills(var/forced = 0) + for(var/V in SKILLS) for(var/datum/skill/S in SKILLS[V]) + if(!skills.Find(S.ID) || forced) + skills[S.ID] = SKILL_NONE - proc/GetSkillClass(points) - // skill classes describe how your character compares in total points - var/original_points = points - points -= min(round((age - 20) / 2.5), 4) // every 2.5 years after 20, one extra skillpoint - if(age > 30) - points -= round((age - 30) / 5) // every 5 years after 30, one extra skillpoint - if(original_points > 0 && points <= 0) points = 1 - switch(points) - if(0) - return "Unconfigured" - if(1 to 3) - return "Terrifying" - if(4 to 6) - return "Below Average" - if(7 to 10) - return "Average" - if(11 to 14) - return "Above Average" - if(15 to 18) - return "Exceptional" - if(19 to 24) - return "Genius" - if(24 to 1000) - return "God" - - proc/SetSkills(mob/user) - if(SKILLS == null) - setup_skills() - - if(skills.len == 0) - ZeroSkills() - - - var/HTML = "" - HTML += "Select your Skills
" - HTML += "Current skill level: [GetSkillClass(used_skillpoints)] ([used_skillpoints])
" - HTML += "Use preconfigured skillset
" - HTML += "" - for(var/V in SKILLS) - HTML += "" - for(var/datum/skill/S in SKILLS[V]) - var/level = skills[S.ID] - HTML += "" - HTML += "" - HTML += "" - // secondary skills don't have an amateur level +/datum/preferences/proc/CalculateSkillPoints() + used_skillpoints = 0 + for(var/V in SKILLS) for(var/datum/skill/S in SKILLS[V]) + var/multiplier = 1 + switch(skills[S.ID]) + if(SKILL_NONE) + used_skillpoints += 0 * multiplier + if(SKILL_BASIC) + used_skillpoints += 1 * multiplier + if(SKILL_ADEPT) + // secondary skills cost less if(S.secondary) - HTML += "" + used_skillpoints += 1 * multiplier else - HTML += "" - HTML += "" - HTML += "" - HTML += "" - HTML += "
[V]" - HTML += "
[S.name]\[Untrained\]\[Amateur\]\[Trained\]\[Professional\]
" - HTML += "\[Done\]" + used_skillpoints += 3 * multiplier + if(SKILL_EXPERT) + // secondary skills cost less + if(S.secondary) + used_skillpoints += 3 * multiplier + else + used_skillpoints += 6 * multiplier - user << browse(null, "window=preferences") - user << browse(HTML, "window=show_skills;size=600x800") - return +/datum/preferences/proc/GetSkillClass(points) + // skill classes describe how your character compares in total points + var/original_points = points + points -= min(round((age - 20) / 2.5), 4) // every 2.5 years after 20, one extra skillpoint + if(age > 30) + points -= round((age - 30) / 5) // every 5 years after 30, one extra skillpoint + if(original_points > 0 && points <= 0) points = 1 + switch(points) + if(0) + return "Unconfigured" + if(1 to 3) + return "Terrifying" + if(4 to 6) + return "Below Average" + if(7 to 10) + return "Average" + if(11 to 14) + return "Above Average" + if(15 to 18) + return "Exceptional" + if(19 to 24) + return "Genius" + if(24 to 1000) + return "God" - proc/ShowChoices(mob/user) - if(!user || !user.client) return - update_preview_icon() - user << browse_rsc(preview_icon_front, "previewicon.png") - user << browse_rsc(preview_icon_side, "previewicon2.png") - var/dat = "
" +/datum/preferences/proc/SetSkills(mob/user) + if(SKILLS == null) + setup_skills() - if(path) - dat += "
" - dat += "Slot [slot_name] - " - dat += "Load slot - " - dat += "Save slot - " - dat += "Reload slot" - dat += "
" + if(skills.len == 0) + ZeroSkills() - else - dat += "Please create an account to save your preferences." - dat += "

" + var/HTML = "" + HTML += "Select your Skills
" + HTML += "Current skill level: [GetSkillClass(used_skillpoints)] ([used_skillpoints])
" + HTML += "Use preconfigured skillset
" + HTML += "" + for(var/V in SKILLS) + HTML += "" + for(var/datum/skill/S in SKILLS[V]) + var/level = skills[S.ID] + HTML += "" + HTML += "" + HTML += "" + // secondary skills don't have an amateur level + if(S.secondary) + HTML += "" + else + HTML += "" + HTML += "" + HTML += "" + HTML += "" + HTML += "
[V]" + HTML += "
[S.name]\[Untrained\]\[Amateur\]\[Trained\]\[Professional\]
" + HTML += "\[Done\]" - dat += "Name: " - dat += "[real_name]
" - dat += "(Random Name) " - dat += "(Always Random Name: [be_random_name ? "Yes" : "No"])" + user << browse(null, "window=preferences") + user << browse(HTML, "window=show_skills;size=600x800") + return + +/datum/preferences/proc/ShowChoices(mob/user) + if(!user || !user.client) return + update_preview_icon() + user << browse_rsc(preview_icon_front, "previewicon.png") + user << browse_rsc(preview_icon_side, "previewicon2.png") + var/dat = "
" + + if(path) + dat += "
" + dat += "Slot [slot_name] - " + dat += "Load slot - " + dat += "Save slot - " + dat += "Reload slot" + dat += "
" + + else + dat += "Please create an account to save your preferences." + + dat += "

" + HTML += "" + HTML += "
" + + dat += "Name: " + dat += "[real_name]
" + dat += "(Random Name) " + dat += "(Always Random Name: [be_random_name ? "Yes" : "No"])" + dat += "
" + + dat += "Gender: [gender == MALE ? "Male" : "Female"]
" + dat += "Age: [age]
" + dat += "Spawn Point: [spawnpoint]" + + dat += "
" + dat += "UI Style: [UI_style]
" + dat += "Custom UI(recommended for White UI):
" + dat += "-Color: [UI_style_color]
__

" + dat += "-Alpha(transparency): [UI_style_alpha]
" + dat += "Play admin midis: [(toggles & SOUND_MIDI) ? "Yes" : "No"]
" + dat += "Play lobby music: [(toggles & SOUND_LOBBY) ? "Yes" : "No"]
" + dat += "Ghost ears: [(toggles & CHAT_GHOSTEARS) ? "All Speech" : "Nearest Creatures"]
" + dat += "Ghost sight: [(toggles & CHAT_GHOSTSIGHT) ? "All Emotes" : "Nearest Creatures"]
" + dat += "Ghost radio: [(toggles & CHAT_GHOSTRADIO) ? "All Chatter" : "Nearest Speakers"]
" + + if(config.allow_Metadata) + dat += "OOC Notes: Edit
" + + dat += "
Custom Loadout: " + var/total_cost = 0 + + if(isnull(gear) || !islist(gear)) gear = list() + + if(gear && gear.len) dat += "
" + for(var/gear_name in gear) + if(gear_datums[gear_name]) + var/datum/gear/G = gear_datums[gear_name] + total_cost += G.cost + dat += "[gear_name] \[remove\]
" - dat += "Gender: [gender == MALE ? "Male" : "Female"]
" - dat += "Age: [age]
" - dat += "Spawn Point: [spawnpoint]" + dat += "Used: [total_cost] points." + else + dat += "none." - dat += "
" - dat += "UI Style: [UI_style]
" - dat += "Custom UI(recommended for White UI):
" - dat += "-Color: [UI_style_color]
__

" - dat += "-Alpha(transparency): [UI_style_alpha]
" - dat += "Play admin midis: [(toggles & SOUND_MIDI) ? "Yes" : "No"]
" - dat += "Play lobby music: [(toggles & SOUND_LOBBY) ? "Yes" : "No"]
" - dat += "Ghost ears: [(toggles & CHAT_GHOSTEARS) ? "All Speech" : "Nearest Creatures"]
" - dat += "Ghost sight: [(toggles & CHAT_GHOSTSIGHT) ? "All Emotes" : "Nearest Creatures"]
" - dat += "Ghost radio: [(toggles & CHAT_GHOSTRADIO) ? "All Chatter" : "Nearest Speakers"]
" + if(total_cost < MAX_GEAR_COST) + dat += " \[add\]" - if(config.allow_Metadata) - dat += "OOC Notes: Edit
" + dat += "

Occupation Choices
" + dat += "\tSet Preferences
" - dat += "
Custom Loadout: " - var/total_cost = 0 + dat += "
Body " + dat += "(®)" + dat += "
" + dat += "Species: [species]
" + dat += "Secondary Language:
[language]
" + dat += "Blood Type: [b_type]
" + dat += "Skin Tone: [-s_tone + 35]/220
" + //dat += "Skin pattern: Adjust
" + dat += "Needs Glasses: [disabilities == 0 ? "No" : "Yes"]
" + dat += "Limbs: Adjust
" + dat += "Internal Organs: Adjust
" - if(isnull(gear) || !islist(gear)) gear = list() + //display limbs below + var/ind = 0 + for(var/name in organ_data) + //world << "[ind] \ [organ_data.len]" + var/status = organ_data[name] + var/organ_name = null + switch(name) + if("l_arm") + organ_name = "left arm" + if("r_arm") + organ_name = "right arm" + if("l_leg") + organ_name = "left leg" + if("r_leg") + organ_name = "right leg" + if("l_foot") + organ_name = "left foot" + if("r_foot") + organ_name = "right foot" + if("l_hand") + organ_name = "left hand" + if("r_hand") + organ_name = "right hand" + if("heart") + organ_name = "heart" + if("eyes") + organ_name = "eyes" - if(gear && gear.len) - dat += "
" - for(var/gear_name in gear) - if(gear_datums[gear_name]) - var/datum/gear/G = gear_datums[gear_name] - total_cost += G.cost - dat += "[gear_name] \[remove\]
" - - dat += "Used: [total_cost] points." - else - dat += "none." - - if(total_cost < MAX_GEAR_COST) - dat += " \[add\]" - - dat += "

Occupation Choices
" - dat += "\tSet Preferences
" - - dat += "
Body " - dat += "(®)" - dat += "
" - dat += "Species: [species]
" - dat += "Secondary Language:
[language]
" - dat += "Blood Type: [b_type]
" - dat += "Skin Tone: [-s_tone + 35]/220
" - //dat += "Skin pattern: Adjust
" - dat += "Needs Glasses: [disabilities == 0 ? "No" : "Yes"]
" - dat += "Limbs: Adjust
" - dat += "Internal Organs: Adjust
" - - //display limbs below - var/ind = 0 - for(var/name in organ_data) - //world << "[ind] \ [organ_data.len]" - var/status = organ_data[name] - var/organ_name = null - switch(name) - if("l_arm") - organ_name = "left arm" - if("r_arm") - organ_name = "right arm" - if("l_leg") - organ_name = "left leg" - if("r_leg") - organ_name = "right leg" - if("l_foot") - organ_name = "left foot" - if("r_foot") - organ_name = "right foot" - if("l_hand") - organ_name = "left hand" - if("r_hand") - organ_name = "right hand" + if(status == "cyborg") + ++ind + if(ind > 1) + dat += ", " + dat += "\tMechanical [organ_name] prothesis" + else if(status == "amputated") + ++ind + if(ind > 1) + dat += ", " + dat += "\tAmputated [organ_name]" + else if(status == "mechanical") + ++ind + if(ind > 1) + dat += ", " + dat += "\tMechanical [organ_name]" + else if(status == "assisted") + ++ind + if(ind > 1) + dat += ", " + switch(organ_name) if("heart") - organ_name = "heart" + dat += "\tPacemaker-assisted [organ_name]" + if("voicebox") //on adding voiceboxes for speaking skrell/similar replacements + dat += "\tSurgically altered [organ_name]" if("eyes") - organ_name = "eyes" - - if(status == "cyborg") - ++ind - if(ind > 1) - dat += ", " - dat += "\tMechanical [organ_name] prothesis" - else if(status == "amputated") - ++ind - if(ind > 1) - dat += ", " - dat += "\tAmputated [organ_name]" - else if(status == "mechanical") - ++ind - if(ind > 1) - dat += ", " - dat += "\tMechanical [organ_name]" - else if(status == "assisted") - ++ind - if(ind > 1) - dat += ", " - switch(organ_name) - if("heart") - dat += "\tPacemaker-assisted [organ_name]" - if("voicebox") //on adding voiceboxes for speaking skrell/similar replacements - dat += "\tSurgically altered [organ_name]" - if("eyes") - dat += "\tRetinal overlayed [organ_name]" - else - dat += "\tMechanically assisted [organ_name]" - if(!ind) - dat += "\[...\]

" - else - dat += "

" - - if(gender == MALE) - dat += "Underwear: [underwear_m[underwear]]
" - else - dat += "Underwear: [underwear_f[underwear]]
" - - dat += "Undershirt: [undershirt_t[undershirt]]
" - - dat += "Backpack Type:
[backbaglist[backbag]]
" - - dat += "Nanotrasen Relation:
[nanotrasen_relation]
" - - dat += "
Preview
" - - dat += "
" - - if(jobban_isbanned(user, "Records")) - dat += "You are banned from using character records.
" - else - dat += "Character Records
" - - dat += "Set Antag Options
" - - dat += "\tSet Skills ([GetSkillClass(used_skillpoints)][used_skillpoints > 0 ? " [used_skillpoints]" : "0"])
" - - dat += "Set Flavor Text
" - dat += "
" - - dat += "
Hair
" - dat += "Change Color
__
" - dat += " Style: [h_style]
" - - dat += "
Facial
" - dat += "Change Color
__
" - dat += " Style: [f_style]
" - - dat += "
Eyes
" - dat += "Change Color
__

" - - dat += "
Body Color
" - dat += "Change Color
__
" - - dat += "

" - if(jobban_isbanned(user, "Syndicate")) - dat += "You are banned from antagonist roles." - src.be_special = 0 - else - var/n = 0 - for (var/i in special_roles) - if(special_roles[i]) //if mode is available on the server - if(jobban_isbanned(user, i)) - dat += "Be [i]: \[BANNED]
" - else if(i == "pai candidate") - if(jobban_isbanned(user, "pAI")) - dat += "Be [i]: \[BANNED]
" - else - dat += "Be [i]: [src.be_special&(1<
" - n++ - dat += "

" - - if(!IsGuestKey(user.key)) - dat += "Undo - " - dat += "Save Setup - " - - dat += "Reset Setup" - dat += "
" - - user << browse(dat, "window=preferences;size=560x736") - - proc/SetChoices(mob/user, limit = 16, list/splitJobs = list("Chief Medical Officer"), width = 550, height = 660) - if(!job_master) - return - - //limit - The amount of jobs allowed per column. Defaults to 17 to make it look nice. - //splitJobs - Allows you split the table by job. You can make different tables for each department by including their heads. Defaults to CE to make it look nice. - //width - Screen' width. Defaults to 550 to make it look nice. - //height - Screen's height. Defaults to 500 to make it look nice. - - - var/HTML = "" - HTML += "
" - HTML += "Choose occupation chances
Unavailable occupations are crossed out.

" - HTML += "
\[Done\]

" // Easier to press up here. - HTML += "
" // Table within a table for alignment, also allows you to easily add more colomns. - HTML += "" - var/index = -1 - - //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 - if((index >= limit) || (job.title in splitJobs)) - if((index < limit) && (lastJob != null)) - //If the cells were broken up by a job in the splitJob list then it will fill in the rest of the cells with - //the last job's selection color. Creating a rather nice effect. - for(var/i = 0, i < (limit - index), i += 1) - HTML += "" - HTML += "
  
" - index = 0 - - HTML += "" - continue - if(!job.player_old_enough(user.client)) - var/available_in_days = job.available_in_days(user.client) - HTML += "[rank]" - continue - if((job_civilian_low & ASSISTANT) && (rank != "Assistant")) - HTML += "[rank]" - continue - if((rank in command_positions) || (rank == "AI"))//Bold head jobs - HTML += "[rank]" - else - HTML += "[rank]" - - HTML += "" - continue + dat += "\tMechanically assisted [organ_name]" + if(!ind) + dat += "\[...\]

" + else + dat += "

" - if(GetJobDepartment(job, 1) & job.flag) - HTML += " \[High]" - else if(GetJobDepartment(job, 2) & job.flag) - HTML += " \[Medium]" - else if(GetJobDepartment(job, 3) & job.flag) - HTML += " \[Low]" + if(gender == MALE) + dat += "Underwear: [underwear_m[underwear]]
" + else + dat += "Underwear: [underwear_f[underwear]]
" + + dat += "Undershirt: [undershirt_t[undershirt]]
" + + dat += "Backpack Type:
[backbaglist[backbag]]
" + + dat += "Nanotrasen Relation:
[nanotrasen_relation]
" + + dat += "
" - var/rank = job.title - lastJob = job - if(jobban_isbanned(user, rank)) - HTML += "[rank] \[BANNED]
\[IN [(available_in_days)] DAYS]
" - - HTML += "" - - if(rank == "Assistant")//Assistant is special - if(job_civilian_low & ASSISTANT) - HTML += " \[Yes]" + dat += "\tRetinal overlayed [organ_name]" else - HTML += " \[No]" - HTML += "
Preview
" + + dat += "
" + + if(jobban_isbanned(user, "Records")) + dat += "You are banned from using character records.
" + else + dat += "Character Records
" + + dat += "Set Antag Options
" + + dat += "\tSet Skills ([GetSkillClass(used_skillpoints)][used_skillpoints > 0 ? " [used_skillpoints]" : "0"])
" + + dat += "Set Flavor Text
" + dat += "
" + + dat += "
Hair
" + dat += "Change Color
__
" + dat += " Style: [h_style]
" + + dat += "
Facial
" + dat += "Change Color
__
" + dat += " Style: [f_style]
" + + dat += "
Eyes
" + dat += "Change Color
__

" + + dat += "
Body Color
" + dat += "Change Color
__
" + + dat += "

" + if(jobban_isbanned(user, "Syndicate")) + dat += "You are banned from antagonist roles." + src.be_special = 0 + else + var/n = 0 + for (var/i in special_roles) + if(special_roles[i]) //if mode is available on the server + if(jobban_isbanned(user, i)) + dat += "Be [i]: \[BANNED]
" + else if(i == "pai candidate") + if(jobban_isbanned(user, "pAI")) + dat += "Be [i]: \[BANNED]
" + else + dat += "Be [i]: [src.be_special&(1<
" + n++ + dat += "

" + + if(!IsGuestKey(user.key)) + dat += "Undo - " + dat += "Save Setup - " + + dat += "Reset Setup" + dat += "
" + + user << browse(dat, "window=preferences;size=560x736") + +/datum/preferences/proc/SetChoices(mob/user, limit = 16, list/splitJobs = list("Chief Medical Officer"), width = 550, height = 660) + if(!job_master) + return + + //limit - The amount of jobs allowed per column. Defaults to 17 to make it look nice. + //splitJobs - Allows you split the table by job. You can make different tables for each department by including their heads. Defaults to CE to make it look nice. + //width - Screen' width. Defaults to 550 to make it look nice. + //height - Screen's height. Defaults to 500 to make it look nice. + + + var/HTML = "" + HTML += "
" + HTML += "Choose occupation chances
Unavailable occupations are crossed out.

" + HTML += "
\[Done\]

" // Easier to press up here. + HTML += "
" // Table within a table for alignment, also allows you to easily add more colomns. + HTML += "" + var/index = -1 + + //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 + if((index >= limit) || (job.title in splitJobs)) + if((index < limit) && (lastJob != null)) + //If the cells were broken up by a job in the splitJob list then it will fill in the rest of the cells with + //the last job's selection color. Creating a rather nice effect. + for(var/i = 0, i < (limit - index), i += 1) + HTML += "" + HTML += "
  
" + index = 0 + + HTML += "" + continue + if(!job.player_old_enough(user.client)) + var/available_in_days = job.available_in_days(user.client) + HTML += "[rank]" + continue + if((job_civilian_low & ASSISTANT) && (rank != "Assistant")) + HTML += "[rank]" + continue + if((rank in command_positions) || (rank == "AI"))//Bold head jobs + HTML += "[rank]" + else + HTML += "[rank]" + + HTML += "" + HTML += " \[No]" HTML += "" - - HTML += "
" + var/rank = job.title + lastJob = job + if(jobban_isbanned(user, rank)) + HTML += "[rank] \[BANNED]
\[IN [(available_in_days)] DAYS]
" + + HTML += "" + + if(rank == "Assistant")//Assistant is special + if(job_civilian_low & ASSISTANT) + HTML += " \[Yes]" else - HTML += " \[NEVER]" - if(job.alt_titles) - HTML += "
 \[[GetPlayerAltTitle(job)]\]
" - - HTML += "
" - - switch(alternate_option) - if(GET_RANDOM_JOB) - HTML += "

Get random job if preferences unavailable

" - if(BE_ASSISTANT) - HTML += "

Be assistant if preference unavailable

" - if(RETURN_TO_LOBBY) - HTML += "

Return to lobby if preference unavailable

" - - HTML += "
\[Reset\]
" - HTML += "
" - - user << browse(null, "window=preferences") - user << browse(HTML, "window=mob_occupation;size=[width]x[height]") - return - - proc/SetDisabilities(mob/user) - var/HTML = "" - HTML += "
" - HTML += "Choose disabilities
" - - HTML += "Need Glasses? [disabilities & (1<<0) ? "Yes" : "No"]
" - HTML += "Seizures? [disabilities & (1<<1) ? "Yes" : "No"]
" - HTML += "Coughing? [disabilities & (1<<2) ? "Yes" : "No"]
" - HTML += "Tourettes/Twitching? [disabilities & (1<<3) ? "Yes" : "No"]
" - HTML += "Nervousness? [disabilities & (1<<4) ? "Yes" : "No"]
" - HTML += "Deafness? [disabilities & (1<<5) ? "Yes" : "No"]
" - - HTML += "
" - HTML += "\[Done\]" - HTML += "
" - - user << browse(null, "window=preferences") - user << browse(HTML, "window=disabil;size=350x300") - return - - proc/SetRecords(mob/user) - var/HTML = "" - HTML += "
" - HTML += "Set Character Records
" - - HTML += "Medical Records
" - - HTML += TextPreview(med_record,40) - - HTML += "

Employment Records
" - - HTML += TextPreview(gen_record,40) - - HTML += "

Security Records
" - - HTML += TextPreview(sec_record,40) - - HTML += "
" - HTML += "\[Done\]" - HTML += "
" - - user << browse(null, "window=preferences") - user << browse(HTML, "window=records;size=350x300") - return - - proc/SetAntagoptions(mob/user) - if(uplinklocation == "" || !uplinklocation) - uplinklocation = "PDA" - var/HTML = "" - HTML += "
" - HTML += "Antagonist Options
" - HTML += "
" - HTML +="Uplink Type : [uplinklocation]" - HTML +="
" - HTML +="
" - HTML +="\[Done\]" - - HTML += "
" - - user << browse(null, "window=preferences") - user << browse(HTML, "window=antagoptions") - return - - proc/SetFlavorText(mob/user) - var/HTML = "" - HTML += "
" - HTML += "Set Flavour Text
" - HTML += "
" - HTML += "General: " - HTML += TextPreview(flavor_texts["general"]) - HTML += "
" - HTML += "Head: " - HTML += TextPreview(flavor_texts["head"]) - HTML += "
" - HTML += "Face: " - HTML += TextPreview(flavor_texts["face"]) - HTML += "
" - HTML += "Eyes: " - HTML += TextPreview(flavor_texts["eyes"]) - HTML += "
" - HTML += "Body: " - HTML += TextPreview(flavor_texts["torso"]) - HTML += "
" - HTML += "Arms: " - HTML += TextPreview(flavor_texts["arms"]) - HTML += "
" - HTML += "Hands: " - HTML += TextPreview(flavor_texts["hands"]) - HTML += "
" - HTML += "Legs: " - HTML += TextPreview(flavor_texts["legs"]) - HTML += "
" - HTML += "Feet: " - HTML += TextPreview(flavor_texts["feet"]) - HTML += "
" - HTML += "
" - HTML +="\[Done\]" - HTML += "" - user << browse(null, "window=preferences") - user << browse(HTML, "window=flavor_text;size=430x300") - return - - proc/GetPlayerAltTitle(datum/job/job) - return player_alt_titles.Find(job.title) > 0 \ - ? player_alt_titles[job.title] \ - : job.title - - proc/SetPlayerAltTitle(datum/job/job, new_title) - // remove existing entry - if(player_alt_titles.Find(job.title)) - player_alt_titles -= job.title - // add one if it's not default - if(job.title != new_title) - player_alt_titles[job.title] = new_title - - proc/SetJob(mob/user, role) - var/datum/job/job = job_master.GetJob(role) - if(!job) - user << browse(null, "window=mob_occupation") - ShowChoices(user) - return - - if(role == "Assistant") - if(job_civilian_low & job.flag) - job_civilian_low &= ~job.flag - else - job_civilian_low |= job.flag - SetChoices(user) - return 1 + continue if(GetJobDepartment(job, 1) & job.flag) - SetJobDepartment(job, 1) + HTML += " \[High]" else if(GetJobDepartment(job, 2) & job.flag) - SetJobDepartment(job, 2) + HTML += " \[Medium]" else if(GetJobDepartment(job, 3) & job.flag) - SetJobDepartment(job, 3) - else//job = Never - SetJobDepartment(job, 4) + HTML += " \[Low]" + else + HTML += " \[NEVER]" + if(job.alt_titles) + HTML += "
 \[[GetPlayerAltTitle(job)]\]
" + + HTML += "
" + + switch(alternate_option) + if(GET_RANDOM_JOB) + HTML += "

Get random job if preferences unavailable

" + if(BE_ASSISTANT) + HTML += "

Be assistant if preference unavailable

" + if(RETURN_TO_LOBBY) + HTML += "

Return to lobby if preference unavailable

" + + HTML += "
\[Reset\]
" + HTML += "" + + user << browse(null, "window=preferences") + user << browse(HTML, "window=mob_occupation;size=[width]x[height]") + return + +/datum/preferences/proc/SetDisabilities(mob/user) + var/HTML = "" + HTML += "
" + HTML += "Choose disabilities
" + + HTML += "Need Glasses? [disabilities & (1<<0) ? "Yes" : "No"]
" + HTML += "Seizures? [disabilities & (1<<1) ? "Yes" : "No"]
" + HTML += "Coughing? [disabilities & (1<<2) ? "Yes" : "No"]
" + HTML += "Tourettes/Twitching? [disabilities & (1<<3) ? "Yes" : "No"]
" + HTML += "Nervousness? [disabilities & (1<<4) ? "Yes" : "No"]
" + HTML += "Deafness? [disabilities & (1<<5) ? "Yes" : "No"]
" + + HTML += "
" + HTML += "\[Done\]" + HTML += "
" + + user << browse(null, "window=preferences") + user << browse(HTML, "window=disabil;size=350x300") + return + +/datum/preferences/proc/SetRecords(mob/user) + var/HTML = "" + HTML += "
" + HTML += "Set Character Records
" + + HTML += "Medical Records
" + + HTML += TextPreview(med_record,40) + + HTML += "

Employment Records
" + + HTML += TextPreview(gen_record,40) + + HTML += "

Security Records
" + + HTML += TextPreview(sec_record,40) + + HTML += "
" + HTML += "\[Done\]" + HTML += "
" + + user << browse(null, "window=preferences") + user << browse(HTML, "window=records;size=350x300") + return + +/datum/preferences/proc/SetAntagoptions(mob/user) + if(uplinklocation == "" || !uplinklocation) + uplinklocation = "PDA" + var/HTML = "" + HTML += "
" + HTML += "Antagonist Options
" + HTML += "
" + HTML +="Uplink Type : [uplinklocation]" + HTML +="
" + HTML +="
" + HTML +="\[Done\]" + + HTML += "
" + + user << browse(null, "window=preferences") + user << browse(HTML, "window=antagoptions") + return + +/datum/preferences/proc/SetFlavorText(mob/user) + var/HTML = "" + HTML += "
" + HTML += "Set Flavour Text
" + HTML += "
" + HTML += "General: " + HTML += TextPreview(flavor_texts["general"]) + HTML += "
" + HTML += "Head: " + HTML += TextPreview(flavor_texts["head"]) + HTML += "
" + HTML += "Face: " + HTML += TextPreview(flavor_texts["face"]) + HTML += "
" + HTML += "Eyes: " + HTML += TextPreview(flavor_texts["eyes"]) + HTML += "
" + HTML += "Body: " + HTML += TextPreview(flavor_texts["torso"]) + HTML += "
" + HTML += "Arms: " + HTML += TextPreview(flavor_texts["arms"]) + HTML += "
" + HTML += "Hands: " + HTML += TextPreview(flavor_texts["hands"]) + HTML += "
" + HTML += "Legs: " + HTML += TextPreview(flavor_texts["legs"]) + HTML += "
" + HTML += "Feet: " + HTML += TextPreview(flavor_texts["feet"]) + HTML += "
" + HTML += "
" + HTML +="\[Done\]" + HTML += "" + user << browse(null, "window=preferences") + user << browse(HTML, "window=flavor_text;size=430x300") + return + +/datum/preferences/proc/GetPlayerAltTitle(datum/job/job) + return player_alt_titles.Find(job.title) > 0 \ + ? player_alt_titles[job.title] \ + : job.title + +/datum/preferences/proc/SetPlayerAltTitle(datum/job/job, new_title) + // remove existing entry + if(player_alt_titles.Find(job.title)) + player_alt_titles -= job.title + // add one if it's not default + if(job.title != new_title) + player_alt_titles[job.title] = new_title + +/datum/preferences/proc/SetJob(mob/user, role) + var/datum/job/job = job_master.GetJob(role) + if(!job) + user << browse(null, "window=mob_occupation") + ShowChoices(user) + return + + if(role == "Assistant") + if(job_civilian_low & job.flag) + job_civilian_low &= ~job.flag + else + job_civilian_low |= job.flag SetChoices(user) return 1 - proc/ResetJobs() - job_civilian_high = 0 - job_civilian_med = 0 - job_civilian_low = 0 + if(GetJobDepartment(job, 1) & job.flag) + SetJobDepartment(job, 1) + else if(GetJobDepartment(job, 2) & job.flag) + SetJobDepartment(job, 2) + else if(GetJobDepartment(job, 3) & job.flag) + SetJobDepartment(job, 3) + else//job = Never + SetJobDepartment(job, 4) - job_medsci_high = 0 - job_medsci_med = 0 - job_medsci_low = 0 + SetChoices(user) + return 1 - job_engsec_high = 0 - job_engsec_med = 0 - job_engsec_low = 0 +/datum/preferences/proc/ResetJobs() + job_civilian_high = 0 + job_civilian_med = 0 + job_civilian_low = 0 + + job_medsci_high = 0 + job_medsci_med = 0 + job_medsci_low = 0 + + job_engsec_high = 0 + job_engsec_med = 0 + job_engsec_low = 0 - proc/GetJobDepartment(var/datum/job/job, var/level) - if(!job || !level) return 0 - switch(job.department_flag) - if(CIVILIAN) - switch(level) - if(1) - return job_civilian_high - if(2) - return job_civilian_med - if(3) - return job_civilian_low - if(MEDSCI) - switch(level) - if(1) - return job_medsci_high - if(2) - return job_medsci_med - if(3) - return job_medsci_low - if(ENGSEC) - switch(level) - if(1) - return job_engsec_high - if(2) - return job_engsec_med - if(3) - return job_engsec_low - return 0 +/datum/preferences/proc/GetJobDepartment(var/datum/job/job, var/level) + if(!job || !level) return 0 + switch(job.department_flag) + if(CIVILIAN) + switch(level) + if(1) + return job_civilian_high + if(2) + return job_civilian_med + if(3) + return job_civilian_low + if(MEDSCI) + switch(level) + if(1) + return job_medsci_high + if(2) + return job_medsci_med + if(3) + return job_medsci_low + if(ENGSEC) + switch(level) + if(1) + return job_engsec_high + if(2) + return job_engsec_med + if(3) + return job_engsec_low + return 0 - proc/SetJobDepartment(var/datum/job/job, var/level) - if(!job || !level) return 0 - switch(level) - if(1)//Only one of these should ever be active at once so clear them all here - job_civilian_high = 0 - job_medsci_high = 0 - job_engsec_high = 0 - return 1 - if(2)//Set current highs to med, then reset them - job_civilian_med |= job_civilian_high - job_medsci_med |= job_medsci_high - job_engsec_med |= job_engsec_high - job_civilian_high = 0 - job_medsci_high = 0 - job_engsec_high = 0 +/datum/preferences/proc/SetJobDepartment(var/datum/job/job, var/level) + if(!job || !level) return 0 + switch(level) + if(1)//Only one of these should ever be active at once so clear them all here + job_civilian_high = 0 + job_medsci_high = 0 + job_engsec_high = 0 + return 1 + if(2)//Set current highs to med, then reset them + job_civilian_med |= job_civilian_high + job_medsci_med |= job_medsci_high + job_engsec_med |= job_engsec_high + job_civilian_high = 0 + job_medsci_high = 0 + job_engsec_high = 0 - switch(job.department_flag) - if(CIVILIAN) - switch(level) - if(2) - job_civilian_high = job.flag - job_civilian_med &= ~job.flag - if(3) - job_civilian_med |= job.flag - job_civilian_low &= ~job.flag - else - job_civilian_low |= job.flag - if(MEDSCI) - switch(level) - if(2) - job_medsci_high = job.flag - job_medsci_med &= ~job.flag - if(3) - job_medsci_med |= job.flag - job_medsci_low &= ~job.flag - else - job_medsci_low |= job.flag - if(ENGSEC) - switch(level) - if(2) - job_engsec_high = job.flag - job_engsec_med &= ~job.flag - if(3) - job_engsec_med |= job.flag - job_engsec_low &= ~job.flag - else - job_engsec_low |= job.flag + switch(job.department_flag) + if(CIVILIAN) + switch(level) + if(2) + job_civilian_high = job.flag + job_civilian_med &= ~job.flag + if(3) + job_civilian_med |= job.flag + job_civilian_low &= ~job.flag + else + job_civilian_low |= job.flag + if(MEDSCI) + switch(level) + if(2) + job_medsci_high = job.flag + job_medsci_med &= ~job.flag + if(3) + job_medsci_med |= job.flag + job_medsci_low &= ~job.flag + else + job_medsci_low |= job.flag + if(ENGSEC) + switch(level) + if(2) + job_engsec_high = job.flag + job_engsec_med &= ~job.flag + if(3) + job_engsec_med |= job.flag + job_engsec_low &= ~job.flag + else + job_engsec_low |= job.flag + return 1 + +/datum/preferences/proc/process_link(mob/user, list/href_list) + if(!user) return + + if(!istype(user, /mob/new_player)) return + if(href_list["preference"] == "job") + switch(href_list["task"]) + if("close") + user << browse(null, "window=mob_occupation") + ShowChoices(user) + if("reset") + ResetJobs() + SetChoices(user) + if("random") + if(alternate_option == GET_RANDOM_JOB || alternate_option == BE_ASSISTANT) + alternate_option += 1 + else if(alternate_option == RETURN_TO_LOBBY) + alternate_option = 0 + else + return 0 + 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", GetPlayerAltTitle(job)) as anything in choices | null + if(choice) + SetPlayerAltTitle(job, choice) + SetChoices(user) + if("input") + SetJob(user, href_list["text"]) + else + SetChoices(user) + return 1 + else if(href_list["preference"] == "skills") + if(href_list["cancel"]) + user << browse(null, "window=show_skills") + ShowChoices(user) + else if(href_list["skillinfo"]) + var/datum/skill/S = locate(href_list["skillinfo"]) + var/HTML = "[S.name]
[S.desc]" + user << browse(HTML, "window=\ref[user]skillinfo") + else if(href_list["setskill"]) + var/datum/skill/S = locate(href_list["setskill"]) + var/value = text2num(href_list["newvalue"]) + skills[S.ID] = value + CalculateSkillPoints() + SetSkills(user) + else if(href_list["preconfigured"]) + var/selected = input(user, "Select a skillset", "Skillset") as null|anything in SKILL_PRE + if(!selected) return + + ZeroSkills(1) + for(var/V in SKILL_PRE[selected]) + if(V == "field") + skill_specialization = SKILL_PRE[selected]["field"] + continue + skills[V] = SKILL_PRE[selected][V] + CalculateSkillPoints() + + SetSkills(user) + else if(href_list["setspecialization"]) + skill_specialization = href_list["setspecialization"] + CalculateSkillPoints() + SetSkills(user) + else + SetSkills(user) return 1 - proc/process_link(mob/user, list/href_list) - if(!user) return + else if (href_list["preference"] == "loadout") - if(!istype(user, /mob/new_player)) return - if(href_list["preference"] == "job") - switch(href_list["task"]) - if("close") - user << browse(null, "window=mob_occupation") - ShowChoices(user) - if("reset") - ResetJobs() - SetChoices(user) - if("random") - if(alternate_option == GET_RANDOM_JOB || alternate_option == BE_ASSISTANT) - alternate_option += 1 - else if(alternate_option == RETURN_TO_LOBBY) - alternate_option = 0 - else - return 0 - 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", GetPlayerAltTitle(job)) as anything in choices | null - if(choice) - SetPlayerAltTitle(job, choice) - SetChoices(user) - if("input") - SetJob(user, href_list["text"]) + if(href_list["task"] == "input") + + var/list/valid_gear_choices = list() + + for(var/gear_name in gear_datums) + var/datum/gear/G = gear_datums[gear_name] + if(G.whitelisted && !is_alien_whitelisted(user, G.whitelisted)) + continue + valid_gear_choices += gear_name + + var/choice = input(user, "Select gear to add: ") as null|anything in valid_gear_choices + + if(choice && gear_datums[choice]) + + var/total_cost = 0 + + if(isnull(gear) || !islist(gear)) gear = list() + + if(gear && gear.len) + for(var/gear_name in gear) + if(gear_datums[gear_name]) + var/datum/gear/G = gear_datums[gear_name] + total_cost += G.cost + + var/datum/gear/C = gear_datums[choice] + total_cost += C.cost + if(C && total_cost <= MAX_GEAR_COST) + gear += choice + user << "\blue Added [choice] for [C.cost] points ([MAX_GEAR_COST - total_cost] points remaining)." else - SetChoices(user) - return 1 - else if(href_list["preference"] == "skills") - if(href_list["cancel"]) - user << browse(null, "window=show_skills") - ShowChoices(user) - else if(href_list["skillinfo"]) - var/datum/skill/S = locate(href_list["skillinfo"]) - var/HTML = "[S.name]
[S.desc]" - user << browse(HTML, "window=\ref[user]skillinfo") - else if(href_list["setskill"]) - var/datum/skill/S = locate(href_list["setskill"]) - var/value = text2num(href_list["newvalue"]) - skills[S.ID] = value - CalculateSkillPoints() - SetSkills(user) - else if(href_list["preconfigured"]) - var/selected = input(user, "Select a skillset", "Skillset") as null|anything in SKILL_PRE - if(!selected) return + user << "\red That item will exceed the maximum loadout cost of [MAX_GEAR_COST] points." - ZeroSkills(1) - for(var/V in SKILL_PRE[selected]) - if(V == "field") - skill_specialization = SKILL_PRE[selected]["field"] - continue - skills[V] = SKILL_PRE[selected][V] - CalculateSkillPoints() - - SetSkills(user) - else if(href_list["setspecialization"]) - skill_specialization = href_list["setspecialization"] - CalculateSkillPoints() - SetSkills(user) - else - SetSkills(user) - return 1 - - else if (href_list["preference"] == "loadout") - - if(href_list["task"] == "input") - - var/list/valid_gear_choices = list() - - for(var/gear_name in gear_datums) - var/datum/gear/G = gear_datums[gear_name] - if(G.whitelisted && !is_alien_whitelisted(user, G.whitelisted)) - continue - valid_gear_choices += gear_name - - var/choice = input(user, "Select gear to add: ") as null|anything in valid_gear_choices - - if(choice && gear_datums[choice]) - - var/total_cost = 0 - - if(isnull(gear) || !islist(gear)) gear = list() - - if(gear && gear.len) - for(var/gear_name in gear) - if(gear_datums[gear_name]) - var/datum/gear/G = gear_datums[gear_name] - total_cost += G.cost - - var/datum/gear/C = gear_datums[choice] - total_cost += C.cost - if(C && total_cost <= MAX_GEAR_COST) - gear += choice - user << "\blue Added [choice] for [C.cost] points ([MAX_GEAR_COST - total_cost] points remaining)." - else - user << "\red That item will exceed the maximum loadout cost of [MAX_GEAR_COST] points." - - else if(href_list["task"] == "remove") - var/to_remove = href_list["gear"] - if(!to_remove) return - for(var/gear_name in gear) - if(gear_name == to_remove) - gear -= gear_name - break - - else if(href_list["preference"] == "flavor_text") - switch(href_list["task"]) - if("open") - SetFlavorText(user) - return - if("done") - user << browse(null, "window=flavor_text") - ShowChoices(user) - return - if("general") - var/msg = input(usr,"Give a general description of your character. This will be shown regardless of clothing, and may include OOC notes and preferences.","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message - if(msg != null) - msg = copytext(msg, 1, MAX_MESSAGE_LEN) - msg = html_encode(msg) - flavor_texts[href_list["task"]] = msg - else - var/msg = input(usr,"Set the flavor text for your [href_list["task"]].","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message - if(msg != null) - msg = copytext(msg, 1, MAX_MESSAGE_LEN) - msg = html_encode(msg) - flavor_texts[href_list["task"]] = msg - SetFlavorText(user) - return - - 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) - if(href_list["task"] == "gen_record") - var/genmsg = input(usr,"Set your employment notes here.","Employment Records",html_decode(gen_record)) as message - - if(genmsg != null) - genmsg = copytext(genmsg, 1, MAX_PAPER_MESSAGE_LEN) - genmsg = html_encode(genmsg) - - gen_record = genmsg - SetRecords(user) - - else if (href_list["preference"] == "antagoptions") - if(text2num(href_list["active"]) == 0) - SetAntagoptions(user) - return - if (href_list["antagtask"] == "uplinktype") - if (uplinklocation == "PDA") - uplinklocation = "Headset" - else if(uplinklocation == "Headset") - uplinklocation = "None" - else - uplinklocation = "PDA" - SetAntagoptions(user) - if (href_list["antagtask"] == "done") - user << browse(null, "window=antagoptions") - ShowChoices(user) - return 1 - - else if (href_list["preference"] == "loadout") - - if(href_list["task"] == "input") - - var/list/valid_gear_choices = list() - - for(var/gear_name in gear_datums) - var/datum/gear/G = gear_datums[gear_name] - if(G.whitelisted && !is_alien_whitelisted(user, G.whitelisted)) - continue - valid_gear_choices += gear_name - - var/choice = input(user, "Select gear to add: ") as null|anything in valid_gear_choices - - if(choice && gear_datums[choice]) - - var/total_cost = 0 - - if(isnull(gear) || !islist(gear)) gear = list() - - if(gear && gear.len) - for(var/gear_name in gear) - if(gear_datums[gear_name]) - var/datum/gear/G = gear_datums[gear_name] - total_cost += G.cost - - var/datum/gear/C = gear_datums[choice] - total_cost += C.cost - if(C && total_cost <= MAX_GEAR_COST) - gear += choice - user << "\blue Added [choice] for [C.cost] points ([MAX_GEAR_COST - total_cost] points remaining)." - else - user << "\red That item will exceed the maximum loadout cost of [MAX_GEAR_COST] points." - - else if(href_list["task"] == "remove") - var/to_remove = href_list["gear"] - if(!to_remove) return - for(var/gear_name in gear) - if(gear_name == to_remove) - gear -= gear_name - break + else if(href_list["task"] == "remove") + var/to_remove = href_list["gear"] + if(!to_remove) return + for(var/gear_name in gear) + if(gear_name == to_remove) + gear -= gear_name + break + else if(href_list["preference"] == "flavor_text") switch(href_list["task"]) - if("random") - switch(href_list["preference"]) - if("name") - real_name = random_name(gender) - if("age") - age = rand(AGE_MIN, AGE_MAX) - if("hair") - r_hair = rand(0,255) - g_hair = rand(0,255) - b_hair = rand(0,255) - if("h_style") - h_style = random_hair_style(gender, species) - if("facial") - r_facial = rand(0,255) - g_facial = rand(0,255) - b_facial = rand(0,255) - if("f_style") - f_style = random_facial_hair_style(gender, species) - if("underwear") - underwear = rand(1,underwear_m.len) - ShowChoices(user) - if("undershirt") - undershirt = rand(1,undershirt_t.len) - ShowChoices(user) - if("eyes") - r_eyes = rand(0,255) - g_eyes = rand(0,255) - b_eyes = rand(0,255) - if("s_tone") - s_tone = random_skin_tone() - if("s_color") - r_skin = rand(0,255) - g_skin = rand(0,255) - b_skin = rand(0,255) - if("bag") - backbag = rand(1,4) - /*if("skin_style") - h_style = random_skin_style(gender)*/ - if("all") - randomize_appearance_for() //no params needed - if("input") - switch(href_list["preference"]) - if("name") - var/raw_name = input(user, "Choose your character's name:", "Character Preference") as text|null - if (!isnull(raw_name)) // Check to ensure that the user entered text (rather than cancel.) - var/new_name = reject_bad_name(raw_name) - if(new_name) - real_name = new_name - else - user << "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and ." + if("open") + SetFlavorText(user) + return + if("done") + user << browse(null, "window=flavor_text") + ShowChoices(user) + return + if("general") + var/msg = input(usr,"Give a general description of your character. This will be shown regardless of clothing, and may include OOC notes and preferences.","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message + if(msg != null) + msg = copytext(msg, 1, MAX_MESSAGE_LEN) + msg = html_encode(msg) + flavor_texts[href_list["task"]] = msg + else + var/msg = input(usr,"Set the flavor text for your [href_list["task"]].","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message + if(msg != null) + msg = copytext(msg, 1, MAX_MESSAGE_LEN) + msg = html_encode(msg) + flavor_texts[href_list["task"]] = msg + SetFlavorText(user) + return - if("age") - var/new_age = input(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference") as num|null - if(new_age) - age = max(min( round(text2num(new_age)), AGE_MAX),AGE_MIN) - if("species") + 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 - var/list/new_species = list("Human") - var/prev_species = species - var/whitelisted = 0 + if(medmsg != null) + medmsg = copytext(medmsg, 1, MAX_PAPER_MESSAGE_LEN) + medmsg = html_encode(medmsg) - if(config.usealienwhitelist) //If we're using the whitelist, make sure to check it! - for(var/S in whitelisted_species) - if(is_alien_whitelisted(user,S)) - new_species += S - whitelisted = 1 - if(!whitelisted) - alert(user, "You cannot change your species as you need to be whitelisted. If you wish to be whitelisted contact an admin in-game, on the forums, or on IRC.") - else //Not using the whitelist? Aliens for everyone! - new_species = whitelisted_species + med_record = medmsg + SetRecords(user) - species = input("Please select a species", "Character Generation", null) in new_species + if(href_list["task"] == "sec_record") + var/secmsg = input(usr,"Set your security notes here.","Security Records",html_decode(sec_record)) as message - if(prev_species != species) - //grab one of the valid hair styles for the newly chosen species - var/list/valid_hairstyles = list() - for(var/hairstyle in hair_styles_list) - var/datum/sprite_accessory/S = hair_styles_list[hairstyle] - if(gender == MALE && S.gender == FEMALE) - continue - if(gender == FEMALE && S.gender == MALE) - continue - if( !(species in S.species_allowed)) - continue - valid_hairstyles[hairstyle] = hair_styles_list[hairstyle] + if(secmsg != null) + secmsg = copytext(secmsg, 1, MAX_PAPER_MESSAGE_LEN) + secmsg = html_encode(secmsg) - if(valid_hairstyles.len) - h_style = pick(valid_hairstyles) - else - //this shouldn't happen - h_style = hair_styles_list["Bald"] + sec_record = secmsg + SetRecords(user) + if(href_list["task"] == "gen_record") + var/genmsg = input(usr,"Set your employment notes here.","Employment Records",html_decode(gen_record)) as message - //grab one of the valid facial hair styles for the newly chosen species - var/list/valid_facialhairstyles = list() - for(var/facialhairstyle in facial_hair_styles_list) - var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle] - if(gender == MALE && S.gender == FEMALE) - continue - if(gender == FEMALE && S.gender == MALE) - continue - if( !(species in S.species_allowed)) - continue + if(genmsg != null) + genmsg = copytext(genmsg, 1, MAX_PAPER_MESSAGE_LEN) + genmsg = html_encode(genmsg) - valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle] + gen_record = genmsg + SetRecords(user) - if(valid_facialhairstyles.len) - f_style = pick(valid_facialhairstyles) - else - //this shouldn't happen - f_style = facial_hair_styles_list["Shaved"] + else if (href_list["preference"] == "antagoptions") + if(text2num(href_list["active"]) == 0) + SetAntagoptions(user) + return + if (href_list["antagtask"] == "uplinktype") + if (uplinklocation == "PDA") + uplinklocation = "Headset" + else if(uplinklocation == "Headset") + uplinklocation = "None" + else + uplinklocation = "PDA" + SetAntagoptions(user) + if (href_list["antagtask"] == "done") + user << browse(null, "window=antagoptions") + ShowChoices(user) + return 1 - //reset hair colour and skin colour - r_hair = 0//hex2num(copytext(new_hair, 2, 4)) - g_hair = 0//hex2num(copytext(new_hair, 4, 6)) - b_hair = 0//hex2num(copytext(new_hair, 6, 8)) + else if (href_list["preference"] == "loadout") - s_tone = 0 + if(href_list["task"] == "input") - if("language") - var/languages_available - var/list/new_languages = list("None") - var/datum/species/S = all_species[species] + var/list/valid_gear_choices = list() - if(config.usealienwhitelist) - for(var/L in all_languages) - var/datum/language/lang = all_languages[L] - if((!(lang.flags & RESTRICTED)) && (is_alien_whitelisted(user, L)||(!( lang.flags & WHITELISTED ))||(S && (L in S.secondary_langs)))) - new_languages += lang + for(var/gear_name in gear_datums) + var/datum/gear/G = gear_datums[gear_name] + if(G.whitelisted && !is_alien_whitelisted(user, G.whitelisted)) + continue + valid_gear_choices += gear_name - languages_available = 1 + var/choice = input(user, "Select gear to add: ") as null|anything in valid_gear_choices - if(!(languages_available)) - alert(user, "There are not currently any available secondary languages.") + if(choice && gear_datums[choice]) + + var/total_cost = 0 + + if(isnull(gear) || !islist(gear)) gear = list() + + if(gear && gear.len) + for(var/gear_name in gear) + if(gear_datums[gear_name]) + var/datum/gear/G = gear_datums[gear_name] + total_cost += G.cost + + var/datum/gear/C = gear_datums[choice] + total_cost += C.cost + if(C && total_cost <= MAX_GEAR_COST) + gear += choice + user << "\blue Added [choice] for [C.cost] points ([MAX_GEAR_COST - total_cost] points remaining)." + else + user << "\red That item will exceed the maximum loadout cost of [MAX_GEAR_COST] points." + + else if(href_list["task"] == "remove") + var/to_remove = href_list["gear"] + if(!to_remove) return + for(var/gear_name in gear) + if(gear_name == to_remove) + gear -= gear_name + break + + switch(href_list["task"]) + if("random") + switch(href_list["preference"]) + if("name") + real_name = random_name(gender) + if("age") + age = rand(AGE_MIN, AGE_MAX) + if("hair") + r_hair = rand(0,255) + g_hair = rand(0,255) + b_hair = rand(0,255) + if("h_style") + h_style = random_hair_style(gender, species) + if("facial") + r_facial = rand(0,255) + g_facial = rand(0,255) + b_facial = rand(0,255) + if("f_style") + f_style = random_facial_hair_style(gender, species) + if("underwear") + underwear = rand(1,underwear_m.len) + ShowChoices(user) + if("undershirt") + undershirt = rand(1,undershirt_t.len) + ShowChoices(user) + if("eyes") + r_eyes = rand(0,255) + g_eyes = rand(0,255) + b_eyes = rand(0,255) + if("s_tone") + s_tone = random_skin_tone() + if("s_color") + r_skin = rand(0,255) + g_skin = rand(0,255) + b_skin = rand(0,255) + if("bag") + backbag = rand(1,4) + /*if("skin_style") + h_style = random_skin_style(gender)*/ + if("all") + randomize_appearance_for() //no params needed + if("input") + switch(href_list["preference"]) + if("name") + var/raw_name = input(user, "Choose your character's name:", "Character Preference") as text|null + if (!isnull(raw_name)) // Check to ensure that the user entered text (rather than cancel.) + var/new_name = reject_bad_name(raw_name) + if(new_name) + real_name = new_name else - for(var/L in all_languages) - var/datum/language/lang = all_languages[L] - if(!(lang.flags & RESTRICTED)) - new_languages += lang.name + user << "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and ." - language = input("Please select a secondary language", "Character Generation", null) in new_languages + if("age") + var/new_age = input(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference") as num|null + if(new_age) + age = max(min( round(text2num(new_age)), AGE_MAX),AGE_MIN) + if("species") - if("metadata") - var/new_metadata = input(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , metadata) as message|null - if(new_metadata) - metadata = sanitize(copytext(new_metadata,1,MAX_MESSAGE_LEN)) + var/list/new_species = list("Human") + var/prev_species = species + var/whitelisted = 0 - if("b_type") - var/new_b_type = input(user, "Choose your character's blood-type:", "Character Preference") as null|anything in list( "A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-" ) - if(new_b_type) - b_type = new_b_type + if(config.usealienwhitelist) //If we're using the whitelist, make sure to check it! + for(var/S in whitelisted_species) + if(is_alien_whitelisted(user,S)) + new_species += S + whitelisted = 1 + if(!whitelisted) + alert(user, "You cannot change your species as you need to be whitelisted. If you wish to be whitelisted contact an admin in-game, on the forums, or on IRC.") + else //Not using the whitelist? Aliens for everyone! + new_species = whitelisted_species - if("hair") - if(species == "Human" || species == "Unathi" || species == "Tajaran" || species == "Skrell") - var/new_hair = input(user, "Choose your character's hair colour:", "Character Preference") as color|null - if(new_hair) - r_hair = hex2num(copytext(new_hair, 2, 4)) - g_hair = hex2num(copytext(new_hair, 4, 6)) - b_hair = hex2num(copytext(new_hair, 6, 8)) + species = input("Please select a species", "Character Generation", null) in new_species - if("h_style") + if(prev_species != species) + //grab one of the valid hair styles for the newly chosen species var/list/valid_hairstyles = list() for(var/hairstyle in hair_styles_list) var/datum/sprite_accessory/S = hair_styles_list[hairstyle] + if(gender == MALE && S.gender == FEMALE) + continue + if(gender == FEMALE && S.gender == MALE) + continue if( !(species in S.species_allowed)) continue - valid_hairstyles[hairstyle] = hair_styles_list[hairstyle] - var/new_h_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in valid_hairstyles - if(new_h_style) - h_style = new_h_style + if(valid_hairstyles.len) + h_style = pick(valid_hairstyles) + else + //this shouldn't happen + h_style = hair_styles_list["Bald"] - if("facial") - var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference") as color|null - if(new_facial) - r_facial = hex2num(copytext(new_facial, 2, 4)) - g_facial = hex2num(copytext(new_facial, 4, 6)) - b_facial = hex2num(copytext(new_facial, 6, 8)) - - if("f_style") + //grab one of the valid facial hair styles for the newly chosen species var/list/valid_facialhairstyles = list() for(var/facialhairstyle in facial_hair_styles_list) var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle] @@ -1180,375 +1093,462 @@ datum/preferences valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle] - var/new_f_style = input(user, "Choose your character's facial-hair style:", "Character Preference") as null|anything in valid_facialhairstyles - if(new_f_style) - f_style = new_f_style - - if("underwear") - var/list/underwear_options - if(gender == MALE) - underwear_options = underwear_m + if(valid_facialhairstyles.len) + f_style = pick(valid_facialhairstyles) else - underwear_options = underwear_f + //this shouldn't happen + f_style = facial_hair_styles_list["Shaved"] - var/new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in underwear_options - if(new_underwear) - underwear = underwear_options.Find(new_underwear) - ShowChoices(user) + //reset hair colour and skin colour + r_hair = 0//hex2num(copytext(new_hair, 2, 4)) + g_hair = 0//hex2num(copytext(new_hair, 4, 6)) + b_hair = 0//hex2num(copytext(new_hair, 6, 8)) - if("undershirt") - var/list/undershirt_options - undershirt_options = undershirt_t + s_tone = 0 - var/new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in undershirt_options - if (new_undershirt) - undershirt = undershirt_options.Find(new_undershirt) - ShowChoices(user) + if("language") + var/languages_available + var/list/new_languages = list("None") + var/datum/species/S = all_species[species] - if("eyes") - var/new_eyes = input(user, "Choose your character's eye colour:", "Character Preference") as color|null - if(new_eyes) - r_eyes = hex2num(copytext(new_eyes, 2, 4)) - g_eyes = hex2num(copytext(new_eyes, 4, 6)) - b_eyes = hex2num(copytext(new_eyes, 6, 8)) + if(config.usealienwhitelist) + for(var/L in all_languages) + var/datum/language/lang = all_languages[L] + if((!(lang.flags & RESTRICTED)) && (is_alien_whitelisted(user, L)||(!( lang.flags & WHITELISTED ))||(S && (L in S.secondary_langs)))) + new_languages += lang - if("s_tone") - if(species != "Human") - return - var/new_s_tone = input(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference") as num|null - if(new_s_tone) - s_tone = 35 - max(min( round(new_s_tone), 220),1) + languages_available = 1 - if("skin") - if(species == "Unathi" || species == "Tajaran" || species == "Skrell") - var/new_skin = input(user, "Choose your character's skin colour: ", "Character Preference") as color|null - if(new_skin) - r_skin = hex2num(copytext(new_skin, 2, 4)) - g_skin = hex2num(copytext(new_skin, 4, 6)) - b_skin = hex2num(copytext(new_skin, 6, 8)) + if(!(languages_available)) + alert(user, "There are not currently any available secondary languages.") + else + for(var/L in all_languages) + var/datum/language/lang = all_languages[L] + if(!(lang.flags & RESTRICTED)) + new_languages += lang.name - if("ooccolor") - var/new_ooccolor = input(user, "Choose your OOC colour:", "Game Preference") as color|null - if(new_ooccolor) - ooccolor = new_ooccolor + language = input("Please select a secondary language", "Character Generation", null) in new_languages - if("bag") - var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference") as null|anything in backbaglist - if(new_backbag) - backbag = backbaglist.Find(new_backbag) + if("metadata") + var/new_metadata = input(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , metadata) as message|null + if(new_metadata) + metadata = sanitize(copytext(new_metadata,1,MAX_MESSAGE_LEN)) - if("nt_relation") - var/new_relation = input(user, "Choose your relation to NT. Note that this represents what others can find out about your character by researching your background, not what your character actually thinks.", "Character Preference") as null|anything in list("Loyal", "Supportive", "Neutral", "Skeptical", "Opposed") - if(new_relation) - nanotrasen_relation = new_relation + if("b_type") + var/new_b_type = input(user, "Choose your character's blood-type:", "Character Preference") as null|anything in list( "A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-" ) + if(new_b_type) + b_type = new_b_type - if("disabilities") - if(text2num(href_list["disabilities"]) >= -1) - if(text2num(href_list["disabilities"]) >= 0) - disabilities ^= (1<= -1) + if(text2num(href_list["disabilities"]) >= 0) + disabilities ^= (1<= 50)) return + UI_style_alpha = UI_style_alpha_new - var/new_state = input(user, "What state do you wish the limb to be in?") as null|anything in list("Normal","Amputated","Prothesis") - if(!new_state) return + if("be_special") + var/num = text2num(href_list["num"]) + be_special ^= (1<= 50)) return - UI_style_alpha = UI_style_alpha_new +/datum/preferences/proc/copy_to(mob/living/carbon/human/character, safety = 0) + if(be_random_name) + real_name = random_name(gender) - if("be_special") - var/num = text2num(href_list["num"]) - be_special ^= (1< underwear_m.len || underwear < 1) - underwear = 0 //I'm sure this is 100% unnecessary, but I'm paranoid... sue me. //HAH NOW NO MORE MAGIC CLONING UNDIES - character.underwear = underwear + if(underwear > underwear_m.len || underwear < 1) + underwear = 0 //I'm sure this is 100% unnecessary, but I'm paranoid... sue me. //HAH NOW NO MORE MAGIC CLONING UNDIES + character.underwear = underwear - if(undershirt > undershirt_t.len || undershirt < 1) - undershirt = 0 - character.undershirt = undershirt + if(undershirt > undershirt_t.len || undershirt < 1) + undershirt = 0 + character.undershirt = undershirt - if(backbag > 4 || backbag < 1) - backbag = 1 //Same as above - character.backbag = backbag + if(backbag > 4 || backbag < 1) + backbag = 1 //Same as above + character.backbag = backbag - //Debugging report to track down a bug, which randomly assigned the plural gender to people. - if(character.gender in list(PLURAL, NEUTER)) - if(isliving(src)) //Ghosts get neuter by default - message_admins("[character] ([character.ckey]) has spawned with their gender as plural or neuter. Please notify coders.") - character.gender = MALE + //Debugging report to track down a bug, which randomly assigned the plural gender to people. + if(character.gender in list(PLURAL, NEUTER)) + if(isliving(src)) //Ghosts get neuter by default + message_admins("[character] ([character.ckey]) has spawned with their gender as plural or neuter. Please notify coders.") + character.gender = MALE - proc/open_load_dialog(mob/user) - var/dat = "" - dat += "
" +/datum/preferences/proc/open_load_dialog(mob/user) + var/dat = "" + dat += "
" - var/savefile/S = new /savefile(path) - if(S) - dat += "Select a character slot to load
" - var/name - for(var/i=1, i<=MAX_SAVE_SLOTS, i++) - S.cd = "/character[i]" - S["real_name"] >> name - if(!name) name = "Character[i]" - if(i==default_slot) - name = "[name]" - dat += "[name]
" + var/savefile/S = new /savefile(path) + if(S) + dat += "Select a character slot to load
" + var/name + for(var/i=1, i<=MAX_SAVE_SLOTS, i++) + S.cd = "/character[i]" + S["real_name"] >> name + if(!name) name = "Character[i]" + if(i==default_slot) + name = "[name]" + dat += "[name]
" - dat += "
" - dat += "Close
" - dat += "
" - user << browse(dat, "window=saves;size=300x390") + dat += "
" + dat += "Close
" + dat += "
" + user << browse(dat, "window=saves;size=300x390") - proc/close_load_dialog(mob/user) - user << browse(null, "window=saves") +/datum/preferences/proc/close_load_dialog(mob/user) + user << browse(null, "window=saves") diff --git a/code/modules/mob/living/silicon/pai/recruit.dm b/code/modules/mob/living/silicon/pai/recruit.dm index 89812a15f4e..1304e8453f3 100644 --- a/code/modules/mob/living/silicon/pai/recruit.dm +++ b/code/modules/mob/living/silicon/pai/recruit.dm @@ -24,92 +24,223 @@ var/datum/paiController/paiController // Global handler for pAI candidates var/askDelay = 10 * 60 * 1 // One minute [ms * sec * min] - Topic(href, href_list[]) - if(href_list["download"]) - var/datum/paiCandidate/candidate = locate(href_list["candidate"]) - var/obj/item/device/paicard/card = locate(href_list["device"]) - if(card.pai) +/datum/paiController/Topic(href, href_list[]) + if(href_list["download"]) + var/datum/paiCandidate/candidate = locate(href_list["candidate"]) + var/obj/item/device/paicard/card = locate(href_list["device"]) + if(card.pai) + return + if(istype(card,/obj/item/device/paicard) && istype(candidate,/datum/paiCandidate)) + var/mob/living/silicon/pai/pai = new(card) + if(!candidate.name) + pai.name = pick(ninja_names) + else + pai.name = candidate.name + pai.real_name = pai.name + pai.key = candidate.key + + card.setPersonality(pai) + card.looking_for_personality = 0 + + ticker.mode.update_cult_icons_removed(card.pai.mind) + ticker.mode.update_rev_icons_removed(card.pai.mind) + + pai_candidates -= candidate + usr << browse(null, "window=findPai") + + if(href_list["new"]) + var/datum/paiCandidate/candidate = locate(href_list["candidate"]) + var/option = href_list["option"] + var/t = "" + + switch(option) + if("name") + t = input("Enter a name for your pAI", "pAI Name", candidate.name) as text + if(t) + candidate.name = copytext(sanitize(t),1,MAX_NAME_LEN) + if("desc") + t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message + if(t) + candidate.description = copytext(sanitize(t),1,MAX_MESSAGE_LEN) + if("role") + t = input("Enter a role for your pAI", "pAI Role", candidate.role) as text + if(t) + candidate.role = copytext(sanitize(t),1,MAX_MESSAGE_LEN) + if("ooc") + t = input("Enter any OOC comments", "pAI OOC Comments", candidate.comments) as message + if(t) + candidate.comments = copytext(sanitize(t),1,MAX_MESSAGE_LEN) + if("save") + candidate.savefile_save(usr) + if("load") + candidate.savefile_load(usr) + //In case people have saved unsanitized stuff. + if(candidate.name) + candidate.name = copytext(sanitize(candidate.name),1,MAX_NAME_LEN) + if(candidate.description) + candidate.description = copytext(sanitize(candidate.description),1,MAX_MESSAGE_LEN) + if(candidate.role) + candidate.role = copytext(sanitize(candidate.role),1,MAX_MESSAGE_LEN) + if(candidate.comments) + candidate.comments = copytext(sanitize(candidate.comments),1,MAX_MESSAGE_LEN) + + if("submit") + if(candidate) + candidate.ready = 1 + for(var/obj/item/device/paicard/p in world) + if(p.looking_for_personality == 1) + p.alertUpdate() + usr << browse(null, "window=paiRecruit") return - if(istype(card,/obj/item/device/paicard) && istype(candidate,/datum/paiCandidate)) - var/mob/living/silicon/pai/pai = new(card) - if(!candidate.name) - pai.name = pick(ninja_names) - else - pai.name = candidate.name - pai.real_name = pai.name - pai.key = candidate.key + recruitWindow(usr) - card.setPersonality(pai) - card.looking_for_personality = 0 - - ticker.mode.update_cult_icons_removed(card.pai.mind) - ticker.mode.update_rev_icons_removed(card.pai.mind) - - pai_candidates -= candidate - usr << browse(null, "window=findPai") - - if(href_list["new"]) - var/datum/paiCandidate/candidate = locate(href_list["candidate"]) - var/option = href_list["option"] - var/t = "" - - switch(option) - if("name") - t = input("Enter a name for your pAI", "pAI Name", candidate.name) as text - if(t) - candidate.name = copytext(sanitize(t),1,MAX_NAME_LEN) - if("desc") - t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message - if(t) - candidate.description = copytext(sanitize(t),1,MAX_MESSAGE_LEN) - if("role") - t = input("Enter a role for your pAI", "pAI Role", candidate.role) as text - if(t) - candidate.role = copytext(sanitize(t),1,MAX_MESSAGE_LEN) - if("ooc") - t = input("Enter any OOC comments", "pAI OOC Comments", candidate.comments) as message - if(t) - candidate.comments = copytext(sanitize(t),1,MAX_MESSAGE_LEN) - if("save") - candidate.savefile_save(usr) - if("load") - candidate.savefile_load(usr) - //In case people have saved unsanitized stuff. - if(candidate.name) - candidate.name = copytext(sanitize(candidate.name),1,MAX_NAME_LEN) - if(candidate.description) - candidate.description = copytext(sanitize(candidate.description),1,MAX_MESSAGE_LEN) - if(candidate.role) - candidate.role = copytext(sanitize(candidate.role),1,MAX_MESSAGE_LEN) - if(candidate.comments) - candidate.comments = copytext(sanitize(candidate.comments),1,MAX_MESSAGE_LEN) - - if("submit") - if(candidate) - candidate.ready = 1 - for(var/obj/item/device/paicard/p in world) - if(p.looking_for_personality == 1) - p.alertUpdate() - usr << browse(null, "window=paiRecruit") - return - recruitWindow(usr) - - proc/recruitWindow(var/mob/M as mob) - var/datum/paiCandidate/candidate - for(var/datum/paiCandidate/c in pai_candidates) - if(!istype(c) || !istype(M)) - break - if(c.key == M.key) - candidate = c - if(!candidate) - candidate = new /datum/paiCandidate() - candidate.key = M.key - pai_candidates.Add(candidate) +/datum/paiController/proc/recruitWindow(var/mob/M as mob) + var/datum/paiCandidate/candidate + for(var/datum/paiCandidate/c in pai_candidates) + if(!istype(c) || !istype(M)) + break + if(c.key == M.key) + candidate = c + if(!candidate) + candidate = new /datum/paiCandidate() + candidate.key = M.key + pai_candidates.Add(candidate) - var/dat = "" - dat += {" - + "} + + dat += {" + + pAI Personality Configuration +

Please configure your pAI personality's options. Remember, what you enter here could determine whether or not the user requesting a personality chooses you!

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:[candidate.name] 
What you plan to call yourself. Suggestions: Any character name you would choose for a station character OR an AI.
Description:[candidate.description] 
What sort of pAI you typically play; your mannerisms, your quirks, etc. This can be as sparse or as detailed as you like.
Preferred Role:[candidate.role] 
Do you like to partner with sneaky social ninjas? Like to help security hunt down thugs? Enjoy watching an engineer's back while he saves the station yet again? This doesn't have to be limited to just station jobs. Pretty much any general descriptor for what you'd like to be doing works here.
OOC Comments:[candidate.comments] 
Anything you'd like to address specifically to the player reading this in an OOC manner. \"I prefer more serious RP.\", \"I'm still learning the interface!\", etc. Feel free to leave this blank if you want.
+
+ + + + + + + +
+ Save Personality +
+ Load Personality +

+ + +
Submit Personality

+ + + "} + + M << browse(dat, "window=paiRecruit;size=580x580;") + +/datum/paiController/proc/findPAI(var/obj/item/device/paicard/p, var/mob/user) + requestRecruits() + var/list/available = list() + for(var/datum/paiCandidate/c in paiController.pai_candidates) + if(c.ready) + var/found = 0 + for(var/mob/dead/observer/o in player_list) + if(o.key == c.key) + found = 1 + if(found) + available.Add(c) + var/dat = "" + + dat += {" + + + + - "} + + + pAI Availability List

+ "} + dat += "

Displaying available AI personalities from central database... If there are no entries, or if a suitable entry is not listed, check again later as more personalities may be added.

" + for(var/datum/paiCandidate/c in available) dat += {" - - pAI Personality Configuration -

Please configure your pAI personality's options. Remember, what you enter here could determine whether or not the user requesting a personality chooses you!

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Name:[candidate.name] 
What you plan to call yourself. Suggestions: Any character name you would choose for a station character OR an AI.
Description:[candidate.description] 
What sort of pAI you typically play; your mannerisms, your quirks, etc. This can be as sparse or as detailed as you like.
Preferred Role:[candidate.role] 
Do you like to partner with sneaky social ninjas? Like to help security hunt down thugs? Enjoy watching an engineer's back while he saves the station yet again? This doesn't have to be limited to just station jobs. Pretty much any general descriptor for what you'd like to be doing works here.
OOC Comments:[candidate.comments] 
Anything you'd like to address specifically to the player reading this in an OOC manner. \"I prefer more serious RP.\", \"I'm still learning the interface!\", etc. Feel free to leave this blank if you want.
-
- - -
- Save Personality + + + + + + + + + + + + + + + + + +
Name:[c.name]
Description:[c.description]
Preferred Role:[c.role]
OOC Comments:[c.comments]
+ + - - - - -
Download [c.name]
- Load Personality -

- - -
Submit Personality

- - +
+
"} - M << browse(dat, "window=paiRecruit;size=580x580;") + dat += {" + + + "} - proc/findPAI(var/obj/item/device/paicard/p, var/mob/user) - requestRecruits() - var/list/available = list() - for(var/datum/paiCandidate/c in paiController.pai_candidates) - if(c.ready) - var/found = 0 - for(var/mob/dead/observer/o in player_list) - if(o.key == c.key) - found = 1 - if(found) - available.Add(c) - var/dat = "" + user << browse(dat, "window=findPai") - dat += {" - - - - - - - pAI Availability List

- "} - dat += "

Displaying available AI personalities from central database... If there are no entries, or if a suitable entry is not listed, check again later as more personalities may be added.

" - - for(var/datum/paiCandidate/c in available) - dat += {" - - - - - - - - - - - - - - - - - -
Name:[c.name]
Description:[c.description]
Preferred Role:[c.role]
OOC Comments:[c.comments]
- - -
Download [c.name] -
-
- "} - - dat += {" - - - "} - - user << browse(dat, "window=findPai") - - proc/requestRecruits() - for(var/mob/dead/observer/O in player_list) - if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted) +/datum/paiController/proc/requestRecruits() + for(var/mob/dead/observer/O in player_list) + if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted) + continue + if(jobban_isbanned(O, "pAI")) + continue + if(asked.Find(O.key)) + if(world.time < asked[O.key] + askDelay) continue - if(jobban_isbanned(O, "pAI")) - continue - if(asked.Find(O.key)) - if(world.time < asked[O.key] + askDelay) - continue - else - asked.Remove(O.key) - if(O.client) - var/hasSubmitted = 0 - for(var/datum/paiCandidate/c in paiController.pai_candidates) - if(c.key == O.key) - hasSubmitted = 1 - if(!hasSubmitted && (O.client.prefs.be_special & BE_PAI)) - question(O.client) + else + asked.Remove(O.key) + if(O.client) + var/hasSubmitted = 0 + for(var/datum/paiCandidate/c in paiController.pai_candidates) + if(c.key == O.key) + hasSubmitted = 1 + if(!hasSubmitted && (O.client.prefs.be_special & BE_PAI)) + question(O.client) - proc/question(var/client/C) - spawn(0) - if(!C) return - asked.Add(C.key) - asked[C.key] = world.time - var/response = alert(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", "Yes", "No", "Never for this round") - if(!C) return //handle logouts that happen whilst the alert is waiting for a response. - if(response == "Yes") - recruitWindow(C.mob) - else if (response == "Never for this round") - var/warning = alert(C, "Are you sure? This action will be undoable and you will need to wait until next round.", "You sure?", "Yes", "No") - if(warning == "Yes") - asked[C.key] = INFINITY - else - question(C) +/datum/paiController/proc/question(var/client/C) + spawn(0) + if(!C) return + asked.Add(C.key) + asked[C.key] = world.time + var/response = alert(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", "Yes", "No", "Never for this round") + if(!C) return //handle logouts that happen whilst the alert is waiting for a response. + if(response == "Yes") + recruitWindow(C.mob) + else if (response == "Never for this round") + var/warning = alert(C, "Are you sure? This action will be undoable and you will need to wait until next round.", "You sure?", "Yes", "No") + if(warning == "Yes") + asked[C.key] = INFINITY + else + question(C)