Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Cargo Engineering Content Part 1 | My little machines that go wwwhrhhhr | Die of CO2 poisoning #217

Merged
merged 1 commit into from
Oct 23, 2023
Merged
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
4 changes: 4 additions & 0 deletions code/__DEFINES/machines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
/// For wiremod/integrated circuits. Uses various minerals.
#define COMPONENT_PRINTER (1<<10)
//Note: More than one of these can be added to a design but imprinter and lathe designs are incompatable.
// SKYRAT EDIT ADDITION
/// Can be made by the orderable colony fabricator
#define COLONY_FABRICATOR (1<<11)
// SKYRAT EDIT END

#define FIREDOOR_OPEN 1
#define FIREDOOR_CLOSED 2
Expand Down
4 changes: 2 additions & 2 deletions code/__DEFINES/~skyrat_defines/cargo_import_companies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define CARGO_COMPANY_DEFOREST (1<<3)
#define CARGO_COMPANY_DONK (1<<4)
#define CARGO_COMPANY_KAHRAMAN (1<<5)
#define CARGO_COMPANY_NAKAMURA_TOOLING (1<<6)
#define CARGO_COMPANY_FRONTIER_EQUIPMENT (1<<6)
#define CARGO_COMPANY_SOL_DEFENSE (1<<7)
#define CARGO_COMPANY_MICROSTAR (1<<8)
#define CARGO_COMPANY_VITEZSTVI_AMMO (1<<9)
Expand All @@ -17,7 +17,7 @@
#define DEFOREST_MEDICAL_NAME "DeForest Medical Corporation"
#define DONK_CO_NAME "Donk Corporation"
#define KAHRAMAN_INDUSTRIES_NAME "Kahraman Heavy Industries"
#define NAKAMURA_ENGINEERING_TOOLING_NAME "Nakamura Engineering Tooling Divison"
#define FRONTIER_EQUIPMENT_NAME "Akhter Company Frontier Equipment"
#define SOL_DEFENSE_DEFENSE_NAME "Sol Defense Imports"
#define MICROSTAR_ENERGY_NAME "MicroStar Energy Weapon Coalition"
#define VITEZSTVI_AMMO_NAME "Vitezstvi Ammo & Weapon Accessories"
Expand Down
29 changes: 29 additions & 0 deletions code/__DEFINES/~skyrat_defines/colony_fabricator_misc.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/// Category for clothing in the organics printer
#define RND_CATEGORY_AKHTER_CLOTHING "Clothing"
/// Category for equipment like belts and bags in the organics printer
#define RND_CATEGORY_AKHTER_EQUIPMENT "Equipment"
/// Category for medical items in the organics printer
#define RND_CATEGORY_AKHTER_MEDICAL "Emergency Medical"
/// Category for resources made by the organics printer
#define RND_CATEGORY_AKHTER_RESOURCES "Resources"
/// Category for the seeds the organics printer can make
#define RND_CATEGORY_AKHTER_SEEDS "Synthesized Seeds"

/// The items the frontier clothing can hold
GLOBAL_LIST_INIT(colonist_suit_allowed, list(
/obj/item/ammo_box,
/obj/item/ammo_casing,
/obj/item/flashlight,
/obj/item/gun,
/obj/item/melee,
/obj/item/tank/internals,
/obj/item/storage/belt/holster,
/obj/item/construction,
/obj/item/fireaxe,
/obj/item/pipe_dispenser,
/obj/item/storage/bag,
/obj/item/pickaxe,
/obj/item/resonator,
/obj/item/t_scanner,
/obj/item/analyzer,
))
2 changes: 2 additions & 0 deletions code/__DEFINES/~skyrat_defines/manufacturer_strings.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@

#define COMPANY_ABDUCTOR "It has <b>[span_abductor("✌︎︎♌︎︎♎︎︎◆︎︎♍︎︎⧫︎︎❄︎♏︎♍︎♒︎")]</b> engraved into it."

#define COMPANY_FRONTIER "It has a small label with <b>[span_engradio("Akhter Company Frontier Equipment")]</b> printed on it, alongside various xerxian proof-marks."

#define COMPANY_REMOVED "It has had <b>[span_grey("all identifying marks scrubbed off")].</b>"
2 changes: 1 addition & 1 deletion code/modules/atmospherics/machinery/portable/pump.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/machinery/portable_atmospherics/pump //SKYRAT EDIT - ICON OVERRIDEN IN SCRUBBER.DM AESTHETICS
/obj/machinery/portable_atmospherics/pump
name = "portable air pump"
icon_state = "siphon"
density = TRUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
/datum/design/vox_gas_filter
name = "Vox Gas Filter"
id = "vox_gas_filter"
build_type = PROTOLATHE | AUTOLATHE
build_type = PROTOLATHE | AUTOLATHE | COLONY_FABRICATOR
materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT)
build_path = /obj/item/gas_filter/vox
category = list(
RND_CATEGORY_EQUIPMENT + RND_SUBCATEGORY_EQUIPMENT_GAS_TANKS
RND_CATEGORY_EQUIPMENT + RND_SUBCATEGORY_EQUIPMENT_GAS_TANKS_EQUIPMENT
)
departmental_flags = ALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Machine that makes water and nothing else

/obj/machinery/plumbing/synthesizer/water_synth
name = "water synthesizer"
desc = "An infinitely useful device for those finding themselves in a frontier without a stable source of water. \
Using a simplified version of the chemistry dispenser's synthesizer process, it can create water out of nothing \
but good old electricity."
icon = 'modular_skyrat/modules/colony_fabricator/icons/chemistry_machines.dmi'
icon_state = "water_synth"
anchored = FALSE
dispensable_reagents = list(
/datum/reagent/water,
)

/obj/machinery/plumbing/synthesizer/water_synth/Initialize(mapload)
. = ..()
AddElement(/datum/element/manufacturer_examine, COMPANY_FRONTIER)

// Deployable item for cargo for the water synth

/obj/item/flatpacked_machine/water_synth
name = "water synthesizer parts kit"
icon = 'modular_skyrat/modules/colony_fabricator/icons/chemistry_machines.dmi'
icon_state = "water_synth_parts"
w_class = WEIGHT_CLASS_NORMAL
type_to_deploy = /obj/machinery/plumbing/synthesizer/water_synth
deploy_time = 2 SECONDS
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/obj/machinery/cell_charger_multi/wall_mounted
name = "mounted multi-cell charging rack"
desc = "The innovative technology of a cell charging rack, but mounted neatly on a wall out of the way!"
icon = 'modular_skyrat/modules/colony_fabricator/icons/cell_charger.dmi'
icon_state = "wall_charger"
base_icon_state = "wall_charger"
circuit = null
flags_1 = NODECONSTRUCT_1
max_batteries = 3
charge_rate = 750
/// The item we turn into when repacked
var/repacked_type = /obj/item/wallframe/cell_charger_multi

MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/cell_charger_multi/wall_mounted, 29)

/obj/machinery/cell_charger_multi/wall_mounted/Initialize(mapload)
. = ..()
find_and_hang_on_wall()
AddElement(/datum/element/manufacturer_examine, COMPANY_FRONTIER)

/obj/machinery/cell_charger_multi/wall_mounted/wrench_act(mob/living/user, obj/item/tool)
. = ..()
user.balloon_alert(user, "deconstructing...")
tool.play_tool_sound(src)
if(tool.use_tool(src, user, 1 SECONDS))
playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE)
deconstruct(TRUE)
return

/obj/machinery/cell_charger_multi/wall_mounted/deconstruct(disassembled)
if(disassembled)
new repacked_type(drop_location())
return ..()

/obj/machinery/cell_charger_multi/wall_mounted/RefreshParts()
. = ..()
charge_rate = 750 // Nuh uh!

// Item for creating the arc furnace or carrying it around

/obj/item/wallframe/cell_charger_multi
name = "unmounted wall multi-cell charging rack"
desc = "The innovative technology of a cell charging rack, but able to be mounted neatly on a wall out of the way!"
icon = 'modular_skyrat/modules/colony_fabricator/icons/packed_machines.dmi'
icon_state = "cell_charger_packed"
w_class = WEIGHT_CLASS_NORMAL
result_path = /obj/machinery/cell_charger_multi/wall_mounted
pixel_shift = 29
custom_materials = list(
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2,
/datum/material/silver = SHEET_MATERIAL_AMOUNT * 1,
)
106 changes: 106 additions & 0 deletions modular_skyrat/modules/colony_fabricator/code/colony_fabricator.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/obj/machinery/rnd/production/colony_lathe
name = "rapid construction fabricator"
desc = "These bad boys are seen just about anywhere someone would want or need to build fast, damn the consequences. \
That tends to be colonies, especially on dangerous worlds, where the influences of this one machine can be seen \
in every bit of architecture."
icon = 'modular_skyrat/modules/colony_fabricator/icons/machines.dmi'
icon_state = "colony_lathe"
base_icon_state = "colony_lathe"
production_animation = null
circuit = null
production_animation = "colony_lathe_n"
flags_1 = NODECONSTRUCT_1
light_color = LIGHT_COLOR_BRIGHT_YELLOW
light_power = 5
charges_tax = FALSE
allowed_buildtypes = COLONY_FABRICATOR
/// The item we turn into when repacked
var/repacked_type = /obj/item/flatpacked_machine
/// The sound loop played while the fabricator is making something
var/datum/looping_sound/colony_fabricator_running/soundloop

/obj/machinery/rnd/production/colony_lathe/Initialize(mapload)
. = ..()
AddElement(/datum/element/repackable, repacked_type, 5 SECONDS)
AddElement(/datum/element/manufacturer_examine, COMPANY_FRONTIER)
// We don't get new designs but can't print stuff if something's not researched, so we use the web that has everything researched
stored_research = locate(/datum/techweb/admin) in SSresearch.techwebs
soundloop = new(src, FALSE)
if(!mapload)
flick("colony_lathe_deploy", src) // Sick ass deployment animation

/obj/machinery/rnd/production/colony_lathe/Destroy()
QDEL_NULL(soundloop)
return ..()

/obj/machinery/rnd/production/colony_lathe/user_try_print_id(design_id, print_quantity)
. = ..()

if(!.)
return

soundloop.start()
set_light(l_range = 1.5)
icon_state = "colony_lathe_working"
update_appearance()

/obj/machinery/rnd/production/colony_lathe/do_print(path, amount)
. = ..()
soundloop.stop()
set_light(l_range = 0)
icon_state = base_icon_state
update_appearance()
flick("colony_lathe_finish_print", src)

/obj/machinery/rnd/production/colony_lathe/calculate_efficiency()
efficiency_coeff = 1

// We take from all nodes even unresearched ones
/obj/machinery/rnd/production/colony_lathe/update_designs()
var/previous_design_count = cached_designs.len

cached_designs.Cut()

for(var/design_id in SSresearch.techweb_designs)
var/datum/design/design = SSresearch.techweb_designs[design_id]

if((isnull(allowed_department_flags) || (design.departmental_flags & allowed_department_flags)) && (design.build_type & allowed_buildtypes))
cached_designs |= design

var/design_delta = cached_designs.len - previous_design_count

if(design_delta > 0)
say("Received [design_delta] new design[design_delta == 1 ? "" : "s"].")
playsound(src, 'sound/machines/twobeep_high.ogg', 50, TRUE)

update_static_data_for_all_viewers()

// Item for carrying the lathe around and building it

/obj/item/flatpacked_machine
name = "flat-packed rapid construction fabricator"
icon = 'modular_skyrat/modules/colony_fabricator/icons/packed_machines.dmi'
icon_state = "colony_lathe_packed"
w_class = WEIGHT_CLASS_BULKY
/// What structure is created by this item.
var/obj/type_to_deploy = /obj/machinery/rnd/production/colony_lathe
/// How long it takes to create the structure in question.
var/deploy_time = 4 SECONDS

/obj/item/flatpacked_machine/Initialize(mapload)
. = ..()
desc = initial(type_to_deploy.desc)
AddComponent(/datum/component/deployable, deploy_time, type_to_deploy, delete_on_use = TRUE)
give_manufacturer_examine()

/// Adds the manufacturer examine element to the flatpack machine, but can be overridden in the future
/obj/item/flatpacked_machine/proc/give_manufacturer_examine()
AddElement(/datum/element/manufacturer_examine, COMPANY_FRONTIER)

/obj/item/borg/apparatus/sheet_manipulator/Initialize(mapload)
. = ..()
storable += /obj/item/flatpacked_machine

/obj/item/borg/apparatus/circuit/Initialize(mapload)
. = ..()
storable += /obj/item/flatpacked_machine
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// Machine categories

#define FABRICATOR_CATEGORY_APPLIANCES "/Appliances"
#define FABRICATOR_SUBCATEGORY_POWER "/Power"
#define FABRICATOR_SUBCATEGORY_ATMOS "/Atmospherics"
#define FABRICATOR_SUBCATEGORY_FLUIDS "/Liquids"

// Techweb node that shouldnt show up anywhere ever specifically for the fabricator to work with

/datum/techweb_node/colony_fabricator_appliances
id = "colony_fabricator_appliances"
display_name = "Colony Fabricator Appliance Designs"
description = "Contains all of the colony fabricator's appliance machine designs."
design_ids = list(
"wall_multi_cell_rack",
"portable_lil_pump",
"portable_scrubbs",
"survival_knife", // I just don't want to make a whole new node for this one sorry
"soup_pot", // This one too
"water_synth",
)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000000000000000) // God save you
hidden = TRUE
show_on_wiki = FALSE
starting_node = TRUE

// Wall mountable multi cell charger

/datum/design/wall_mounted_multi_charger
name = "Mounted Multi-Cell Charging Rack"
id = "wall_multi_cell_rack"
build_type = COLONY_FABRICATOR
materials = list(
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2,
/datum/material/silver = SHEET_MATERIAL_AMOUNT * 1,
)
build_path = /obj/item/wallframe/cell_charger_multi
category = list(
RND_CATEGORY_INITIAL,
FABRICATOR_CATEGORY_APPLIANCES + FABRICATOR_SUBCATEGORY_POWER,
)
construction_time = 15 SECONDS

// Portable scrubber and pumps for all your construction atmospherics needs

/datum/design/portable_gas_pump
name = "Portable Air Pump"
id = "portable_lil_pump"
build_type = COLONY_FABRICATOR
materials = list(
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 7.5,
/datum/material/glass = SHEET_MATERIAL_AMOUNT * 3,
)
build_path = /obj/machinery/portable_atmospherics/pump
category = list(
RND_CATEGORY_INITIAL,
FABRICATOR_CATEGORY_APPLIANCES + FABRICATOR_SUBCATEGORY_ATMOS,
)
construction_time = 30 SECONDS

/datum/design/portable_gas_scrubber
name = "Portable Air Scrubber"
id = "portable_scrubbs"
build_type = COLONY_FABRICATOR
materials = list(
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 7.5,
/datum/material/glass = SHEET_MATERIAL_AMOUNT * 3,
)
build_path = /obj/machinery/portable_atmospherics/scrubber
category = list(
RND_CATEGORY_INITIAL,
FABRICATOR_CATEGORY_APPLIANCES + FABRICATOR_SUBCATEGORY_ATMOS,
)
construction_time = 30 SECONDS

// Plumbable chem machine that makes nothing but water

/datum/design/water_synthesizer
name = "Water Synthesizer"
id = "water_synth"
build_type = COLONY_FABRICATOR
materials = list(
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2.5,
/datum/material/glass = SHEET_MATERIAL_AMOUNT,
)
build_path = /obj/machinery/plumbing/synthesizer/water_synth
category = list(
RND_CATEGORY_INITIAL,
FABRICATOR_CATEGORY_APPLIANCES + FABRICATOR_SUBCATEGORY_FLUIDS,
)
construction_time = 10 SECONDS

#undef FABRICATOR_CATEGORY_APPLIANCES
#undef FABRICATOR_SUBCATEGORY_POWER
#undef FABRICATOR_SUBCATEGORY_ATMOS
#undef FABRICATOR_SUBCATEGORY_FLUIDS
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/datum/design/survival_knife
name = "Survival Knife"
id = "survival_knife"
build_type = COLONY_FABRICATOR
materials = list(
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 6
)
build_path = /obj/item/knife/combat/survival
category = list(
RND_CATEGORY_INITIAL,
RND_CATEGORY_EQUIPMENT + RND_SUBCATEGORY_EQUIPMENT_KITCHEN,
)
departmental_flags = DEPARTMENT_BITFLAG_SERVICE

/datum/design/soup_pot
name = "Soup Pot"
id = "soup_pot"
build_type = COLONY_FABRICATOR
materials = list(
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2.5
)
build_path = /obj/item/reagent_containers/cup/soup_pot
category = list(
RND_CATEGORY_INITIAL,
RND_CATEGORY_EQUIPMENT + RND_SUBCATEGORY_EQUIPMENT_KITCHEN,
)
departmental_flags = DEPARTMENT_BITFLAG_SERVICE
Loading
Loading