Skip to content

Commit

Permalink
Merge pull request #3688 from MistakeNot4892/feature/utensils
Browse files Browse the repository at this point in the history
Reworks utensils.
  • Loading branch information
out-of-phaze authored Feb 27, 2024
2 parents ca4d060 + 10c9fd4 commit d965c9d
Show file tree
Hide file tree
Showing 54 changed files with 414 additions and 271 deletions.
16 changes: 14 additions & 2 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -318,5 +318,17 @@
#define LEVEL_ABOVE_PLATING 2

// Defines for fluorescence (/atom/var/fluorescent)
#define FLUORESCENT_GLOWS 1 // Glows when under flourescent light
#define FLUORESCENT_GLOWING 2 // Currently glowing due to flourescent light
/// Glows when under flourescent light
#define FLUORESCENT_GLOWS 1
/// Currently glowing due to flourescent light
#define FLUORESCENT_GLOWING 2

// Flags used for utensil-food interaction.
/// Solid or semi-solid food; chopsticks, forks.
#define UTENSIL_FLAG_COLLECT BITFLAG(0)
/// Soft, liquid or semi-liquid food; soups, stews, pudding.
#define UTENSIL_FLAG_SCOOP BITFLAG(1)
/// Foods that need to be sliced before eating; steak, grapefruit.
#define UTENSIL_FLAG_SLICE BITFLAG(2)
/// Unimplemented; condiments that are collected before being spread on other food.
#define UTENSIL_FLAG_SPREAD BITFLAG(3)
12 changes: 9 additions & 3 deletions code/datums/trading/traders/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,22 @@
)
possible_wanted_items = list()
possible_trading_items = list(
/obj/item/utensil/chopsticks = TRADER_THIS_TYPE,
/obj/item/utensil/chopsticks/plastic = TRADER_THIS_TYPE,
/obj/item/chems/condiment/small/soysauce = TRADER_THIS_TYPE,
/obj/item/chems/condiment/capsaicin = TRADER_THIS_TYPE,
/obj/item/chems/food/boiledrice/chazuke = TRADER_THIS_TYPE,
/obj/item/chems/food/katsucurry = TRADER_THIS_TYPE,
/obj/item/chems/food/meatkabob = TRADER_THIS_TYPE,
/obj/item/chems/food/monkeysdelight = TRADER_THIS_TYPE,
/obj/item/chems/food/boiledegg = TRADER_THIS_TYPE,
/obj/item/chems/food/boiledrice = TRADER_THIS_TYPE,
/obj/item/chems/food/ricepudding = TRADER_THIS_TYPE,
/obj/item/chems/food/slice/xenomeatbread/filled = TRADER_THIS_TYPE,
/obj/item/chems/food/soydope = TRADER_THIS_TYPE,
/obj/item/chems/food/stewedsoymeat = TRADER_THIS_TYPE,
/obj/item/chems/drinks/dry_ramen = TRADER_THIS_TYPE
)

var/list/fortunes = list(
var/static/list/fortunes = list(
"Today it's up to you to create the peacefulness you long for.",
"If you refuse to accept anything but the best, you very often get it.",
"A smile is your passport into the hearts of others.",
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/kitchen/smartfridge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
icon_contents = "food"

/obj/machinery/smartfridge/foods/accept_check(var/obj/item/O)
if(istype(O,/obj/item/chems/food) || istype(O,/obj/item/kitchen/utensil))
if(istype(O,/obj/item/chems/food) || istype(O,/obj/item/utensil))
return 1

/obj/machinery/smartfridge/drying_rack
Expand Down
91 changes: 0 additions & 91 deletions code/game/objects/items/weapons/material/kitchen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,97 +3,6 @@
material = /decl/material/solid/metal/aluminium
material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME

/*
* Utensils
*/
/obj/item/kitchen/utensil
w_class = ITEM_SIZE_TINY
thrown_material_force_multiplier = 1
origin_tech = @'{"materials":1}'
attack_verb = list("attacked", "stabbed", "poked")
sharp = 0
edge = 0
material_force_multiplier = 0.1 // 6 when wielded with hardness 60 (steel)
thrown_material_force_multiplier = 0.1

var/loaded //Descriptive string for currently loaded food object.
var/scoop_food = 1

/obj/item/kitchen/utensil/Initialize()
. = ..()
if (prob(60))
default_pixel_y = rand(0, 4)
reset_offsets(0)
create_reagents(5)
set_extension(src, /datum/extension/tool/variable, list(
TOOL_RETRACTOR = TOOL_QUALITY_BAD,
TOOL_HEMOSTAT = TOOL_QUALITY_MEDIOCRE
))

/obj/item/kitchen/utensil/attack(mob/living/carbon/M, mob/living/carbon/user)
if(!istype(M))
return ..()

if(user.a_intent != I_HELP)
if(user.get_target_zone() == BP_HEAD || user.get_target_zone() == BP_EYES)
if((MUTATION_CLUMSY in user.mutations) && prob(50))
M = user
return eyestab(M,user)
else
return ..()

if (reagents.total_volume > 0)
reagents.trans_to_mob(M, reagents.total_volume, CHEM_INGEST)
if(M == user)
if(!M.can_eat(loaded))
return
M.visible_message("<span class='notice'>\The [user] eats some [loaded] from \the [src].</span>")
else
user.visible_message("<span class='warning'>\The [user] begins to feed \the [M]!</span>")
if(!(M.can_force_feed(user, loaded) && do_mob(user, M, 5 SECONDS)))
return
M.visible_message("<span class='notice'>\The [user] feeds some [loaded] to \the [M] with \the [src].</span>")
playsound(M.loc,'sound/items/eatfood.ogg', rand(10,40), 1)
overlays.Cut()
return
else
to_chat(user, "<span class='warning'>You don't have anything on \the [src].</span>")//if we have help intent and no food scooped up DON'T STAB OURSELVES WITH THE FORK
return

/obj/item/kitchen/utensil/fork
name = "fork"
desc = "It's a fork. Sure is pointy."
icon_state = "fork"

/obj/item/kitchen/utensil/fork/plastic
material = /decl/material/solid/organic/plastic

/obj/item/kitchen/utensil/spoon
name = "spoon"
desc = "It's a spoon. You can see your own upside-down face in it."
icon_state = "spoon"
attack_verb = list("attacked", "poked")
material_force_multiplier = 0.1 //2 when wielded with weight 20 (steel)

/obj/item/kitchen/utensil/spoon/plastic
material = /decl/material/solid/organic/plastic

/obj/item/kitchen/utensil/spork
name = "spork"
desc = "It's a spork. It's much like a fork, but much blunter."
icon_state = "spork"

/obj/item/kitchen/utensil/spork/plastic
material = /decl/material/solid/organic/plastic

/obj/item/kitchen/utensil/foon
name = "foon"
desc = "It's a foon. It's much like a spoon, but much sharper."
icon_state = "foon"

/obj/item/kitchen/utensil/foon/plastic
material = /decl/material/solid/organic/plastic

/*
* Rolling Pins
*/
Expand Down
19 changes: 2 additions & 17 deletions code/game/objects/items/weapons/material/knives.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,15 @@
/obj/item/knife/can_take_wear_damage()
return FALSE //Prevents knives from shattering/breaking from usage

//table knives
/obj/item/knife/table
name = "table knife"
desc = "A simple table knife, used to cut up individual portions of food."
icon = 'icons/obj/items/weapon/knives/table.dmi'
material = /decl/material/solid/metal/aluminium
material_force_multiplier = 0.1
sharp = FALSE
attack_verb = list("prodded")
w_class = ITEM_SIZE_SMALL
material_alteration = MAT_FLAG_ALTERATION_COLOR

/obj/item/knife/table/plastic
material = /decl/material/solid/organic/plastic

/obj/item/knife/table/primitive
/obj/item/knife/primitive
name = "dueling knife"
desc = "A length of leather-bound wood studded with razor-sharp teeth. How crude."
icon = 'icons/obj/items/weapon/knives/savage.dmi'
material = /decl/material/solid/organic/wood
material_alteration = MAT_FLAG_ALTERATION_NAME
w_class = ITEM_SIZE_NORMAL

/obj/item/knife/table/primitive/get_autopsy_descriptors()
/obj/item/knife/primitive/get_autopsy_descriptors()
. = ..()
. += "serrated"

Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/weapons/storage/firstaid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
/obj/item/screwdriver,
/obj/item/wrench,
/obj/item/hatchet,
/obj/item/kitchen/utensil/fork,
/obj/item/utensil/fork,
/obj/item/shard,
/obj/item/flame/lighter,
/obj/item/stack/cable_coil
Expand All @@ -187,7 +187,7 @@
/obj/item/screwdriver,
/obj/item/wrench,
/obj/item/hatchet,
/obj/item/kitchen/utensil/fork,
/obj/item/utensil/fork,
/obj/item/shard,
/obj/item/flame/lighter,
/obj/item/stack/cable_coil
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/items/weapons/storage/mre.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MRE Stuff
/obj/random/mre/spread,
/obj/random/mre/drink,
/obj/random/mre/sauce,
/obj/item/kitchen/utensil/spork/plastic
/obj/item/utensil/spork/plastic
)

/obj/item/storage/mre/Initialize(ml, material_key)
Expand Down Expand Up @@ -91,7 +91,7 @@ MRE Stuff
/obj/random/mre/spread/vegan,
/obj/random/mre/drink,
/obj/random/mre/sauce/vegan,
/obj/item/kitchen/utensil/spoon/plastic
/obj/item/utensil/spoon/plastic
)

/obj/item/storage/mre/menu10
Expand All @@ -106,7 +106,7 @@ MRE Stuff
/obj/item/chems/food/candy/proteinbar,
/obj/item/chems/condiment/small/packet/protein,
/obj/random/mre/sauce/sugarfree,
/obj/item/kitchen/utensil/spoon/plastic
/obj/item/utensil/spoon/plastic
)

/obj/item/storage/mre/menu11
Expand Down
5 changes: 3 additions & 2 deletions code/game/objects/obj_edibility.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
)

/obj/proc/handle_consumed(mob/feeder, mob/eater, consumption_method = EATING_METHOD_EAT)
transfer_eaten_material(eater, get_food_default_transfer_amount(eater))
play_feed_sound(eater, consumption_method)
if(eater)
transfer_eaten_material(eater, get_food_default_transfer_amount(eater))
play_feed_sound(eater, consumption_method)
if(!get_edible_material_amount(eater))
if(feeder && eater)
show_food_consumed_message(feeder, eater)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/clothing/under/accessories/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
/obj/item/hatchet,
/obj/item/knife,
)
new /obj/item/knife/table/primitive(hold)
new /obj/item/knife/table/primitive(hold)
new /obj/item/knife/primitive(hold)
new /obj/item/knife/primitive(hold)
update_icon()

/obj/item/clothing/accessory/storage/knifeharness/on_update_icon()
Expand Down
28 changes: 18 additions & 10 deletions code/modules/fabrication/designs/micro/designs_cutlery.dm
Original file line number Diff line number Diff line change
@@ -1,43 +1,51 @@
/datum/fabricator_recipe/cutlery
name = "fork, aluminium"
path = /obj/item/kitchen/utensil/fork
path = /obj/item/utensil/fork
category = "Cutlery"
fabricator_types = list(FABRICATOR_CLASS_MICRO)

/datum/fabricator_recipe/cutlery/spoon_aluminium
name = "spoon, aluminium"
path = /obj/item/kitchen/utensil/spoon
path = /obj/item/utensil/spoon

/datum/fabricator_recipe/cutlery/spork_aluminium
name = "spork, aluminium"
path = /obj/item/kitchen/utensil/spork
path = /obj/item/utensil/spork

/datum/fabricator_recipe/cutlery/knife_aluminium
name = "table knife, aluminium"
path = /obj/item/knife/table
path = /obj/item/utensil/knife

/datum/fabricator_recipe/cutlery/chopsticks
name = "chopsticks, aluminium"
path = /obj/item/utensil/chopsticks/aluminium

/datum/fabricator_recipe/cutlery/foon_aluminium
name = "foon, aluminium"
path = /obj/item/kitchen/utensil/foon
path = /obj/item/utensil/foon
hidden = TRUE

/datum/fabricator_recipe/cutlery/fork_plastic
name = "fork, plastic"
path = /obj/item/kitchen/utensil/fork/plastic
path = /obj/item/utensil/fork/plastic

/datum/fabricator_recipe/cutlery/spoon_plastic
name = "spoon, plastic"
path = /obj/item/kitchen/utensil/spoon/plastic
path = /obj/item/utensil/spoon/plastic

/datum/fabricator_recipe/cutlery/spork_plastic
name = "spork, plastic"
path = /obj/item/kitchen/utensil/spork/plastic
path = /obj/item/utensil/spork/plastic

/datum/fabricator_recipe/cutlery/knife_plastic
name = "table knife, plastic"
path = /obj/item/knife/table/plastic
path = /obj/item/utensil/knife/plastic

/datum/fabricator_recipe/cutlery/chopsticks/plastic
name = "chopsticks, plastic"
path = /obj/item/utensil/chopsticks/plastic

/datum/fabricator_recipe/cutlery/foon_plastic
name = "foon, plastic"
path = /obj/item/kitchen/utensil/foon/plastic
path = /obj/item/utensil/foon/plastic
hidden = TRUE
Loading

0 comments on commit d965c9d

Please sign in to comment.