Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions code/__DEFINES/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ GLOBAL_LIST_INIT(food_buffs, list(
))

/// Food quality change according to species diet
#define DISLIKED_FOOD_QUALITY_CHANGE -2
#define LIKED_FOOD_QUALITY_CHANGE 2
#define DISLIKED_FOOD_QUALITY_CHANGE -1.5
#define LIKED_FOOD_QUALITY_CHANGE 1.5
/// Threshold for food to be considered gross
#define GROSS_FOOD_QUALITY_THRESHOLD -2
/// Threshold for food to give a toxic reaction
#define TOXIC_FOOD_QUALITY_THRESHOLD -8
/// Food is dangerous to consume
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
#define TRAIT_NO_GRAB_SPEED_PENALTY "no_grab_speed_penalty"
/// Doesn't let a mob shift this atom around with move_pulled
#define TRAIT_NO_MOVE_PULL "no_move_pull"
/// Does not harm patients when undergoing CPR
#define TRAIT_CPR_CERTIFIED "cpr_certified"

/// Boosts the heart rate of the mob
#define TRAIT_HEART_RATE_BOOST "heart_rate_boost"
Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/skills.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@
//while using the SKILLCHIP_RESTRICTED_CATEGORIES flag
/// General related skillchip category
#define SKILLCHIP_CATEGORY_GENERAL "general"

/// Always print this skill in print_skills
#define SKILL_ALWAYS_PRINT (1<<0)
/// Skill is is physical, not mental, and doesn't apply through skillchips or mindswaps
#define SKILL_PHYSICAL (1<<1)
2 changes: 2 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_FOOD_SILVER "food_silver"
/// If this item's been made by a chef instead of being map-spawned or admin-spawned or such
#define TRAIT_FOOD_CHEF_MADE "food_made_by_chef"
/// If this item is microwaved or cooked, it won't gain TRAIT_FOOD_CHEF_MADE unless it already had it
#define TRAIT_FOOD_MUST_INHERIT_CHEF_MADE "food_must_inherit_chef_made"
/// This atom has a quality_food_ingredient element attached
#define TRAIT_QUALITY_FOOD_INGREDIENT "quality_food_ingredient"
/// The items needs two hands to be carried
Expand Down
5 changes: 3 additions & 2 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_FISHING_SPOT" = TRAIT_FISHING_SPOT,
"TRAIT_FOOD_CHEF_MADE" = TRAIT_FOOD_CHEF_MADE,
"TRAIT_FOOD_FRIED" = TRAIT_FOOD_FRIED,
"TRAIT_GOT_DAMPENED" = TRAIT_GOT_DAMPENED,
"TRAIT_QUALITY_FOOD_INGREDIENT" = TRAIT_QUALITY_FOOD_INGREDIENT,
"TRAIT_FOOD_MUST_INHERIT_CHEF_MADE" = TRAIT_FOOD_MUST_INHERIT_CHEF_MADE,
"TRAIT_FOOD_SILVER" = TRAIT_FOOD_SILVER,
"TRAIT_GOT_DAMPENED" = TRAIT_GOT_DAMPENED,
"TRAIT_KEEP_TOGETHER" = TRAIT_KEEP_TOGETHER,
"TRAIT_LIGHTING_DEBUGGED" = TRAIT_LIGHTING_DEBUGGED,
"TRAIT_MESSAGE_IN_A_BOTTLE_LOCATION" = TRAIT_MESSAGE_IN_A_BOTTLE_LOCATION,
"TRAIT_QUALITY_FOOD_INGREDIENT" = TRAIT_QUALITY_FOOD_INGREDIENT,
"TRAIT_RECENTLY_COINED" = TRAIT_RECENTLY_COINED,
"TRAIT_RUSTY" = TRAIT_RUSTY,
"TRAIT_SPINNING" = TRAIT_SPINNING,
Expand Down
12 changes: 10 additions & 2 deletions code/controllers/subsystem/skills.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ SUBSYSTEM_DEF(skills)
name = "Skills"
flags = SS_NO_FIRE
///Dictionary of skill.type || skill ref
var/list/all_skills = list()
var/list/datum/skill/all_skills = list()
///List of level names with index corresponding to skill level
var/list/level_names = list("None", "Novice", "Apprentice", "Journeyman", "Expert", "Master", "Legendary") //List of skill level names. Note that indexes can be accessed like so: level_names[SKILL_LEVEL_NOVICE]
var/list/level_names = list(
SKILL_LEVEL_NONE = "Untrained",
SKILL_LEVEL_NOVICE = "Novice",
SKILL_LEVEL_APPRENTICE = "Apprentice",
SKILL_LEVEL_JOURNEYMAN = "Journeyman",
SKILL_LEVEL_EXPERT = "Expert",
SKILL_LEVEL_MASTER = "Master",
SKILL_LEVEL_LEGENDARY = "Legendary",
)

/datum/controller/subsystem/skills/Initialize()
InitializeSkills()
Expand Down
13 changes: 7 additions & 6 deletions code/datums/components/bakeable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
///Time spent baking so far
var/current_bake_time = 0

/// REF() to the mind which placed us in an oven
var/who_baked_us
// NON-MODULE CHANGE
/// WEAKREF() to the mind which placed us in an oven
var/datum/weakref/who_baked_us

/// Reagents that should be added to the result
var/list/added_reagents
Expand Down Expand Up @@ -53,8 +54,8 @@
/datum/component/bakeable/proc/on_baking_start(datum/source, atom/used_oven, mob/baker)
SIGNAL_HANDLER

if(baker && baker.mind)
who_baked_us = REF(baker.mind)
// NON-MODULE CHANGE
who_baked_us = WEAKREF(baker?.mind)

///Ran every time an item is baked by something
/datum/component/bakeable/proc/on_bake(datum/source, atom/used_oven, seconds_per_tick = 1)
Expand All @@ -80,8 +81,8 @@
if(added_reagents) // Add any new reagents that should be added
baked_result.reagents.add_reagent_list(added_reagents)

if(who_baked_us)
ADD_TRAIT(baked_result, TRAIT_FOOD_CHEF_MADE, who_baked_us)
// NON-MODULE CHANGE
handle_chef_made_food(baked_result, original_object, who_baked_us?.resolve())

if(original_object.custom_materials)
baked_result.set_custom_materials(original_object.custom_materials, 1)
Expand Down
80 changes: 55 additions & 25 deletions code/datums/components/food/edible.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,22 +228,29 @@ Behavior that's still missing from this component that original food items had t
examine_list += span_warning("You may die from eating this meal.")
else if (quality <= TOXIC_FOOD_QUALITY_THRESHOLD)
examine_list += span_warning("You find this meal disgusting!")
else
// NON-MODULE CHANGE
else if (quality <= GROSS_FOOD_QUALITY_THRESHOLD)
examine_list += span_warning("You find this meal inedible.")
else
examine_list += span_notice("You find this meal shoddy.")

if(owner.reagents.total_volume > 0)
var/purity = owner.reagents.get_average_purity(/datum/reagent/consumable)
switch(purity)
if(0 to 0.2)
examine_list += span_warning("It is made of terrible ingredients shortening the effect...")
// NON-MODULE CHANGE
if(0.2 to 0.4)
examine_list += span_warning("It is made of synthetic ingredients shortening the effect.")
examine_list += span_warning("It is made of poor ingredients shortening the effect.")
if(0.4 to 0.6)
examine_list += span_notice("It is made of average quality ingredients.")
if(0.6 to 0.8)
examine_list += span_green("It is made of organic ingredients prolonging the effect.")
if(0.8 to 1)
examine_list += span_green("It is made of finest ingredients prolonging the effect!")
// NON-MODULE CHANGE
if(1 to 1.5)
examine_list += span_green("A master chef using the finest ingredients to make this meal, prolonging the effect!")

var/datum/mind/mind = user.mind
if(mind && HAS_TRAIT_FROM(owner, TRAIT_FOOD_CHEF_MADE, REF(mind)))
Expand Down Expand Up @@ -569,25 +576,30 @@ Behavior that's still missing from this component that original food items had t
gourmand.add_mood_event("toxic_food", /datum/mood_event/disgusting_food)
return

if(food_quality < 0)
to_chat(gourmand,span_notice("That didn't taste very good..."))
// NON-MODULE CHANGE
if(food_quality <= GROSS_FOOD_QUALITY_THRESHOLD)
to_chat(gourmand, span_notice("That didn't taste very good..."))
gourmand.adjust_disgust(11 + 15 * fraction)
gourmand.add_mood_event("gross_food", /datum/mood_event/gross_food)
return

// NON-MODULE CHANGE
if(food_quality < 0)
to_chat(gourmand, span_notice("<i>That could've been better.</i>"))
gourmand.add_mood_event("gross_food", /datum/mood_event/bad_food)
return
// NON-MODULE CHANGE
if(food_quality == 0)
to_chat(gourmand, span_notice("<i>That's a mediocre meal.</i>"))
gourmand.add_mood_event("mid_food", /datum/mood_event/mid_food)
return // meh

food_quality = min(food_quality, FOOD_QUALITY_TOP)
// NON-MODULE CHANGES
var/atom/owner = parent
var/timeout_mod = owner.reagents.get_average_purity(/datum/reagent/consumable) * 2 // mood event duration is 100% at average purity of 50%
var/datum/mood_event/event = GLOB.food_quality_events[food_quality]
event = new event.type
event.timeout *= timeout_mod
gourmand.add_mood_event("quality_food", event)
var/timeout_mod = owner.reagents.get_average_purity(/datum/reagent/consumable) * 1.5 // mood event duration is 100% at average purity of 50%
gourmand.add_mood_event("quality_food", GLOB.food_quality_events[food_quality], timeout_mod)
gourmand.adjust_disgust(-5 + -2 * food_quality * fraction)
var/quality_label = GLOB.food_quality_description[food_quality]
to_chat(gourmand, span_notice("That's \an [quality_label] meal."))
to_chat(gourmand, span_notice("<i>That's \an [quality_label] meal.</i>"))

/// Get the complexity of the crafted food
/datum/component/edible/proc/get_recipe_complexity()
Expand All @@ -603,6 +615,13 @@ Behavior that's still missing from this component that original food items had t
/datum/component/edible/proc/get_perceived_food_quality(mob/living/carbon/human/eater)
var/food_quality = get_recipe_complexity()

// NON-MODULE CHANGE
if(HAS_MIND_TRAIT(eater, TRAIT_SNOB))
if(food_quality <= FOOD_QUALITY_VERYGOOD)
food_quality -= 0.5
else
food_quality += 0.5

if(HAS_TRAIT(parent, TRAIT_FOOD_SILVER)) // it's not real food
if(!isjellyperson(eater)) //if you aren't a jellyperson, it makes you sick no matter how nice it looks
return TOXIC_FOOD_QUALITY_THRESHOLD
Expand All @@ -612,25 +631,36 @@ Behavior that's still missing from this component that original food items had t
var/special_reaction = check_liked.Invoke(eater)
switch(special_reaction) //return early for special foods
if(FOOD_LIKED)
return LIKED_FOOD_QUALITY_CHANGE
// NON-MODULE CHANGE
return round(LIKED_FOOD_QUALITY_CHANGE * 1.25)
if(FOOD_DISLIKED)
return DISLIKED_FOOD_QUALITY_CHANGE
// NON-MODULE CHANGE
return round(DISLIKED_FOOD_QUALITY_CHANGE * 1.25)
if(FOOD_TOXIC)
return TOXIC_FOOD_QUALITY_THRESHOLD
if(FOOD_ALLERGIC)
return FOOD_QUALITY_DANGEROUS

if(ishuman(eater))
if(foodtypes & eater.get_allergic_foodtypes())
return FOOD_QUALITY_DANGEROUS
if(count_matching_foodtypes(foodtypes, eater.get_toxic_foodtypes())) //if the food is toxic, we don't care about anything else
return TOXIC_FOOD_QUALITY_THRESHOLD
if(HAS_TRAIT(eater, TRAIT_AGEUSIA)) //if you can't taste it, it doesn't taste good
return 0
food_quality += DISLIKED_FOOD_QUALITY_CHANGE * count_matching_foodtypes(foodtypes, eater.get_disliked_foodtypes())
food_quality += LIKED_FOOD_QUALITY_CHANGE * count_matching_foodtypes(foodtypes, eater.get_liked_foodtypes())

return food_quality
// NON-MODULE CHANGES
if(HAS_TRAIT(eater, TRAIT_AGEUSIA)) //if you can't taste it, it doesn't taste good
return 0
if(foodtypes & eater.get_allergic_foodtypes())
return FOOD_QUALITY_DANGEROUS
if(count_matching_foodtypes(foodtypes, eater.get_toxic_foodtypes())) //if the food is toxic, we don't care about anything else
return TOXIC_FOOD_QUALITY_THRESHOLD
food_quality += DISLIKED_FOOD_QUALITY_CHANGE * count_matching_foodtypes(foodtypes, eater.get_disliked_foodtypes())
food_quality += LIKED_FOOD_QUALITY_CHANGE * count_matching_foodtypes(foodtypes, eater.get_liked_foodtypes())

// NON-MODULE CHANGES
var/obj/item/food = parent
var/reagent_quality_mod = INFINITY
for(var/datum/reagent/consumable/nutri in food.reagents?.reagent_list)
reagent_quality_mod = min(reagent_quality_mod, nutri.data?["quality_modifier"] || 0)

if(reagent_quality_mod != INFINITY)
food_quality += reagent_quality_mod

return min(floor(food_quality), FOOD_QUALITY_TOP)

/// Get the number of matching food types in provided bitfields
/datum/component/edible/proc/count_matching_foodtypes(bitfield_one, bitfield_two)
Expand Down
13 changes: 7 additions & 6 deletions code/datums/components/grillable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
var/current_cook_time = 0
///Do we use the large steam sprite?
var/use_large_steam_sprite = FALSE
/// REF() to the mind which placed us on the griddle
var/who_placed_us
// NON-MODULE CHANGE
/// WEAKREF() to the mind which placed us on the griddle
var/datum/weakref/who_placed_us
/// Reagents that should be added to the result
var/list/added_reagents

Expand Down Expand Up @@ -59,8 +60,8 @@
/datum/component/grillable/proc/on_grill_placed(datum/source, mob/griller)
SIGNAL_HANDLER

if(griller && griller.mind)
who_placed_us = REF(griller.mind)
// NON-MODULE CHANGE
who_placed_us = WEAKREF(griller?.mind)

RegisterSignal(parent, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved))

Expand Down Expand Up @@ -110,8 +111,8 @@
grilled_result.reagents.add_reagent_list(added_reagents)

SEND_SIGNAL(parent, COMSIG_ITEM_GRILLED, grilled_result)
if(who_placed_us)
ADD_TRAIT(grilled_result, TRAIT_FOOD_CHEF_MADE, who_placed_us)
// NON-MODULE CHANGE
handle_chef_made_food(grilled_result, parent, who_placed_us?.resolve())

grill_source.visible_message("<span class='[positive_result ? "notice" : "warning"]'>[parent] turns into \a [grilled_result]!</span>")
grilled_result.pixel_x = original_object.pixel_x
Expand Down
20 changes: 12 additions & 8 deletions code/datums/elements/dryable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,34 @@
if(dry_result == dried_atom.type)//if the dried type is the same as our currrent state, don't bother creating a whole new item, just re-color it.
var/atom/movable/resulting_atom = dried_atom
resulting_atom.add_atom_colour(dried_color, FIXED_COLOUR_PRIORITY)
apply_dried_status(resulting_atom, drying_user)
// NON-MODULE CHANGE
apply_dried_status(resulting_atom, drying_user?.resolve(), source)
return
else if(isstack(source)) //Check if its a sheet
var/obj/item/stack/itemstack = dried_atom
for(var/i in 1 to itemstack.amount)
var/atom/movable/resulting_atom = new dry_result(source.loc)
apply_dried_status(resulting_atom, drying_user)
// NON-MODULE CHANGE
apply_dried_status(resulting_atom, drying_user?.resolve(), source)
qdel(source)
return
else if(istype(source, /obj/item/food) && ispath(dry_result, /obj/item/food))
var/obj/item/food/source_food = source
var/obj/item/food/resulting_food = new dry_result(source.loc)
resulting_food.reagents.clear_reagents()
source_food.reagents.trans_to(resulting_food, source_food.reagents.total_volume)
apply_dried_status(resulting_food, drying_user)
// NON-MODULE CHANGE
apply_dried_status(resulting_food, drying_user?.resolve(), source)
qdel(source)
return
else
var/atom/movable/resulting_atom = new dry_result(source.loc)
apply_dried_status(resulting_atom, drying_user)
// NON-MODULE CHANGE
apply_dried_status(resulting_atom, drying_user?.resolve(), source)
qdel(source)

/datum/element/dryable/proc/apply_dried_status(atom/target, datum/weakref/drying_user)
/datum/element/dryable/proc/apply_dried_status(atom/target, datum/mind/chef, atom/source)
ADD_TRAIT(target, TRAIT_DRIED, ELEMENT_TRAIT(type))
var/datum/mind/user_mind = drying_user?.resolve()
if(drying_user && istype(target, /obj/item/food))
ADD_TRAIT(target, TRAIT_FOOD_CHEF_MADE, REF(user_mind))
// NON-MODULE CHANGE
if(istype(chef) && istype(target, /obj/item/food))
handle_chef_made_food(target, source, chef, 0.25)
3 changes: 1 addition & 2 deletions code/datums/elements/food/microwavable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
if(added_reagents) // Add any new reagents that should be added
result.reagents.add_reagent_list(added_reagents)

if(microwaver && microwaver.mind)
ADD_TRAIT(result, TRAIT_FOOD_CHEF_MADE, REF(microwaver.mind))
handle_chef_made_food(result, source, microwaver?.mind, 0.75)

qdel(source)

Expand Down
Loading
Loading