-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expands the rapid construction fabricator's appliances to be more tha…
…n four (4) things! (#1429) * its almost the last of the frontier stuff, wowee!! * lets go #2 * it aint skyrat anymore stupid dog * that should be that then * oh wait fix the design datumf irst * changes how the categories are sorted * Update modular_nova/modules/colony_fabricator/code/appliances/recycler.dm * Update modular_nova/modules/colony_fabricator/code/appliances/co2_cracker.dm * Update modular_nova/modules/colony_fabricator/code/appliances/recycler.dm * Update modular_nova/modules/colony_fabricator/code/appliances/co2_cracker.dm * Update modular_nova/modules/colony_fabricator/code/appliances/co2_cracker.dm * Update modular_nova/modules/colony_fabricator/code/appliances/recycler.dm * lets the recycler be wrenched down * fixes the design section * shakes fist angrily at the nodeconstruct flag --------- Co-authored-by: Paxilmaniac <[email protected]> Co-authored-by: Bloop <[email protected]>
- Loading branch information
1 parent
61e91c5
commit f77dfbe
Showing
20 changed files
with
823 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
modular_nova/modules/colony_fabricator/code/appliances/co2_cracker.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
// We can't just use electrolyzer reactions, because that'd let electrolyzers do co2 cracking | ||
|
||
GLOBAL_LIST_INIT(cracker_reactions, cracker_reactions_list()) | ||
|
||
/// Global proc to build up the list of co2 cracker reactions | ||
/proc/cracker_reactions_list() | ||
var/list/built_reaction_list = list() | ||
for(var/reaction_path in subtypesof(/datum/cracker_reaction)) | ||
var/datum/cracker_reaction/reaction = new reaction_path() | ||
|
||
built_reaction_list[reaction.id] = reaction | ||
|
||
return built_reaction_list | ||
|
||
/datum/cracker_reaction | ||
var/list/requirements | ||
var/name = "reaction" | ||
var/id = "r" | ||
var/desc = "" | ||
var/list/factor | ||
|
||
/// Called when the co2 cracker reaction is run, should be where the code for actually changing gasses around is run | ||
/datum/cracker_reaction/proc/react(turf/location, datum/gas_mixture/air_mixture, working_power) | ||
return | ||
|
||
/// Checks if this reaction can actually be run | ||
/datum/cracker_reaction/proc/reaction_check(datum/gas_mixture/air_mixture) | ||
var/temp = air_mixture.temperature | ||
var/list/cached_gases = air_mixture.gases | ||
if((requirements["MIN_TEMP"] && temp < requirements["MIN_TEMP"]) || (requirements["MAX_TEMP"] && temp > requirements["MAX_TEMP"])) | ||
return FALSE | ||
for(var/id in requirements) | ||
if(id == "MIN_TEMP" || id == "MAX_TEMP") | ||
continue | ||
if(!cached_gases[id] || cached_gases[id][MOLES] < requirements[id]) | ||
return FALSE | ||
return TRUE | ||
|
||
/datum/cracker_reaction/co2_cracking | ||
name = "CO2 Cracking" | ||
id = "co2_cracking" | ||
desc = "Conversion of CO2 into equal amounts of O2" | ||
requirements = list( | ||
/datum/gas/carbon_dioxide = MINIMUM_MOLE_COUNT, | ||
) | ||
factor = list( | ||
/datum/gas/carbon_dioxide = "1 mole of CO2 gets consumed", | ||
/datum/gas/oxygen = "1 mole of O2 gets produced", | ||
"Location" = "Can only happen on turfs with an active CO2 cracker.", | ||
) | ||
|
||
/datum/cracker_reaction/co2_cracking/react(turf/location, datum/gas_mixture/air_mixture, working_power) | ||
var/old_heat_capacity = air_mixture.heat_capacity() | ||
air_mixture.assert_gases(/datum/gas/water_vapor, /datum/gas/oxygen) | ||
var/proportion = min(air_mixture.gases[/datum/gas/carbon_dioxide][MOLES] * INVERSE(2), (2.5 * (working_power ** 2))) | ||
air_mixture.gases[/datum/gas/carbon_dioxide][MOLES] -= proportion | ||
air_mixture.gases[/datum/gas/oxygen][MOLES] += proportion | ||
var/new_heat_capacity = air_mixture.heat_capacity() | ||
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) | ||
air_mixture.temperature = max(air_mixture.temperature * old_heat_capacity / new_heat_capacity, TCMB) | ||
|
||
// CO2 cracker machine itself | ||
|
||
/obj/machinery/electrolyzer/co2_cracker | ||
name = "portable CO2 cracker" | ||
desc = "A portable device that is the savior of many a colony on the frontier. Performing similarly to an electrolyzer, \ | ||
it takes in nearby gasses and breaks them into different gasses. The big draw of this one? It can crack carbon dioxide \ | ||
into breathable oxygen. Handy for places where CO2 is all too common, and oxygen is all too hard to find." | ||
icon = 'modular_nova/modules/colony_fabricator/icons/portable_machines.dmi' | ||
circuit = null | ||
working_power = 1 | ||
/// Soundloop for while the thermomachine is turned on | ||
var/datum/looping_sound/conditioner_running/soundloop | ||
|
||
/obj/machinery/electrolyzer/co2_cracker/Initialize(mapload) | ||
. = ..() | ||
soundloop = new(src, FALSE) | ||
AddElement(/datum/element/manufacturer_examine, COMPANY_FRONTIER) | ||
|
||
/obj/machinery/electrolyzer/co2_cracker/process_atmos() | ||
if(on && !soundloop.loop_started) | ||
soundloop.start() | ||
else if(soundloop.loop_started) | ||
soundloop.stop() | ||
return ..() | ||
|
||
/obj/machinery/electrolyzer/co2_cracker/call_reactions(datum/gas_mixture/env) | ||
for(var/reaction in GLOB.cracker_reactions) | ||
var/datum/cracker_reaction/current_reaction = GLOB.cracker_reactions[reaction] | ||
|
||
if(!current_reaction.reaction_check(env)) | ||
continue | ||
|
||
current_reaction.react(loc, env, working_power) | ||
|
||
env.garbage_collect() | ||
|
||
/obj/machinery/electrolyzer/co2_cracker/RefreshParts() | ||
. = ..() | ||
working_power = 2 | ||
efficiency = 1 | ||
|
||
/obj/machinery/electrolyzer/co2_cracker/crowbar_act(mob/living/user, obj/item/tool) | ||
return | ||
|
||
// "parts kit" for buying these from cargo | ||
|
||
/obj/item/flatpacked_machine/co2_cracker | ||
name = "CO2 cracker parts kit" | ||
icon = 'modular_nova/modules/colony_fabricator/icons/parts_kits.dmi' | ||
icon_state = "co2_cracker" | ||
type_to_deploy = /obj/machinery/electrolyzer/co2_cracker | ||
deploy_time = 2 SECONDS | ||
custom_materials = list( | ||
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 7.5, | ||
/datum/material/glass = SHEET_MATERIAL_AMOUNT * 3, | ||
/datum/material/plasma = HALF_SHEET_MATERIAL_AMOUNT, // We're gonna pretend plasma is the catalyst for co2 cracking | ||
) |
46 changes: 46 additions & 0 deletions
46
modular_nova/modules/colony_fabricator/code/appliances/foodricator.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/obj/machinery/biogenerator/foodricator | ||
name = "organic rations printer" | ||
desc = "An advanced machine seen in frontier outposts and colonies capable of turning organic plant matter into \ | ||
various foods or ingredients. The best friend of a chef where deliveries are inconsistent or simply don't exist. \ | ||
Some of those that consume the food from this complain that the foods it makes have poor taste, though they must \ | ||
not appreciate being able to eat steak and eggs for breakfast with a lack of any livestock at all in the colony." | ||
icon = 'modular_nova/modules/colony_fabricator/icons/foodricator.dmi' | ||
circuit = null | ||
anchored = FALSE | ||
pass_flags = PASSTABLE | ||
efficiency = 1 | ||
productivity = 2.5 | ||
anchored_tabletop_offset = 8 | ||
show_categories = list( | ||
RND_CATEGORY_AKHTER_FOODRICATOR_INGREDIENTS, | ||
RND_CATEGORY_AKHTER_FOODRICATOR_BAGS, | ||
RND_CATEGORY_AKHTER_FOODRICATOR_SNACKS, | ||
RND_CATEGORY_AKHTER_FOODRICATOR_UTENSILS, | ||
RND_CATEGORY_AKHTER_SEEDS, | ||
) | ||
|
||
/obj/machinery/biogenerator/foodricator/Initialize(mapload) | ||
. = ..() | ||
AddElement(/datum/element/manufacturer_examine, COMPANY_FRONTIER) | ||
|
||
/obj/machinery/biogenerator/foodricator/RefreshParts() | ||
. = ..() | ||
efficiency = 1 | ||
productivity = 3 | ||
|
||
/obj/machinery/biogenerator/foodricator/default_deconstruction_crowbar() | ||
return | ||
|
||
// Deployable item for cargo for the rations printer | ||
|
||
/obj/item/flatpacked_machine/organics_ration_printer | ||
name = "organic rations printer parts kit" | ||
icon = 'modular_nova/modules/colony_fabricator/icons/foodricator.dmi' | ||
icon_state = "biogenerator_parts" | ||
type_to_deploy = /obj/machinery/biogenerator/foodricator | ||
custom_materials = list( | ||
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 5, | ||
/datum/material/glass = SHEET_MATERIAL_AMOUNT * 2, | ||
/datum/material/silver = SHEET_MATERIAL_AMOUNT, | ||
/datum/material/gold = HALF_SHEET_MATERIAL_AMOUNT, | ||
) |
81 changes: 81 additions & 0 deletions
81
modular_nova/modules/colony_fabricator/code/appliances/recycler.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/obj/machinery/colony_recycler | ||
name = "materials recycler" | ||
desc = "A large crushing machine used to recycle small items inefficiently. Items are inserted by hand, rather than by belt. \ | ||
Mind your fingers." | ||
icon = 'modular_nova/modules/colony_fabricator/icons/portable_machines.dmi' | ||
icon_state = "recycler" | ||
anchored = FALSE | ||
density = TRUE | ||
circuit = null | ||
/// The percentage of materials returned | ||
var/amount_produced = 80 | ||
/// The sound made when an item is eaten | ||
var/item_recycle_sound = 'modular_nova/modules/reagent_forging/sound/forge.ogg' | ||
/// The recycler's internal materials storage, for when items recycled don't produce enough to make a full sheet of that material | ||
var/datum/component/material_container/materials | ||
/// The list of all the materials we can recycle | ||
var/static/list/allowed_materials = list( | ||
/datum/material/iron, | ||
/datum/material/glass, | ||
/datum/material/silver, | ||
/datum/material/plasma, | ||
/datum/material/gold, | ||
/datum/material/diamond, | ||
/datum/material/plastic, | ||
/datum/material/uranium, | ||
/datum/material/bananium, | ||
/datum/material/titanium, | ||
/datum/material/bluespace, | ||
) | ||
/// The item we turn into when repacked | ||
var/repacked_type = /obj/item/flatpacked_machine/recycler | ||
|
||
/obj/machinery/colony_recycler/Initialize(mapload) | ||
. = ..() | ||
AddElement(/datum/element/repackable, repacked_type, 5 SECONDS) | ||
AddElement(/datum/element/manufacturer_examine, COMPANY_FRONTIER) | ||
materials = AddComponent( \ | ||
/datum/component/material_container, \ | ||
allowed_materials, \ | ||
INFINITY, \ | ||
MATCONTAINER_EXAMINE, \ | ||
container_signals = list(COMSIG_MATCONTAINER_ITEM_CONSUMED = TYPE_PROC_REF(/obj/machinery/colony_recycler, has_eaten_materials)), \ | ||
) | ||
|
||
/obj/machinery/colony_recycler/Destroy() | ||
materials = null | ||
return ..() | ||
|
||
/obj/machinery/colony_recycler/examine(mob/user) | ||
. = ..() | ||
. += span_notice("Reclaiming <b>[amount_produced]%</b> of materials salvaged.") | ||
. += span_notice("Can be <b>secured</b> with a <b>wrench</b> using <b>Right-Click</b>.") | ||
|
||
/obj/machinery/colony_recycler/wrench_act_secondary(mob/living/user, obj/item/tool) | ||
default_unfasten_wrench(user, tool) | ||
return ITEM_INTERACT_SUCCESS | ||
|
||
/// Proc called when the recycler eats new materials, checks if we should spit out new material sheets | ||
/obj/machinery/colony_recycler/proc/has_eaten_materials(container, obj/item/item_inserted, last_inserted_id, mats_consumed, amount_inserted, atom/context) | ||
SIGNAL_HANDLER | ||
|
||
flick("recycler_grind", src) | ||
playsound(src, item_recycle_sound, 50, TRUE) | ||
use_power(min(active_power_usage * 0.25, amount_inserted / 100)) | ||
|
||
if(amount_inserted) | ||
materials.retrieve_all(drop_location()) | ||
|
||
// "parts kit" for buying these from cargo | ||
|
||
/obj/item/flatpacked_machine/recycler | ||
name = "recycler parts kit" | ||
icon = 'modular_nova/modules/colony_fabricator/icons/parts_kits.dmi' | ||
icon_state = "recycler" | ||
type_to_deploy = /obj/machinery/colony_recycler | ||
deploy_time = 2 SECONDS | ||
custom_materials = list( | ||
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 7.5, | ||
/datum/material/glass = SHEET_MATERIAL_AMOUNT * 3, | ||
/datum/material/titanium = HALF_SHEET_MATERIAL_AMOUNT, // Titan for the crushing element | ||
) |
Oops, something went wrong.