Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cytology Adjacent Update #1: New pet food, made from pets. Buffs health of selected simple mobs. #61532

Merged
merged 6 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

#define STATUS_EFFECT_MAYHEM /datum/status_effect/mayhem //Total bloodbath. Activated by orb of mayhem pickup/bottle of mayhem item.

#define STATUS_EFFECT_HEALTH_BUFFED /datum/status_effect/limited_buff/health_buff //Has had their health buffed 10% to 30% depending if the effect has been reapplied.
Krysonism marked this conversation as resolved.
Show resolved Hide resolved

/////////////
// DEBUFFS //
/////////////
Expand Down
34 changes: 34 additions & 0 deletions code/datums/status_effects/buffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -522,3 +522,37 @@
/datum/movespeed_modifier/status_speed_boost
multiplicative_slowdown = -1

//this buff provides a max health buff and a health
Krysonism marked this conversation as resolved.
Show resolved Hide resolved
/datum/status_effect/limited_buff/health_buff
id = "health_buff"
alert_type = null
///This var stores the mobs max health when the buff was first applied, and determines the size of future buffs.database.database.
var/historic_max_health
///This var determines how large the health buff will be. health_buff_modifier * historic_max_health * stacks
var/health_buff_modifier = 0.1 //translate to a 10% buff over historic health per stack
///This modifier multiplies the healing by the effect.
var/healing_modifier = 2
///If the mob has a low max health, we instead use this flat value to increase max health and calculate any heal.
var/fragile_mob_health_buff = 10

/datum/status_effect/limited_buff/health_buff/on_creation(mob/living/new_owner, ...)
Krysonism marked this conversation as resolved.
Show resolved Hide resolved
historic_max_health = new_owner.maxHealth
. = ..()

/datum/status_effect/limited_buff/health_buff/on_apply()
. = ..()
var/health_increase = round(max(fragile_mob_health_buff, historic_max_health * health_buff_modifier))
owner.maxHealth += health_increase
owner.balloon_alert_to_viewers("health buffed")
to_chat(owner, span_nicegreen("You feel healthy, like if your body is little stronger than it was a moment ago."))

if(isanimal(owner)) //dumb animals have their own proc for healing.
var/mob/living/simple_animal/healthy_animal = owner
healthy_animal.adjustHealth(-(health_increase * healing_modifier))
else
owner.adjustBruteLoss(-(health_increase * healing_modifier))

/datum/status_effect/limited_buff/health_buff/maxed_out()
. = ..()
to_chat(owner, span_warning("You don't feel any healthier."))

21 changes: 21 additions & 0 deletions code/datums/status_effects/status_effect.dm
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,24 @@
/datum/status_effect/grouped/before_remove(source)
sources -= source
return !length(sources)

//These effects reapplies their on_apply() effect when refreshed while stacks < max_stacks
/datum/status_effect/limited_buff
id = "limited_buff"
duration = -1
status_type = STATUS_EFFECT_REFRESH
///How many stacks we currently have
var/stacks = 1
///How many stacks we can have maximum
var/max_stacks = 3

/datum/status_effect/limited_buff/refresh(effect, ...)
Krysonism marked this conversation as resolved.
Show resolved Hide resolved
. = ..()
Krysonism marked this conversation as resolved.
Show resolved Hide resolved
if(stacks < max_stacks)
on_apply()
stacks++
else
maxed_out()

/datum/status_effect/limited_buff/proc/maxed_out()
return
6 changes: 3 additions & 3 deletions code/game/objects/items/food/lizard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@
/obj/item/food/canned_jellyfish
name = "canned gunner jellyfish"
desc = "A can of gunner jellyfish packed in brine. Contains a mild hallucinogen which is destroyed by cooking."
icon = 'icons/obj/food/lizard.dmi'
icon = 'icons/obj/food/canned.dmi'
icon_state = "canned_jellyfish"
food_reagents = list(/datum/reagent/consumable/nutriment/protein = 4, /datum/reagent/toxin/mindbreaker = 2, /datum/reagent/consumable/salt = 1)
tastes = list("slime" = 1, "burning" = 1, "salt" = 1)
Expand All @@ -587,7 +587,7 @@
/obj/item/food/desert_snails
name = "canned desert snails"
desc = "Giant snails from the Tiziran desert, packaged in brine. Shells included. Probably best not eaten raw, unless you're a lizard."
icon = 'icons/obj/food/lizard.dmi'
icon = 'icons/obj/food/canned.dmi'
icon_state = "canned_snails"
food_reagents = list(/datum/reagent/consumable/nutriment/protein = 4, /datum/reagent/consumable/salt = 2)
tastes = list("snails" = 1)
Expand All @@ -597,7 +597,7 @@
/obj/item/food/larvae
name = "canned bee larva"
desc = "A can of bee larva packaged in honey. Probably appetizing to someone."
icon = 'icons/obj/food/lizard.dmi'
icon = 'icons/obj/food/canned.dmi'
icon_state = "canned_larvae"
food_reagents = list(/datum/reagent/consumable/nutriment/protein = 4, /datum/reagent/consumable/honey = 2)
tastes = list("sweet bugs" = 1)
Expand Down
46 changes: 46 additions & 0 deletions code/game/objects/items/food/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@
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
Expand Down Expand Up @@ -705,3 +706,48 @@
foodtypes = JUNKFOOD | SUGAR | GROSS
food_flags = FOOD_FINGER_FOOD
w_class = WEIGHT_CLASS_TINY

/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 tecniques."
Krysonism marked this conversation as resolved.
Show resolved Hide resolved
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/afterattack(atom/target, mob/user, proximity_flag)
. = ..()
if(!proximity_flag)
return
if(!isanimal(target))
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/simple_animal/hungry_pet)
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(STATUS_EFFECT_HEALTH_BUFFED) //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."))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only indent once for the visible message, kinda like how you don't want to over-indent for lists

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)
9 changes: 7 additions & 2 deletions code/game/objects/items/trash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

/obj/item/trash/can/food/peaches
name = "canned peaches"
icon = 'icons/obj/food/food.dmi'
icon = 'icons/obj/food/canned.dmi'
icon_state = "peachcan_empty"

/obj/item/trash/can/food/peaches/maint
Expand All @@ -96,7 +96,7 @@

/obj/item/trash/can/food/beans
name = "tin of beans"
icon = 'icons/obj/food/food.dmi'
icon = 'icons/obj/food/canned.dmi'
icon_state = "beans_empty"

/obj/item/trash/can/Initialize()
Expand All @@ -112,3 +112,8 @@
/obj/item/trash/cnds
name = "\improper C&Ds packet"
icon_state = "cnds"

/obj/item/trash/can/food/envirochow
name = "dog eat dog envirochow"
icon = 'icons/obj/food/canned.dmi'
icon_state = "envirochow_empty"
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,12 @@
)
result = /obj/item/food/full_english
subcategory = CAT_MEAT

/datum/crafting_recipe/food/envirochow
name = "Envirochow"
reqs = list(
/obj/item/food/meat/slab/corgi = 2,
/datum/reagent/consumable/nutriment/vitamin = 5,
)
result = /obj/item/food/canned/envirochow
subcategory = CAT_MEAT
Binary file added icons/obj/food/canned.dmi
Binary file not shown.
Binary file modified icons/obj/food/food.dmi
Binary file not shown.
Binary file modified icons/obj/food/lizard.dmi
Binary file not shown.