Merge pull request #12441 from xxalpha/swiss_cheese

Adds a very small chance of mice chewing power cables.
This commit is contained in:
Razharas
2015-10-26 03:04:23 +03:00
@@ -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("<span class='warning'>[src] chews through the [C]. It's toast!</span>")
playsound(src, 'sound/effects/sparks2.ogg', 100, 1)
C.Deconstruct()
death(toast=1)
else
C.Deconstruct()
visible_message("<span class='warning'>[src] chews through the [C].</span>")
/*
* Mouse types
*/