diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 9156b5b416a..df7e4f18901 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -1,14 +1,37 @@ proc/random_hair_style(gender, species = "Human") - switch(gender) - if(MALE) return pick(hair_styles_male_list) - if(FEMALE) return pick(hair_styles_female_list) - else return pick(hair_styles_list) + var/h_style = "Bald" + + var/list/valid_hairstyles = list() + for(var/hairstyle in hair_styles_list) + var/datum/sprite_accessory/S = hair_styles_list[hairstyle] + if(gender != S.gender) + continue + if(!(species in S.species_allowed)) + continue + valid_hairstyles[hairstyle] = hair_styles_list[hairstyle] + + if(valid_hairstyles.len) + h_style = pick(valid_hairstyles) + + return h_style proc/random_facial_hair_style(gender, species = "Human") - switch(gender) - if(MALE) return pick(facial_hair_styles_male_list) - if(FEMALE) return pick(facial_hair_styles_female_list) - else return pick(facial_hair_styles_list) + var/f_style = "Shaved" + + 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 != S.gender) + 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) + + return f_style proc/random_name(gender, species = "Human") if(gender==FEMALE) return capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index fd034fbf5ae..2ff200ae885 100755 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -1140,7 +1140,7 @@ proc/process_ghost_teleport_locs() icon_state = "cloning" /area/medical/sleeper - name = "\improper Emergency" + name = "\improper Medical Treatment Center" icon_state = "exam_room" //Security diff --git a/code/game/gamemodes/autotraitor/autotraitor.dm b/code/game/gamemodes/autotraitor/autotraitor.dm index de795b19222..a6da766b4e7 100644 --- a/code/game/gamemodes/autotraitor/autotraitor.dm +++ b/code/game/gamemodes/autotraitor/autotraitor.dm @@ -124,7 +124,12 @@ //message_admins("[newtraitor.real_name] is the new Traitor.") forge_traitor_objectives(newtraitor.mind) - equip_traitor(newtraitor) + + if(istype(newtraitor, /mob/living/silicon)) + add_law_zero(newtraitor) + else + equip_traitor(newtraitor) + traitors += newtraitor.mind newtraitor << "\red ATTENTION: \black It is time to pay your debt to the Syndicate..." newtraitor << "You are now a traitor." diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm index c877084339b..a7936f15643 100644 --- a/code/game/mecha/equipment/tools/tools.dm +++ b/code/game/mecha/equipment/tools/tools.dm @@ -21,6 +21,9 @@ if(!action_checks(target)) return if(!cargo_holder) return if(istype(target, /obj/structure/stool)) return + for(var/M in target.contents) + if(istype(M, /mob/living)) + return if(istype(target,/obj)) var/obj/O = target diff --git a/code/game/objects/items/weapons/manuals.dm b/code/game/objects/items/weapons/manuals.dm index cc2c284adce..0f65736b507 100644 --- a/code/game/objects/items/weapons/manuals.dm +++ b/code/game/objects/items/weapons/manuals.dm @@ -584,7 +584,7 @@ icon_state = "bookSpaceLaw" author = "Nanotrasen" title = "Space Law" - /*dat = {" + dat = {"
@@ -594,7 +594,7 @@ - "}*/ + "} /obj/item/weapon/book/manual/engineering_guide name = "Engineering Textbook" diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 1b65f1b7e13..22f484c5d7c 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -119,10 +119,11 @@ density = 1 return 1 -/obj/structure/closet/proc/toggle() - if(src.opened) - return src.close() - return src.open() +/obj/structure/closet/proc/toggle(mob/user as mob) + . = src.opened ? src.close() : src.open() + if(!.) + user << "It won't budge!" + return // this should probably use dump_contents() /obj/structure/closet/ex_act(severity) @@ -180,7 +181,6 @@ if(src.opened) if(istype(W, /obj/item/weapon/grab)) src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet - if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if(!WT.remove_fuel(0,user)) @@ -191,15 +191,11 @@ M.show_message("\The [src] has been cut apart by [user] with \the [WT].", 3, "You hear welding.", 2) del(src) return - if(isrobot(user)) return - usr.drop_item() - if(W) W.loc = src.loc - else if(istype(W, /obj/item/weapon/packageWrap)) return else if(istype(W, /obj/item/weapon/weldingtool)) @@ -207,7 +203,7 @@ if(!WT.remove_fuel(0,user)) user << "You need more welding fuel to complete this task." return - src.welded =! src.welded + src.welded = !src.welded src.update_icon() for(var/mob/M in viewers(src)) M.show_message("[src] has been [welded?"welded shut":"unwelded"] by [user.name].", 3, "You hear welding.", 2) @@ -257,9 +253,7 @@ /obj/structure/closet/attack_hand(mob/user as mob) src.add_fingerprint(user) - - if(!src.toggle()) - usr << "It won't budge!" + src.toggle(user) /obj/structure/closet/verb/verb_toggleopen() set src in oview(1) @@ -270,7 +264,8 @@ return if(ishuman(usr)) - src.attack_hand(usr) + src.add_fingerprint(usr) + src.toggle(usr) else usr << "This mob type can't use this verb." diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm index 74062c27759..f6ce5d6d81e 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm @@ -17,16 +17,17 @@ health = 200 /obj/structure/closet/secure_closet/can_open() - ..() if(src.locked) return 0 - return 1 + return ..() /obj/structure/closet/secure_closet/close() - ..() - if(broken) - icon_state = src.icon_off - return 1 + if(..()) + if(broken) + icon_state = src.icon_off + return 1 + else + return 0 /obj/structure/closet/secure_closet/emp_act(severity) for(var/obj/O in src) @@ -44,15 +45,21 @@ ..() /obj/structure/closet/secure_closet/proc/togglelock(mob/user as mob) + if(src.opened) + user << "Close the locker first." + return + if(src.broken) + user << "The locker appears to be broken." + return + if(user.loc == src) + user << "You can't reach the lock from inside." + return if(src.allowed(user)) src.locked = !src.locked for(var/mob/O in viewers(user, 3)) if((O.client && !( O.blinded ))) O << "The locker has been [locked ? null : "un"]locked by [user]." - if(src.locked) - src.icon_state = src.icon_locked - else - src.icon_state = src.icon_closed + update_icon() else user << "Access Denied" @@ -62,15 +69,12 @@ if(src.large) src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet else - user << "The locker is too small to stuff [W] into!" + user << "The locker is too small to stuff [W:affecting] into!" if(isrobot(user)) return user.drop_item() if(W) W.loc = src.loc - else if(src.broken) - user << "The locker appears to be broken." - return else if((istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && !src.broken) broken = 1 locked = 0 @@ -88,46 +92,17 @@ else for(var/mob/O in viewers(user, 3)) O.show_message("The locker has been broken by [user] with an electromagnetic card!", 1, "You hear a faint electrical spark.", 2) + else if(istype(W,/obj/item/weapon/packageWrap) || istype(W,/obj/item/weapon/weldingtool)) + return ..(W,user) else - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W - if(!WT.remove_fuel(0,user)) - user << "You need more welding fuel to complete this task." - return - src.welded =! src.welded - src.update_icon() - for(var/mob/M in viewers(src)) - M.show_message("[src] has been [welded?"welded shut":"unwelded"] by [user.name].", 3, "You hear welding.", 2) - else - togglelock(user) - -/obj/structure/closet/secure_closet/relaymove(mob/user as mob) - if(user.stat || !isturf(src.loc)) - return - - if(!(src.locked)) - for(var/obj/item/I in src) - I.loc = src.loc - for(var/mob/M in src) - M.loc = src.loc - if(M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE - src.icon_state = src.icon_opened - src.opened = 1 - else - user << "The locker is locked!" - if(world.time > lastbang+5) - lastbang = world.time - for(var/mob/M in hearers(src, null)) - M << "BANG, bang!" - return + togglelock(user) /obj/structure/closet/secure_closet/attack_hand(mob/user as mob) src.add_fingerprint(user) - - if(!src.toggle()) - return src.attackby(null, user) + if(src.locked) + src.togglelock(user) + else + src.toggle(user) /obj/structure/closet/secure_closet/attack_paw(mob/user as mob) return src.attack_hand(user) @@ -140,15 +115,9 @@ if(!usr.canmove || usr.stat || usr.restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain return - if(get_dist(usr, src) != 1) - return - - if(src.broken) - return - - if (ishuman(usr)) - if (!opened) - togglelock(usr) + if(ishuman(usr)) + src.add_fingerprint(usr) + src.togglelock(usr) else usr << "This mob type can't use this verb." diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index c2514a11241..04f18fe3b6a 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -102,7 +102,7 @@ if(iswirecutter(W)) if(!shock(user, 100)) playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1) - new /obj/item/stack/rods(loc) + new /obj/item/stack/rods(loc, 2) del(src) else if((isscrewdriver(W)) && (istype(loc, /turf/simulated) || anchored)) if(!shock(user, 90)) diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index c6a448be97e..0937e72d848 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -22,13 +22,31 @@ //handle facial hair (if necessary) if(H.gender == MALE) - var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in facial_hair_styles_list + var/list/species_facial_hair = list() + if(H.species) + for(var/i in facial_hair_styles_list) + var/datum/sprite_accessory/facial_hair/tmp_facial = facial_hair_styles_list[i] + if(H.species.name in tmp_facial.species_allowed) + species_facial_hair += i + else + species_facial_hair = facial_hair_styles_list + + var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in species_facial_hair if(userloc != H.loc) return //no tele-grooming if(new_style) H.f_style = new_style //handle normal hair - var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in hair_styles_list + var/list/species_hair = list() + if(H.species) + for(var/i in hair_styles_list) + var/datum/sprite_accessory/hair/tmp_hair = hair_styles_list[i] + if(H.species.name in tmp_hair.species_allowed) + species_hair += i + else + species_hair = hair_styles_list + + var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in species_hair if(userloc != H.loc) return //no tele-grooming if(new_style) H.h_style = new_style diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index 2f0a38f985b..34b4cacde93 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -48,7 +48,7 @@ proc/admin_proc() world << "you have enough rights!" NOTE: it checks usr! not src! So if you're checking somebody's rank in a proc which they did not call -you will have to do something like if(client.rights & R_ADMIN) yourself. +you will have to do something like if(client.holder.rights & R_ADMIN) yourself. */ /proc/check_rights(rights_required, show_msg=1) if(usr && usr.client) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 597ad94ebfd..f4cb339f045 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -764,13 +764,13 @@ datum/preferences g_hair = rand(0,255) b_hair = rand(0,255) if("h_style") - h_style = random_hair_style(gender) + 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) + f_style = random_facial_hair_style(gender, species) if("underwear") underwear = rand(1,underwear_m.len) ShowChoices(user) @@ -822,9 +822,7 @@ datum/preferences 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) + if(gender != S.gender) continue if( !(species in S.species_allowed)) continue @@ -840,9 +838,7 @@ datum/preferences 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) + if(gender != S.gender) continue if( !(species in S.species_allowed)) continue @@ -925,9 +921,7 @@ datum/preferences 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) + if(gender != S.gender) continue if( !(species in S.species_allowed)) continue diff --git a/code/modules/mob/living/carbon/alien/humanoid/emote.dm b/code/modules/mob/living/carbon/alien/humanoid/emote.dm index 087422810c3..71dc56ef402 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/emote.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/emote.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/alien/humanoid/emote(var/act) +/mob/living/carbon/alien/humanoid/emote(var/act,var/m_type=1,var/message = null) var/param = null if (findtext(act, "-", 1, null)) @@ -9,10 +9,25 @@ if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_' act = copytext(act,1,length(act)) var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) - var/m_type = 1 - var/message switch(act) + if ("me") + if(silent) + return + if (src.client) + if (client.prefs.muted & MUTE_IC) + src << "\red You cannot send IC messages (muted)." + return + if (src.client.handle_spam_prevention(message,MUTE_IC)) + return + if (stat) + return + if(!(message)) + return + return custom_emote(m_type, message) + + if ("custom") + return custom_emote(m_type, message) if("sign") if (!src.restrained()) message = text("The alien signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null)) diff --git a/code/modules/mob/living/carbon/alien/larva/emote.dm b/code/modules/mob/living/carbon/alien/larva/emote.dm index 2be246fe8fb..375c5c6b0c9 100644 --- a/code/modules/mob/living/carbon/alien/larva/emote.dm +++ b/code/modules/mob/living/carbon/alien/larva/emote.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/alien/larva/emote(var/act) +/mob/living/carbon/alien/larva/emote(var/act,var/m_type=1,var/message = null) var/param = null if (findtext(act, "-", 1, null)) @@ -9,10 +9,25 @@ if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_' act = copytext(act,1,length(act)) var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) - var/m_type = 1 - var/message switch(act) + if ("me") + if(silent) + return + if (src.client) + if (client.prefs.muted & MUTE_IC) + src << "\red You cannot send IC messages (muted)." + return + if (src.client.handle_spam_prevention(message,MUTE_IC)) + return + if (stat) + return + if(!(message)) + return + return custom_emote(m_type, message) + + if ("custom") + return custom_emote(m_type, message) if("sign") if (!src.restrained()) message = text("The alien signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null)) diff --git a/code/modules/mob/living/carbon/brain/emote.dm b/code/modules/mob/living/carbon/brain/emote.dm index 8f83bd390ab..1995ff5e1cc 100644 --- a/code/modules/mob/living/carbon/brain/emote.dm +++ b/code/modules/mob/living/carbon/brain/emote.dm @@ -12,6 +12,23 @@ if(src.stat == DEAD) return switch(act) + if ("me") + if(silent) + return + if (src.client) + if (client.prefs.muted & MUTE_IC) + src << "\red You cannot send IC messages (muted)." + return + if (src.client.handle_spam_prevention(message,MUTE_IC)) + return + if (stat) + return + if(!(message)) + return + return custom_emote(m_type, message) + + if ("custom") + return custom_emote(m_type, message) if ("alarm") src << "You sound an alarm." message = "[src] sounds an alarm." diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 4029fc46444..591e4426e09 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -63,7 +63,7 @@ else alert("Unable to use this emote, must be either hearable or visible.") return - message = "[src] [input]" + return custom_emote(m_type, message) if ("me") if(silent) @@ -78,7 +78,7 @@ return if(!(message)) return - message = "[src] [message]" + return custom_emote(m_type, message) if ("salute") if (!src.buckled) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index b8b87003274..e074d9caae8 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -282,40 +282,43 @@ wound_descriptors[this_wound_desc] += W.amount continue wound_descriptors[this_wound_desc] = W.amount - var/list/flavor_text = list() - var/list/no_exclude = list("gaping wound", "big gaping wound", "massive wound", "large bruise",\ - "huge bruise", "massive bruise", "severe burn", "large burn", "deep burn", "carbonised area") - for(var/wound in wound_descriptors) - switch(wound_descriptors[wound]) - if(1) - if(!flavor_text.len) - flavor_text += "[t_He] has[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]" - else - flavor_text += "[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]" - if(2) - if(!flavor_text.len) - flavor_text += "[t_He] has[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s" - else - flavor_text += "[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s" - if(3 to 5) - if(!flavor_text.len) - flavor_text += "[t_He] has several [wound]s" - else - flavor_text += " several [wound]s" - if(6 to INFINITY) - if(!flavor_text.len) - flavor_text += "[t_He] has a bunch of [wound]s" - else - flavor_text += " a ton of [wound]\s" - var/flavor_text_string = "" - for(var/text = 1, text <= flavor_text.len, text++) - if(text == flavor_text.len && flavor_text.len > 1) - flavor_text_string += ", and" - else if(flavor_text.len > 1 && text > 1) - flavor_text_string += "," - flavor_text_string += flavor_text[text] - flavor_text_string += " on [t_his] [temp.display_name].