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:
@@ -85,8 +85,10 @@
|
||||
heal_overall_damage(0, abs(amount), 0, FALSE, TRUE, updating_health)
|
||||
return amount
|
||||
|
||||
/mob/living/carbon/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE)
|
||||
if(!forced && HAS_TRAIT(src, TRAIT_TOXINLOVER)) //damage becomes healing and healing becomes damage
|
||||
|
||||
//God save me from spaghettifying this - Syscorrupt damage is not affected by toxlovers.
|
||||
/mob/living/carbon/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE, toxins_type = TOX_DEFAULT)
|
||||
if(!forced && HAS_TRAIT(src, TRAIT_TOXINLOVER) && toxins_type != TOX_SYSCORRUPT) //damage becomes healing and healing becomes damage
|
||||
amount = -amount
|
||||
if(amount > 0)
|
||||
blood_volume -= 3 * amount //5x was too much, this is punishing enough.
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user