Skip to content

Commit

Permalink
[MIRROR] Cytology Adjacent Update #1: New pet food, made from pets. B…
Browse files Browse the repository at this point in the history
…uffs health of selected simple mobs. (tgstation#879)

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

* doggy dog world

* space begone

* suggestions from review

* removes frog related oopsie

* indent fix

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

Co-authored-by: Krysonism <49783092+Krysonism@users.noreply.github.com>
  • Loading branch information
ms-mirror-bot and Krysonism committed Oct 1, 2021
1 parent 0f0816b commit 6522c31
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 5 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#define STATUS_EFFECT_LIGHTNINGORB /datum/status_effect/lightningorb //Speed from a lightning orb!

#define STATUS_EFFECT_MAYHEM /datum/status_effect/mayhem //Total bloodbath. Activated by orb of mayhem pickup/bottle of mayhem item.
///Has had their health buffed 10% to 30% depending if the effect has been reapplied.
#define STATUS_EFFECT_HEALTH_BUFFED /datum/status_effect/limited_buff/health_buff

/////////////
// 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 heal.
/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)
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."))

20 changes: 20 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,23 @@
/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)
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
47 changes: 47 additions & 0 deletions code/game/objects/items/food/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,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 @@ -713,3 +714,49 @@
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 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/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."))
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 @@ -91,7 +91,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 @@ -100,7 +100,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(mapload)
Expand All @@ -116,3 +116,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 @@ -264,3 +264,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.

0 comments on commit 6522c31

Please sign in to comment.