Adds the electric razor (#5415)

-adds the electric razor, that allow you to shave the hair or beard of your target
-fixes #5228 and any species transformation keeping the old hair in
This commit is contained in:
Alberyk
2018-10-27 20:54:37 +02:00
committed by Werner
parent da9a9619bb
commit 47b16ab8a3
10 changed files with 137 additions and 14 deletions
+103 -1
View File
@@ -21,7 +21,7 @@
/obj/item/weapon/lipstick/black
name = "black lipstick"
colour = "black"
/obj/item/weapon/lipstick/pink
name = "pink lipstick"
colour = "pink"
@@ -82,3 +82,105 @@
/obj/item/weapon/haircomb/attack_self(mob/user)
user.visible_message("<span class='notice'>[user] uses [src] to comb their hair with incredible style and sophistication. What a [user.gender == FEMALE ? "lady" : "guy"].</span>")
/obj/item/weapon/razor
name = "electric razor"
desc = "The latest and greatest power razor born from the science of shaving."
icon = 'icons/obj/weapons.dmi'
icon_state = "razor"
w_class = 2
/obj/item/weapon/razor/proc/shave(mob/living/carbon/human/H, location)
if(location == "head")
H.h_style = H.species.default_h_style
else
H.f_style = H.species.default_f_style
H.update_hair()
playsound(H, 'sound/items/welder2.ogg', 20, 1)
/obj/item/weapon/razor/attack(mob/M, mob/user, var/target_zone)
if(!ishuman(M))
return ..()
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/E = H.get_organ(target_zone)
if(!E || E.is_stump())
to_chat(user, "<span class='danger'>They are missing that limb!</span>")
return FALSE
if(!ishuman_species(H) && !istajara(H)) //you can only shave humans and tajara for obvious reasons
return FALSE
if(target_zone == "head")
if(H.head && (H.head.body_parts_covered & HEAD))
to_chat(user, "<span class='warning'>\The [H.head] is in the way!</span>")
return FALSE
if(H.h_style == "Bald" || H.h_style == "Balding Hair" || H.h_style == "Skinhead" || H.h_style == "Tajaran Ears")
to_chat(user, "<span class='warning'>There is not enough hair left to shave!</span>")
return FALSE
if(H == user) //shaving yourself
user.visible_message("\The [user] starts to shave \his head with \the [src].", \
"<span class='notice'>You start to shave your head with \the [src].</span>")
if(do_mob(user, user, 20))
user.visible_message("\The [user] shaves \his head with \the [src].", \
"<span class='notice'>You finish shaving with \the [src].</span>")
shave(H, target_zone)
return TRUE
else
user.visible_message("<span class='warning'>\The [user] tries to shave \the [H]'s head with \the [src]!</span>", \
"<span class='notice'>You start shaving [H]'s head.</span>")
if(do_mob(user, H, 20))
user.visible_message("<span class='warning'>\The [user] shaves \the [H]'s head bald with \the [src]!</span>", \
"<span class='notice'>You shave \the [H]'s head bald.</span>")
shave(H, target_zone)
return TRUE
else if(target_zone == "mouth")
if(H.head && (H.head.body_parts_covered & FACE))
to_chat(user, "<span class='warning'>\The [H.head] is in the way!</span>")
return FALSE
if(H.wear_mask && (H.wear_mask.body_parts_covered & FACE))
to_chat(user, "<span class='warning'>\The [H.wear_mask] is in the way!</span>")
return FALSE
if(H.f_style == "Shaved")
to_chat(user, "<span class='warning'>There is not enough facial hair left to shave!</span>")
return FALSE
if(H == user) //shaving yourself
user.visible_message("<span class='warning'>\The [user] starts to shave \his facial hair with \the [src].</span>", \
"<span class='notice'>You take a moment to shave your facial hair with \the [src].</span>")
if(do_mob(user, user, 20))
user.visible_message("<span class='warning'>\The [user] shaves \his facial hair clean with \the [src].</span>", \
"<span class='notice'>You finish shaving with \the [src].</span>")
shave(H, target_zone)
return TRUE
else
user.visible_message("<span class='warning'>\The [user] tries to shave \the [H]'s facial hair with \the [src].</span>", \
"<span class='notice'>You start shaving [H]'s facial hair.</span>")
if(do_mob(user, H, 20))
user.visible_message("<span class='warning'>\The [user] shaves off \the [H]'s facial hair with \the [src].</span>", \
"<span class='notice'>You shave [H]'s facial hair clean off.</span>")
shave(H, target_zone)
return TRUE
else
to_chat(user, "<span class='warning'>You need to target the mouth or head to shave \the [H]!</span>")
return
+2 -1
View File
@@ -823,7 +823,8 @@
/obj/item/weapon/reagent_containers/inhaler/hyperzine = 0.1,
/obj/item/weapon/storage/box/pineapple = 0.1,
/obj/item/weapon/flag/america = 0.1,
/obj/item/weapon/flag/america/l = 0.1
/obj/item/weapon/flag/america/l = 0.1,
/obj/item/weapon/razor = 0.5
)
/obj/random/hoodie
+2 -7
View File
@@ -94,8 +94,7 @@
spawn(1)
var/newname = sanitizeSafe(input(vox,"Enter a name, or leave blank for the default name.", "Name change","") as text, MAX_NAME_LEN)
if(!newname || newname == "")
var/datum/language/L = all_languages[vox.species.default_language]
newname = L.get_random_name()
newname = user.species.get_random_name()
vox.real_name = newname
vox.name = vox.real_name
raiders.update_access(vox)
@@ -149,10 +148,6 @@
var/newname = sanitizeSafe(input(user,"Enter a name, or leave blank for the default name.", "Name change","") as text, MAX_NAME_LEN)
if(!newname || newname == "")
var/datum/language/L = all_languages[user.species.default_language]
newname = L.get_random_name()
newname = user.species.get_random_name()
user.fully_replace_character_name(user.real_name,newname)
user.h_style = "Short Vox Quills"
user.f_style = "Shaved"
user.update_hair(0)
..()