Skip to content

Commit

Permalink
Merge pull request #3536 from MistakeNot4892/nutriment
Browse files Browse the repository at this point in the history
Prevents nutriment and soap from melting at room temperature.
  • Loading branch information
out-of-phaze authored Dec 26, 2023
2 parents 333f988 + 78b627c commit 94873f4
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 20 deletions.
10 changes: 6 additions & 4 deletions code/game/objects/items/weapons/soap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
throwforce = 0
throw_speed = 4
throw_range = 20
material = /decl/material/liquid/cleaner
material = /decl/material/liquid/cleaner/soap
max_health = 5
var/key_data

Expand Down Expand Up @@ -105,13 +105,15 @@

/obj/item/soap/attackby(var/obj/item/I, var/mob/user)
if(istype(I, /obj/item/key))
if(!key_data)
if(key_data)
to_chat(user, SPAN_WARNING("\The [src] already has a key imprint."))
else
to_chat(user, SPAN_NOTICE("You imprint \the [I] into \the [src]."))
var/obj/item/key/K = I
key_data = K.key_data
update_icon()
return
..()
return TRUE
return ..()

/obj/item/soap/on_update_icon()
. = ..()
Expand Down
15 changes: 7 additions & 8 deletions code/modules/locks/key.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@
icon = 'icons/obj/items/key.dmi'
icon_state = "keys"
w_class = ITEM_SIZE_TINY
material = DEFAULT_FURNITURE_MATERIAL
material = /decl/material/solid/metal/brass
material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC
var/key_data = ""

/obj/item/key/Initialize(mapload,var/data)
. = ..(mapload)
if(data)
key_data = data
/obj/item/key/Initialize(var/mapload, var/material_key, var/new_key_data)
. = ..(mapload, material_key)
if(new_key_data)
key_data = new_key_data

/obj/item/key/proc/get_data(var/mob/user)
return key_data

/obj/item/key/soap
name = "soap key"
desc = "a fragile key made using a bar of soap."
material = /decl/material/liquid/cleaner
material = /decl/material/liquid/cleaner/soap
var/uses = 0

/obj/item/key/soap/get_data(var/mob/user)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/locks/lock_construct.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
lock_data = generateRandomString(round(material.integrity/50))

/obj/item/lock_construct/attackby(var/obj/item/I, var/mob/user)
if(istype(I,/obj/item/key))
if(istype(I, /obj/item/key))
var/obj/item/key/K = I
if(!K.key_data)
to_chat(user, SPAN_NOTICE("You fashion \the [I] to unlock \the [src]."))
Expand Down
11 changes: 11 additions & 0 deletions code/modules/reagents/chems/chems_cleaner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@
turf_touch_threshold = 0.1
uid = "chem_cleaner"
exoplanet_rarity_gas = MAT_RARITY_EXOTIC

/decl/material/liquid/cleaner/soap
name = "soap"
lore_text = "A soft solid compound used to clean things. Usually derived from oil or fat."
taste_description = "waxy blandness"
color = COLOR_BEIGE
uid = "chem_soap"
melting_point = 323
ignition_point = 353
boiling_point = 373
accelerant_value = 0.3
31 changes: 30 additions & 1 deletion code/modules/reagents/chems/chems_nutriment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@
uid = "chem_nutriment"
exoplanet_rarity_gas = MAT_RARITY_NOWHERE // Please, no more animal protein or glowsap or corn oil atmosphere.

// Technically a room-temperature solid, but saves
// repathing it to /solid all over the codebase.
melting_point = 323
ignition_point = 353
boiling_point = 373
accelerant_value = 0.65

var/nutriment_factor = 10 // Per unit
var/hydration_factor = 0 // Per unit
var/injectable = 0
var/injectable = FALSE

/decl/material/liquid/nutriment/mix_data(var/datum/reagents/reagents, var/list/newdata, var/newamount)

Expand Down Expand Up @@ -102,6 +109,8 @@
taste_description = "egg"
color = "#ffffaa"
uid = "chem_nutriment_egg"
melting_point = 273
boiling_point = 373

//vegetamarian alternative that is safe for vegans to ingest//rewired it from its intended nutriment/protein/egg/softtofu because it would not actually work, going with plan B, more recipes.

Expand All @@ -120,6 +129,8 @@
color = "#ffff00"
fruit_descriptor = "rich"
uid = "chem_nutriment_honey"
melting_point = 273
boiling_point = 373

/decl/material/liquid/nutriment/flour
name = "flour"
Expand All @@ -145,6 +156,8 @@
exoplanet_rarity_plant = MAT_RARITY_NOWHERE
exoplanet_rarity_gas = MAT_RARITY_NOWHERE
uid = "chem_nutriment_batter"
melting_point = 273
boiling_point = 373

/decl/material/liquid/nutriment/batter/touch_turf(var/turf/T, var/amount, var/datum/reagents/holder)
..()
Expand Down Expand Up @@ -257,6 +270,8 @@
exoplanet_rarity_plant = MAT_RARITY_NOWHERE
exoplanet_rarity_gas = MAT_RARITY_NOWHERE
uid = "chem_nutriment_soysauce"
melting_point = 273
boiling_point = 373

/decl/material/liquid/nutriment/ketchup
name = "ketchup"
Expand All @@ -267,6 +282,8 @@
exoplanet_rarity_plant = MAT_RARITY_NOWHERE
exoplanet_rarity_gas = MAT_RARITY_NOWHERE
uid = "chem_nutriment_ketchup"
melting_point = 273
boiling_point = 373

/decl/material/liquid/nutriment/banana_cream
name = "banana cream"
Expand All @@ -276,6 +293,8 @@
exoplanet_rarity_plant = MAT_RARITY_NOWHERE
exoplanet_rarity_gas = MAT_RARITY_NOWHERE
uid = "chem_nutriment_bananacream"
melting_point = 273
boiling_point = 373

/decl/material/liquid/nutriment/barbecue
name = "barbecue sauce"
Expand All @@ -286,6 +305,8 @@
exoplanet_rarity_plant = MAT_RARITY_NOWHERE
exoplanet_rarity_gas = MAT_RARITY_NOWHERE
uid = "chem_nutriment_bbqsauce"
melting_point = 273
boiling_point = 373

/decl/material/liquid/nutriment/garlicsauce
name = "garlic sauce"
Expand All @@ -296,6 +317,8 @@
exoplanet_rarity_plant = MAT_RARITY_NOWHERE
exoplanet_rarity_gas = MAT_RARITY_NOWHERE
uid = "chem_nutriment_garlicsauce"
melting_point = 273
boiling_point = 373

/decl/material/liquid/nutriment/rice
name = "rice"
Expand Down Expand Up @@ -326,6 +349,8 @@
color = "#801e28"
fruit_descriptor = "sweet"
uid = "chem_nutriment_cherryjelly"
melting_point = 273
boiling_point = 373

/decl/material/liquid/nutriment/cornoil
name = "corn oil"
Expand All @@ -336,6 +361,8 @@
color = "#302000"
slipperiness = 8
uid = "chem_nutriment_cornoil"
melting_point = 273
boiling_point = 373

/decl/material/liquid/nutriment/sprinkles
name = "sprinkles"
Expand Down Expand Up @@ -369,6 +396,8 @@
color = "#e8dfd0"
taste_mult = 3
uid = "chem_nutriment_vinegar"
melting_point = 273
boiling_point = 373

/decl/material/liquid/nutriment/mayo
name = "mayonnaise"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/reagents/reactions/reaction_other.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/decl/chemical_reaction/soap_key/on_reaction(var/datum/reagents/holder)
var/obj/item/soap/S = holder.get_reaction_loc(chemical_reaction_flags)
if(istype(S) && S.key_data)
var/obj/item/key/soap/key = new(get_turf(S), S.key_data)
var/obj/item/key/soap/key = new(get_turf(S), null, S.key_data)
key.uses = strength
..()

Expand Down
11 changes: 6 additions & 5 deletions code/modules/vehicles/cargo_train.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
on = 0
powered = 1
locked = 0

load_item_visible = 1
load_offset_x = 0
buckle_pixel_shift = list("x" = 0, "y" = 0, "z" = 7)

var/car_limit = 3 //how many cars an engine can pull before performance degrades
charge_use = 1 KILOWATTS
active_engines = 1
var/car_limit = 3 //how many cars an engine can pull before performance degrades
var/obj/item/key/cargo_train/key

/obj/item/key/cargo_train
name = "key"
desc = "A keyring with a small steel key, and a yellow fob reading \"Choo Choo!\"."
desc = "A small key on a yellow fob reading \"Choo Choo!\"."
material = /decl/material/solid/metal/steel
matter = list(
/decl/material/solid/organic/plastic = MATTER_AMOUNT_REINFORCEMENT
)
icon = 'icons/obj/vehicles.dmi'
icon_state = "train_keys"
w_class = ITEM_SIZE_TINY
Expand Down

0 comments on commit 94873f4

Please sign in to comment.