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

Autolathe Stuff #19194

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
9 changes: 9 additions & 0 deletions aurorastation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,15 @@
#include "code\game\machinery\atmoalter\scrubber.dm"
#include "code\game\machinery\autolathe\autolathe.dm"
#include "code\game\machinery\autolathe\autolathe_datums.dm"
#include "code\game\machinery\autolathe\designs\ammunition.dm"
#include "code\game\machinery\autolathe\designs\armaments.dm"
#include "code\game\machinery\autolathe\designs\components.dm"
#include "code\game\machinery\autolathe\designs\dinnerware.dm"
#include "code\game\machinery\autolathe\designs\engineering.dm"
#include "code\game\machinery\autolathe\designs\general.dm"
#include "code\game\machinery\autolathe\designs\materials.dm"
#include "code\game\machinery\autolathe\designs\medical.dm"
#include "code\game\machinery\autolathe\designs\tools.dm"
#include "code\game\machinery\bots\bots.dm"
#include "code\game\machinery\camera\camera.dm"
#include "code\game\machinery\camera\camera_assembly.dm"
Expand Down
32 changes: 30 additions & 2 deletions code/game/machinery/autolathe/autolathe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@

/obj/machinery/autolathe/ui_data(mob/user)
. = ..()

var/list/data = list()
data["disabled"] = disabled
data["material_efficiency"] = mat_efficiency
Expand All @@ -95,14 +96,28 @@
for(var/material in stored_material)
data["materials"] += list(list("material" = material, "stored" = stored_material[material], "max_capacity" = storage_capacity[material]))
data["recipes"] = list()

var/ship_security_level = seclevel2num(get_security_level())
var/is_on_ship = isStationLevel(z) // since ship security levels are global FOR NOW, we'll ignore the alert check for offship autolathes
for(var/recipe in GET_SINGLETON_SUBTYPE_LIST(/singleton/autolathe_recipe))
var/singleton/autolathe_recipe/R = recipe
if(R.hidden && !hacked)
if(R.IsAbstract())
continue

var/is_enabled = TRUE
if(!hacked)
if(R.hack_only)
continue
if(is_on_ship && ship_security_level < R.security_level)
is_enabled = FALSE

Geevies marked this conversation as resolved.
Show resolved Hide resolved
var/list/recipe_data = list()
recipe_data["name"] = R.name
recipe_data["recipe"] = R.type
recipe_data["hidden"] = R.hidden
recipe_data["security_level"] = R.security_level ? capitalize(num2seclevel(R.security_level)) : "None"
recipe_data["hidden"] = R.hack_only
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should update the name of that car so ui and dm code are consistent

recipe_data["enabled"] = is_enabled
Geevies marked this conversation as resolved.
Show resolved Hide resolved

var/list/resources = list()
for(var/resource in R.resources)
resources += "[R.resources[resource] * mat_efficiency] [resource]"
Expand Down Expand Up @@ -187,6 +202,19 @@
if(!istype(R))
CRASH("Unknown recipe given! [R], param is [params["recipe"]].")

var/ship_security_level = seclevel2num(get_security_level())
var/is_on_ship = isStationLevel(z) // since ship security levels are global FOR NOW, we'll ignore the alert check for offship autolathes

var/is_enabled = TRUE
if(!hacked)
if(R.hack_only)
is_enabled = FALSE
else if(is_on_ship && ship_security_level < R.security_level)
is_enabled = FALSE
Geevies marked this conversation as resolved.
Show resolved Hide resolved

if(!is_enabled)
CRASH("Someone tried to print an un-enabled recipe! [R], param is [params["recipe"]].")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should print who that someone is (ckey)


intent_message(MACHINE_SOUND)

//Check if we still have the materials.
Expand Down
Loading
Loading