Files
Bubberstation/code/game/objects/items/food/packaged.dm
SkyratBot 408f0e9c5a [MIRROR] Audits usage of isanimal() vs isanimal_or_basic_mob() [MDB IGNORE] (#19938)
* Audits usage of isanimal() vs isanimal_or_basic_mob() (#74029)

## About The Pull Request

There's a couple of open issues which fix places where only simple
animals were considered, but they are doing it piecemeal.
I decided to just go through every instance of `isanimal` or
`subtypesof(mob/living/simple_animal)` I could find, identify which
should also affect basic mobs, and fix them.

I left out the two others which are already in PR, I'm not stealing your
GBP.

Fixes https://github.com/tgstation/tgstation/issues/68881

## Why It's Good For The Game

Consistency, mostly.
As far as I can tell all of these things _should_ have effected basic
mobs, but didn't.
This fixes a fair number of bugs but also they're bugs that nobody
noticed or reported.

There are a couple of places I did not update which will need updating
in future. These are:
- Dextrousness checks, because basic mobs don't have that yet.
- The Charge cooldown action, because frankly I couldn't tell what it
was trying to do.

alright here goes

## Changelog

🆑
fix: Carp will once again be healed from being near carp rifts
fix: Sepia slime cores and the rewind camera now work on Ian
fix: Sapient ridden carp (or cows) can throw off their riders by shoving
them, or by performing the spin emote.
fix: Giant Spider AI will be disabled by the timestop spell
fix: Ian can eat envirochow
fix: Mice, Frogs, and Cockroaches will no longer set off bear traps
fix: You can put a macrobomb implant into Cayenne (or Ian)
fix: Ian will now recognise that being squeezed by a cyborg is a nice
hug
fix: The player panel will tell admins if you're currently a corgi
fix: The staff of storms deals massive damage to Bileworms and Giant
Spiders
fix: Ian will whimper if forced to scream
fix: Slimes can consume space carp
fix: Mice can be captured in xenoballs
fix: You can use pacifying potions on Giant Spiders
fix: Sgt Araneus can be fitted with a xenobiological radio implant
fix: Sapient corgis no longer count as living players for the purpose of
highlander escape objectives
fix: The random sentience event can now target corgis and sergeant
araneus
add: The random sentience event can target a wider array of farm animals
fix: Petsplosion wizard event can target corgis
add: Petsplosion wizard event will now target farm animals and
mothroaches
fix: The colossus possession crystal can now actually possess the
cockroach it spawns, does not kill you instantly upon ending possession
/🆑

* Audits usage of isanimal() vs isanimal_or_basic_mob()

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-03-18 03:15:31 -07:00

243 lines
8.6 KiB
Plaintext

// Pre-packaged meals, canned, wrapped, and vended
// Cans
/obj/item/food/canned
name = "Canned Air"
desc = "If you ever wondered where air came from..."
food_reagents = list(
/datum/reagent/oxygen = 6,
/datum/reagent/nitrogen = 24,
)
icon = 'icons/obj/food/canned.dmi'
icon_state = "peachcan"
food_flags = FOOD_IN_CONTAINER
w_class = WEIGHT_CLASS_NORMAL
max_volume = 30
w_class = WEIGHT_CLASS_SMALL
preserved_food = TRUE
/obj/item/food/canned/proc/open_can(mob/user)
to_chat(user, span_notice("You pull back the tab of \the [src]."))
playsound(user.loc, 'sound/items/foodcanopen.ogg', 50)
reagents.flags |= OPENCONTAINER
preserved_food = FALSE
make_decompose()
/obj/item/food/canned/attack_self(mob/user)
if(!is_drainable())
open_can(user)
icon_state = "[icon_state]_open"
return ..()
/obj/item/food/canned/attack(mob/living/target, mob/user, def_zone)
if (!is_drainable())
to_chat(user, span_warning("[src]'s lid hasn't been opened!"))
return FALSE
return ..()
/obj/item/food/canned/beans
name = "tin of beans"
desc = "Musical fruit in a slightly less musical container."
icon_state = "beans"
trash_type = /obj/item/trash/can/food/beans
food_reagents = list(
/datum/reagent/consumable/nutriment = 4,
/datum/reagent/consumable/nutriment/protein = 9,
/datum/reagent/consumable/ketchup = 4,
)
tastes = list("beans" = 1)
foodtypes = VEGETABLES
/obj/item/food/canned/peaches
name = "canned peaches"
desc = "Just a nice can of ripe peaches swimming in their own juices."
icon_state = "peachcan"
trash_type = /obj/item/trash/can/food/peaches
food_reagents = list(
/datum/reagent/consumable/peachjuice = 20,
/datum/reagent/consumable/sugar = 8,
/datum/reagent/consumable/nutriment = 2,
)
tastes = list("peaches" = 7, "tin" = 1)
foodtypes = FRUIT | SUGAR
/obj/item/food/canned/peaches/maint
name = "Maintenance Peaches"
desc = "I have a mouth and I must eat."
icon_state = "peachcanmaint"
trash_type = /obj/item/trash/can/food/peaches/maint
tastes = list("peaches" = 1, "tin" = 7)
venue_value = FOOD_PRICE_EXOTIC
/obj/item/food/canned/tomatoes
name = "canned San Marzano tomatoes"
desc = "A can of premium San Marzano tomatoes, from the hills of Southern Italy."
icon_state = "tomatoescan"
trash_type = /obj/item/trash/can/food/tomatoes
food_reagents = list(
/datum/reagent/consumable/tomatojuice = 20,
/datum/reagent/consumable/salt = 2,
)
tastes = list("tomato" = 7, "tin" = 1)
foodtypes = VEGETABLES //fuck you, real life!
/obj/item/food/canned/pine_nuts
name = "canned pine nuts"
desc = "A small can of pine nuts. Can be eaten on their own, if you're into that."
icon_state = "pinenutscan"
trash_type = /obj/item/trash/can/food/pine_nuts
food_reagents = list(/datum/reagent/consumable/nutriment/vitamin = 3)
tastes = list("pine nuts" = 1)
foodtypes = NUTS
w_class = WEIGHT_CLASS_SMALL
/obj/item/food/canned/envirochow
name = "dog eat dog envirochow"
desc = "The first pet food product that is made fully sustainable by employing ancient British animal husbandry techniques."
icon_state = "envirochow"
trash_type = /obj/item/trash/can/food/envirochow
food_reagents = list(
/datum/reagent/consumable/nutriment/protein = 9,
/datum/reagent/consumable/nutriment/vitamin = 4,
)
tastes = list("dog food" = 5, "狗肉" = 3)
foodtypes = MEAT | GROSS
/obj/item/food/canned/envirochow/attack_animal(mob/living/simple_animal/user, list/modifiers)
if(!check_buffability(user))
return ..()
apply_buff(user)
/obj/item/food/canned/envirochow/attack_basic_mob(mob/living/basic/user, list/modifiers)
if(!check_buffability(user))
return ..()
apply_buff(user)
/obj/item/food/canned/envirochow/afterattack(atom/target, mob/user, proximity_flag)
. = ..()
if(!proximity_flag)
return
if(!check_buffability(target))
return
apply_buff(target, user)
///This proc checks if the mob is able to recieve the buff.
/obj/item/food/canned/envirochow/proc/check_buffability(mob/living/hungry_pet)
if(!isanimal_or_basicmob(hungry_pet)) // Not a pet
return FALSE
if(!is_drainable()) // Can is not open
return FALSE
if(hungry_pet.stat) // Parrot deceased
return FALSE
if(hungry_pet.mob_biotypes & (MOB_BEAST|MOB_REPTILE|MOB_BUG))
return TRUE
else
return FALSE // Humans, robots & spooky ghosts not allowed
///This makes the animal eat the food, and applies the buff status effect to them.
/obj/item/food/canned/envirochow/proc/apply_buff(mob/living/simple_animal/hungry_pet, mob/living/dog_mom)
hungry_pet.apply_status_effect(/datum/status_effect/limited_buff/health_buff) //the status effect keeps track of the stacks
hungry_pet.visible_message(
span_notice("[hungry_pet] chows down on [src]."),
span_nicegreen("You chow down on [src]."),
span_notice("You hear sloppy eating noises."))
SEND_SIGNAL(src, COMSIG_FOOD_CONSUMED, hungry_pet, dog_mom ? dog_mom : hungry_pet) //If there is no dog mom, we assume the pet fed itself.
playsound(loc, 'sound/items/eatfood.ogg', rand(30, 50), TRUE)
qdel(src)
// DONK DINNER: THE INNOVATIVE WAY TO GET YOUR DAILY RECOMMENDED ALLOWANCE OF SALT... AND THEN SOME!
/obj/item/food/ready_donk
name = "\improper Ready-Donk: Bachelor Chow"
desc = "A quick Donk-dinner: now with flavour!"
icon_state = "ready_donk"
trash_type = /obj/item/trash/ready_donk
food_reagents = list(/datum/reagent/consumable/nutriment = 5)
tastes = list("food?" = 2, "laziness" = 1)
foodtypes = MEAT | JUNKFOOD
food_flags = FOOD_FINGER_FOOD
w_class = WEIGHT_CLASS_SMALL
/// What type of ready-donk are we warmed into?
var/warm_type = /obj/item/food/ready_donk/warm
/obj/item/food/ready_donk/make_bakeable()
AddComponent(/datum/component/bakeable, warm_type, rand(15 SECONDS, 20 SECONDS), TRUE, TRUE)
/obj/item/food/ready_donk/make_microwaveable()
AddElement(/datum/element/microwavable, warm_type)
/obj/item/food/ready_donk/examine_more(mob/user)
. = ..()
. += span_notice("<i>You browse the back of the box...</i>")
. += "\t[span_info("Ready-Donk: a product of Donk Co.")]"
. += "\t[span_info("Heating instructions: open box and pierce film, heat in microwave on high for 2 minutes. Allow to stand for 60 seconds prior to eating. Product will be hot.")]"
. += "\t[span_info("Per 200g serving contains: 8g Sodium; 25g Fat, of which 22g are saturated; 2g Sugar.")]"
return .
/obj/item/food/ready_donk/warm
name = "warm Ready-Donk: Bachelor Chow"
desc = "A quick Donk-dinner, now with flavour! And it's even hot!"
icon_state = "ready_donk_warm"
food_reagents = list(
/datum/reagent/consumable/nutriment = 5,
/datum/reagent/medicine/omnizine = 3,
)
tastes = list("food?" = 2, "laziness" = 1)
// Don't burn your warn ready donks.
warm_type = /obj/item/food/badrecipe
/obj/item/food/ready_donk/mac_n_cheese
name = "\improper Ready-Donk: Donk-a-Roni"
desc = "Neon-orange mac n' cheese in seconds!"
tastes = list("cheesy pasta" = 2, "laziness" = 1)
foodtypes = GRAIN | DAIRY | JUNKFOOD
warm_type = /obj/item/food/ready_donk/warm/mac_n_cheese
/obj/item/food/ready_donk/warm/mac_n_cheese
name = "warm Ready-Donk: Donk-a-Roni"
desc = "Neon-orange mac n' cheese, ready to eat!"
icon_state = "ready_donk_warm_mac"
tastes = list("cheesy pasta" = 2, "laziness" = 1)
foodtypes = GRAIN | DAIRY | JUNKFOOD
/obj/item/food/ready_donk/donkhiladas
name = "\improper Ready-Donk: Donkhiladas"
desc = "Donk Co's signature Donkhiladas with Donk sauce, for an 'authentic' taste of Mexico."
tastes = list("enchiladas" = 2, "laziness" = 1)
foodtypes = GRAIN | DAIRY | MEAT | VEGETABLES | JUNKFOOD
warm_type = /obj/item/food/ready_donk/warm/donkhiladas
/obj/item/food/ready_donk/warm/donkhiladas
name = "warm Ready-Donk: Donkhiladas"
desc = "Donk Co's signature Donkhiladas with Donk sauce, served as hot as the Mexican sun."
icon_state = "ready_donk_warm_mex"
tastes = list("enchiladas" = 2, "laziness" = 1)
foodtypes = GRAIN | DAIRY | MEAT | VEGETABLES | JUNKFOOD
// Rations
/obj/item/food/rationpack
name = "ration pack"
desc = "A square bar that sadly <i>looks</i> like chocolate, packaged in a nondescript grey wrapper. Has saved soldiers' lives before - usually by stopping bullets."
icon_state = "rationpack"
bite_consumption = 3
junkiness = 15
tastes = list("cardboard" = 3, "sadness" = 3)
foodtypes = null //Don't ask what went into them. You're better off not knowing.
food_reagents = list(
/datum/reagent/consumable/nutriment/stabilized = 10,
/datum/reagent/consumable/nutriment = 2,
) //Won't make you fat. Will make you question your sanity.
///Override for checkliked callback
/obj/item/food/rationpack/make_edible()
. = ..()
AddComponent(/datum/component/edible, check_liked = CALLBACK(src, PROC_REF(check_liked)))
/obj/item/food/rationpack/proc/check_liked(fraction, mob/mob) //Nobody likes rationpacks. Nobody.
return FOOD_DISLIKED