Block free golems from using shuttle consoles, other than to go home (#65991)

* Block golems from using shuttle consoles

* Update code/modules/mob_spawn/ghost_roles/golem_roles.dm

Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
This commit is contained in:
Mothblocks
2022-04-09 13:03:45 -07:00
committed by GitHub
co-authored by Kylerace
parent bd26cc7ba4
commit 18849c0c25
3 changed files with 16 additions and 6 deletions
@@ -52,10 +52,8 @@
if (policy)
to_chat(new_spawn, policy)
to_chat(new_spawn, "Build golem shells in the autolathe, and feed refined mineral sheets to the shells to bring them to life! You are generally a peaceful group unless provoked.")
var/static/list/allowed_areas
if(!allowed_areas)
allowed_areas = typecacheof(list(/area/icemoon, /area/lavaland, /area/ruin))
new_spawn.AddComponent(/datum/component/hazard_area, area_whitelist=allowed_areas)
try_keep_home(new_spawn)
else
new_spawn.mind.enslave_mind_to_creator(owner)
log_game("[key_name(new_spawn)] possessed a golem shell enslaved to [key_name(owner)].")
@@ -71,6 +69,12 @@
else
new_spawn.mind.set_assigned_role(SSjob.GetJobType(/datum/job/free_golem))
/obj/effect/mob_spawn/ghost_role/human/golem/proc/try_keep_home(mob/new_spawn)
var/static/list/allowed_areas = typecacheof(list(/area/icemoon, /area/lavaland, /area/ruin))
ADD_TRAIT(new_spawn, TRAIT_FORBID_MINING_SHUTTLE_CONSOLE_OUTSIDE_STATION, INNATE_TRAIT)
new_spawn.AddComponent(/datum/component/hazard_area, area_whitelist = allowed_areas)
/obj/effect/mob_spawn/ghost_role/human/golem/attack_hand(mob/user, list/modifiers)
. = ..()
if(.)