Fixes a bug with species component application (#18696)

* Update trait.dm

Update trait.dm

Fixes a bug and cleans up Omen dice application

* small godmode fix

* Proper

* Fixes organ regen
This commit is contained in:
Cameron Lennox
2025-10-27 01:51:35 -04:00
committed by GitHub
parent 4ff81edb10
commit cccd2280a7
7 changed files with 29 additions and 12 deletions
+2 -2
View File
@@ -251,7 +251,7 @@
to_chat(user, span_cult("You feel extraordinarily unlucky..."))
if(evil)
user.AddComponent(
/datum/component/omen/dice,\
/datum/component/omen,\
incidents_left = 1,\
luck_mod = 1,\
damage_mod = 1,\
@@ -262,7 +262,7 @@
else
user.AddComponent(
/datum/component/omen/dice,\
/datum/component/omen,\
incidents_left = 1,\
luck_mod = 0.3,\
damage_mod = 1,\
@@ -562,3 +562,11 @@
G.radiation_color = trait_prefs["glow_color"]
G.glows = trait_prefs["glow_enabled"]
G.radiation_healing = TRUE
/datum/trait/positive/radioactive_heal/unapply(var/datum/species/S,var/mob/living/carbon/human/H, var/list/trait_prefs)
..() //Does all the removal stuff
//We then check to see if we still have the radiation component (such as we have a species componennt of it)
//If so, we remove the healing effect.
var/datum/component/radiation_effects/G = H.GetComponent(added_component_path)
if(G)
G.radiation_healing = initial(G.radiation_healing)
@@ -73,7 +73,7 @@
add_verb(H, /mob/living/carbon/human/proc/trait_tutorial)
if(special_env)
S.env_traits += src
if(added_component_path)
if(added_component_path && !H.GetComponent(added_component_path))
H.AddComponent(added_component_path)
return
@@ -107,6 +107,15 @@
if(added_component_path)
var/datum/component/C = H.GetComponent(added_component_path)
if(C)
if(LAZYLEN(S.species_component))
//Species_component is a list of paths.
for(var/checked_species_component in S.species_component)
//Ex: ACP = /datum/component/radioactive/type2 CSC = /datum/component/radioactive. This returns.
if(ispath(added_component_path, checked_species_component))
return
//Ex: ACP = /datum/component/radioactive CSC = /datum/component/radioactive/shadekin. This passes.
if(ispath(checked_species_component, added_component_path))
return
qdel(C)
return
@@ -18,8 +18,9 @@
// Heals the internal organ passively as long as it's under the bruised threshold
// Not a lot of MATH just yet, but nutrition or other factors could be taken into account
// Per the original PR: 'Allows internal organs to regenerate themselves passively, as long as they're not bruised.'
/obj/item/organ/internal/proc/passive_heal()
if(!is_bruised() && !is_broken())
if(is_bruised() || is_broken())
return
var/heal_amt = healing_factor * CONFIG_GET(number/organ_regeneration_multiplier)