Some uses of ismouse() replaced with isanimal()

world.time used to calculate mouse spawn timer.

Spawn timer now applies to being killed via splat().
This commit is contained in:
RavingManiac
2013-02-19 19:22:00 +08:00
parent b2b2894e3b
commit 254b5cccd4
5 changed files with 11 additions and 12 deletions
+1 -1
View File
@@ -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
///////////////
+5 -2
View File
@@ -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 << "<span class='warning'>You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death.</span>"
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 << "<span class='warning'>You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death. You have [timedifference_text] left.</span>"
return
//find a viable mouse candidate
@@ -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
@@ -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
*/
+1 -1
View File
@@ -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