mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 18:44:48 +01:00
Refactors outfits to work with mind initialization (#25395)
* wow * fix runtime and ci * i spell good * Fix * Update code/datums/outfits/outfit_admin.dm Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Signed-off-by: Matt <116982774+Burzah@users.noreply.github.com> --------- Signed-off-by: Matt <116982774+Burzah@users.noreply.github.com> Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
This commit is contained in:
@@ -1786,6 +1786,7 @@
|
||||
|
||||
//Initialisation procs
|
||||
/mob/proc/mind_initialize()
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
if(mind)
|
||||
mind.key = key
|
||||
else
|
||||
@@ -1797,6 +1798,7 @@
|
||||
if(!mind.name)
|
||||
mind.name = real_name
|
||||
mind.current = src
|
||||
SEND_SIGNAL(src, COMSIG_MIND_INITIALIZE)
|
||||
|
||||
//HUMAN
|
||||
/mob/living/carbon/human/mind_initialize()
|
||||
|
||||
@@ -50,7 +50,20 @@
|
||||
|
||||
/datum/outfit/proc/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
|
||||
//to be overriden for toggling internals, id binding, access etc
|
||||
return
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
if(visualsOnly)
|
||||
return
|
||||
|
||||
if(H.mind)
|
||||
on_mind_initialize(H)
|
||||
return
|
||||
RegisterSignal(H, COMSIG_MIND_INITIALIZE, PROC_REF(on_mind_initialize))
|
||||
|
||||
// Guaranteed access to mind, will never be called if visualsOnly = TRUE
|
||||
/datum/outfit/proc/on_mind_initialize(mob/living/carbon/human/H)
|
||||
SIGNAL_HANDLER // COMSIG_MIND_INITIALIZE
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
UnregisterSignal(H, COMSIG_MIND_INITIALIZE) // prevent this call from being called multiple times on a human
|
||||
|
||||
/datum/outfit/proc/equip(mob/living/carbon/human/H, visualsOnly = FALSE)
|
||||
pre_equip(H, visualsOnly)
|
||||
|
||||
@@ -3,21 +3,15 @@
|
||||
|
||||
/datum/outfit/admin/pre_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
|
||||
. = ..()
|
||||
if(!visualsOnly && H.mind)
|
||||
H.mind.assigned_role = name
|
||||
H.job = name
|
||||
|
||||
/datum/outfit/admin/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
|
||||
. = ..()
|
||||
|
||||
if(visualsOnly)
|
||||
return
|
||||
|
||||
if(H.mind)
|
||||
H.mind.offstation_role = TRUE
|
||||
else
|
||||
H.RegisterSignal(H, COMSIG_HUMAN_LOGIN, TYPE_PROC_REF(/mob/living/carbon/human, apply_offstation_roles))
|
||||
H.job = name
|
||||
|
||||
/datum/outfit/admin/on_mind_initialize(mob/living/carbon/human/H)
|
||||
. = ..()
|
||||
H.mind.assigned_role = name
|
||||
H.mind.offstation_role = TRUE
|
||||
|
||||
/proc/apply_to_card(obj/item/card/id/I, mob/living/carbon/human/H, list/access = list(), rank, special_icon)
|
||||
if(!istype(I) || !istype(H))
|
||||
@@ -1250,17 +1244,17 @@
|
||||
if(istype(I))
|
||||
apply_to_card(I, H, get_all_accesses(), "Ancient One", "data")
|
||||
|
||||
if(H.mind)
|
||||
if(!H.mind.has_antag_datum(/datum/antagonist/vampire))
|
||||
H.mind.make_vampire(TRUE)
|
||||
var/datum/antagonist/vampire/V = H.mind.has_antag_datum(/datum/antagonist/vampire)
|
||||
V.bloodusable = 9999
|
||||
V.bloodtotal = 9999
|
||||
V.add_subclass(SUBCLASS_ANCIENT, FALSE)
|
||||
H.dna.SetSEState(GLOB.jumpblock, TRUE)
|
||||
singlemutcheck(H, GLOB.jumpblock, MUTCHK_FORCED)
|
||||
H.update_mutations()
|
||||
H.gene_stability = 100
|
||||
/datum/outfit/admin/ancient_vampire/on_mind_initialize(mob/living/carbon/human/H)
|
||||
. = ..()
|
||||
H.mind.make_vampire()
|
||||
var/datum/antagonist/vampire/V = H.mind.has_antag_datum(/datum/antagonist/vampire)
|
||||
V.bloodusable = 9999
|
||||
V.bloodtotal = 9999
|
||||
V.add_subclass(SUBCLASS_ANCIENT, FALSE)
|
||||
H.dna.SetSEState(GLOB.jumpblock, TRUE)
|
||||
singlemutcheck(H, GLOB.jumpblock, MUTCHK_FORCED)
|
||||
H.update_mutations()
|
||||
H.gene_stability = 100
|
||||
|
||||
/datum/outfit/admin/wizard
|
||||
name = "Blue Wizard"
|
||||
@@ -1490,10 +1484,6 @@
|
||||
|
||||
H.real_name = "Unknown" //Enforcers sacrifice their name to Oblivion for their power
|
||||
|
||||
for(var/spell_path in spell_paths)
|
||||
var/S = new spell_path
|
||||
H.mind.AddSpell(S)
|
||||
|
||||
var/obj/item/clothing/suit/hooded/oblivion/robes = H.wear_suit
|
||||
if(istype(robes))
|
||||
robes.ToggleHood()
|
||||
@@ -1502,6 +1492,12 @@
|
||||
if(istype(I))
|
||||
apply_to_card(I, H, get_all_accesses(), "Oblivion Enforcer")
|
||||
|
||||
/datum/outfit/admin/enforcer/on_mind_initialize(mob/living/carbon/human/H)
|
||||
. = ..()
|
||||
for(var/spell_path in spell_paths)
|
||||
var/S = new spell_path
|
||||
H.mind.AddSpell(S)
|
||||
|
||||
/datum/outfit/admin/viper
|
||||
name = "Solar Federation Viper Infiltrator"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user