[MIRROR] Makes R&D artifacts not just 'destroy them for the rocks' (#12154)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-12-26 07:08:02 +01:00
committed by GitHub
co-authored by Cameron Lennox
parent 3d50b0f125
commit bf9176a1be
6 changed files with 53 additions and 2 deletions
@@ -0,0 +1,28 @@
/datum/component/deconstructable_research
///Used by R&D to determine how many points the item gives.
var/techweb_points = 0
///Used by R&D to determine what point type the item gives, if any
var/techweb_point_type = TECHWEB_POINT_TYPE_GENERIC
/datum/component/deconstructable_research/Initialize(techweb_points, techweb_point_type)
if(!isobj(parent))
return COMPONENT_INCOMPATIBLE
if(!isnull(techweb_points))
src.techweb_points = techweb_points
if(!isnull(techweb_point_type))
src.techweb_point_type = techweb_point_type
/datum/component/deconstructable_research/RegisterWithParent()
RegisterSignal(parent, COMSIG_TECHWEB_POINT_CHECK, PROC_REF(point_check))
RegisterSignal(parent, COMSIG_TECHWEB_TYPE_CHECK, PROC_REF(type_check))
/datum/component/deconstructable_research/UnregisterFromParent()
UnregisterSignal(parent, COMSIG_TECHWEB_POINT_CHECK)
UnregisterSignal(parent, COMSIG_TECHWEB_TYPE_CHECK)
/datum/component/deconstructable_research/proc/point_check(atom/movable/source)
return techweb_points
/datum/component/deconstructable_research/proc/type_check(atom/movable/source, list/modify_me)
modify_me["type"] = techweb_point_type