Skip to content

Commit

Permalink
Various primitive/crafting fixes/qol (#2032)
Browse files Browse the repository at this point in the history
* Switch big moarter to item_interactions

clean up some balloon alerts

* decon fixes, move to atom_deconstruction

* millstone decon fix

* No free pots.

* oven decon

* Show our stack recipes in crafting menu

* shouldn't be calling parent here

* machines use on_decon

* missed a no_decon

* Smithable soup pots

* mortar mixing

* stop if full

* /closet handles this actually

* redundant flags

* whoopsie

* wait, that's not right

* mortar reagent transfers

* revert this whole ass file

* just put this back i guess

* no rack parts

* moves some checks around, better checks

* better mortar sanity

* this hurts me as much as it hurts you

* we still need attackby :(

* this is too verbose

* Some forge fixes too

* smithing decon

* Novification ™️

* Move clay to the modular file too

* Might as well grab these too
  • Loading branch information
FlufflesTheDog authored and StealsThePRs committed Apr 19, 2024
1 parent cd8ed59 commit dc7f0c6
Show file tree
Hide file tree
Showing 13 changed files with 188 additions and 83 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/~nova_defines/construction.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define CAT_HEMOPHAGE "Hemophage Food"
#define CAT_TESHARI "Teshari Food"

GLOBAL_LIST_INIT(crafting_category_food_skyrat, list(
GLOBAL_LIST_INIT(crafting_category_food_nova, list(
CAT_HEMOPHAGE,
CAT_TESHARI,
))
6 changes: 3 additions & 3 deletions code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@

GLOB.emote_list = init_emote_list() // WHY DOES THIS NEED TO GO HERE? IT JUST INITS DATUMS

make_skyrat_datum_references() //NOVA EDIT ADDITION - CUSTOMIZATION
make_nova_datum_references() //NOVA EDIT ADDITION - CUSTOMIZATION
init_nova_stack_recipes() //NOVA EDIT ADDITION - More sheet recipes
init_crafting_recipes()
init_crafting_recipes_atoms()

Expand All @@ -107,7 +108,7 @@
if(ispath(path, /datum/crafting_recipe/stack))
continue
var/datum/crafting_recipe/recipe = new path()
var/is_cooking = ((recipe.category in GLOB.crafting_category_food) || (recipe.category in GLOB.crafting_category_food_skyrat)) // NOVA EDIT - Add skyrat food crafting category
var/is_cooking = ((recipe.category in GLOB.crafting_category_food) || (recipe.category in GLOB.crafting_category_food_nova)) // NOVA EDIT - Add nova food crafting category
recipe.reqs = sort_list(recipe.reqs, GLOBAL_PROC_REF(cmp_crafting_req_priority))
if(recipe.name != "" && recipe.result)
if(is_cooking)
Expand All @@ -128,7 +129,6 @@
/obj/item/stack/sheet/sinew = GLOB.sinew_recipes,
/obj/item/stack/sheet/animalhide/carp = GLOB.carp_recipes,
/obj/item/stack/sheet/mineral/sandstone = GLOB.sandstone_recipes,
/obj/item/stack/sheet/mineral/clay = GLOB.clay_recipes, // NOVA EDIT ADDITION
/obj/item/stack/sheet/mineral/sandbags = GLOB.sandbag_recipes,
/obj/item/stack/sheet/mineral/diamond = GLOB.diamond_recipes,
/obj/item/stack/sheet/mineral/uranium = GLOB.uranium_recipes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// Iron

GLOBAL_LIST_INIT(skyrat_metal_recipes, list(
GLOBAL_LIST_INIT(nova_metal_recipes, list(
new/datum/stack_recipe("wall mounted fire-safety closet", /obj/item/wallframe/firecloset, 2, time = 1.5 SECONDS, check_density = FALSE, category = CAT_FURNITURE),
new/datum/stack_recipe("wall mounted emergency closet", /obj/item/wallframe/emcloset, 2, time = 1.5 SECONDS, check_density = FALSE, category = CAT_FURNITURE),
new/datum/stack_recipe("wall mounted closet", /obj/item/wallframe/closet, 2, time = 1.5 SECONDS, check_density = FALSE, category = CAT_FURNITURE),
Expand All @@ -35,29 +35,29 @@ GLOBAL_LIST_INIT(skyrat_metal_recipes, list(
new/datum/stack_recipe("throwing wheel", /obj/structure/throwing_wheel, 10, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_TOOLS),
))

GLOBAL_LIST_INIT(skyrat_metal_airlock_recipes, list(
GLOBAL_LIST_INIT(nova_metal_airlock_recipes, list(
new /datum/stack_recipe("corporate airlock assembly", /obj/structure/door_assembly/door_assembly_corporate, 4, time = 5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_DOORS),
new /datum/stack_recipe("service airlock assembly", /obj/structure/door_assembly/door_assembly_service, 4, time = 5 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_DOORS),
))

/obj/item/stack/sheet/iron/get_main_recipes()
. = ..()
. += GLOB.skyrat_metal_recipes
add_recipes_to_sublist(., "airlock assemblies", GLOB.skyrat_metal_airlock_recipes)
. += GLOB.nova_metal_recipes
add_recipes_to_sublist(., "airlock assemblies", GLOB.nova_metal_airlock_recipes)

// Plasteel

GLOBAL_LIST_INIT(skyrat_plasteel_recipes, list(
GLOBAL_LIST_INIT(nova_plasteel_recipes, list(
new/datum/stack_recipe("plasteel barricade", /obj/structure/deployable_barricade/metal/plasteel, 2, time = 1 SECONDS, on_solid_ground = TRUE, check_direction = TRUE, category = CAT_STRUCTURE),
))

/obj/item/stack/sheet/plasteel/get_main_recipes()
. = ..()
. += GLOB.skyrat_plasteel_recipes
. += GLOB.nova_plasteel_recipes

// Rods

GLOBAL_LIST_INIT(skyrat_rod_recipes, list(
GLOBAL_LIST_INIT(nova_rod_recipes, list(
new/datum/stack_recipe("towel bin", /obj/structure/towel_bin/empty, 2, time = 0.5 SECONDS, one_per_turf = FALSE, check_density = FALSE, category = CAT_CONTAINERS),
new/datum/stack_recipe("guard rail", /obj/structure/deployable_barricade/guardrail, 2, time = 1 SECONDS, on_solid_ground = TRUE, check_direction = TRUE, category = CAT_STRUCTURE),
new/datum/stack_recipe("wrestling ropes", /obj/structure/railing/wrestling, 3, time = 1.8 SECONDS, on_solid_ground = TRUE, check_direction = TRUE, check_density = FALSE, category = CAT_STRUCTURE),
Expand All @@ -67,11 +67,11 @@ GLOBAL_LIST_INIT(skyrat_rod_recipes, list(

/obj/item/stack/rods/get_main_recipes()
. = ..()
. += GLOB.skyrat_rod_recipes
. += GLOB.nova_rod_recipes

// Wood

GLOBAL_LIST_INIT(skyrat_wood_recipes, list(
GLOBAL_LIST_INIT(nova_wood_recipes, list(
new/datum/stack_recipe("water basin", /obj/structure/reagent_water_basin, 5, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_TOOLS),
new/datum/stack_recipe("forging work bench", /obj/structure/reagent_crafting_bench, 5, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_TOOLS),
new/datum/stack_recipe("wooden half-barricade", /obj/structure/deployable_barricade/wooden, 5, time = 2 SECONDS, on_solid_ground = TRUE, check_direction = TRUE, category = CAT_STRUCTURE),
Expand All @@ -95,11 +95,11 @@ GLOBAL_LIST_INIT(skyrat_wood_recipes, list(

/obj/item/stack/sheet/mineral/wood/get_main_recipes()
. = ..()
. += GLOB.skyrat_wood_recipes
. += GLOB.nova_wood_recipes

// Cloth

GLOBAL_LIST_INIT(skyrat_cloth_recipes, list(
GLOBAL_LIST_INIT(nova_cloth_recipes, list(
new/datum/stack_recipe("fancy pillow", /obj/item/fancy_pillow, 3, check_density = FALSE, category = CAT_ENTERTAINMENT),
new/datum/stack_recipe("towel", /obj/item/towel, 2, check_density = FALSE, category = CAT_CLOTHING),
new/datum/stack_recipe("eyepatch wrap", /obj/item/clothing/glasses/eyepatch/wrap, 2, check_density = FALSE, category = CAT_CLOTHING),
Expand All @@ -109,14 +109,14 @@ GLOBAL_LIST_INIT(skyrat_cloth_recipes, list(

/obj/item/stack/sheet/cloth/get_main_recipes()
. = ..()
. += GLOB.skyrat_cloth_recipes
. += GLOB.nova_cloth_recipes

// Leather

GLOBAL_LIST_INIT(skyrat_leather_recipes, list(
GLOBAL_LIST_INIT(nova_leather_recipes, list(
))

GLOBAL_LIST_INIT(skyrat_leather_belt_recipes, list(
GLOBAL_LIST_INIT(nova_leather_belt_recipes, list(
new/datum/stack_recipe("xenoarch belt", /obj/item/storage/belt/utility/xenoarch, 4, check_density = FALSE, category = CAT_CONTAINERS),
new/datum/stack_recipe("medical bandolier", /obj/item/storage/belt/medbandolier, 5, check_density = FALSE, category = CAT_CONTAINERS),
new/datum/stack_recipe("gear harness", /obj/item/clothing/under/misc/nova/gear_harness, 6, check_density = FALSE, category = CAT_CLOTHING),
Expand All @@ -125,35 +125,35 @@ GLOBAL_LIST_INIT(skyrat_leather_belt_recipes, list(

/obj/item/stack/sheet/leather/get_main_recipes()
. = ..()
. += GLOB.skyrat_leather_recipes
add_recipes_to_sublist(., "belts", GLOB.skyrat_leather_belt_recipes)
. += GLOB.nova_leather_recipes
add_recipes_to_sublist(., "belts", GLOB.nova_leather_belt_recipes)

// Titanium

GLOBAL_LIST_INIT(skyrat_titanium_recipes, list(
GLOBAL_LIST_INIT(nova_titanium_recipes, list(
new/datum/stack_recipe("spaceship plating", /obj/item/stack/sheet/spaceship, 1, time = 5, check_density = FALSE, category = CAT_MISC),
))

/obj/item/stack/sheet/mineral/titanium/get_main_recipes()
. = ..()
. += GLOB.skyrat_titanium_recipes
. += GLOB.nova_titanium_recipes

// Snow

GLOBAL_LIST_INIT(skyrat_snow_recipes, list(
GLOBAL_LIST_INIT(nova_snow_recipes, list(
new/datum/stack_recipe("snow barricade", /obj/structure/deployable_barricade/snow, 2, on_solid_ground = TRUE, check_direction = TRUE, category = CAT_STRUCTURE),
))

/obj/item/stack/sheet/mineral/snow/get_main_recipes()
. = ..()
. += GLOB.skyrat_snow_recipes
. += GLOB.nova_snow_recipes

// Sand

GLOBAL_LIST_INIT(skyrat_sand_recipes, list(
GLOBAL_LIST_INIT(nova_sand_recipes, list(
new/datum/stack_recipe("ant farm", /obj/structure/antfarm, 20, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_TOOLS),
))

/obj/item/stack/ore/glass/get_main_recipes()
. = ..()
. += GLOB.skyrat_sand_recipes
. += GLOB.nova_sand_recipes
36 changes: 35 additions & 1 deletion modular_nova/modules/customization/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/proc/make_skyrat_datum_references()
/proc/make_nova_datum_references()
make_sprite_accessory_references()
make_default_mutant_bodypart_references()
make_body_marking_references()
Expand Down Expand Up @@ -74,6 +74,40 @@
GLOB.features_block_lengths["[GLOB.dna_body_marking_blocks[marking_zone] + (feature_block_set - 1) * DNA_BLOCKS_PER_MARKING + color_block]"] = DNA_BLOCK_SIZE_COLOR
GLOB.dna_total_feature_blocks += DNA_BLOCKS_PER_MARKING_ZONE

/proc/init_nova_stack_recipes()
var/list/additional_stack_recipes = list(
/obj/item/stack/sheet/leather = list(GLOB.nova_leather_recipes, GLOB.nova_leather_belt_recipes),
/obj/item/stack/sheet/mineral/titanium = list(GLOB.nova_titanium_recipes),
/obj/item/stack/sheet/mineral/snow = list(GLOB.nova_snow_recipes),
/obj/item/stack/sheet/iron = list(GLOB.nova_metal_recipes, GLOB.nova_metal_airlock_recipes),
/obj/item/stack/sheet/plasteel = list(GLOB.nova_plasteel_recipes),
/obj/item/stack/sheet/mineral/wood = list(GLOB.nova_wood_recipes),
/obj/item/stack/sheet/cloth = list(GLOB.nova_cloth_recipes),
/obj/item/stack/ore/glass = list(GLOB.nova_sand_recipes),
/obj/item/stack/rods = list(GLOB.nova_rod_recipes),
/obj/item/stack/sheet/mineral/stone = list(GLOB.stone_recipes),
/obj/item/stack/sheet/mineral/clay = list(GLOB.clay_recipes),
/obj/item/stack/sheet/plastic_wall_panel = list(GLOB.plastic_wall_panel_recipes),
/obj/item/stack/sheet/spaceshipglass = list(GLOB.spaceshipglass_recipes),
)
for(var/stack in additional_stack_recipes)
for(var/material_list in additional_stack_recipes[stack])
for(var/stack_recipe in material_list)
if(istype(stack_recipe, /datum/stack_recipe_list))
var/datum/stack_recipe_list/stack_recipe_list = stack_recipe
for(var/nested_recipe in stack_recipe_list.recipes)
if(!nested_recipe)
continue
var/datum/crafting_recipe/stack/recipe = new/datum/crafting_recipe/stack(stack, nested_recipe)
if(recipe.name != "" && recipe.result)
GLOB.crafting_recipes += recipe
else
if(!stack_recipe)
continue
var/datum/crafting_recipe/stack/recipe = new/datum/crafting_recipe/stack(stack, stack_recipe)
if(recipe.name != "" && recipe.result)
GLOB.crafting_recipes += recipe

/proc/make_augment_references()
// Here we build the global loadout lists
for(var/path in subtypesof(/datum/augment_item))
Expand Down
117 changes: 84 additions & 33 deletions modular_nova/modules/primitive_cooking_additions/code/big_mortar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,82 +62,115 @@
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN

/obj/structure/large_mortar/attackby(obj/item/attacking_item, mob/living/carbon/human/user)
if(istype(attacking_item, /obj/item/storage/bag))
if(attacking_item.is_refillable())
return

/obj/structure/large_mortar/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking)
. = ..()
if(. || user.combat_mode || tool.is_refillable())
return .
if(istype(tool, /obj/item/storage/bag))
if(length(contents) >= maximum_contained_items)
balloon_alert(user, "already full")
return TRUE
balloon_alert(user, "already full!")
return ITEM_INTERACT_BLOCKING

if(!length(attacking_item.contents))
if(!length(tool.contents))
balloon_alert(user, "nothing to transfer!")
return TRUE
return ITEM_INTERACT_BLOCKING

for(var/obj/item/target_item in attacking_item.contents)
for(var/obj/item/target_item in tool.contents)
if(length(contents) >= maximum_contained_items)
break

if(target_item.juice_typepath || target_item.grind_results)
target_item.forceMove(src)

if (length(contents) >= maximum_contained_items)
balloon_alert(user, "filled!")
balloon_alert(user, "filled")
else
balloon_alert(user, "transferred")
return TRUE
return ITEM_INTERACT_SUCCESS

if(istype(attacking_item, /obj/item/pestle))
if(istype(tool, /obj/item/pestle))
if(!anchored)
balloon_alert(user, "secure to ground first")
return

if(!length(contents))
balloon_alert(user, "nothing to grind")
return
balloon_alert(user, "not secured!")
return ITEM_INTERACT_BLOCKING

if(user.getStaminaLoss() > LARGE_MORTAR_STAMINA_MINIMUM)
balloon_alert(user, "too tired")
return
if(!length(contents) && reagents.total_volume == 0)
balloon_alert(user, "mortar empty!")
return ITEM_INTERACT_BLOCKING

var/list/choose_options = list(
"Grind" = image(icon = 'icons/hud/radial.dmi', icon_state = "radial_grind"),
"Juice" = image(icon = 'icons/hud/radial.dmi', icon_state = "radial_juice")
"Juice" = image(icon = 'icons/hud/radial.dmi', icon_state = "radial_juice"),
"Mix" = image(icon = 'icons/hud/radial.dmi', icon_state = "radial_mix"),
)
var/picked_option = show_radial_menu(user, src, choose_options, radius = 38, require_near = TRUE)

if(!length(contents) || !in_range(src, user) || !user.is_holding(attacking_item) && !picked_option)
return
if(user.getStaminaLoss() > LARGE_MORTAR_STAMINA_MINIMUM)
balloon_alert(user, "too tired!")
return ITEM_INTERACT_BLOCKING

if(!in_range(src, user) || !user.is_holding(tool) || !picked_option)
return ITEM_INTERACT_BLOCKING
var/act_verb = LOWER_TEXT(picked_option)
var/act_verb_ing
if(act_verb == "juice")
act_verb_ing = "juicing"
else
act_verb_ing = "[act_verb]ing"

balloon_alert_to_viewers("grinding...")
var/has_resource
if(picked_option == "Mix")
has_resource = reagents.total_volume > 0
else
has_resource = length(contents) > 0

if(!has_resource)
balloon_alert(user, "nothing to [act_verb]!")
return ITEM_INTERACT_BLOCKING

balloon_alert_to_viewers("[act_verb_ing]...")
if(!do_after(user, 5 SECONDS, target = src))
balloon_alert_to_viewers("stopped grinding")
return
balloon_alert_to_viewers("stopped [act_verb_ing]")
return ITEM_INTERACT_BLOCKING

user.adjustStaminaLoss(LARGE_MORTAR_STAMINA_USE) //This is a bit more tiring than a normal sized mortar and pestle
switch(picked_option)
if("Juice")
for(var/obj/item/target_item as anything in contents)
if (reagents.total_volume >= reagents.maximum_volume)
balloon_alert(user, "overflowing!")
break
if(target_item.juice_typepath)
juice_target_item(target_item, user)
else
grind_target_item(target_item, user)

if("Grind")
for(var/obj/item/target_item as anything in contents)
if (reagents.total_volume >= reagents.maximum_volume)
balloon_alert(user, "overflowing!")
break
if(target_item.grind_results)
grind_target_item(target_item, user)
else
juice_target_item(target_item, user)
return
if("Mix")
mix()

return ITEM_INTERACT_SUCCESS

if(!attacking_item.grind_results && !attacking_item.juice_typepath)
balloon_alert(user, "can't grind this")
return ..()
if(!tool.grind_results && !tool.juice_typepath)
balloon_alert(user, "can't grind this!")
return ITEM_INTERACT_BLOCKING

if(length(contents) >= maximum_contained_items)
balloon_alert(user, "already full")
return
balloon_alert(user, "already full!")
return ITEM_INTERACT_BLOCKING

attacking_item.forceMove(src)
return ..()
tool.forceMove(src)
return ITEM_INTERACT_SUCCESS

///Juices the passed target item, and transfers any contained chems to the mortar as well
/obj/structure/large_mortar/proc/juice_target_item(obj/item/to_be_juiced, mob/living/carbon/human/user)
Expand All @@ -161,12 +194,30 @@

if(!to_be_ground.grind(src.reagents, user))
if(isstack(to_be_ground))
to_chat(usr, span_notice("[src] attempts to grind as many pieces of [to_be_ground] as possible."))
to_chat(user, span_notice("[src] attempts to grind as many pieces of [to_be_ground] as possible."))
else
to_chat(user, span_danger("You fail to grind [to_be_ground]."))

to_chat(user, span_notice("You break [to_be_ground] into a fine powder."))
QDEL_NULL(to_be_ground)

///Mixes contained reagents, creating butter/mayo/whipped cream
/obj/structure/large_mortar/proc/mix()
//Recipe to make Butter
var/butter_amt = FLOOR(reagents.get_reagent_amount(/datum/reagent/consumable/milk) / MILK_TO_BUTTER_COEFF, 1)
var/purity = reagents.get_reagent_purity(/datum/reagent/consumable/milk)
reagents.remove_reagent(/datum/reagent/consumable/milk, MILK_TO_BUTTER_COEFF * butter_amt)
for(var/i in 1 to butter_amt)
var/obj/item/food/butter/tasty_butter = new(drop_location())
tasty_butter.reagents.set_all_reagents_purity(purity)

//Recipe to make Mayonnaise
if (reagents.has_reagent(/datum/reagent/consumable/eggyolk))
reagents.convert_reagent(/datum/reagent/consumable/eggyolk, /datum/reagent/consumable/mayonnaise)

//Recipe to make whipped cream
if (reagents.has_reagent(/datum/reagent/consumable/cream))
reagents.convert_reagent(/datum/reagent/consumable/cream, /datum/reagent/consumable/whipped_cream)

#undef LARGE_MORTAR_STAMINA_MINIMUM
#undef LARGE_MORTAR_STAMINA_USE
Loading

0 comments on commit dc7f0c6

Please sign in to comment.