From 344d9bf17d5e839fc6983420822bdf0a404fcb10 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 27 Aug 2020 22:17:37 +0200 Subject: [PATCH] [MIRROR] Remove rats from total count on death (#547) * Remove rats from total count on death (#53209) * remove rats on death * revival add back to the list * Remove rats from total count on death Co-authored-by: NightRed --- .../mob/living/simple_animal/friendly/mouse.dm | 10 ++++++++++ .../mob/living/simple_animal/hostile/regalrat.dm | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index bc2d2296693..2e30d6967dc 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -62,8 +62,18 @@ M.desc = "It's toast." qdel(src) else + SSmobs.cheeserats -= src // remove play controlled mouse also ..(gibbed) +/mob/living/simple_animal/mouse/revive(full_heal = FALSE, admin_revive = FALSE) + var/cap = CONFIG_GET(number/ratcap) + if(!admin_revive && !ckey && LAZYLEN(SSmobs.cheeserats) >= cap) + visible_message("[src] twitched but does not continue moving due to the overwhelming rodent population on the station!") + return FALSE + . = ..() + if(.) + SSmobs.cheeserats += src + /mob/living/simple_animal/mouse/Crossed(AM as mob|obj) if( ishuman(AM) ) if(!stat) diff --git a/code/modules/mob/living/simple_animal/hostile/regalrat.dm b/code/modules/mob/living/simple_animal/hostile/regalrat.dm index 8ea1881d903..6512ccd9b51 100644 --- a/code/modules/mob/living/simple_animal/hostile/regalrat.dm +++ b/code/modules/mob/living/simple_animal/hostile/regalrat.dm @@ -198,6 +198,19 @@ SSmobs.cheeserats -= src return ..() +/mob/living/simple_animal/hostile/rat/death(gibbed) + SSmobs.cheeserats -= src // remove rats on death + return ..() + +/mob/living/simple_animal/hostile/rat/revive(full_heal = FALSE, admin_revive = FALSE) + var/cap = CONFIG_GET(number/ratcap) + if(!admin_revive && !ckey && LAZYLEN(SSmobs.cheeserats) >= cap) + visible_message("[src] twitched but does not continue moving due to the overwhelming rodent population on the station!") + return FALSE + . = ..() + if(.) + SSmobs.cheeserats += src + /mob/living/simple_animal/hostile/rat/examine(mob/user) . = ..() if(istype(user,/mob/living/simple_animal/hostile/rat))