Mouse Skeletons (#1279)

Adds decomposing animations for mice when dusted. They'll leave behind a little mouse skeleton
Mice and lizards will decompose to a skeleton 30 mins after death, or if dusted

Also some fixes to various small issues and runtime errors related to held mobs and supermatters.
This commit is contained in:
NanakoAC
2016-12-23 18:52:27 +00:00
committed by skull132
parent 7fe4433669
commit 4e5556e9d9
9 changed files with 99 additions and 32 deletions
+5 -2
View File
@@ -25,8 +25,11 @@
//This is the proc for turning a mob into ash. Mostly a copy of gib code (above).
//Originally created for wizard disintegrate. I've removed the virus code since it's irrelevant here.
//Dusting robots does not eject the MMI, so it's a bit more powerful than gib() /N
/mob/proc/dust(anim="dust-m",remains=/obj/effect/decal/cleanable/ash)
/mob/proc/dust(anim="dust-m",remains=/obj/effect/decal/cleanable/ash, iconfile = 'icons/mob/mob.dmi')
death(1)
if (istype(loc, /obj/item/weapon/holder))
var/obj/item/weapon/holder/H = loc
H.release_mob()
var/atom/movable/overlay/animation = null
transforming = 1
canmove = 0
@@ -35,7 +38,7 @@
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.icon = iconfile
animation.master = src
flick(anim, animation)
+2
View File
@@ -70,6 +70,8 @@ var/list/holder_mob_icon_cache = list()
origin_tech = list(TECH_BIO = 6)
/obj/item/weapon/holder/process()
if (!contained)
qdel(src)
if(!get_holding_mob() || contained.loc != src)
if (is_unsafe_container(loc) && contained.loc == src)
@@ -20,11 +20,19 @@
density = 0
seek_speed = 0.75
var/decompose_time = 18000
/mob/living/simple_animal/lizard/New()
..()
nutrition = rand(max_nutrition*0.25, max_nutrition*0.75)
/mob/living/simple_animal/lizard/Life()
if (!..())
if ((world.time - timeofdeath) > decompose_time)
dust()
/mob/living/simple_animal/lizard/attack_hand(mob/living/carbon/human/M as mob)
if (src.stat == DEAD)//If the creature is dead, we don't pet it, we just pickup the corpse on click
get_scooped(M)
@@ -35,3 +43,6 @@
/mob/living/simple_animal/lizard/death()
.=..()
desc = "It doesn't hiss anymore."
/mob/living/simple_animal/lizard/dust()
..(remains = /obj/effect/decal/remains/lizard)
@@ -49,38 +49,43 @@
can_pull_size = 1
can_pull_mobs = MOB_PULL_NONE
var/decompose_time = 18000
/mob/living/simple_animal/mouse/Life()
..()
if(..())
if(client)
//Player-animals don't do random speech normally, so this is here
//Player-controlled mice will still squeak, but less often than NPC mice
if (stat == CONSCIOUS && prob(speak_chance*0.1))
squeak_soft(0)
if(client)
//Player-animals don't do random speech normally, so this is here
//Player-controlled mice will still squeak, but less often than NPC mice
if (stat == CONSCIOUS && prob(speak_chance*0.1))
squeak_soft(0)
if(is_ventcrawling == 0)
sight = SEE_SELF // Returns mouse sight to normal when they leave a vent
if(is_ventcrawling == 0)
sight = SEE_SELF // Returns mouse sight to normal when they leave a vent
if (squeals < maxSqueals)
var/diff = world.time - last_squealgain
if (diff > 600)
squeals++
last_squealgain = world.time
if (squeals < maxSqueals)
var/diff = world.time - last_squealgain
if (diff > 600)
squeals++
last_squealgain = world.time
if(!ckey && stat == CONSCIOUS && prob(0.5))
stat = UNCONSCIOUS
icon_state = "mouse_[body_color]_sleep"
wander = 0
speak_chance = 0
//snuffles
else if(stat == UNCONSCIOUS)
if(ckey || prob(1))
stat = CONSCIOUS
icon_state = "mouse_[body_color]"
wander = 1
speak_chance = initial(speak_chance)
else if(prob(5))
audible_emote("snuffles.")
if(!ckey && stat == CONSCIOUS && prob(0.5))
stat = UNCONSCIOUS
icon_state = "mouse_[body_color]_sleep"
wander = 0
speak_chance = 0
//snuffles
else if(stat == UNCONSCIOUS)
if(ckey || prob(1))
stat = CONSCIOUS
icon_state = "mouse_[body_color]"
wander = 1
speak_chance = initial(speak_chance)
else if(prob(5))
audible_emote("snuffles.")
else
if ((world.time - timeofdeath) > decompose_time)
dust()
@@ -221,6 +226,9 @@
client.time_died_as_mouse = world.time
..()
/mob/living/simple_animal/mouse/dust()
..(anim = "dust_[body_color]", remains = /obj/effect/decal/remains/mouse, iconfile = 'icons/mob/mouse.dmi')
/mob/living/simple_animal/mouse/lay_down()
set name = "Rest"
set category = "IC"
+5
View File
@@ -371,6 +371,11 @@
user.dust()
power += 200
else
if (istype(user, /obj/item/weapon/holder))
var/obj/item/weapon/holder/H = user
Consume(H.contained)//If its a holder, eat the thing inside
qdel(H)
return
qdel(user)
power += 200