From 124fba1d3b0afa78366b571a6778e8aec0303be1 Mon Sep 17 00:00:00 2001 From: Firecage Date: Sun, 18 Oct 2015 12:47:14 +0200 Subject: [PATCH] Enables fixing mirrors. --- code/game/objects/structures/mirror.dm | 34 ++++++++++++++++++++------ 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 002da122b27..6952caa0f40 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -10,7 +10,8 @@ /obj/structure/mirror/attack_hand(mob/user) - if(shattered) return + if(shattered) + return if(ishuman(user)) var/mob/living/carbon/human/H = user @@ -23,7 +24,8 @@ //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 - if(userloc != H.loc) return //no tele-grooming + if(userloc != H.loc) + return //no tele-grooming if(new_style) H.facial_hair_style = new_style else @@ -31,7 +33,8 @@ //handle normal hair var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in hair_styles_list - if(userloc != H.loc) return //no tele-grooming + if(userloc != H.loc) + return //no tele-grooming if(new_style) H.hair_style = new_style @@ -39,7 +42,8 @@ /obj/structure/mirror/proc/shatter() - if(shattered) return + if(shattered) + return shattered = 1 icon_state = "mirror_broke" playsound(src, "shatter", 70, 1) @@ -61,6 +65,19 @@ if(I.damtype == STAMINA) return if(shattered) + if(istype(I, /obj/item/weapon/weldingtool)) + var/obj/item/weapon/weldingtool/WT = I + if(WT.remove_fuel(0, user)) + user << "You begin repairing the shaterred [src]..." + playsound(src, 'sound/items/Welder.ogg', 100, 1) + if(do_after(user, 10, target = src)) + if(!user || !WT || !WT.isOn()) + return + user << "You repair the shattered [src]." + shattered = 0 + icon_state = "mirror" + desc = "Mirror mirror on the wall, who's the most robust of them all?" + return playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1) return @@ -74,7 +91,8 @@ /obj/structure/mirror/attack_alien(mob/living/user) user.do_attack_animation(src) - if(islarva(user)) return + if(islarva(user)) + return if(shattered) playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1) return @@ -83,9 +101,11 @@ /obj/structure/mirror/attack_animal(mob/living/user) - if(!isanimal(user)) return + if(!isanimal(user)) + return var/mob/living/simple_animal/M = user - if(M.melee_damage_upper <= 0) return + if(M.melee_damage_upper <= 0) + return M.do_attack_animation(src) if(shattered) playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)