Merge pull request #8029 from KasparoVy/a-well-cooked-meal

Refactors Ore Eating to Allow the Consumption of Material Sheets
This commit is contained in:
Aronai Sieyes
2020-05-22 16:27:15 -04:00
committed by GitHub
10 changed files with 128 additions and 57 deletions

View File

@@ -61,6 +61,6 @@
#define DEPARTMENT_TALON "ITV Talon"
#define MAT_TITANIUMGLASS "ti-glass"
#define MAT_PLASTITANIUM "plastitanium"
#define MAT_PLASTANIUMGLASS "plastitanium glass"
#define MAT_TITANIUMGLASS "ti-glass"
#define MAT_PLASTITANIUM "plastitanium"
#define MAT_PLASTITANIUMGLASS "plastitanium glass"

View File

@@ -2,4 +2,4 @@
..(loc, MAT_TITANIUMGLASS)
/obj/item/weapon/material/shard/plastitaniumglass/New(loc)
..(loc, MAT_PLASTANIUMGLASS)
..(loc, MAT_PLASTITANIUMGLASS)

View File

@@ -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_minerals(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_minerals(src))
return
..()
//VOREStation Add End
/obj/item/stack/material/iron
name = "iron"
icon_state = "sheet-silver"

View File

@@ -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"

View File

@@ -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

View File

@@ -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,

View File

@@ -125,12 +125,12 @@
//VOREStation Add
/obj/item/weapon/ore/attack(mob/living/M as mob, mob/living/user as mob)
if(M.handle_eat_ore(src, user))
if(M.handle_eat_minerals(src, user))
return
..()
/obj/item/weapon/ore/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))
if(user.handle_eat_minerals(src))
return
..()
//VOREStation Add End

View File

@@ -5,7 +5,7 @@
var/metabolism = 0.0015
var/lightweight = FALSE //Oof! Nonhelpful bump stumbles.
var/trashcan = FALSE //It's always sunny in the wrestling ring.
var/eat_ore = FALSE //HEAVY METAL DIET
var/eat_minerals = FALSE //HEAVY METAL DIET
var/base_species = null // Unused outside of a few species
var/selects_bodytype = FALSE // Allows the species to choose from body types intead of being forced to be just one.

View File

@@ -101,13 +101,13 @@
/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
var_changes = list("gets_food_nutrition" = 0, "eat_minerals" = 1)
/datum/trait/gem_eater/apply(var/datum/species/S,var/mob/living/carbon/human/H)
..(S,H)
H.verbs |= /mob/living/proc/eat_ore
H.verbs |= /mob/living/proc/eat_minerals
/datum/trait/glowing_eyes
name = "Glowing Eyes"

View File

@@ -29,7 +29,7 @@
var/can_be_drop_pred = TRUE // Mobs are pred by default.
var/next_preyloop // For Fancy sound internal loop
var/adminbus_trash = FALSE // For abusing trash eater for event shenanigans.
var/adminbus_eat_ore = FALSE // This creature subsists on a diet of pure adminium.
var/adminbus_eat_minerals = FALSE // This creature subsists on a diet of pure adminium.
var/vis_height = 32 // Sprite height used for resize features.
//
@@ -646,17 +646,17 @@
to_chat(src, "<span class='notice'>This item is not appropriate for ethical consumption.</span>")
return
/mob/living/proc/eat_ore() //Actual eating abstracted so the user isn't given a prompt due to an argument in this verb.
set name = "Eat Ore"
/mob/living/proc/eat_minerals() //Actual eating abstracted so the user isn't given a prompt due to an argument in this verb.
set name = "Eat Minerals"
set category = "Abilities"
set desc = "Consume held ore and gems. Snack time!"
set desc = "Consume held raw ore, gems and refined minerals. Snack time!"
handle_eat_ore()
handle_eat_minerals()
/mob/living/proc/handle_eat_ore(obj/item/snack, mob/living/user)
/mob/living/proc/handle_eat_minerals(obj/item/snack, mob/living/user)
var/mob/living/feeder = user ? user : src //Whoever's doing the feeding - us or someone else.
var/mob/living/carbon/human/H = src
if(!(adminbus_eat_ore || (istype(H) && H.species.eat_ore))) //Am I awesome enough to eat a shiny rock?
if(!(adminbus_eat_minerals || (istype(H) && H.species.eat_minerals))) //Am I awesome enough to eat a shiny rock?
return
if(!vore_selected)
@@ -665,54 +665,113 @@
var/obj/item/I = (snack ? snack : feeder.get_active_hand())
if(!I)
to_chat(feeder, "<span class='notice'>Why is the ore gone?</span>")
to_chat(feeder, "<span class='notice'>You look longingly at your empty hands, imagining if they held something edible...</span>")
return
var/obj/item/weapon/ore/O = I
if(!istype(O))
if(!istype(I))
to_chat(src, "<span class='notice'>You pause for a moment to examine [I] and realize it's not even worth the energy to chew.</span>")
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, "<span class='notice'>You feed [O] to [src].</span>")
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, "<span class='notice'>[S["remark"]]</span>")
adjust_nutrition(S["nutrition"])
else //Handle everything else.
if(istype(O, /obj/item/weapon/ore/slag/))
to_chat(src, "<span class='notice'>You taste dusty, crunchy mistakes. This is a travesty... but at least it is an edible one.</span>")
adjust_nutrition(15)
else //Random rock.
to_chat(src, "<span class='notice'>You taste stony, gravelly goodness - but you crave something with actual nutritional value.</span>")
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 long to rend the material apart has left your jaw sore, but a veritable explosion of mind boggling indescribable flavour is unleashed. Completely alien sensations daze and overwhelm 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, "<span class='notice'>You start crunching on [I] with your powerful jaws, attempting to tear it apart...</span>")
if(do_after(feeder, T, ignore_movement = TRUE, exclusive = TRUE)) //Eat on the move, but not multiple things at once.
if(feeder != src)
to_chat(feeder, "<span class='notice'>You feed [I] to [src].</span>")
log_admin("VORE: [feeder] fed [src] [I].")
else
log_admin("VORE: [src] used Eat Minerals 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.",
"<span class='notice'>[nom["remark"]]</span>",
"<span class='notice'>You hear the gnashing of jaws with some ominous grinding and crunching noises, then... Swallowing?</span>")
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, "<span class='notice'>You were interrupted while gnawing on [I]!</span>")
else //Not the droids we're looking for.
to_chat(src, "<span class='notice'>You pause for a moment to examine [I] and realize it's not even worth the energy to chew.</span>") //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"