From 1a5bdf4e98f05f0c183e9f5f7ec3a66961bf1ce1 Mon Sep 17 00:00:00 2001 From: KasparoVy <12377767+KasparoVy@users.noreply.github.com> Date: Fri, 22 May 2020 03:25:36 -0400 Subject: [PATCH] Refactors Ore Eating to Allow the Consumption of Material Sheets Refactors ore eating to facilitate the ethical consumption of refined materials, easily obtainable on station. Suggested by the kobolds. Also fixes the material name of Plastitanium glass throughout the codebase. --- code/__defines/misc_vr.dm | 6 +- .../items/weapons/material/shards_vr.dm | 2 +- code/modules/materials/material_sheets.dm | 12 ++ code/modules/materials/material_sheets_vr.dm | 2 +- code/modules/materials/materials_vr.dm | 2 +- code/modules/mining/alloys_vr.dm | 2 +- .../species/station/traits_vr/neutral.dm | 2 +- code/modules/vore/eating/living_vr.dm | 131 +++++++++++++----- vorestation.dme | 6 +- 9 files changed, 118 insertions(+), 47 deletions(-) diff --git a/code/__defines/misc_vr.dm b/code/__defines/misc_vr.dm index 63003d88c99..57c651c1954 100644 --- a/code/__defines/misc_vr.dm +++ b/code/__defines/misc_vr.dm @@ -61,6 +61,6 @@ #define DEPARTMENT_TALON "ITV Talon" -#define MAT_TITANIUMGLASS "ti-glass" -#define MAT_PLASTITANIUM "plastitanium" -#define MAT_PLASTANIUMGLASS "plastitanium glass" \ No newline at end of file +#define MAT_TITANIUMGLASS "ti-glass" +#define MAT_PLASTITANIUM "plastitanium" +#define MAT_PLASTITANIUMGLASS "plastitanium glass" \ No newline at end of file diff --git a/code/game/objects/items/weapons/material/shards_vr.dm b/code/game/objects/items/weapons/material/shards_vr.dm index e59966c9b10..edc6a1efec7 100644 --- a/code/game/objects/items/weapons/material/shards_vr.dm +++ b/code/game/objects/items/weapons/material/shards_vr.dm @@ -2,4 +2,4 @@ ..(loc, MAT_TITANIUMGLASS) /obj/item/weapon/material/shard/plastitaniumglass/New(loc) - ..(loc, MAT_PLASTANIUMGLASS) \ No newline at end of file + ..(loc, MAT_PLASTITANIUMGLASS) \ No newline at end of file diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index 029191ff6e4..2e77ee9e592 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -88,6 +88,18 @@ return return ..() +//VOREStation Add +/obj/item/stack/material/attack(mob/living/M as mob, mob/living/user as mob) + if(M.handle_eat_ore(src, user)) + return + ..() + +/obj/item/stack/material/attack_generic(var/mob/living/user) //Allow adminbussed mobs to eat ore if they click it while NOT on help intent. + if(user.handle_eat_ore(src)) + return + ..() +//VOREStation Add End + /obj/item/stack/material/iron name = "iron" icon_state = "sheet-silver" diff --git a/code/modules/materials/material_sheets_vr.dm b/code/modules/materials/material_sheets_vr.dm index 38eba492634..fa8676d92d8 100644 --- a/code/modules/materials/material_sheets_vr.dm +++ b/code/modules/materials/material_sheets_vr.dm @@ -39,7 +39,7 @@ item_state = "sheet-silver" no_variants = FALSE drop_sound = 'sound/items/drop/glass.ogg' - default_type = MAT_PLASTANIUMGLASS + default_type = MAT_PLASTITANIUMGLASS /obj/fiftyspawner/plastitanium_glass name = "stack of plastitanium glass" diff --git a/code/modules/materials/materials_vr.dm b/code/modules/materials/materials_vr.dm index ec06e880e9f..a5847853d06 100644 --- a/code/modules/materials/materials_vr.dm +++ b/code/modules/materials/materials_vr.dm @@ -65,7 +65,7 @@ composite_material = list(MAT_TITANIUM = SHEET_MATERIAL_AMOUNT, MAT_PLASTEEL = SHEET_MATERIAL_AMOUNT) /material/glass/plastaniumglass - name = MAT_PLASTANIUMGLASS + name = MAT_PLASTITANIUMGLASS display_name = "plas-titanium glass" stack_type = /obj/item/stack/material/glass/plastitanium integrity = 200 diff --git a/code/modules/mining/alloys_vr.dm b/code/modules/mining/alloys_vr.dm index 516beee88f8..6b2348bdbab 100644 --- a/code/modules/mining/alloys_vr.dm +++ b/code/modules/mining/alloys_vr.dm @@ -18,7 +18,7 @@ product = /obj/item/stack/material/glass/titanium /datum/alloy/plastiglass - metaltag = MAT_PLASTANIUMGLASS + metaltag = MAT_PLASTITANIUMGLASS requires = list( "rutile" = 1, "sand" = 2, diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm index 5950d069d5d..72c15722830 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm @@ -101,7 +101,7 @@ /datum/trait/gem_eater name = "Expensive Taste" - desc = "You only gain nutrition from ore. There's nothing that sates the appetite better than precious gems, exotic or rare minerals and you have damn fine taste. Anything else is beneath you." + desc = "You only gain nutrition from raw ore and refined minerals. There's nothing that sates the appetite better than precious gems, exotic or rare minerals and you have damn fine taste. Anything else is beneath you." cost = 0 var_changes = list("gets_food_nutrition" = 0, "eat_ore" = 1) //The verb is given in human.dm diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index 492482eb5c8..25f4043971d 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -668,51 +668,110 @@ to_chat(feeder, "Why is the ore gone?") return - var/obj/item/weapon/ore/O = I - if(!istype(O)) + if(!istype(I)) to_chat(src, "You pause for a moment to examine [I] and realize it's not even worth the energy to chew.") return - else - //Eat the ore using the vorebelly for the sound then get rid of the ore to prevent infinite nutrition. - feeder.drop_item() - O.forceMove(vore_selected) - qdel(O) - if(feeder != src) - to_chat(feeder, "You feed [O] to [src].") - log_admin("VORE: [feeder] fed [src] [O].") - else - log_admin("VORE: [src] used Eat Ore to swallow [O].") + var/list/nom = null + var/material/M = null + if(istype(I, /obj/item/weapon/ore)) //Raw unrefined ore. Some things are just better untempered! + var/obj/item/weapon/ore/O = I //List in list, define by material property of ore in code/mining/modules/ore.dm. //50 nutrition = 5 ore to get 250 nutrition. 250 is the beginning of the 'well fed' range. var/list/rock_munch = list( - "uranium" = list("nutrition" = 30, "remark" = "Crunching [O] in your jaws almost makes you wince, a horridly tangy and sour flavour radiating through your mouth. It goes down all the same."), - "hematite" = list("nutrition" = 15, "remark" = "The familiar texture and taste of [O] does the job but leaves little to the imagination and hardly sates your appetite."), - "carbon" = list("nutrition" = 15, "remark" = "Utterly bitter, crunching down on [O] only makes you long for better things. But a snack's a snack..."), - "marble" = list("nutrition" = 40, "remark" = "A fitting dessert, the sweet and savoury [O] lingers on the palate and satisfies your hunger."), - "sand" = list("nutrition" = 0, "remark" = "You crunch on [O] but its texture is almost gag-inducing. Stifling a cough, you somehow manage to swallow both [O] and your regrets."), - "phoron" = list("nutrition" = 30, "remark" = "Crunching [O] to dust between your jaws, a warmth fills your mouth that briefly spreads down the throat to your chest as you swallow."), - "silver" = list("nutrition" = 40, "remark" = "[O] tastes quite nice indeed as you munch on it. A little tarnished, but that's just fine aging."), - "gold" = list("nutrition" = 40, "remark" = "You taste supreme richness that exceeds expectations and satisfies your hunger."), - "diamond" = list("nutrition" = 50, "remark" = "The heavenly taste of [O] almost brings a tear to your eye. Its glimmering gloriousness is even better on the tongue than you imagined, so you savour it fondly."), - "platinum" = list("nutrition" = 40, "remark" = "A bit tangy but elegantly balanced with a long faintly sour finish. Delectible."), - "mhydrogen" = list("nutrition" = 30, "remark" = "Quite sweet on the tongue, you savour the light and easy to chew [O], finishing it quickly."), - "rutile" = list("nutrition" = 50, "remark" = "A little... angular, you savour the light but chewy [O], finishing it quickly."), - MAT_VERDANTIUM = list("nutrition" = 50, "remark" = "You taste scientific mystery and a rare delicacy. Your tastebuds tingle pleasantly as you eat [O] and the feeling warmly blossoms in your chest for a moment."), - MAT_LEAD = list("nutrition" = 40, "remark" = "It takes some work to break down [O] but you manage it, unlocking lasting tangy goodness in the process. Yum."), + "uranium" = list("nutrition" = 30, "remark" = "Crunching [O] in your jaws almost makes you wince, a horribly tangy and sour flavour radiating through your mouth. It goes down all the same.", "WTF" = FALSE), + "hematite" = list("nutrition" = 15, "remark" = "The familiar texture and taste of [O] does the job but leaves little to the imagination and hardly sates your appetite.", "WTF" = FALSE), + "carbon" = list("nutrition" = 15, "remark" = "Utterly bitter, crunching down on [O] only makes you long for better things. But a snack's a snack...", "WTF" = FALSE), + "marble" = list("nutrition" = 40, "remark" = "A fitting dessert, the sweet and savoury [O] lingers on the palate and satisfies your hunger.", "WTF" = FALSE), + "sand" = list("nutrition" = 0, "remark" = "You crunch on [O] but its texture is almost gag-inducing. Stifling a cough, you somehow manage to swallow both [O] and your regrets.", "WTF" = FALSE), + "phoron" = list("nutrition" = 30, "remark" = "Crunching [O] to dust between your jaw you find pleasant, comforting warmth filling your mouth that briefly spreads down the throat to your chest as you swallow.", "WTF" = FALSE), + "silver" = list("nutrition" = 40, "remark" = "[O] tastes quite nice indeed as you munch on it. A little tarnished, but that's just fine aging.", "WTF" = FALSE), + "gold" = list("nutrition" = 40, "remark" = "You taste supreme richness that exceeds expectations and satisfies your hunger.", "WTF" = FALSE), + "diamond" = list("nutrition" = 50, "remark" = "The heavenly taste of [O] almost brings a tear to your eye. Its glimmering gloriousness is even better on the tongue than you imagined, so you savour it fondly.", "WTF" = FALSE), + "platinum" = list("nutrition" = 40, "remark" = "A bit tangy but elegantly balanced with a long faintly sour finish. Delectible.", "WTF" = FALSE), + "mhydrogen" = list("nutrition" = 30, "remark" = "Quite sweet on the tongue, you savour the light and easy to chew [O], finishing it quickly.", "WTF" = FALSE), + "rutile" = list("nutrition" = 50, "remark" = "A little... angular, you savour the light but chewy [O], finishing it quickly.", "WTF" = FALSE), + MAT_VERDANTIUM = list("nutrition" = 50, "remark" = "You taste scientific mystery and a rare delicacy. Your tastebuds tingle pleasantly as you eat [O] and the feeling warmly blossoms in your chest for a moment.", "WTF" = FALSE), + MAT_LEAD = list("nutrition" = 40, "remark" = "It takes some work to break down [O] but you manage it, unlocking lasting tangy goodness in the process. Yum.", "WTF" = FALSE) ) if(O.material in rock_munch) - var/S = rock_munch[O.material] - to_chat(src, "[S["remark"]]") - adjust_nutrition(S["nutrition"]) - else //Handle everything else. - if(istype(O, /obj/item/weapon/ore/slag/)) - to_chat(src, "You taste dusty, crunchy mistakes. This is a travesty... but at least it is an edible one.") - adjust_nutrition(15) - else //Random rock. - to_chat(src, "You taste stony, gravelly goodness - but you crave something with actual nutritional value.") + nom = rock_munch[O.material] + M = name_to_material[O.material] + else if(istype(O, /obj/item/weapon/ore/slag)) + nom = list("nutrition" = 15, "remark" = "You taste dusty, crunchy mistakes. This is a travesty... but at least it is an edible one.", "WTF" = FALSE) + else //Random rock. + nom = list("nutrition" = 0, "remark" = "You taste stony, gravelly goodness - but you crave something with actual nutritional value.", "WTF" = FALSE) - return TRUE //Good eats, cheers mate. + else if(istype(I, /obj/item/stack/material)) //The equivalent of a cooked meal I guess. Stuff that is compressed during refinement has had nutrition bumped up by 5. + var/obj/item/stack/material/O = I + var/list/refined_taste = list( + "uranium" = list("nutrition" = 30, "remark" = "Crunching [O] in your jaws almost makes you wince, a horribly tangy and sour flavour radiating through your mouth. It goes down all the same.", "WTF" = FALSE), + "diamond" = list("nutrition" = 55, "remark" = "After significant effort to crumble the gem, you unlock heavenly flavour that almost brings a tear to your eye. Its glimmering gloriousness is even better on the tongue than you imagined, so you savour it fondly.", "WTF" = FALSE), + "gold" = list("nutrition" = 40, "remark" = "You taste supreme richness that exceeds expectations and satisfies your hunger.", "WTF" = FALSE), + "silver" = list("nutrition" = 40, "remark" = "[O] tastes quite nice indeed as you munch on it. A little tarnished, but that's just fine aging.", "WTF" = FALSE), + "phoron" = list("nutrition" = 35, "remark" = "Crunching [O] to dust between your jaw you find pleasant, comforting warmth filling your mouth that briefly spreads down the throat to your chest as you swallow.", "WTF" = FALSE), + "sandstone" = list("nutrition" = 0, "remark" = "You crumble [O] easily in your jaws but its texture is almost gag-inducing. Stifling a cough, you somehow manage to swallow both [O] and your regrets.", "WTF" = FALSE), + "marble" = list("nutrition" = 40, "remark" = "A fitting dessert, the sweet and savoury [O] lingers on the palate and satisfies your hunger.", "WTF" = FALSE), + DEFAULT_WALL_MATERIAL = list("nutrition" = 20, "remark" = "Rending the [O] apart with ease, you briefly enjoy a classic but unremarkable taste. You need something more substantial.", "WTF" = FALSE), + "plasteel" = list("nutrition" = 40, "remark" = "The elegant taste of a fine richly-augmented alloy, chewing away on [O] yields lasting and satisfying flavour with a traditional metallic tang.", "WTF" = FALSE), + "durasteel" = list("nutrition" = 65, "remark" = "After much grinding the [O] eventually yields a sublime rush of flavours dominated by glorious diamond, further improved by the rich balance platinum and tang carbonic steel both bring to the mix: A supremely full bodied and savoury experience.", "WTF" = FALSE), + MAT_TITANIUM = list("nutrition" = 45, "remark" = "The trademark bite and density of [O], somehow light on the palate with a refreshing coolness that lasts. Much improved with refinement, it certainly hits the spot.", "WTF" = FALSE), + MAT_TITANIUMGLASS = list("nutrition" = 20, "remark" = "Grinding [O] down with a satisfying crunch, you quickly feel a cool and refreshing rush of flavour. It almost makes you even hungrier...", "WTF" = FALSE), + MAT_PLASTITANIUM = list("nutrition" = 60, "remark" = "A glorious marriage of richness and mildly sour with cool refreshing finish. [O] practically begs to be savoured, lingering on the palate long enough to tempt another bite.", "WTF" = FALSE), + MAT_PLASTITANIUMGLASS = list("nutrition" = 25, "remark" = "After some work, you grind [O] down with a satisfying crunch to unleash a sublime mixture of mildly sour richness and cooling refreshment. It readily entices you for another bite.", "WTF" = FALSE), + "glass" = list("nutrition" = 0, "remark" = "All crunch and nothing more, you effortlessly grind [O] down to find it only wets your appetite and dries the throat.", "WTF" = FALSE), + "rglass" = list("nutrition" = 5, "remark" = "With a satisfying crunch, you grind [O] down with ease. It is barely palatable with a subtle metallic tang.", "WTF" = FALSE), + "borosilicate glass" = list("nutrition" = 10, "remark" = "With a satisfying crunch, you grind [O] down with ease and find it somewhat palatable due to a subtle but familiar rush of phoronic warmth.", "WTF" = FALSE), + "reinforced borosilicate glass" = list("nutrition" = 15, "remark" = "With a satisfying crunch, you grind [O] down. It is quite palatable due to a subtle metallic tang and familiar rush of phoronic warmth.", "WTF" = FALSE), + MAT_GRAPHITE = list("nutrition" = 30, "remark" = "Satisfyingly metallic with a mildly savoury tartness, you chew [O] until its flavour is no more but are left longing for another.", "WTF" = FALSE), + "osmium" = list("nutrition" = 45, "remark" = "Successive bites serve to almost chill your palate, a rush of rich and mildly sour flavour unlocked with the grinding of your powerful jaws. Delectible.", "WTF" = FALSE), + "mhydrogen" = list("nutrition" = 35, "remark" = "Quite sweet on the tongue, you savour the light and easy to chew [O], finishing it quickly.", "WTF" = FALSE), + "platinum" = list("nutrition" = 40, "remark" = "A bit tangy but elegantly balanced with a long faintly sour finish. Delectible.", "WTF" = FALSE), + "iron" = list("nutrition" = 15, "remark" = "The familiar texture and taste of [O] does the job but leaves little to the imagination and hardly sates your appetite.", "WTF" = FALSE), + MAT_LEAD = list("nutrition" = 0, "remark" = "It takes some work to break down [O] but you manage it, unlocking lasting tangy goodness in the process. Yum.", "WTF" = FALSE), + MAT_VERDANTIUM = list("nutrition" = 55, "remark" = "You taste scientific mystery and a rare delicacy. Your tastebuds tingle pleasantly as you eat [O] and the feeling warmly blossoms in your chest for a moment.", "WTF" = FALSE), + MAT_MORPHIUM = list("nutrition" = 75, "remark" = "The question, the answer and the taste: It all floods your mouth and your mind to momentarily overwhelm the senses. What the hell was that? Your mouth and throat are left tingling for a while.", "WTF" = 10), + "alienalloy" = list("nutrition" = 120, "remark" = "Working hard for so to rend the material apart has left your jaw sore, but a veritable explosion of mind boggling indescribable flavour is unleashed. Completely alien sensations dazes and overwhelms you while it feels like an interdimensional rift opened in your mouth, briefly numbing your face.", "WTF" = 15) + ) + if(O.default_type in refined_taste) + var/obj/item/stack/material/stack = O.split(1) //A little off the top. + I = stack + nom = refined_taste[O.default_type] + M = name_to_material[O.default_type] + + if(nom) //Ravenous 1-4, snackage confirmed. Clear for chowdown, over. + playsound(src, 'sound/items/eatfood.ogg', rand(10,50), 1) + var/T = (istype(M) ? M.hardness/40 : 1) SECONDS //1.5 seconds to eat a sheet of metal. 2.5 for durasteel and diamond & 1 by default (applies to some ores like raw carbon, slag, etc. + to_chat(src, "You start crunching on [I] with your powerful jaws, attempting to tear it apart...") + if(do_after(feeder, T, ignore_movement = TRUE, exclusive = TRUE)) + if(feeder != src) + to_chat(feeder, "You feed [I] to [src].") + log_admin("VORE: [feeder] fed [src] [I].") + else + log_admin("VORE: [src] used Eat Ore to swallow [I].") + //Eat the ore using the vorebelly for the sound then get rid of the ore to prevent infinite nutrition. + drop_from_inventory(I, vore_selected) //Never touches the ground - straight to the gut. + visible_message("[src] crunches [I] to pieces and swallows it down.", + "[nom["remark"]]", + "You hear the gnashing of jaws with some ominous grinding and crunching noises, then... Swallowing?") + + adjust_nutrition(nom["nutrition"]) + qdel(I) + + if(nom["WTF"]) //Bites back. + H.Weaken(2) + H.Confuse(nom["WTF"]) + H.apply_effect(nom["WTF"], STUTTER) + H.make_jittery(nom["WTF"]) + H.make_dizzy(nom["WTF"]) + H.druggy = max(H.druggy, nom["WTF"]) + + return TRUE + else + to_chat(src, "You were interrupted while gnawing on [I]!") + + else //Not the droids we're looking for. + to_chat(src, "You pause for a moment to examine [I] and realize it's not even worth the energy to chew.") //If it ain't ore or the type of sheets we can eat, bugger off! /mob/living/proc/switch_scaling() set name = "Switch scaling mode" diff --git a/vorestation.dme b/vorestation.dme index b6101c30d9f..a78b1f1a002 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -1641,9 +1641,9 @@ #include "code\modules\ai\ai_holder_targeting_vr.dm" #include "code\modules\ai\interfaces.dm" #include "code\modules\ai\say_list.dm" -#include "code\modules\ai\ai_holder_subtypes\simple_mob_ai.dm" -#include "code\modules\ai\ai_holder_subtypes\simple_mob_ai_vr.dm" -#include "code\modules\ai\ai_holder_subtypes\slime_xenobio_ai.dm" +#include "code\modules\ai\aI_holder_subtypes\simple_mob_ai.dm" +#include "code\modules\ai\aI_holder_subtypes\simple_mob_ai_vr.dm" +#include "code\modules\ai\aI_holder_subtypes\slime_xenobio_ai.dm" #include "code\modules\alarm\alarm.dm" #include "code\modules\alarm\alarm_handler.dm" #include "code\modules\alarm\atmosphere_alarm.dm"