diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index 0232cff4d36e0a..c806e2f63a73f5 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -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 // diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index a114cc5a83c2ce..eb2bee94cec096 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -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.")) + diff --git a/code/datums/status_effects/status_effect.dm b/code/datums/status_effects/status_effect.dm index 85e18550ff9f85..eeedc36f99915a 100644 --- a/code/datums/status_effects/status_effect.dm +++ b/code/datums/status_effects/status_effect.dm @@ -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 diff --git a/code/game/objects/items/food/lizard.dm b/code/game/objects/items/food/lizard.dm index 09608ac78c9f82..9553e0225348f5 100644 --- a/code/game/objects/items/food/lizard.dm +++ b/code/game/objects/items/food/lizard.dm @@ -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) @@ -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) @@ -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) diff --git a/code/game/objects/items/food/misc.dm b/code/game/objects/items/food/misc.dm index b41810a921361c..3d0936e31f6f67 100644 --- a/code/game/objects/items/food/misc.dm +++ b/code/game/objects/items/food/misc.dm @@ -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 @@ -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) diff --git a/code/game/objects/items/trash.dm b/code/game/objects/items/trash.dm index 37feb31e3f0fce..4a8203c525a1c0 100644 --- a/code/game/objects/items/trash.dm +++ b/code/game/objects/items/trash.dm @@ -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 @@ -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) @@ -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" diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_meat.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_meat.dm index 688dedbd7ed1f6..1969e88b04c1b6 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_meat.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_meat.dm @@ -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 diff --git a/icons/obj/food/canned.dmi b/icons/obj/food/canned.dmi new file mode 100644 index 00000000000000..73a90b8c54f52c Binary files /dev/null and b/icons/obj/food/canned.dmi differ diff --git a/icons/obj/food/food.dmi b/icons/obj/food/food.dmi index dfa70a2bb5ab80..1a5d7fd5173c10 100644 Binary files a/icons/obj/food/food.dmi and b/icons/obj/food/food.dmi differ diff --git a/icons/obj/food/lizard.dmi b/icons/obj/food/lizard.dmi index d6303de5589620..25ea72ec4a262e 100644 Binary files a/icons/obj/food/lizard.dmi and b/icons/obj/food/lizard.dmi differ