mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-31 01:00:59 +01:00
[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:
co-authored by
Cameron Lennox
parent
3d50b0f125
commit
bf9176a1be
@@ -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
|
||||
Reference in New Issue
Block a user