4b2a8aebe5
* temp * meatwalls * more * adds sheetifier * fix * two * mat texture + 4dplanner admin (#21) * mat texture + 4dplanner admin * keep together trait * counter instead of trait * finalizations * woops * fixes * oopsie * only set starting keep_together if necessary (#24) * keep together as trait again * remove false comment * doc for TRAIT_KEEP_TOGETHER * remove needless scoping Co-authored-by: 4dplanner <3combined@gmail.com>
35 lines
759 B
Plaintext
35 lines
759 B
Plaintext
/datum/component/beauty
|
|
var/beauty = 0
|
|
|
|
/datum/component/beauty/Initialize(beautyamount)
|
|
if(!isatom(parent) || isarea(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
|
|
beauty = beautyamount
|
|
|
|
if(ismovable(parent))
|
|
RegisterSignal(parent, COMSIG_ENTER_AREA, .proc/enter_area)
|
|
RegisterSignal(parent, COMSIG_EXIT_AREA, .proc/exit_area)
|
|
|
|
var/area/A = get_area(parent)
|
|
if(A)
|
|
enter_area(null, A)
|
|
|
|
/datum/component/beauty/proc/enter_area(datum/source, area/A)
|
|
if(A.outdoors)
|
|
return
|
|
A.totalbeauty += beauty
|
|
A.update_beauty()
|
|
|
|
/datum/component/beauty/proc/exit_area(datum/source, area/A)
|
|
if(A.outdoors)
|
|
return
|
|
A.totalbeauty -= beauty
|
|
A.update_beauty()
|
|
|
|
/datum/component/beauty/Destroy()
|
|
. = ..()
|
|
var/area/A = get_area(parent)
|
|
if(A)
|
|
exit_area(null, A)
|