Moths can now eat clothes (#39350)

* Moths can now eat clothes

* Remove old call hacky fix

* Fix damage sound, cleaned code
This commit is contained in:
Jared-Fogle
2018-08-04 19:28:33 -07:00
committed by oranges
parent 9cfe6aac14
commit eecbc99d87
2 changed files with 17 additions and 0 deletions
+1
View File
@@ -56,6 +56,7 @@
#define isslimeperson(A) (is_species(A, /datum/species/jelly/slime))
#define isluminescent(A) (is_species(A, /datum/species/jelly/luminescent))
#define iszombie(A) (is_species(A, /datum/species/zombie))
#define ismoth(A) (is_species(A, /datum/species/moth))
#define ishumanbasic(A) (is_species(A, /datum/species/human))
//why arent catpeople a subspecies
+16
View File
@@ -56,6 +56,22 @@
if(M.putItemFromInventoryInHandIfPossible(src, H.held_index))
add_fingerprint(usr)
/obj/item/reagent_containers/food/snacks/clothing
name = "oops"
desc = "If you're reading this it means I messed up. This is related to moths eating clothes and I didn't know a better way to do it than making a new food object."
list_reagents = list("nutriment" = 1)
tastes = list("dust" = 1, "lint" = 1)
/obj/item/clothing/attack(mob/M, mob/user, def_zone)
if(user.a_intent != INTENT_HARM && ismoth(M))
var/obj/item/reagent_containers/food/snacks/clothing/clothing_as_food = new
clothing_as_food.name = name
if(clothing_as_food.attack(M, user, def_zone))
take_damage(15, sound_effect=FALSE)
qdel(clothing_as_food)
else
return ..()
/obj/item/clothing/attackby(obj/item/W, mob/user, params)
if(damaged_clothes && istype(W, /obj/item/stack/sheet/cloth))
var/obj/item/stack/sheet/cloth/C = W