Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make mice not chew cables through catwalks #28157

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions code/modules/mob/living/simple_animal/friendly/mouse.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,22 @@
#ifdef GAME_TESTS // DO NOT EAT MY CABLES DURING UNIT TESTS
return
#endif
if(prob(chew_probability) && isturf(loc))
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.get_available_power() && !HAS_TRAIT(src, TRAIT_SHOCKIMMUNE))
visible_message("<span class='warning'>[src] chews through [C]. It's toast!</span>")
playsound(src, 'sound/effects/sparks2.ogg', 100, 1)
toast() // mmmm toasty.
else
visible_message("<span class='warning'>[src] chews through [C].</span>")
investigate_log("was chewed through by a mouse in [get_area(F)]([F.x], [F.y], [F.z] - [ADMIN_JMP(F)])","wires")
C.deconstruct()
if(!prob(chew_probability) || !isfloorturf(loc))
return
var/turf/simulated/floor/F = get_turf(src)
if(F.intact || F.transparent_floor)
return
var/obj/structure/cable/C = locate() in F
if(!C || !prob(15))
return
if(C.get_available_power() && !HAS_TRAIT(src, TRAIT_SHOCKIMMUNE))
visible_message("<span class='warning'>[src] chews through [C]. It's toast!</span>")
playsound(src, 'sound/effects/sparks2.ogg', 100, 1)
toast() // mmmm toasty.
else
visible_message("<span class='warning'>[src] chews through [C].</span>")
investigate_log("was chewed through by a mouse in [get_area(F)]([F.x], [F.y], [F.z] - [ADMIN_JMP(F)])","wires")
C.deconstruct()

/mob/living/simple_animal/mouse/handle_automated_speech()
..()
Expand Down
Loading