mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Techwebs (#11249)
This commit is contained in:
@@ -29,8 +29,16 @@
|
||||
|
||||
var/filtertext
|
||||
|
||||
/// Reference to a remote material inventory, such as an ore silo.
|
||||
var/datum/component/remote_materials/rmat
|
||||
|
||||
/obj/machinery/autolathe/Initialize(mapload)
|
||||
AddComponent(/datum/component/material_container, subtypesof(/datum/material), 0, MATCONTAINER_EXAMINE, _after_insert = CALLBACK(src, PROC_REF(AfterMaterialInsert)))
|
||||
rmat = AddComponent( \
|
||||
/datum/component/remote_materials, \
|
||||
mapload, \
|
||||
mat_container_signals = list( \
|
||||
COMSIG_MATCONTAINER_ITEM_CONSUMED = TYPE_PROC_REF(/obj/machinery/autolathe, AfterMaterialInsert) \
|
||||
))
|
||||
. = ..()
|
||||
if(!autolathe_recipes)
|
||||
autolathe_recipes = new()
|
||||
@@ -58,6 +66,8 @@
|
||||
/obj/machinery/autolathe/tgui_static_data(mob/user)
|
||||
var/list/data = ..()
|
||||
|
||||
data += rmat.mat_container.tgui_static_data(user)
|
||||
|
||||
var/list/categories = list()
|
||||
var/list/recipes = list()
|
||||
for(var/datum/category_group/autolathe/A in autolathe_recipes.categories)
|
||||
@@ -89,8 +99,7 @@
|
||||
/obj/machinery/autolathe/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
||||
var/list/data = ..()
|
||||
data["busy"] = busy
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
data["materials"] = materials.tgui_data(user, TRUE)
|
||||
data["materials"] = rmat.mat_container.tgui_data(user, TRUE)
|
||||
data["mat_efficiency"] = mat_efficiency
|
||||
return data
|
||||
|
||||
@@ -160,7 +169,7 @@
|
||||
if(making.hidden && !hacked)
|
||||
return
|
||||
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
var/datum/component/material_container/materials = rmat.mat_container
|
||||
|
||||
var/list/materials_used = list()
|
||||
|
||||
@@ -183,15 +192,11 @@
|
||||
//Check if we still have the materials.
|
||||
var/coeff = (making.no_scale ? 1 : mat_efficiency) //stacks are unaffected by production coefficient
|
||||
|
||||
for(var/datum/material/used_material as anything in making.resources)
|
||||
var/amount_needed = making.resources[used_material] * coeff * multiplier
|
||||
materials_used[used_material] = amount_needed
|
||||
|
||||
if(LAZYLEN(materials_used))
|
||||
if(!materials.has_materials(materials_used))
|
||||
if(!materials.has_materials(making.resources))
|
||||
return
|
||||
|
||||
materials.use_materials(materials_used)
|
||||
rmat.use_materials(making.resources, coeff, multiplier)
|
||||
|
||||
busy = making.name
|
||||
update_use_power(USE_POWER_ACTIVE)
|
||||
@@ -261,18 +266,12 @@
|
||||
for(var/obj/item/stock_parts/manipulator/M in component_parts)
|
||||
man_rating += M.rating
|
||||
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
materials.max_amount = mb_rating * 75000
|
||||
rmat.set_local_size(mb_rating * 75000)
|
||||
|
||||
build_time = 50 / man_rating
|
||||
mat_efficiency = 1.1 - man_rating * 0.1// Normally, price is 1.25 the amount of material, so this shouldn't go higher than 0.6. Maximum rating of parts is 5
|
||||
update_tgui_static_data(usr)
|
||||
|
||||
/obj/machinery/autolathe/dismantle()
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
materials.retrieve_all()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/autolathe/proc/AfterMaterialInsert(obj/item/item_inserted, id_inserted, amount_inserted)
|
||||
flick("autolathe_loading", src)//plays metal insertion animation
|
||||
// use_power(min(1000, amount_inserted / 100))
|
||||
@@ -280,6 +279,5 @@
|
||||
|
||||
/obj/machinery/autolathe/examine(mob/user)
|
||||
. = ..()
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
if(in_range(user, src) || isobserver(user))
|
||||
. += span_notice("The status display reads: Storing up to <b>[materials.max_amount]</b> material units.<br>Material consumption at <b>[mat_efficiency*100]%</b>.")
|
||||
. += span_notice("The status display reads: Storing up to <b>[rmat.local_size]</b> material units.<br>Material consumption at <b>[mat_efficiency*100]%</b>.")
|
||||
|
||||
@@ -35,7 +35,9 @@
|
||||
new CB.build_path(loc, CB)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
/obj/machinery/computer/arcade/proc/prizevend()
|
||||
/obj/machinery/computer/arcade/proc/prizevend(mob/user)
|
||||
SEND_SIGNAL(src, COMSIG_ARCADE_PRIZEVEND, user)
|
||||
|
||||
if(LAZYLEN(special_prizes)) // Downstream wanted the 'win things inside contents sans circuitboard' feature kept.
|
||||
var/atom/movable/AM = pick_n_take(special_prizes)
|
||||
AM.forceMove(get_turf(src))
|
||||
@@ -221,11 +223,11 @@
|
||||
emagged = 0
|
||||
else if(!contents.len)
|
||||
feedback_inc("arcade_win_normal")
|
||||
prizevend()
|
||||
prizevend(user)
|
||||
|
||||
else
|
||||
feedback_inc("arcade_win_normal")
|
||||
prizevend()
|
||||
prizevend(user)
|
||||
|
||||
else if (emagged && (turtle >= 4))
|
||||
var/boomamt = rand(5,10)
|
||||
@@ -1015,7 +1017,7 @@
|
||||
message_admins("[key_name_admin(user)] made it to Orion on an emagged machine and got an explosive toy ship.")
|
||||
log_game("[key_name(user)] made it to Orion on an emagged machine and got an explosive toy ship.")
|
||||
else
|
||||
prizevend()
|
||||
prizevend(user)
|
||||
emagged = 0
|
||||
name = "The Orion Trail"
|
||||
desc = "Learn how our ancestors got to Orion, and have fun in the process!"
|
||||
@@ -1292,7 +1294,7 @@
|
||||
|
||||
if(prob(winprob)) /// YEAH.
|
||||
if(!emagged)
|
||||
prizevend()
|
||||
prizevend(user)
|
||||
winscreen = "You won!"
|
||||
else if(emagged)
|
||||
gameprice = 1
|
||||
|
||||
@@ -4,14 +4,6 @@
|
||||
board_type = new /datum/frame/frame_types/button
|
||||
matter = list(MAT_STEEL = 50, MAT_GLASS = 50)
|
||||
|
||||
/datum/design/circuit/airlock_cycling
|
||||
name = "Machine Design (Cycling Airlock Board)"
|
||||
desc = "The circuit board for cycling airlock parts."
|
||||
id = "airlock_cycling"
|
||||
build_path = /obj/item/circuitboard/airlock_cycling
|
||||
req_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2)
|
||||
sort_string = "MAAAD"
|
||||
|
||||
/obj/item/circuitboard/airlock_cycling/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(I.has_tool_quality(TOOL_MULTITOOL))
|
||||
var/result = tgui_input_list(
|
||||
|
||||
@@ -429,6 +429,7 @@ Class Procs:
|
||||
. = dismantle()
|
||||
|
||||
/obj/machinery/proc/dismantle()
|
||||
SEND_SIGNAL(src, COMSIG_OBJ_DECONSTRUCT)
|
||||
playsound(src, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
for(var/obj/I in contents)
|
||||
if(istype(I,/obj/item/card/id))
|
||||
|
||||
Reference in New Issue
Block a user