diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index d7a7f89dbfc..98efbd099b3 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1468,3 +1468,64 @@ Standard way to write links -Sayu if(istype(arglist,/list)) arglist = list2params(arglist) return "[content]" + + +/proc/get_location_accessible(mob/M, location) + var/covered_locations = 0 //based on body_parts_covered + var/face_covered = 0 //based on flags_inv + var/eyesmouth_covered = 0 //based on flags + if(iscarbon(M)) + var/mob/living/carbon/C = M + for(var/obj/item/clothing/I in list(C.back, C.wear_mask)) + covered_locations |= I.body_parts_covered + face_covered |= I.flags_inv + eyesmouth_covered |= I.flags + if(ishuman(C)) + var/mob/living/carbon/human/H = C + for(var/obj/item/I in list(H.wear_suit, H.w_uniform, H.shoes, H.belt, H.gloves, H.glasses, H.head, H.r_ear, H.l_ear)) + covered_locations |= I.body_parts_covered + face_covered |= I.flags_inv + eyesmouth_covered |= I.flags + + switch(location) + if("head") + if(covered_locations & HEAD) + return 0 + if("eyes") + if(covered_locations & HEAD || face_covered & HIDEEYES || eyesmouth_covered & GLASSESCOVERSEYES) + return 0 + if("mouth") + if(covered_locations & HEAD || face_covered & HIDEFACE || eyesmouth_covered & MASKCOVERSMOUTH) + return 0 + if("chest") + if(covered_locations & UPPER_TORSO) + return 0 + if("groin") + if(covered_locations & LOWER_TORSO) + return 0 + if("l_arm") + if(covered_locations & ARM_LEFT) + return 0 + if("r_arm") + if(covered_locations & ARM_RIGHT) + return 0 + if("l_leg") + if(covered_locations & LEG_LEFT) + return 0 + if("r_leg") + if(covered_locations & LEG_RIGHT) + return 0 + if("l_hand") + if(covered_locations & HAND_LEFT) + return 0 + if("r_hand") + if(covered_locations & HAND_RIGHT) + return 0 + if("l_foot") + if(covered_locations & FOOT_LEFT) + return 0 + if("r_foot") + if(covered_locations & FOOT_RIGHT) + return 0 + + return 1 \ No newline at end of file diff --git a/code/game/objects/items/weapons/cosmetics.dm b/code/game/objects/items/weapons/cosmetics.dm index 39a058a196a..1adcbc06172 100644 --- a/code/game/objects/items/weapons/cosmetics.dm +++ b/code/game/objects/items/weapons/cosmetics.dm @@ -83,5 +83,77 @@ "You wipe off [H]'s lipstick.") H.lip_style = null H.update_body() + else + ..() + +/obj/item/weapon/razor + name = "electric razor" + desc = "The latest and greatest power razor born from the science of shaving." + icon = 'icons/obj/items.dmi' + icon_state = "razor" + flags = FPRINT | TABLEPASS| CONDUCT + w_class = 1.0 + +/obj/item/weapon/razor/attack(mob/living/carbon/M as mob, mob/user as mob) + if(ishuman(M)) + var/mob/living/carbon/human/H = M + if(user.zone_sel.selecting == "mouth") + if(!get_location_accessible(H, "mouth")) + user << "The mask is in the way." + return + if(H.f_style == "Shaved") + user << "Already clean-shaven." + return + if(H == user) //shaving yourself + user.visible_message("[user] starts to shave their facial hair with \the [src].", \ + "You take a moment shave your facial hair with \the [src].") + if(do_after(user, 50)) + user.visible_message("[user] shaves his facial hair clean with the [src].", \ + "You finish shaving with the [src]. Fast and clean!") + H.f_style = "Shaved" + H.update_hair() + playsound(src.loc, 'sound/items/Welder2.ogg', 20, 1) + else + var/turf/user_loc = user.loc + var/turf/H_loc = H.loc + user.visible_message("[user] tries to shave [H]'s facial hair with \the [src].", \ + "You start shaving [H]'s facial hair.") + if(do_after(user, 50)) + if(user_loc == user.loc && H_loc == H.loc) + user.visible_message("[user] shaves off [H]'s facial hair with \the [src].", \ + "You shave [H]'s facial hair clean off.") + H.f_style = "Shaved" + H.update_hair() + playsound(src.loc, 'sound/items/Welder2.ogg', 20, 1) + if(user.zone_sel.selecting == "head") + if(!get_location_accessible(H, "head")) + user << "The headgear is in the way." + return + if(H.h_style == "Bald" || H.h_style == "Balding Hair" || H.h_style == "Skinhead") + user << "There is not enough hair left to shave..." + return + if(H == user) //shaving yourself + user.visible_message("[user] starts to shave their head with \the [src].", \ + "You start to shave your head with \the [src].") + if(do_after(user, 50)) + user.visible_message("[user] shaves his head with the [src].", \ + "You finish shaving with the [src].") + H.h_style = "Skinhead" + H.update_hair() + playsound(src.loc, 'sound/items/Welder2.ogg', 40, 1) + else + var/turf/user_loc = user.loc + var/turf/H_loc = H.loc + user.visible_message("[user] tries to shave [H]'s head with \the [src]!", \ + "You start shaving [H]'s head.") + if(do_after(user, 50)) + if(user_loc == user.loc && H_loc == H.loc) + user.visible_message("[user] shaves [H]'s head bald with \the [src]!", \ + "You shave [H]'s head bald.") + H.h_style = "Skinhead" + H.update_hair() + playsound(src.loc, 'sound/items/Welder2.ogg', 40, 1) + else + ..() else ..() \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 4066a45a82a..1f8de8d6ba6 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -172,7 +172,7 @@ src.modules += new /obj/item/weapon/reagent_containers/food/drinks/beer(src) src.modules += new /obj/item/weapon/reagent_containers/food/condiment/enzyme(src) src.modules += new /obj/item/weapon/pen/robopen(src) - src.modules += new /obj/item/device/violin(src) + src.modules += new /obj/item/weapon/razor(src) var/obj/item/weapon/rsf/M = new /obj/item/weapon/rsf(src) M.matter = 30 src.modules += M diff --git a/icons/mob/items_lefthand.dmi b/icons/mob/items_lefthand.dmi index e5ca483dcfe..7a94e7e9257 100644 Binary files a/icons/mob/items_lefthand.dmi and b/icons/mob/items_lefthand.dmi differ diff --git a/icons/mob/items_righthand.dmi b/icons/mob/items_righthand.dmi index 2068729366b..7a26c6a825c 100644 Binary files a/icons/mob/items_righthand.dmi and b/icons/mob/items_righthand.dmi differ diff --git a/icons/obj/items.dmi b/icons/obj/items.dmi index 16e15154c42..6fdb8ce559f 100644 Binary files a/icons/obj/items.dmi and b/icons/obj/items.dmi differ diff --git a/maps/tgstation-redux-WIP.dmm b/maps/tgstation-redux-WIP.dmm index 18e5eff4405..186f955b5c7 100644 --- a/maps/tgstation-redux-WIP.dmm +++ b/maps/tgstation-redux-WIP.dmm @@ -1454,7 +1454,7 @@ "aBX" = (/obj/machinery/firealarm{dir = 8; pixel_x = -24},/turf/simulated/floor{dir = 8; icon_state = "barber"},/area/civilian/barber) "aBY" = (/obj/structure/table/reinforced,/turf/simulated/floor{dir = 8; icon_state = "barber"},/area/civilian/barber) "aBZ" = (/obj/structure/stool/bed/chair/barber{dir = 4},/turf/simulated/floor{dir = 8; icon_state = "barber"},/area/civilian/barber) -"aCa" = (/obj/structure/table/reinforced,/obj/structure/mirror{pixel_x = 28},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/turf/simulated/floor{dir = 8; icon_state = "barber"},/area/civilian/barber) +"aCa" = (/obj/structure/table/reinforced,/obj/structure/mirror{pixel_x = 28},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/item/weapon/razor,/turf/simulated/floor{dir = 8; icon_state = "barber"},/area/civilian/barber) "aCb" = (/turf/simulated/floor{icon_state = "bar"},/area/civilian/clothing) "aCc" = (/obj/structure/table/reinforced,/turf/simulated/floor{icon_state = "bar"},/area/civilian/clothing) "aCd" = (/obj/structure/disposalpipe/segment,/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/machinery/firealarm{dir = 4; pixel_x = 24},/turf/simulated/floor{icon_state = "bar"},/area/civilian/clothing)