//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33 #define UI_OLD 0 #define UI_NEW 1 var/global/list/special_roles = list( //keep synced with the defines BE_* in setup.dm --rastaf //some autodetection here. "traitor" = IS_MODE_COMPILED("traitor"), // 0 "operative" = IS_MODE_COMPILED("nuclear"), // 1 "changeling" = IS_MODE_COMPILED("changeling"), // 2 "wizard" = IS_MODE_COMPILED("wizard"), // 3 "malf AI" = IS_MODE_COMPILED("malfunction"), // 4 "revolutionary" = IS_MODE_COMPILED("revolution"), // 5 "alien candidate" = 1, //always show // 6 "pAI candidate" = 1, // -- TLE // 7 "cultist" = IS_MODE_COMPILED("cult"), // 8 "infested monkey" = IS_MODE_COMPILED("monkey"), // 9 "meme" = IS_MODE_COMPILED("meme"), // 10 ) var/const/BE_TRAITOR =(1<<0) var/const/BE_OPERATIVE =(1<<1) var/const/BE_CHANGELING=(1<<2) var/const/BE_WIZARD =(1<<3) var/const/BE_MALF =(1<<4) var/const/BE_REV =(1<<5) var/const/BE_ALIEN =(1<<6) var/const/BE_PAI =(1<<7) var/const/BE_CULTIST =(1<<8) var/const/BE_MONKEY =(1<<9) var/const/BE_MEME =(1<<10) datum/preferences var/real_name var/be_random_name = 0 var/gender = MALE var/age = 30.0 var/b_type = "A+" //Special role selection var/be_special = 0 //Play admin midis var/midis = 1 //Toggle ghost ears var/ghost_ears = 1 var/ghost_sight = 1 //Play pregame music var/pregame_music = 1 //Saved changlog filesize to detect if there was a change var/lastchangelog = 0 //Just like it sounds var/ooccolor = "#b82e00" var/underwear = 1 var/list/underwear_m = list("White", "Grey", "Green", "Blue", "Black", "None") //Curse whoever made male/female underwear diffrent colours var/list/underwear_f = list("Red", "White", "Yellow", "Blue", "Black", "None") var/backbag = 2 var/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Alt") //Hair type var/h_style = "Short Hair" var/datum/sprite_accessory/hair/hair_style //Hair color var/r_hair = 0 var/g_hair = 0 var/b_hair = 0 //Face hair type var/f_style = "Shaved" var/datum/sprite_accessory/facial_hair/facial_hair_style //Face hair color var/r_facial = 0 var/g_facial = 0 var/b_facial = 0 //Species var/species = "Human" //Skin color var/s_tone = 0 //Eye color var/r_eyes = 0 var/g_eyes = 0 var/b_eyes = 0 //UI style //UI = UI_OLD var/UI_style = "Midnight" //Mob preview var/icon/preview_icon = null var/preview_dir = SOUTH //Jobs, uses bitflags var/job_civilian_high = 0 var/job_civilian_med = 0 var/job_civilian_low = 0 var/job_medsci_high = 0 var/job_medsci_med = 0 var/job_medsci_low = 0 var/job_engsec_high = 0 var/job_engsec_med = 0 var/job_engsec_low = 0 var/list/job_alt_titles = new() // the default name of a job like "Medical Doctor" var/flavor_text = "" var/med_record = "" var/sec_record = "" // slot stuff (Why were they var/var? --SkyMarshal) var/slotname var/curslot = 0 var/disabilities = 0 var/used_skillpoints = 0 var/skill_specialization = null var/list/skills = list() // skills can range from 0 to 3 // OOC Metadata: var/metadata = "" New() hair_style = new/datum/sprite_accessory/hair/short facial_hair_style = new/datum/sprite_accessory/facial_hair/shaved randomize_name() ..() //proc for making sentences Do This As An Example. For names. proc/simple_titlecase(string) string = uppertext(copytext(string,1,2)) + copytext(string, 2) var/space_pos = findtext(string, " ") var/strlen = length(string) while(space_pos) string = copytext(string,1,space_pos+1) + \ uppertext(copytext(string, space_pos+1, space_pos+2)) + \ ((space_pos+2 <= strlen) ? copytext(string, space_pos+2) : "") space_pos = findtext(string, " ", space_pos+1) //In case of a trailing space if(space_pos >= strlen) return string return string 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 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 if(S.secondary) HTML += "" else HTML += "" HTML += "" HTML += "" HTML += "" HTML += "
[V]" HTML += "
[S.name]\[Untrained\]\[Amateur\]\[Trained\]\[Professional\]
" HTML += "\[Done\]" user << browse(null, "window=preferences") user << browse(HTML, "window=show_skills;size=600x800") return proc/ShowChoices(mob/user) update_preview_icon() user << browse_rsc(preview_icon, "previewicon.png") var/dat = "" dat += "Name: " dat += "[real_name] " dat += "(®) " dat += "(® = [be_random_name ? "Yes" : "No"])" dat += "
" dat += "Gender: [gender == MALE ? "Male" : "Female"]
" dat += "Age: [age]" dat += "
" dat += "UI Style: [UI_style]
" dat += "Play admin midis: [midis == 1 ? "Yes" : "No"]
" dat += "Ghost ears: [ghost_ears == 0 ? "Nearest Creatures" : "All Speech"]
" dat += "Ghost sight: [ghost_sight == 0 ? "Nearest Creatures" : "All Emotes"]
" if(config.allow_Metadata) dat += "OOC Notes: Edit
" if((user.client) && (user.client.holder) && (user.client.holder.rank) && (user.client.holder.level >= 5)) dat += "
OOC
" dat += "Change colour
__
" dat += "
Occupation Choices
" dat += "\tSet Preferences
" dat += "
Skill Choices
" dat += "\t[GetSkillClass(used_skillpoints)] ([used_skillpoints])
" dat += "\tSet Skills
" dat += "
Body " dat += "(®)" // Random look dat += "
" dat += "Species: [species]
" dat += "Blood Type: [b_type]
" dat += "Skin Tone: [-s_tone + 35]/220
" // if(!IsGuestKey(user.key))//Seeing as it doesn't do anything, it may as well not show up. if(gender == MALE) dat += "Underwear: [underwear_m[underwear]]
" else dat += "Underwear: [underwear_f[underwear]]
" dat += "Backpack Type:
[backbaglist[backbag]]
" dat += "
Preview
" dat += "<" dat += "" dat += ">" 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 += "
Disabilities
" if(jobban_isbanned(user, "Records")) dat += "
You are banned from using character records.
" else dat += "
Character Records
" dat += "
Flavor Text
" dat += "Change
" if(lentext(flavor_text) <= 40) dat += "[flavor_text]" else dat += "[copytext(flavor_text, 1, 37)]..." 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 += "
" // slot options if (!IsGuestKey(user.key)) if(!curslot) curslot = 1 slotname = savefile_getslots(user)[1] dat += "Save Slot [curslot] ([slotname])
" dat += "Load
" dat += "Create New Slot
" dat += "Reset Setup
" dat += "" user << browse(dat, "window=preferences;size=300x710") proc/loadsave(mob/user) var/dat = "" dat += "
" var/list/slots = savefile_getslots(user) for(var/slot=1, slot<=slots.len, slot++) dat += "Load Slot [slot] ([slots[slot]]) (R)

" dat += "Close
" dat += "
" user << browse(dat, "window=saves;size=300x640") proc/closesave(mob/user) user << browse(null, "window=saves;size=300x640") 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
" if(lentext(med_record) <= 40) HTML += "[med_record]" else HTML += "[copytext(med_record, 1, 37)]..." HTML += "

Security Records
" if(lentext(sec_record) <= 40) HTML += "[sec_record]
" else HTML += "[copytext(sec_record, 1, 37)]...
" HTML += "
" HTML += "\[Done\]" HTML += "
" user << browse(null, "window=preferences") user << browse(HTML, "window=records;size=350x300") return proc/GetAltTitle(datum/job/job) return job_alt_titles.Find(job.title) > 0 \ ? job_alt_titles[job.title] \ : job.title proc/SetAltTitle(datum/job/job, new_title) // remove existing entry if(job_alt_titles.Find(job.title)) job_alt_titles -= job.title // add one if it's not default if(job.title != new_title) job_alt_titles[job.title] = new_title proc/SetChoices(mob/user, limit = 17, list/splitJobs, width = 550, height = 500) //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. // Modify this if you added more jobs and it looks like a mess. Add the jobs in the splitJobs that you want to trigger and intitate a new table. if(splitJobs == null) if (ticker && ticker.current_state >= GAME_STATE_PLAYING) splitJobs = list() else splitJobs = list("Chief Engineer") var/HTML = "" HTML += "
" HTML += "Choose occupation chances
Unavailable occupations are in red.

" 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 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_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 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]" else HTML += " \[NEVER]" if(job.alt_titles) HTML += "\[[GetAltTitle(job)]\]" else HTML += "" HTML += "" user << browse(null, "window=preferences") user << browse(HTML, "window=mob_occupation;size=[width]x[height]") return 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 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) SetChoices(user) return 1 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 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 proc/process_link(mob/user, list/link_tags) if(!usr) return if(link_tags["occ"]) if(link_tags["cancel"]) user << browse(null, "window=\ref[user]occupation") return else if(link_tags["job"]) SetJob(user, link_tags["job"]) else if(job_master) SetChoices(user) return 1 if(link_tags["preview_dir"]) preview_dir = text2num(link_tags["preview_dir"]) if(link_tags["skills"]) if(link_tags["cancel"]) user << browse(null, "window=show_skills") ShowChoices(user) return else if(link_tags["skillinfo"]) var/datum/skill/S = locate(link_tags["skillinfo"]) var/HTML = "[S.name]
[S.desc]" user << browse(HTML, "window=\ref[user]skillinfo") else if(link_tags["setskill"]) var/datum/skill/S = locate(link_tags["setskill"]) var/value = text2num(link_tags["newvalue"]) skills[S.ID] = value CalculateSkillPoints() SetSkills(user) else if(link_tags["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(link_tags["setspecialization"]) skill_specialization = link_tags["setspecialization"] CalculateSkillPoints() SetSkills(user) else SetSkills(user) return 1 if(link_tags["alt_title"] && link_tags["job"]) var/datum/job/job = locate(link_tags["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(link_tags["real_name"]) var/new_name switch(link_tags["real_name"]) if("input") new_name = copytext( (input(user, "Please select a name:", "Character Generation") as text) ,1,MAX_NAME_LEN) var/list/bad_characters = list("_", "'", "\"", "<", ">", ";", "\[", "\]", "{", "}", "|", "\\","0","1","2","3","4","5","6","7","8","9") for(var/c in bad_characters) new_name = dd_replacetext(new_name, c, "") if(!new_name || (new_name == "Unknown") || (new_name == "floor") || (new_name == "wall") || (new_name == "r-wall")) alert("Invalid name. Don't do that!") return //Make it so number one. (means you can have names like McMillian). Credit to: Jtgibson new_name = simple_titlecase(new_name) /* //Carn: To fix BYOND text-parsing errors caused by people using dumb capitalisation in their names. var/tempname for(var/N in dd_text2list(new_name, " ")) if(N && tempname) //if both aren't null strings tempname += " " tempname += capitalize(lowertext(N)) new_name = tempname */ if("random") randomize_name() if(new_name) real_name = new_name if(link_tags["age"]) switch(link_tags["age"]) if("input") var/new_age = input(user, "Please enter an age ([minimum_age]-[maximum_age])", "Character Generation") as num if(new_age) age = max(min(round(text2num(new_age)), maximum_age), minimum_age) if("random") age = rand (minimum_age, maximum_age) if(link_tags["OOC"]) var/tempnote = "" tempnote = copytext(sanitize(input(user, "Please enter your OOC Notes!:", "OOC notes" , metadata) as text),1,MAX_MESSAGE_LEN) if(tempnote) metadata = tempnote return if(link_tags["b_type"]) switch(link_tags["b_type"]) if("input") var/new_b_type = input(user, "Please select a blood type:", "Character Generation") as null|anything in list( "A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-" ) if(new_b_type) b_type = new_b_type if("random") b_type = pickweight ( list ("A+" = 31, "A-" = 7, "B+" = 8, "B-" = 2, "AB+" = 2, "AB-" = 1, "O+" = 40, "O-" = 9)) if(link_tags["species"]) switch(link_tags["species"]) if("input") var/list/new_species = list("Human") var/prev_species = species if(config.usealienwhitelist) //If we're using the whitelist, make sure to check it! if(is_alien_whitelisted(user, "Soghun")) //Check for Soghun and admins new_species += "Soghun" if(is_alien_whitelisted(user, "Tajaran")) //Check for Tajaran and admins new_species += "Tajaran" if(is_alien_whitelisted(user, "Skrell")) //Check for Skrell and admins new_species += "Skrell" else //Not using the whitelist? Aliens for everyone! new_species += "Tajaran" new_species += "Soghun" new_species += "Skrell" species = input("Please select a species", "Character Generation", null) in new_species if(prev_species != species) h_style = "Bald" //Try not to carry face/head hair over. f_style = "Shaved" s_tone = 0 //Don't carry over skintone either. hair_style = new/datum/sprite_accessory/hair/bald facial_hair_style = new/datum/sprite_accessory/facial_hair/shaved if(species == "Skrell") if(gender == FEMALE) hair_style = new/datum/sprite_accessory/hair/alien/skrell/female/tentacle else hair_style = new/datum/sprite_accessory/hair/alien/skrell/male/tentacle if(link_tags["hair"]) switch(link_tags["hair"]) if("input") var/new_hair = input(user, "Please select hair color.", "Character Generation") as color 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)) if("random") randomize_hair_color("hair") if(link_tags["facial"]) switch(link_tags["facial"]) if("input") var/new_facial = input(user, "Please select facial hair color.", "Character Generation") as color 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("random") randomize_hair_color("facial") if(link_tags["eyes"]) switch(link_tags["eyes"]) if("input") var/new_eyes = input(user, "Please select eye color.", "Character Generation") as color 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("random") randomize_eyes_color() if(link_tags["s_tone"]) switch(link_tags["s_tone"]) if("random") randomize_skin_tone() if("input") var/new_tone = input(user, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black) or 20-70 for other species.", "Character Generation") as num if(new_tone) if(species != "Human") s_tone = max(min(round(text2num(new_tone)), 70), 20) else s_tone = max(min(round(text2num(new_tone)), 220), 1) s_tone = -s_tone + 35 if(link_tags["h_style"]) if(species == "Tajaran" || species == "Soghun") return switch(link_tags["h_style"]) // New and improved hair selection code, by Doohl if("random") // random hair selection randomize_hair(gender) // call randomize_hair() proc with var/gender parameter // see preferences_setup.dm for proc if("input") // input hair selection // Generate list of hairs via typesof() var/list/all_hairs = typesof(/datum/sprite_accessory/hair) - /datum/sprite_accessory/hair - typesof(/datum/sprite_accessory/hair/alien) if(species == "Skrell") if(gender == FEMALE) all_hairs = typesof(/datum/sprite_accessory/hair/alien/skrell/female) - /datum/sprite_accessory/hair/alien/skrell/female else all_hairs = typesof(/datum/sprite_accessory/hair/alien/skrell/male) - /datum/sprite_accessory/hair/alien/skrell/male // List of hair names var/list/hairs = list() // loop through potential hairs for(var/x in all_hairs) var/datum/sprite_accessory/hair/H = new x // create new hair datum based on type x hairs.Add(H.name) // add hair name to hairs del(H) // delete the hair after it's all done // prompt the user for a hair selection, the selection being anything in list hairs var/new_style = input(user, "Select a hair style", "Character Generation") as null|anything in hairs // if new style selected (not cancel) if(new_style) h_style = new_style for(var/x in all_hairs) // loop through all_hairs again. Might be slightly CPU expensive, but not significantly. var/datum/sprite_accessory/hair/H = new x // create new hair datum if(H.name == new_style) hair_style = H // assign the hair_style variable a new hair datum break else del(H) // if hair H not used, delete. BYOND can garbage collect, but better safe than sorry if(link_tags["ooccolor"]) var/ooccolor = input(user, "Please select OOC colour.", "OOC colour") as color if(ooccolor) src.ooccolor = ooccolor if(link_tags["f_style"]) if(species != "Human") //Non-humans don't have hair stuff yet. return switch(link_tags["f_style"]) // see above for commentation. This is just a slight modification of the hair code for facial hairs if("random") randomize_facial(gender) if("input") var/list/all_fhairs = typesof(/datum/sprite_accessory/facial_hair) - /datum/sprite_accessory/facial_hair var/list/fhairs = list() for(var/x in all_fhairs) var/datum/sprite_accessory/facial_hair/H = new x fhairs.Add(H.name) del(H) var/new_style = input(user, "Select a facial hair style", "Character Generation") as null|anything in fhairs if(new_style) f_style = new_style for(var/x in all_fhairs) var/datum/sprite_accessory/facial_hair/H = new x if(H.name == new_style) facial_hair_style = H break else del(H) if(link_tags["gender"]) if(gender == MALE) gender = FEMALE if(species == "Skrell") hair_style = new/datum/sprite_accessory/hair/alien/skrell/female/tentacle else gender = MALE if(species == "Skrell") hair_style = new/datum/sprite_accessory/hair/alien/skrell/male/tentacle if(link_tags["UI"]) switch(UI_style) if("Midnight") UI_style = "Orange" if("Orange") UI_style = "old" if("old") UI_style = "Midnight" else UI_style = "Midnight" if(link_tags["midis"]) midis = !midis if(link_tags["ghost_ears"]) ghost_ears = !ghost_ears if(link_tags["ghost_sight"]) ghost_sight = !ghost_sight if(link_tags["underwear"]) switch(link_tags["underwear"]) if("inputmale") var/tempUnderwear = input(user, "Please select your underwear colour:", "Character Generation") as null|anything in underwear_m if(tempUnderwear) underwear = underwear_m.Find(tempUnderwear) if("inputfemale") var/tempUnderwear = input(user, "Please select your underwear colour:", "Character Generation") as null|anything in underwear_f if(tempUnderwear) underwear = underwear_f.Find(tempUnderwear) if("random") if(prob (75)) underwear = pick(1,2,3,4,5) else underwear = 6 if(link_tags["backbag_type"]) switch(link_tags["backbag_type"]) if("input") var/tempBag = input(user, "Please pick a backpack type:", "Character Generation") as null|anything in backbaglist if(tempBag) backbag = backbaglist.Find(tempBag) if("random") backbag = pick(1,2,3) if(link_tags["be_special"]) src.be_special^=(1< 10) usr << "You have reached the character limit." return slotname = input(usr,"Choose a name for your slot","Name","Slot "+num2text(count)) curslot = savefile_createslot(user, slotname) if(!savefile_load(user, count)) alert(user, "You do not have a savefile.") else closesave(user) if(link_tags["reset_all"]) gender = MALE randomize_name() age = 30 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 job_alt_titles = new() underwear = 1 backbag = 2 be_special = 0 be_random_name = 0 r_hair = 0.0 g_hair = 0.0 b_hair = 0.0 r_facial = 0.0 g_facial = 0.0 b_facial = 0.0 h_style = "Short Hair" f_style = "Shaved" r_eyes = 0.0 g_eyes = 0.0 b_eyes = 0.0 s_tone = 0.0 b_type = "A+" //UI = UI_OLD UI_style = "Midnight" midis = 1 ghost_ears = 1 disabilities = 0 if(link_tags["disabilities"]) if(text2num(link_tags["disabilities"]) >= -1) if(text2num(link_tags["disabilities"]) >= 0) disabilities ^= (1<= 1) SetRecords(user) return else user << browse(null, "window=records") if(link_tags["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(link_tags["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) ShowChoices(user) proc/copy_to(mob/living/carbon/human/character, safety = 0) if(be_random_name) randomize_name() character.real_name = real_name character.original_name = real_name //Original name is only used in ghost chat! It is not to be edited by anything! character.species = species character.flavor_text = flavor_text character.med_record = med_record character.sec_record = sec_record character.gender = gender character.age = age character.dna.b_type = b_type character.r_eyes = r_eyes character.g_eyes = g_eyes character.b_eyes = b_eyes character.r_hair = r_hair character.g_hair = g_hair character.b_hair = b_hair character.r_facial = r_facial character.g_facial = g_facial character.b_facial = b_facial character.s_tone = s_tone character.h_style = h_style character.f_style = f_style switch(UI_style) if("Midnight") character.UI = 'screen1_Midnight.dmi' if("Orange") character.UI = 'screen1_Orange.dmi' if("old") character.UI = 'screen1_old.dmi' else character.UI = 'screen1_Midnight.dmi' character.hair_style = hair_style character.facial_hair_style = facial_hair_style if(underwear > 6 || underwear < 1) underwear = 1 //I'm sure this is 100% unnecessary, but I'm paranoid... sue me. character.underwear = underwear if(backbag > 4 || backbag < 1) backbag = 1 //Same as above character.backbag = backbag character.used_skillpoints = used_skillpoints character.skill_specialization = skill_specialization character.skills = skills character.update_face() character.update_body() if(!safety)//To prevent run-time errors due to null datum when using randomize_appearance_for() spawn(10) if(character&&character.client) setup_client(character.client) proc/copy_to_observer(mob/dead/observer/character) spawn(10) if(character && character.client) setup_client(character.client) proc/setup_client(var/client/C) if(C) C.midis = src.midis C.ooccolor = src.ooccolor C.be_alien = be_special & BE_ALIEN C.be_pai = be_special & BE_PAI C.be_syndicate = be_special if(isnull(src.ghost_ears)) src.ghost_ears = 1 //There were problems where the default was null before someone saved their profile. C.ghost_ears = src.ghost_ears C.ghost_sight = src.ghost_sight proc/copydisabilities(mob/living/carbon/human/character) if(disabilities & 1) character.dna.struc_enzymes = setblock(character.dna.struc_enzymes,GLASSESBLOCK,toggledblock(getblock(character.dna.struc_enzymes,GLASSESBLOCK,3)),3) if(disabilities & 2) character.dna.struc_enzymes = setblock(character.dna.struc_enzymes,HEADACHEBLOCK,toggledblock(getblock(character.dna.struc_enzymes,HEADACHEBLOCK,3)),3) if(disabilities & 4) character.dna.struc_enzymes = setblock(character.dna.struc_enzymes,COUGHBLOCK,toggledblock(getblock(character.dna.struc_enzymes,COUGHBLOCK,3)),3) if(disabilities & 8) character.dna.struc_enzymes = setblock(character.dna.struc_enzymes,TWITCHBLOCK,toggledblock(getblock(character.dna.struc_enzymes,TWITCHBLOCK,3)),3) if(disabilities & 16) character.dna.struc_enzymes = setblock(character.dna.struc_enzymes,NERVOUSBLOCK,toggledblock(getblock(character.dna.struc_enzymes,NERVOUSBLOCK,3)),3) if(disabilities & 32) character.dna.struc_enzymes = setblock(character.dna.struc_enzymes,DEAFBLOCK,toggledblock(getblock(character.dna.struc_enzymes,DEAFBLOCK,3)),3) //if(disabilities & 64) //mute //if(disabilities & 128) //character.dna.struc_enzymes = setblock(character.dna.struc_enzymes,BLINDBLOCK,toggledblock(getblock(character.dna.struc_enzymes,BLINDBLOCK,3)),3) character.disabilities = disabilities #undef UI_OLD #undef UI_NEW
" var/rank = job.title lastJob = job if(jobban_isbanned(user, rank)) HTML += "[rank] \[BANNED]
" HTML += "" if(rank == "Assistant")//Assistant is special if(job_civilian_low & ASSISTANT) HTML += " \[Yes]" else HTML += " \[No]" HTML += "