syscorruption framework

Adds a framework for systems corruption instead of toxins damage for use in synthetic species. No ways to deal / heal it yet, nor effects, or actual uses. Soon.
This commit is contained in:
DeltaFire
2020-11-01 04:56:31 +01:00
parent 713ed9018e
commit ed08983b97
5 changed files with 41 additions and 6 deletions
+29 -4
View File
@@ -168,20 +168,45 @@
updatehealth()
return amount
/mob/living/proc/getToxLoss()
return toxloss
//By default, returns toxins damage no matter what kind of tox damage the target is using.
/mob/living/proc/getToxLoss(toxins_type = TOX_OMNI)
if(toxins_type == TOX_OMNI)
return toxloss
/mob/living/proc/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE)
var/affected_by = TOX_DEFAULT
if(HAS_TRAIT(src, TRAIT_ROBOTICORGANISM))
affected_by = TOX_SYSCORRUPT
if(toxins_type != affected_by)
return 0
else
return toxloss
/mob/living/proc/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE, toxins_type = TOX_DEFAULT)
if(!forced && (status_flags & GODMODE))
return FALSE
var/affected_by = TOX_DEFAULT
if(HAS_TRAIT(src, TRAIT_ROBOTICORGANISM))
affected_by = TOX_SYSCORRUPT
if(toxins_type != TOX_OMNI && toxins_type != affected_by)
return FALSE
toxloss = clamp((toxloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
/mob/living/proc/setToxLoss(amount, updating_health = TRUE, forced = FALSE)
//Defaults to omni here because setToxLoss is used by very few things that usually want to set all types
/mob/living/proc/setToxLoss(amount, updating_health = TRUE, forced = FALSE, toxins_type = TOX_OMNI)
if(!forced && (status_flags & GODMODE))
return FALSE
var/affected_by = TOX_DEFAULT
if(HAS_TRAIT(src, TRAIT_ROBOTICORGANISM))
affected_by = TOX_SYSCORRUPT
if(toxins_type != TOX_OMNI && toxins_type != affected_by)
return FALSE
toxloss = amount
if(updating_health)
updatehealth()