From ec9142c238961bdafb2477d4690b07990a08607a Mon Sep 17 00:00:00 2001 From: GDN <96800819+GDNgit@users.noreply.github.com> Date: Wed, 5 Oct 2022 22:29:31 -0500 Subject: [PATCH] Species now have their innate actions GC (#19212) --- code/modules/mob/living/carbon/human/species/golem.dm | 10 ++++------ .../modules/mob/living/carbon/human/species/machine.dm | 5 ++--- code/modules/mob/living/carbon/human/species/moth.dm | 7 +++---- code/modules/mob/living/carbon/human/species/unathi.dm | 6 ++---- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/golem.dm b/code/modules/mob/living/carbon/human/species/golem.dm index b06cb23b2a3..fcb76bd7bb9 100644 --- a/code/modules/mob/living/carbon/human/species/golem.dm +++ b/code/modules/mob/living/carbon/human/species/golem.dm @@ -118,7 +118,6 @@ prefix = "Plasma" special_names = list("Flood", "Fire", "Bar", "Man") var/boom_warning = FALSE - var/datum/action/innate/ignite/ignite /datum/species/golem/plasma/handle_life(mob/living/carbon/human/H) if(H.bodytemperature > 750) @@ -143,11 +142,11 @@ /datum/species/golem/plasma/on_species_gain(mob/living/carbon/C, datum/species/old_species) ..() if(ishuman(C)) - ignite = new + var/datum/action/innate/ignite/ignite = new() ignite.Grant(C) /datum/species/golem/plasma/on_species_loss(mob/living/carbon/C) - if(ignite) + for(var/datum/action/innate/ignite/ignite in C.actions) ignite.Remove(C) ..() @@ -434,7 +433,6 @@ special_names = list("Crystal", "Polycrystal") unarmed_type = /datum/unarmed_attack/golem/bluespace - var/datum/action/innate/unstable_teleport/unstable_teleport var/teleport_cooldown = 100 var/last_teleport = 0 var/tele_range = 6 @@ -488,12 +486,12 @@ /datum/species/golem/bluespace/on_species_gain(mob/living/carbon/C, datum/species/old_species) ..() if(ishuman(C)) - unstable_teleport = new + var/datum/action/innate/unstable_teleport/unstable_teleport = new() unstable_teleport.Grant(C) last_teleport = world.time /datum/species/golem/bluespace/on_species_loss(mob/living/carbon/C) - if(unstable_teleport) + for(var/datum/action/innate/unstable_teleport/unstable_teleport in C.actions) unstable_teleport.Remove(C) ..() diff --git a/code/modules/mob/living/carbon/human/species/machine.dm b/code/modules/mob/living/carbon/human/species/machine.dm index bf6090efe22..17496b06bb1 100644 --- a/code/modules/mob/living/carbon/human/species/machine.dm +++ b/code/modules/mob/living/carbon/human/species/machine.dm @@ -77,11 +77,10 @@ "is frying their own circuits!", "is blocking their ventilation port!") - var/datum/action/innate/change_monitor/monitor /datum/species/machine/on_species_gain(mob/living/carbon/human/H) ..() - monitor = new() + var/datum/action/innate/change_monitor/monitor = new() monitor.Grant(H) for(var/datum/atom_hud/data/human/medical/medhud in GLOB.huds) medhud.remove_from_hud(H) @@ -92,7 +91,7 @@ /datum/species/machine/on_species_loss(mob/living/carbon/human/H) ..() - if(monitor) + for(var/datum/action/innate/change_monitor/monitor in H.actions) monitor.Remove(H) for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) diag_hud.remove_from_hud(H) diff --git a/code/modules/mob/living/carbon/human/species/moth.dm b/code/modules/mob/living/carbon/human/species/moth.dm index b68c665e9cb..fa8c64329cc 100644 --- a/code/modules/mob/living/carbon/human/species/moth.dm +++ b/code/modules/mob/living/carbon/human/species/moth.dm @@ -40,8 +40,6 @@ optional_body_accessory = FALSE - var/datum/action/innate/cocoon/cocoon - suicide_messages = list( "is attempting to nibble their antenna off!", "is twisting their own abdomen!", @@ -53,7 +51,7 @@ /datum/species/moth/on_species_gain(mob/living/carbon/human/H) ..() - cocoon = new() + var/datum/action/innate/cocoon/cocoon = new() cocoon.Grant(H) RegisterSignal(H, COMSIG_LIVING_FIRE_TICK, .proc/check_burn_wings) RegisterSignal(H, COMSIG_LIVING_AHEAL, .proc/on_aheal) @@ -62,7 +60,8 @@ /datum/species/moth/on_species_loss(mob/living/carbon/human/H) ..() - cocoon.Remove(H) + for(var/datum/action/innate/cocoon/cocoon in H.actions) + cocoon.Remove(H) UnregisterSignal(H, COMSIG_LIVING_FIRE_TICK) UnregisterSignal(H, COMSIG_LIVING_AHEAL) UnregisterSignal(H, COMSIG_HUMAN_CHANGE_BODY_ACCESSORY) diff --git a/code/modules/mob/living/carbon/human/species/unathi.dm b/code/modules/mob/living/carbon/human/species/unathi.dm index 90bda821f20..31bbc332391 100644 --- a/code/modules/mob/living/carbon/human/species/unathi.dm +++ b/code/modules/mob/living/carbon/human/species/unathi.dm @@ -56,17 +56,15 @@ "is twisting their own neck!", "is holding their breath!") - var/datum/action/innate/tail_lash/lash - /datum/species/unathi/on_species_gain(mob/living/carbon/human/H) ..() - lash = new + var/datum/action/innate/tail_lash/lash = new() lash.Grant(H) /datum/species/unathi/on_species_loss(mob/living/carbon/human/H) ..() - if(lash) + for(var/datum/action/innate/tail_lash/lash in H.actions) lash.Remove(H) /datum/action/innate/tail_lash