Fixes pet collars not updating icons (#34184)
This commit is contained in:
committed by
CitadelStationBot
parent
2b9b826a95
commit
8bd1f07353
@@ -29,6 +29,7 @@
|
||||
var/turns_since_scan = 0
|
||||
var/mob/living/simple_animal/mouse/movement_target
|
||||
gold_core_spawnable = FRIENDLY_SPAWN
|
||||
collar_type = "cat"
|
||||
|
||||
/mob/living/simple_animal/pet/cat/Initialize()
|
||||
. = ..()
|
||||
@@ -39,8 +40,11 @@
|
||||
if(client && stat != DEAD)
|
||||
if (resting)
|
||||
icon_state = "[icon_living]_rest"
|
||||
collar_type = "[initial(collar_type)]_rest"
|
||||
else
|
||||
icon_state = "[icon_living]"
|
||||
collar_type = "[initial(collar_type)]"
|
||||
regenerate_icons()
|
||||
|
||||
|
||||
/mob/living/simple_animal/pet/cat/space
|
||||
@@ -60,6 +64,7 @@
|
||||
icon_state = "original"
|
||||
icon_living = "original"
|
||||
icon_dead = "original_dead"
|
||||
collar_type = null
|
||||
unique_pet = TRUE
|
||||
|
||||
/mob/living/simple_animal/pet/cat/kitten
|
||||
@@ -71,6 +76,7 @@
|
||||
density = FALSE
|
||||
pass_flags = PASSMOB
|
||||
mob_size = MOB_SIZE_SMALL
|
||||
collar_type = "kitten"
|
||||
|
||||
//RUNTIME IS ALIVE! SQUEEEEEEEE~
|
||||
/mob/living/simple_animal/pet/cat/Runtime
|
||||
@@ -162,17 +168,20 @@
|
||||
if(prob(1))
|
||||
emote("me", 1, pick("stretches out for a belly rub.", "wags its tail.", "lies down."))
|
||||
icon_state = "[icon_living]_rest"
|
||||
collar_type = "[initial(collar_type)]_rest"
|
||||
resting = 1
|
||||
update_canmove()
|
||||
else if (prob(1))
|
||||
emote("me", 1, pick("sits down.", "crouches on its hind legs.", "looks alert."))
|
||||
icon_state = "[icon_living]_sit"
|
||||
collar_type = "[initial(collar_type)]_sit"
|
||||
resting = 1
|
||||
update_canmove()
|
||||
else if (prob(1))
|
||||
if (resting)
|
||||
emote("me", 1, pick("gets up and meows.", "walks around.", "stops resting."))
|
||||
icon_state = "[icon_living]"
|
||||
collar_type = "[initial(collar_type)]"
|
||||
resting = 0
|
||||
update_canmove()
|
||||
else
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
var/nofur = 0 //Corgis that have risen past the material plane of existence.
|
||||
gold_core_spawnable = FRIENDLY_SPAWN
|
||||
can_be_held = TRUE
|
||||
collar_type = "corgi"
|
||||
|
||||
/mob/living/simple_animal/pet/dog/pug
|
||||
name = "\improper pug"
|
||||
@@ -42,6 +43,7 @@
|
||||
icon_dead = "pug_dead"
|
||||
butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/pug = 3)
|
||||
gold_core_spawnable = FRIENDLY_SPAWN
|
||||
collar_type = "pug"
|
||||
|
||||
/mob/living/simple_animal/pet/dog/Initialize()
|
||||
. = ..()
|
||||
@@ -469,7 +471,7 @@
|
||||
|
||||
|
||||
/mob/living/simple_animal/pet/dog/corgi/regenerate_icons()
|
||||
cut_overlays()
|
||||
..()
|
||||
if(inventory_head)
|
||||
var/image/head_icon
|
||||
var/datum/dog_fashion/DF = new inventory_head.dog_fashion(src)
|
||||
@@ -509,10 +511,6 @@
|
||||
back_icon = DF.get_overlay()
|
||||
add_overlay(back_icon)
|
||||
|
||||
if(pcollar)
|
||||
add_overlay(collar)
|
||||
add_overlay(pettag)
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -527,6 +525,7 @@
|
||||
density = FALSE
|
||||
pass_flags = PASSMOB
|
||||
mob_size = MOB_SIZE_SMALL
|
||||
collar_type = "puppy"
|
||||
|
||||
//puppies cannot wear anything.
|
||||
/mob/living/simple_animal/pet/dog/corgi/puppy/Topic(href, href_list)
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
/mob/living/simple_animal/pet
|
||||
icon = 'icons/mob/pets.dmi'
|
||||
mob_size = MOB_SIZE_SMALL
|
||||
var/obj/item/clothing/neck/petcollar/pcollar = null
|
||||
var/collar = ""
|
||||
var/pettag = ""
|
||||
var/obj/item/clothing/neck/petcollar/pcollar
|
||||
var/collar_type
|
||||
var/unique_pet = FALSE
|
||||
blood_volume = BLOOD_VOLUME_NORMAL
|
||||
|
||||
/mob/living/simple_animal/pet/attackby(obj/item/O, mob/user, params)
|
||||
if(istype(O, /obj/item/clothing/neck/petcollar) && !pcollar)
|
||||
var/pet_icon_states = icon_states("[icon]")
|
||||
if("[icon_state]collar" in pet_icon_states)
|
||||
if(collar_type)
|
||||
var/obj/item/clothing/neck/petcollar/P = O
|
||||
pcollar = P
|
||||
collar = "[icon_state]collar"
|
||||
pettag = "[icon_state]tag"
|
||||
pcollar = P.type
|
||||
regenerate_icons()
|
||||
to_chat(user, "<span class='notice'>You put the [P] around [src]'s neck.</span>")
|
||||
if(P.tagname && !unique_pet)
|
||||
@@ -41,17 +37,25 @@
|
||||
|
||||
/mob/living/simple_animal/pet/revive(full_heal = 0, admin_revive = 0)
|
||||
if(..())
|
||||
if(collar_type)
|
||||
collar_type = "[initial(collar_type)]"
|
||||
regenerate_icons()
|
||||
. = 1
|
||||
. = TRUE
|
||||
|
||||
/mob/living/simple_animal/pet/death(gibbed)
|
||||
..(gibbed)
|
||||
if(collar_type)
|
||||
collar_type = "[initial(collar_type)]_dead"
|
||||
regenerate_icons()
|
||||
|
||||
/mob/living/simple_animal/pet/gib()
|
||||
if(pcollar)
|
||||
new pcollar(drop_location())
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/pet/regenerate_icons()
|
||||
cut_overlays()
|
||||
if(collar)
|
||||
add_overlay(collar)
|
||||
if(pettag)
|
||||
add_overlay(pettag)
|
||||
if(pcollar && collar_type)
|
||||
add_overlay("[collar_type]collar")
|
||||
add_overlay("[collar_type]tag")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user