diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index e3d10e6c27..f9b05a3afe 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -167,8 +167,6 @@ var/assignment = GetAssignment(H) var/id = generate_record_id() - var/icon/front = new(get_id_photo(H), dir = SOUTH) - var/icon/side = new(get_id_photo(H), dir = WEST) //General Record var/datum/data/record/G = CreateGeneralRecord(H, id) G.fields["name"] = H.real_name @@ -227,7 +225,7 @@ /proc/generate_record_id() return add_zero(num2hex(rand(1, 65535)), 4) //no point generating higher numbers because of the limitations of num2hex -/proc/get_id_photo(var/mob/living/carbon/human/H) +/proc/get_id_photo(var/mob/living/carbon/human/H, var/assigned_role) var/icon/preview_icon = null var/g = "m" diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index e20619141c..108fd45f27 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1324,7 +1324,7 @@ proc/admin_notice(var/message, var/rights) return log_and_message_admins("attempting to force mode autospawn.") - ticker.mode.process_autoantag() + ticker.mode.try_latespawn() /datum/admins/proc/paralyze_mob(mob/living/H as mob) set category = "Admin" @@ -1345,9 +1345,9 @@ proc/admin_notice(var/message, var/rights) set category = "Debug" set name = "Set Telecrystals" set desc = "Allows admins to change telecrystals of a user." - + var/crystals - + if(check_rights(R_ADMIN)) crystals = input("Amount of telecrystals for [H.ckey]", crystals) as null|num if (!isnull(crystals)) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 28cc880584..73531b82e2 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -239,677 +239,7 @@ datum/preferences else return 0 - 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 << "Added \the '[choice]' for [C.cost] points ([MAX_GEAR_COST - total_cost] points remaining)." - else - user << "Adding \the '[choice]' will exceed the maximum loadout cost of [MAX_GEAR_COST] points." - - else if(href_list["task"] == "remove") - var/i_remove = text2num(href_list["gear"]) - if(i_remove < 1 || i_remove > gear.len) return - gear.Cut(i_remove, i_remove + 1) - - else if(href_list["task"] == "clear") - gear.Cut() - - 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 = sanitize(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, extra = 0) - flavor_texts[href_list["task"]] = msg - else - var/msg = sanitize(input(usr,"Set the flavor text for your [href_list["task"]].","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message, extra = 0) - flavor_texts[href_list["task"]] = msg - SetFlavorText(user) - return - - else if(href_list["preference"] == "flavour_text_robot") - switch(href_list["task"]) - if("open") - SetFlavourTextRobot(user) - return - if("done") - user << browse(null, "window=flavour_text_robot") - ShowChoices(user) - return - if("Default") - var/msg = sanitize(input(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting.","Flavour Text",html_decode(flavour_texts_robot["Default"])) as message, extra = 0) - flavour_texts_robot[href_list["task"]] = msg - else - var/msg = sanitize(input(usr,"Set the flavour text for your robot with [href_list["task"]] module. If you leave this empty, default flavour text will be used for this module.","Flavour Text",html_decode(flavour_texts_robot[href_list["task"]])) as message, extra = 0) - flavour_texts_robot[href_list["task"]] = msg - SetFlavourTextRobot(user) - return - - else if(href_list["preference"] == "pAI") - paiController.recruitWindow(user, 0) - return 1 - - else if(href_list["preference"] == "records") - if(text2num(href_list["record"]) >= 1) - SetRecords(user) - return - else - user << browse(null, "window=records") - if(href_list["task"] == "med_record") - var/medmsg = sanitize(input(usr,"Set your medical notes here.","Medical Records",html_decode(med_record)) as message, MAX_PAPER_MESSAGE_LEN, extra = 0) - if(medmsg != null) - med_record = medmsg - SetRecords(user) - - if(href_list["task"] == "sec_record") - var/secmsg = sanitize(input(usr,"Set your security notes here.","Security Records",html_decode(sec_record)) as message, MAX_PAPER_MESSAGE_LEN, extra = 0) - if(secmsg != null) - sec_record = secmsg - SetRecords(user) - if(href_list["task"] == "gen_record") - var/genmsg = sanitize(input(usr,"Set your employment notes here.","Employment Records",html_decode(gen_record)) as message, MAX_PAPER_MESSAGE_LEN, extra = 0) - if(genmsg != null) - gen_record = genmsg - SetRecords(user) - - if(href_list["task"] == "exploitable_record") - var/exploitmsg = sanitize(input(usr,"Set exploitable information about you here.","Exploitable Information",html_decode(exploit_record)) as message, MAX_PAPER_MESSAGE_LEN, extra = 0) - if(exploitmsg != null) - exploit_record = exploitmsg - SetAntagoptions(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") - - if(isnull(gear) || !islist(gear)) - gear = list() - if(!gear.len) - return - - var/choice = input(user, "Select gear to remove: ") as null|anything in gear - if(!choice) - return - - for(var/gear_name in gear) - if(gear_name == choice) - gear -= gear_name - break - - switch(href_list["task"]) - if("change") - if(href_list["preference"] == "species") - // Actual whitelist checks are handled elsewhere, this is just for accessing the preview window. - var/choice = input("Which species would you like to look at?") as null|anything in playable_species - if(!choice) return - species_preview = choice - SetSpecies(user) - - if("random") - switch(href_list["preference"]) - if("name") - real_name = random_name(gender,species) - 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") - var/r = pick(underwear_m) - underwear = underwear_m[r] - ShowChoices(user) - if("undershirt") - var/r = pick(undershirt_t) - undershirt = undershirt_t[r] - 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 - var/datum/species/S = all_species[species] - if(istype(S)) - new_name = S.sanitize_name(raw_name) - else - new_name = sanitizeName(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("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") - user << browse(null, "window=species") - var/prev_species = species - species = href_list["newspecies"] - 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(valid_hairstyles.len) - h_style = pick(valid_hairstyles) - else - //this shouldn't happen - h_style = hair_styles_list["Bald"] - - //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 - - valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle] - - if(valid_facialhairstyles.len) - f_style = pick(valid_facialhairstyles) - else - //this shouldn't happen - f_style = facial_hair_styles_list["Shaved"] - - //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)) - - s_tone = 0 - - if("language") - var/languages_available - var/list/new_languages = list("None") - var/datum/species/S = all_species[species] - - 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 - - languages_available = 1 - - 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 - - language = input("Please select a secondary language", "Character Generation", null) in new_languages - - 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(new_metadata) - - 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("hair") - if(species == "Human" || species == "Unathi" || species == "Tajara" || species == "Skrell") - var/new_hair = input(user, "Choose your character's hair colour:", "Character Preference", rgb(r_hair, g_hair, b_hair)) 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)) - - if("h_style") - var/list/valid_hairstyles = list() - for(var/hairstyle in hair_styles_list) - var/datum/sprite_accessory/S = hair_styles_list[hairstyle] - 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("facial") - var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference", rgb(r_facial, g_facial, b_facial)) 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") - 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 - - 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 - else - underwear_options = underwear_f - - var/new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in underwear_options - if(new_underwear) - underwear = underwear_options[new_underwear] - ShowChoices(user) - - if("undershirt") - var/list/undershirt_options - undershirt_options = undershirt_t - - var/new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in undershirt_options - if (new_undershirt) - undershirt = undershirt_options[new_undershirt] - ShowChoices(user) - - if("eyes") - var/new_eyes = input(user, "Choose your character's eye colour:", "Character Preference", rgb(r_eyes, g_eyes, b_eyes)) 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("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) - - if("skin") - if(species == "Unathi" || species == "Tajara" || species == "Skrell") - var/new_skin = input(user, "Choose your character's skin colour: ", "Character Preference", rgb(r_skin, g_skin, b_skin)) 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("ooccolor") - var/new_ooccolor = input(user, "Choose your OOC colour:", "Game Preference") as color|null - if(new_ooccolor) - ooccolor = new_ooccolor - - 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("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("disabilities") - if(text2num(href_list["disabilities"]) >= -1) - if(text2num(href_list["disabilities"]) >= 0) - disabilities ^= (1<= 50)) return - UI_style_alpha = UI_style_alpha_new - - if("be_special") - var/num = text2num(href_list["num"]) - be_special ^= (1<> metadata - S["real_name"] >> real_name - S["name_is_always_random"] >> be_random_name - S["gender"] >> gender - S["age"] >> age - S["species"] >> species - S["language"] >> language - S["spawnpoint"] >> spawnpoint - - //colors to be consolidated into hex strings (requires some work with dna code) - S["hair_red"] >> r_hair - S["hair_green"] >> g_hair - S["hair_blue"] >> b_hair - S["facial_red"] >> r_facial - S["facial_green"] >> g_facial - S["facial_blue"] >> b_facial - S["skin_tone"] >> s_tone - S["skin_red"] >> r_skin - S["skin_green"] >> g_skin - S["skin_blue"] >> b_skin - S["hair_style_name"] >> h_style - S["facial_style_name"] >> f_style - S["eyes_red"] >> r_eyes - S["eyes_green"] >> g_eyes - S["eyes_blue"] >> b_eyes - S["underwear"] >> underwear - S["undershirt"] >> undershirt - S["backbag"] >> backbag - S["b_type"] >> b_type - - //Jobs - S["alternate_option"] >> alternate_option - S["job_civilian_high"] >> job_civilian_high - S["job_civilian_med"] >> job_civilian_med - S["job_civilian_low"] >> job_civilian_low - S["job_medsci_high"] >> job_medsci_high - S["job_medsci_med"] >> job_medsci_med - S["job_medsci_low"] >> job_medsci_low - S["job_engsec_high"] >> job_engsec_high - S["job_engsec_med"] >> job_engsec_med - S["job_engsec_low"] >> job_engsec_low - - //Flavour Text - S["flavor_texts_general"] >> flavor_texts["general"] - S["flavor_texts_head"] >> flavor_texts["head"] - S["flavor_texts_face"] >> flavor_texts["face"] - S["flavor_texts_eyes"] >> flavor_texts["eyes"] - S["flavor_texts_torso"] >> flavor_texts["torso"] - S["flavor_texts_arms"] >> flavor_texts["arms"] - S["flavor_texts_hands"] >> flavor_texts["hands"] - S["flavor_texts_legs"] >> flavor_texts["legs"] - S["flavor_texts_feet"] >> flavor_texts["feet"] - - //Flavour text for robots. - S["flavour_texts_robot_Default"] >> flavour_texts_robot["Default"] - for(var/module in robot_module_types) - S["flavour_texts_robot_[module]"] >> flavour_texts_robot[module] - - //Miscellaneous - S["med_record"] >> med_record - S["sec_record"] >> sec_record - S["gen_record"] >> gen_record - S["be_special"] >> be_special - S["disabilities"] >> disabilities - S["player_alt_titles"] >> player_alt_titles - S["used_skillpoints"] >> used_skillpoints - S["skills"] >> skills - S["skill_specialization"] >> skill_specialization - S["organ_data"] >> organ_data - S["rlimb_data"] >> rlimb_data - S["gear"] >> gear - S["home_system"] >> home_system - S["citizenship"] >> citizenship - S["faction"] >> faction - S["religion"] >> religion - - S["nanotrasen_relation"] >> nanotrasen_relation - //S["skin_style"] >> skin_style - - S["uplinklocation"] >> uplinklocation - S["exploit_record"] >> exploit_record - - S["UI_style_color"] << UI_style_color - S["UI_style_alpha"] << UI_style_alpha - - //Sanitize - metadata = sanitize_text(metadata, initial(metadata)) - - if(isnull(species) || !(species in playable_species)) - species = "Human" - - var/datum/species/cur_species = all_species[species] - if(istype(cur_species)) - real_name = cur_species.sanitize_name(real_name) - else - real_name = sanitizeName(real_name) - - if(isnum(underwear)) - var/list/undies = gender == MALE ? underwear_m : underwear_f - underwear = undies[undies[underwear]] - - if(isnum(undershirt)) - undershirt = undershirt_t[undershirt_t[undershirt]] - - if(isnull(language)) language = "None" - if(isnull(spawnpoint)) spawnpoint = "Arrivals Shuttle" - if(isnull(nanotrasen_relation)) nanotrasen_relation = initial(nanotrasen_relation) - if(!real_name) real_name = random_name(gender) - be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name)) - gender = sanitize_gender(gender) - age = sanitize_integer(age, AGE_MIN, AGE_MAX, initial(age)) - r_hair = sanitize_integer(r_hair, 0, 255, initial(r_hair)) - g_hair = sanitize_integer(g_hair, 0, 255, initial(g_hair)) - b_hair = sanitize_integer(b_hair, 0, 255, initial(b_hair)) - r_facial = sanitize_integer(r_facial, 0, 255, initial(r_facial)) - g_facial = sanitize_integer(g_facial, 0, 255, initial(g_facial)) - b_facial = sanitize_integer(b_facial, 0, 255, initial(b_facial)) - s_tone = sanitize_integer(s_tone, -185, 34, initial(s_tone)) - r_skin = sanitize_integer(r_skin, 0, 255, initial(r_skin)) - g_skin = sanitize_integer(g_skin, 0, 255, initial(g_skin)) - b_skin = sanitize_integer(b_skin, 0, 255, initial(b_skin)) - h_style = sanitize_inlist(h_style, hair_styles_list, initial(h_style)) - f_style = sanitize_inlist(f_style, facial_hair_styles_list, initial(f_style)) - r_eyes = sanitize_integer(r_eyes, 0, 255, initial(r_eyes)) - g_eyes = sanitize_integer(g_eyes, 0, 255, initial(g_eyes)) - b_eyes = sanitize_integer(b_eyes, 0, 255, initial(b_eyes)) - backbag = sanitize_integer(backbag, 1, backbaglist.len, initial(backbag)) - b_type = sanitize_text(b_type, initial(b_type)) - - alternate_option = sanitize_integer(alternate_option, 0, 2, initial(alternate_option)) - job_civilian_high = sanitize_integer(job_civilian_high, 0, 65535, initial(job_civilian_high)) - job_civilian_med = sanitize_integer(job_civilian_med, 0, 65535, initial(job_civilian_med)) - job_civilian_low = sanitize_integer(job_civilian_low, 0, 65535, initial(job_civilian_low)) - job_medsci_high = sanitize_integer(job_medsci_high, 0, 65535, initial(job_medsci_high)) - job_medsci_med = sanitize_integer(job_medsci_med, 0, 65535, initial(job_medsci_med)) - job_medsci_low = sanitize_integer(job_medsci_low, 0, 65535, initial(job_medsci_low)) - job_engsec_high = sanitize_integer(job_engsec_high, 0, 65535, initial(job_engsec_high)) - job_engsec_med = sanitize_integer(job_engsec_med, 0, 65535, initial(job_engsec_med)) - job_engsec_low = sanitize_integer(job_engsec_low, 0, 65535, initial(job_engsec_low)) - - if(!skills) skills = list() - if(!used_skillpoints) used_skillpoints= 0 - if(isnull(disabilities)) disabilities = 0 - if(!player_alt_titles) player_alt_titles = new() - if(!organ_data) src.organ_data = list() - if(!rlimb_data) src.rlimb_data = list() - if(!gear) src.gear = list() - //if(!skin_style) skin_style = "Default" - - if(!home_system) home_system = "Unset" - if(!citizenship) citizenship = "None" - if(!faction) faction = "None" - if(!religion) religion = "None" - + player_setup.load_character(S) return 1 /datum/preferences/proc/save_character() @@ -244,4 +90,4 @@ return 1 #undef SAVEFILE_VERSION_MAX -#undef SAVEFILE_VERSION_MIN +#undef SAVEFILE_VERSION_MIN \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index b430bd05d5..3acaabdab3 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -272,7 +272,6 @@ for(var/obj/item/organ/external/temp in organs) if(temp) if(temp.status & ORGAN_DESTROYED) - is_destroyed["[temp.name]"] = 1 wound_flavor_text["[temp.name]"] = "[T.He] [T.is] missing [T.his] [temp.name].\n" continue if(!is_synth && temp.status & ORGAN_ROBOT) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 5b8dd4a472..801c730a00 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -733,32 +733,6 @@ return 0 return 1 -/mob/living/carbon/human/proc/vomit() - - if(!check_has_mouth()) - return - if(stat == DEAD) - return - if(!lastpuke) - lastpuke = 1 - src << "You feel nauseous..." - spawn(150) //15 seconds until second warning - src << "You feel like you are about to throw up!" - spawn(100) //and you have 10 more for mad dash to the bucket - Stun(5) - - src.visible_message("[src] throws up!","You throw up!") - playsound(loc, 'sound/effects/splat.ogg', 50, 1) - - var/turf/location = loc - if (istype(location, /turf/simulated)) - location.add_vomit_floor(src, 1) - - nutrition -= 40 - adjustToxLoss(-3) - spawn(350) //wait 35 seconds before next volley - lastpuke = 0 - /mob/living/carbon/human/proc/morph() set name = "Morph" set category = "Superpower" diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index c1b85a1c99..01da722636 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -146,7 +146,8 @@ emp_act for(var/obj/item/organ/external/O in organs) O.emp_act(severity) for(var/obj/item/organ/I in O.internal_organs) - if(I.robotic == 0) continue + if(!(I.status & ORGAN_ROBOT)) + continue I.emp_act(severity) ..() diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm new file mode 100644 index 0000000000..437c9d06a5 --- /dev/null +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -0,0 +1,37 @@ +#define HUMAN_EATING_NO_ISSUE 0 +#define HUMAN_EATING_NO_MOUTH 1 +#define HUMAN_EATING_BLOCKED_MOUTH 2 + +/mob/living/carbon/human/can_eat(var/food, var/feedback = 1) + var/list/status = can_eat_status() + if(status[1] == HUMAN_EATING_NO_ISSUE) + return 1 + if(feedback) + if(status[1] == HUMAN_EATING_NO_MOUTH) + src << "Where do you intend to put \the [food]? You don't have a mouth!" + else if(status[1] == HUMAN_EATING_BLOCKED_MOUTH) + src << "\The [status[2]] is in the way!" + return 0 + +/mob/living/carbon/human/can_force_feed(var/feeder, var/food, var/feedback = 1) + var/list/status = can_eat_status() + if(status[1] == HUMAN_EATING_NO_ISSUE) + return 1 + if(feedback) + if(status[1] == HUMAN_EATING_NO_MOUTH) + feeder << "Where do you intend to put \the [food]? \The [src] doesn't have a mouth!" + else if(status[1] == HUMAN_EATING_BLOCKED_MOUTH) + feeder << "\The [status[2]] is in the way!" + return 0 + +/mob/living/carbon/human/proc/can_eat_status() + if(!check_has_mouth()) + return list(HUMAN_EATING_NO_MOUTH) + var/obj/item/blocked = check_mouth_coverage() + if(blocked) + return list(HUMAN_EATING_BLOCKED_MOUTH, blocked) + return list(HUMAN_EATING_NO_ISSUE) + +#undef HUMAN_EATING_NO_ISSUE +#undef HUMAN_EATING_NO_MOUTH +#undef HUMAN_EATING_BLOCKED_MOUTH diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 8535308222..577f4bb896 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -168,9 +168,6 @@ inherent_verbs = list() inherent_verbs |= /mob/living/carbon/human/proc/regurgitate -/datum/species/proc/sanitize_name(var/new_name) - return sanitizeName(new_name) - /datum/species/proc/get_station_variant() return name diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index b613fc0df2..bc5b609b89 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -466,6 +466,12 @@ proc/is_blind(A) /mob/proc/is_client_active(var/active = 1) return client && client.inactivity < active MINUTES +/mob/proc/can_eat() + return 1 + +/mob/proc/can_force_feed() + return 1 + #define SAFE_PERP -50 /mob/living/proc/assess_perp(var/obj/access_obj, var/check_access, var/auth_weapons, var/check_records, var/check_arrest) if(stat == DEAD) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 2e7848e2c6..bfcf1aefa3 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -345,17 +345,14 @@ obj/structure/cable/proc/cableColor(var/colorC) var/turf/T // Handle up/down cables - if(d1 == 11 || d1 == 12 || d2 == 11 || d2 == 12) - var/turf/controllerlocation = locate(1, 1, z) - for(var/obj/effect/landmark/zcontroller/controller in controllerlocation) - if(controller.up && (d1 == 12 || d2 == 12)) - T = locate(src.x, src.y, controller.up_target) - if(T) - . += power_list(T, src, 11, 1) - if(controller.down && (d1 == 11 || d2 == 11)) - T = locate(src.x, src.y, controller.down_target) - if(T) - . += power_list(T, src, 12, 1) + if(d1 == 11 || d2 == 11) + T = GetBelow(src) + if(T) + . += power_list(T, src, 12, 1) + if(d1 == 12 || d1 == 12) + T = GetAbove(src) + if(T) + . += power_list(T, src, 11, 1) // Handle standard cables in adjacent turfs for(var/cable_dir in list(d1, d2)) @@ -467,7 +464,6 @@ obj/structure/cable/proc/cableColor(var/colorC) slot_flags = SLOT_BELT item_state = "coil" attack_verb = list("whipped", "lashed", "disciplined", "flogged") - stacktype = /obj/item/stack/cable_coil /obj/item/stack/cable_coil/cyborg name = "cable coil synthesizer" @@ -887,4 +883,4 @@ obj/structure/cable/proc/cableColor(var/colorC) /obj/item/stack/cable_coil/random/New() stacktype = /obj/item/stack/cable_coil color = pick(COLOR_RED, COLOR_BLUE, COLOR_LIME, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN) - ..() + ..() \ No newline at end of file diff --git a/code/modules/reagents/reagent_containers/food/drinks/jar.dm b/code/modules/reagents/reagent_containers/food/drinks/jar.dm index 47abb8637a..b4d305bae7 100644 --- a/code/modules/reagents/reagent_containers/food/drinks/jar.dm +++ b/code/modules/reagents/reagent_containers/food/drinks/jar.dm @@ -1,7 +1,4 @@ - - ///jar - /obj/item/weapon/reagent_containers/food/drinks/jar name = "empty jar" desc = "A jar. You're not sure what it's supposed to hold." @@ -9,23 +6,20 @@ item_state = "beaker" center_of_mass = list("x"=15, "y"=8) unacidable = 1 - New() - ..() - reagents.add_reagent("slime", 50) - on_reagent_change() - if (reagents.reagent_list.len > 0) - switch(reagents.get_master_reagent_id()) - if("slime") - icon_state = "jar_slime" - name = "slime jam" - desc = "A jar of slime jam. Delicious!" - else - icon_state ="jar_what" - name = "jar of something" - desc = "You can't really tell what this is." - else - icon_state = "jar" - name = "empty jar" - desc = "A jar. You're not sure what it's supposed to hold." - return +/obj/item/weapon/reagent_containers/food/drinks/jar/on_reagent_change() + if (reagents.reagent_list.len > 0) + switch(reagents.get_master_reagent_id()) + if("slime") + icon_state = "jar_slime" + name = "slime jam" + desc = "A jar of slime jam. Delicious!" + else + icon_state ="jar_what" + name = "jar of something" + desc = "You can't really tell what this is." + else + icon_state = "jar" + name = "empty jar" + desc = "A jar. You're not sure what it's supposed to hold." + return diff --git a/polaris.dme b/polaris.dme index df6a2c7bfe..ef45df9118 100644 --- a/polaris.dme +++ b/polaris.dme @@ -1349,6 +1349,7 @@ #include "code\modules\mob\living\carbon\human\human_damage.dm" #include "code\modules\mob\living\carbon\human\human_defense.dm" #include "code\modules\mob\living\carbon\human\human_defines.dm" +#include "code\modules\mob\living\carbon\human\human_helpers.dm" #include "code\modules\mob\living\carbon\human\human_movement.dm" #include "code\modules\mob\living\carbon\human\human_organs.dm" #include "code\modules\mob\living\carbon\human\human_powers.dm"