From 42259d6e1aee625d932c1f916db612eb7a0c1a9d Mon Sep 17 00:00:00 2001 From: xxalpha Date: Fri, 16 Oct 2015 18:36:32 +0100 Subject: [PATCH] Adds a very small chance of mice chewing power cables. Prob15 --- .../living/simple_animal/friendly/mouse.dm | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index fbe54636bcb..1c0f9cea91a 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -23,6 +23,7 @@ mob_size = MOB_SIZE_TINY var/body_color //brown, gray and white, leave blank for random gold_core_spawnable = 2 + var/chew_probability = 1 /mob/living/simple_animal/mouse/New() ..() @@ -38,11 +39,14 @@ src.icon_dead = "mouse_[body_color]_splat" death() -/mob/living/simple_animal/mouse/death(gibbed) +/mob/living/simple_animal/mouse/death(gibbed, toast) if(!ckey) ..(1) var/obj/item/trash/deadmouse/M = new(src.loc) M.icon_state = icon_dead + if(toast) + M.color = "#3A3A3A" + M.desc = "It's toast." qdel(src) else ..(gibbed) @@ -55,6 +59,21 @@ playsound(src, 'sound/effects/mousesqueek.ogg', 100, 1) ..() +/mob/living/simple_animal/mouse/handle_automated_action() + if(prob(chew_probability)) + var/turf/simulated/floor/F = get_turf(src) + if(istype(F) && !F.intact) + var/obj/structure/cable/C = locate() in F + if(C && prob(15)) + if(C.avail()) + visible_message("[src] chews through the [C]. It's toast!") + playsound(src, 'sound/effects/sparks2.ogg', 100, 1) + C.Deconstruct() + death(toast=1) + else + C.Deconstruct() + visible_message("[src] chews through the [C].") + /* * Mouse types */