mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
[MIRROR] Golem Rework [MDB IGNORE] (#21001)
* Golem Rework * SECT 9 * ok --------- Co-authored-by: Jacquerel <hnevard@gmail.com> Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
co-authored by
Jacquerel
Gandalf
parent
7f0d1b80be
commit
aac6045ba8
@@ -201,16 +201,7 @@
|
||||
|
||||
/datum/outfit/consumed_golem/pre_equip(mob/living/carbon/human/golem, visualsOnly = FALSE)
|
||||
if(!visualsOnly)
|
||||
golem.set_species(pick(
|
||||
/datum/species/golem/adamantine,
|
||||
/datum/species/golem/diamond,
|
||||
/datum/species/golem/gold,
|
||||
/datum/species/golem/plasma,
|
||||
/datum/species/golem/plasteel,
|
||||
/datum/species/golem/plastitanium,
|
||||
/datum/species/golem/silver,
|
||||
/datum/species/golem/titanium,
|
||||
))
|
||||
golem.set_species(/datum/species/golem)
|
||||
if(prob(30))
|
||||
glasses = pick_weight(list(
|
||||
/obj/item/clothing/glasses/hud/diagnostic = 2,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
name = "inert free golem shell"
|
||||
desc = "A humanoid shape, empty, lifeless, and full of potential."
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state = "construct"
|
||||
icon_state = "shell_complete"
|
||||
mob_species = /datum/species/golem
|
||||
anchored = FALSE
|
||||
move_resist = MOVE_FORCE_NORMAL
|
||||
@@ -15,22 +15,20 @@
|
||||
you_are_text = "You are a Free Golem. Your family worships The Liberator."
|
||||
flavour_text = "In his infinite and divine wisdom, he set your clan free to travel the stars with a single declaration: \"Yeah go do whatever.\""
|
||||
spawner_job_path = /datum/job/free_golem
|
||||
/// If TRUE, other golems can touch us to swap into this shell.
|
||||
var/can_transfer = TRUE
|
||||
/// Weakref to the creator of this golem shell.
|
||||
var/datum/weakref/owner_ref
|
||||
/// Typepath to a material to feed to the golem as soon as it is built
|
||||
var/initial_type
|
||||
|
||||
/obj/effect/mob_spawn/ghost_role/human/golem/Initialize(mapload, datum/species/golem/species, mob/creator)
|
||||
/obj/effect/mob_spawn/ghost_role/human/golem/Initialize(mapload, mob/creator, made_of)
|
||||
if(creator)
|
||||
name = "inert servant golem shell"
|
||||
prompt_name = "servant golem"
|
||||
if(species) //spawners list uses object name to register so this goes before ..()
|
||||
name += " ([initial(species.prefix)])"
|
||||
mob_species = species
|
||||
initial_type = made_of
|
||||
. = ..()
|
||||
var/area/init_area = get_area(src)
|
||||
if(!mapload && init_area)
|
||||
notify_ghosts("\A [initial(species.prefix)] golem shell has been completed in \the [init_area.name].", source = src, action=NOTIFY_ATTACK, flashwindow = FALSE, ignore_key = POLL_IGNORE_GOLEM)
|
||||
notify_ghosts("\A golem shell has been completed in \the [init_area.name].", source = src, action=NOTIFY_ATTACK, flashwindow = FALSE, ignore_key = POLL_IGNORE_GOLEM)
|
||||
if(creator)
|
||||
you_are_text = "You are a golem."
|
||||
flavour_text = "You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools."
|
||||
@@ -40,31 +38,35 @@
|
||||
|
||||
|
||||
/obj/effect/mob_spawn/ghost_role/human/golem/name_mob(mob/living/spawned_mob, forced_name)
|
||||
if(!forced_name)
|
||||
var/datum/species/golem/golem_species = mob_species
|
||||
if(owner_ref?.resolve())
|
||||
forced_name = "[initial(golem_species.prefix)] Golem ([rand(1,999)])"
|
||||
else
|
||||
golem_species = new mob_species
|
||||
forced_name = golem_species.random_name()
|
||||
if(forced_name || !iscarbon(spawned_mob))
|
||||
return ..()
|
||||
|
||||
if(owner_ref?.resolve())
|
||||
forced_name = "Golem ([rand(1,999)])"
|
||||
return ..()
|
||||
|
||||
var/datum/species/golem/golem_species = new()
|
||||
forced_name = golem_species.random_name()
|
||||
return ..()
|
||||
|
||||
/obj/effect/mob_spawn/ghost_role/human/golem/special(mob/living/new_spawn, mob/mob_possessor)
|
||||
. = ..()
|
||||
if(is_path_in_list(initial_type, GLOB.golem_stack_food_directory))
|
||||
var/datum/golem_food_buff/initial_buff = GLOB.golem_stack_food_directory[initial_type]
|
||||
initial_buff.apply_effects(new_spawn)
|
||||
|
||||
var/mob/living/real_owner = owner_ref?.resolve()
|
||||
var/datum/species/golem/golem_species = mob_species
|
||||
to_chat(new_spawn, "[initial(golem_species.info_text)]")
|
||||
if(isnull(real_owner))
|
||||
if(!is_station_level(new_spawn.z))
|
||||
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.")
|
||||
try_keep_home(new_spawn)
|
||||
|
||||
new_spawn.log_message("possessed a free golem shell.", LOG_GAME)
|
||||
log_admin("[key_name(new_spawn)] possessed a free golem shell.")
|
||||
|
||||
else if(new_spawn.mind)
|
||||
new_spawn.mind.enslave_mind_to_creator(real_owner)
|
||||
|
||||
else
|
||||
stack_trace("[type] created a golem without a mind.")
|
||||
|
||||
@@ -78,32 +80,6 @@
|
||||
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(.)
|
||||
return
|
||||
if(!isgolem(user) || !can_transfer)
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/golem = user
|
||||
var/transfer_choice = tgui_alert(usr, "Transfer your soul to [src]? (Warning, your old body will die!)",,list("Yes","No"))
|
||||
if(transfer_choice != "Yes")
|
||||
return
|
||||
if(QDELETED(src) || uses <= 0)
|
||||
return
|
||||
uses -= 1
|
||||
golem.log_message("golem-swapped into [src].", LOG_GAME)
|
||||
golem.visible_message(
|
||||
span_notice("A faint light leaves [golem], moving to [src] and animating it!"),
|
||||
span_notice("You leave your old body behind, and transfer into [src]!"),
|
||||
)
|
||||
show_flavor = FALSE
|
||||
var/mob/living/carbon/human/newgolem = create(user, golem.real_name)
|
||||
golem.transfer_quirk_datums(newgolem)
|
||||
golem.death()
|
||||
check_uses()
|
||||
return TRUE
|
||||
|
||||
/obj/effect/mob_spawn/ghost_role/human/golem/servant
|
||||
name = "inert servant golem shell"
|
||||
prompt_name = "servant golem"
|
||||
@@ -112,5 +88,11 @@
|
||||
name = "dust-caked free golem shell"
|
||||
desc = "A humanoid shape, empty, lifeless, and full of potential."
|
||||
prompt_name = "free golem"
|
||||
can_transfer = FALSE
|
||||
mob_species = /datum/species/golem/adamantine
|
||||
|
||||
/obj/effect/mob_spawn/ghost_role/human/golem/adamantine/special(mob/living/new_spawn, mob/mob_possessor)
|
||||
. = ..()
|
||||
if(!ishuman(new_spawn))
|
||||
return
|
||||
var/mob/living/carbon/human/new_golem = new_spawn
|
||||
var/obj/item/organ/internal/vocal_cords/adamantine/free_golem_radio = new()
|
||||
free_golem_radio.Insert(new_golem)
|
||||
|
||||
Reference in New Issue
Block a user