From 254b5cccd497104002b99a4d9872923d56dc26a3 Mon Sep 17 00:00:00 2001 From: RavingManiac Date: Tue, 19 Feb 2013 19:22:00 +0800 Subject: [PATCH] Some uses of ismouse() replaced with isanimal() world.time used to calculate mouse spawn timer. Spawn timer now applies to being killed via splat(). --- code/modules/client/client defines.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 7 +++++-- code/modules/mob/living/carbon/human/inventory.dm | 2 +- .../modules/mob/living/simple_animal/friendly/mouse.dm | 10 +++------- code/modules/recycling/disposal.dm | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index 6fbb741b990..2c69b9957ef 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -16,7 +16,7 @@ var/moving = null var/adminobs = null var/area = null - var/can_spawn_as_mouse = 1 + var/time_died_as_mouse = null //when the client last died as a mouse /////////////// diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 68a9a834809..4b4dac419d9 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -263,8 +263,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set name = "Become mouse" set category = "Ghost" - if(client.can_spawn_as_mouse == 0) - src << "You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death." + var/timedifference = world.time - client.time_died_as_mouse + if(client.time_died_as_mouse && timedifference <= mouse_respawn_time * 600) + var/timedifference_text + timedifference_text = time2text(mouse_respawn_time * 600 - timedifference,"mm:ss") + src << "You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death. You have [timedifference_text] left." return //find a viable mouse candidate diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 8c22808fdef..1fa82e5778d 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -461,7 +461,7 @@ It can still be worn/put on as normal. */ /obj/effect/equip_e/human/done() //TODO: And rewrite this :< ~Carn target.cpr_time = 1 - if(ismouse(source)) return //mice cannot strip people + if(isanimal(source)) return //animals cannot strip people if(!source || !target) return //Target or source no longer exist if(source.loc != s_loc) return //source has moved if(target.loc != t_loc) return //target has moved diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index 9e5648005f1..9e201f2cb34 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -48,6 +48,8 @@ src.stat = DEAD src.icon_dead = "mouse_[color]_splat" src.icon_state = "mouse_[color]_splat" + if(client) + client.time_died_as_mouse = world.time //copy paste from alien/larva, if that func is updated please update this one also /mob/living/simple_animal/mouse/verb/ventcrawl() @@ -160,15 +162,9 @@ /mob/living/simple_animal/mouse/Die() if(client) - client.mouse_respawn_timer() + client.time_died_as_mouse = world.time ..() -/client/proc/mouse_respawn_timer() - can_spawn_as_mouse = 0 - spawn(mouse_respawn_time * 600) - can_spawn_as_mouse = 1 - return - /* * Mouse types */ diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index f4e53667a2e..6ff62b6565b 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -136,7 +136,7 @@ MouseDrop_T(mob/target, mob/user) if (!istype(target) || target.buckled || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || istype(user, /mob/living/silicon/ai)) return - if(ismouse(user) && target != user) return //mice cannot put mobs other than themselves into disposal + if(isanimal(user) && target != user) return //animals cannot put mobs other than themselves into disposal src.add_fingerprint(user) var/target_loc = target.loc var/msg