From e85c19046fd2bdc04fe22e8fa911edb9558ec4ae Mon Sep 17 00:00:00 2001 From: FelisCorax Date: Wed, 13 Jan 2016 16:11:58 -0500 Subject: [PATCH] Copied machine hair eating code from current server. --- code/game/machinery/kitchen/gibber.dm | 11 ++++- code/game/mecha/mech_fabricator.dm | 47 +++++++++++++++++++ code/modules/reagents/Chemistry-Machinery.dm | 48 ++++++++++++++++++++ 3 files changed, 104 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/kitchen/gibber.dm b/code/game/machinery/kitchen/gibber.dm index 8ee374e9610..29994c17efb 100644 --- a/code/game/machinery/kitchen/gibber.dm +++ b/code/game/machinery/kitchen/gibber.dm @@ -106,6 +106,15 @@ move_into_gibber(user,G.affecting) // Grab() process should clean up the grab item, no need to del it. + if(istype(user, /mob/living/carbon/human)) + var/mob/living/carbon/human/M = user + if(M.h_style == "Floorlength Braid" || M.h_style == "Very Long Hair") + if(prob(10)) + M.apply_damage(30, BRUTE, "head") + M.apply_damage(45, HALLOSS) + M.visible_message("\red [user]'s hair catches in the [src]!", "\red Your hair gets caught in the [src]!") + M.say("*scream") + /obj/machinery/gibber/MouseDrop_T(mob/target, mob/user) if(user.stat || user.restrained()) return @@ -235,5 +244,3 @@ thing.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(0,3),emagged ? 100 : 50) // Being pelted with bits of meat and bone would hurt. update_icon() - - diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 9013e0b8a6b..94cfba54359 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -553,6 +553,14 @@ /obj/machinery/mecha_part_fabricator/attack_hand(mob/user as mob) var/dat, left_part + if(istype(user, /mob/living/carbon/human)) + var/mob/living/carbon/human/M = user + if(M.h_style == "Floorlength Braid" || M.h_style == "Very Long Hair") + if(prob(10)) + M.apply_damage(30, BRUTE, "head") + M.apply_damage(45, HALLOSS) + M.visible_message("\red [user]'s hair catches in the [src]!", "\red Your hair gets caught in the [src]!") + M.say("*scream") if (..()) return if(!operation_allowed(user)) @@ -851,3 +859,42 @@ else user << "The fabricator cannot hold more [sname]." return + +/obj/machinery/mecha_part_fabricator/MouseDrop_T(mob/living/carbon/human/target as mob, mob/user as mob) + if (!istype(target) || target.buckled || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || istype(user, /mob/living/silicon/ai)) + return + if(target == user) + if(target.h_style == "Floorlength Braid" || target.h_style == "Very Long Hair") + user.visible_message("\blue [user] looks like they're about to feed their own hair into the [src], but think better of it.", "\blue You grasp your hair and are about to feed it into the [src], but stop and come to your sense.") + return + src.add_fingerprint(user) + var/target_loc = target.loc + if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis) + if(target.h_style != "Cut Hair" || target.h_style != "Short Hair" || target.h_style != "Skinhead" || target.h_style != "Buzzcut" || target.h_style != "Crewcut" || target.h_style != "Bald" || target.h_style != "Balding Hair") + user.visible_message("\red [user] starts feeding [target]'s hair into the [src]!", "\red You start feeding [target]'s hair into the [src]!") + if(!do_after(usr, 50)) + return + if(target_loc != target.loc) + return + if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis) + user.visible_message("\red [user] feeds the [target]'s hair into the [src] and flicks it on!", "\red You turn the [src] on!") + target.apply_damage(30, BRUTE, "head") + target.apply_damage(25, HALLOSS) + target.say("*scream") + + user.attack_log += text("\[[time_stamp()]\] Has fed [target.name]'s ([target.ckey]) hair into a [src].") + target.attack_log += text("\[[time_stamp()]\] Has had their hair fed into [src] by [user.name] ([user.ckey])") + msg_admin_attack("[key_name_admin(user.ckey)] fed [key_name_admin(target)] in a [src]. (JMP)") + else + return + if(!do_after(usr, 35)) + return + if(target_loc != target.loc) + return + if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis) + user.visible_message("\red [user] starts tugging on [target]'s head as the [src] keeps running!", "\red You start tugging on [target]'s head!") + target.apply_damage(25, BRUTE, "head") + target.apply_damage(10, HALLOSS) + target.say("*scream") + spawn(10) + user.visible_message("\red [user] stops the [src] and leaves [target] resting as they are.", "\red You turn the [src] off and let go of [target].") diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 354a6482691..e060328acb4 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -662,6 +662,15 @@ var/beaker_contents = "" var/dat = "" + if(istype(user, /mob/living/carbon/human)) + var/mob/living/carbon/human/M = user + if(M.h_style == "Floorlength Braid" || M.h_style == "Very Long Hair") + if(prob(10)) + M.apply_damage(30, BRUTE, "head") + M.apply_damage(45, HALLOSS) + M.visible_message("\red [user]'s hair catches in the [src]!", "\red Your hair gets caught in the [src]!") + M.say("*scream") + if(!inuse) for (var/obj/item/O in holdingitems) processing_chamber += "\A [O.name]
" @@ -781,3 +790,42 @@ break #undef REAGENTS_PER_SHEET + +/obj/machinery/reagentgrinder/MouseDrop_T(mob/living/carbon/human/target as mob, mob/user as mob) + if (!istype(target) || target.buckled || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || istype(user, /mob/living/silicon/ai)) + return + if(target == user) + if(target.h_style == "Floorlength Braid" || target.h_style == "Very Long Hair") + user.visible_message("\blue [user] looks like they're about to feed their own hair into the [src], but think better of it.", "\blue You grasp your hair and are about to feed it into the [src], but stop and come to your sense.") + return + src.add_fingerprint(user) + var/target_loc = target.loc + if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis) + if(target.h_style != "Cut Hair" || target.h_style != "Short Hair" || target.h_style != "Skinhead" || target.h_style != "Buzzcut" || target.h_style != "Crewcut" || target.h_style != "Bald" || target.h_style != "Balding Hair") + user.visible_message("\red [user] starts feeding [target]'s hair into the [src]!", "\red You start feeding [target]'s hair into the [src]!") + if(!do_after(usr, 50)) + return + if(target_loc != target.loc) + return + if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis) + user.visible_message("\red [user] feeds the [target]'s hair into the [src] and flicks it on!", "\red You turn the [src] on!") + target.apply_damage(30, BRUTE, "head") + target.apply_damage(25, HALLOSS) + target.say("*scream") + + user.attack_log += text("\[[time_stamp()]\] Has fed [target.name]'s ([target.ckey]) hair into a [src].") + target.attack_log += text("\[[time_stamp()]\] Has had their hair fed into [src] by [user.name] ([user.ckey])") + msg_admin_attack("[key_name_admin(user)] fed [key_name_admin(target)] in a [src]. (JMP)") + else + return + if(!do_after(usr, 35)) + return + if(target_loc != target.loc) + return + if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis) + user.visible_message("\red [user] starts tugging on [target]'s head as the [src] keeps running!", "\red You start tugging on [target]'s head!") + target.apply_damage(25, BRUTE, "head") + target.apply_damage(10, HALLOSS) + target.say("*scream") + spawn(10) + user.visible_message("\red [user] stops the [src] and leaves [target] resting as they are.", "\red You turn the [src] off and let go of [target].")