Configuration Controller (#7857)

This commit is contained in:
Selis
2024-04-05 07:44:20 +02:00
committed by GitHub
parent c542e3bac0
commit e1a987c25c
235 changed files with 3294 additions and 989 deletions

View File

@@ -33,7 +33,7 @@ GLOBAL_LIST_BOILERPLATE(all_brain_organs, /obj/item/organ/internal/brain)
if(!owner || owner.stat == DEAD)
defib_timer = max(--defib_timer, 0)
else
defib_timer = min(++defib_timer, (config.defib_timer MINUTES) / 2)
defib_timer = min(++defib_timer, (CONFIG_GET(number/defib_timer) MINUTES) / 2) // CHOMPEdit
/obj/item/organ/internal/brain/proc/can_assist()
return can_assist
@@ -78,10 +78,10 @@ GLOBAL_LIST_BOILERPLATE(all_brain_organs, /obj/item/organ/internal/brain)
tmp_owner.internal_organs_by_name[organ_tag] = new replace_path(tmp_owner, 1)
tmp_owner = null
/obj/item/organ/internal/brain/New()
..()
health = config.default_brain_health
defib_timer = (config.defib_timer MINUTES) / 2
/obj/item/organ/internal/brain/Initialize() // CHOMPEdit
. = ..() // CHOMPEdit
health = CONFIG_GET(number/default_brain_health) // CHOMPEdit
defib_timer = (CONFIG_GET(number/defib_timer) MINUTES) / 2 // CHOMPEdit
spawn(5)
if(brainmob)
butcherable = FALSE

View File

@@ -179,7 +179,7 @@ var/list/organ_cache = list()
if(B && prob(40) && !isbelly(loc)) //VOREStation Edit
reagents.remove_reagent("blood",0.1)
blood_splatter(src,B,1)
if(config.organs_decay && decays) damage += rand(1,3)
if(CONFIG_GET(flag/organs_decay) && decays) damage += rand(1,3) // CHOMPEdit
if(damage >= max_damage)
damage = max_damage
adjust_germ_level(rand(2,6))

View File

@@ -308,7 +308,7 @@
// push them faster into paincrit though, as the additional damage is converted into shock.
var/brute_overflow = 0
var/burn_overflow = 0
if(is_damageable(brute + burn) || !config.limbs_can_break)
if(is_damageable(brute + burn) || !CONFIG_GET(flag/limbs_can_break)) // CHOMPedit
if(brute)
if(can_cut)
if(sharp && !edge)
@@ -322,7 +322,7 @@
else
//If we can't inflict the full amount of damage, spread the damage in other ways
//How much damage can we actually cause?
var/can_inflict = max_damage * config.organ_health_multiplier - (brute_dam + burn_dam)
var/can_inflict = max_damage * CONFIG_GET(number/organ_health_multiplier) - (brute_dam + burn_dam) // CHOMPEdit
var/spillover = 0
if(can_inflict)
if (brute > 0)
@@ -339,7 +339,7 @@
//How much brute damage is left to inflict
spillover += max(0, brute - can_inflict)
can_inflict = max_damage * config.organ_health_multiplier - (brute_dam + burn_dam) //Refresh the can_inflict var, so burn doesn't overload the limb if it is set to take both.
can_inflict = max_damage * CONFIG_GET(number/organ_health_multiplier) - (brute_dam + burn_dam) //Refresh the can_inflict var, so burn doesn't overload the limb if it is set to take both. // CHOMPEdit
if (burn > 0 && can_inflict)
//Inflict all burn damage we can
@@ -350,7 +350,7 @@
//If there is pain to dispense.
if(spillover)
owner.shock_stage += spillover * config.organ_damage_spillover_multiplier
owner.shock_stage += spillover * CONFIG_GET(number/organ_damage_spillover_multiplier) // CHOMPEdit
// sync the organ's damage with its wounds
src.update_damages()
@@ -359,7 +359,7 @@
//If limb took enough damage, try to cut or tear it off
if(owner && loc == owner && !is_stump())
if(!cannot_amputate && config.limbs_can_break && (brute_dam + burn_dam) >= (max_damage * config.organ_health_multiplier))
if(!cannot_amputate && CONFIG_GET(flag/limbs_can_break) && (brute_dam + burn_dam) >= (max_damage * CONFIG_GET(number/organ_health_multiplier))) // CHOMPEdit
//organs can come off in three cases
//1. If the damage source is edge_eligible and the brute damage dealt exceeds the edge threshold, then the organ is cut off.
//2. If the damage amount dealt exceeds the disintegrate threshold, the organ is completely obliterated.
@@ -550,7 +550,7 @@ This function completely restores a damaged organ to perfect condition.
//Burn damage can cause fluid loss due to blistering and cook-off
if((damage > 5 || damage + burn_dam >= 15) && type == BURN && (robotic < ORGAN_ROBOT) && !(species.flags & NO_BLOOD))
var/fluid_loss = 0.4 * (damage/(owner.getMaxHealth() - config.health_threshold_dead)) * owner.species.blood_volume*(1 - owner.species.blood_level_fatal)
var/fluid_loss = 0.4 * (damage/(owner.getMaxHealth() - CONFIG_GET(number/health_threshold_dead))) * owner.species.blood_volume*(1 - owner.species.blood_level_fatal) // CHOMPEdit
owner.remove_blood(fluid_loss)
// first check whether we can widen an existing wound
@@ -775,7 +775,7 @@ Note that amputating the affected organ does in fact remove the infection from t
//we only update wounds once in [wound_update_accuracy] ticks so have to emulate realtime
heal_amt = heal_amt * wound_update_accuracy
//configurable regen speed woo, no-regen hardcore or instaheal hugbox, choose your destiny
heal_amt = heal_amt * config.organ_regeneration_multiplier
heal_amt = heal_amt * CONFIG_GET(number/organ_regeneration_multiplier) // CHOMPEdit
// amount of healing is spread over all the wounds
heal_amt = heal_amt / (wounds.len + 1)
// making it look prettier on scanners
@@ -825,7 +825,7 @@ Note that amputating the affected organ does in fact remove the infection from t
status |= ORGAN_BLEEDING
//Bone fractures
if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(robotic >= ORGAN_ROBOT))
if(CONFIG_GET(flag/bones_can_break) && brute_dam > min_broken_damage * CONFIG_GET(number/organ_health_multiplier) && !(robotic >= ORGAN_ROBOT)) // CHOMPEdit
src.fracture()
update_health()
@@ -1112,7 +1112,7 @@ Note that amputating the affected organ does in fact remove the infection from t
/obj/item/organ/external/proc/mend_fracture()
if(robotic >= ORGAN_ROBOT)
return 0 //ORGAN_BROKEN doesn't have the same meaning for robot limbs
if(brute_dam > min_broken_damage * config.organ_health_multiplier)
if(brute_dam > min_broken_damage * CONFIG_GET(number/organ_health_multiplier)) // CHOMPEdit
return 0 //will just immediately fracture again
status &= ~ORGAN_BROKEN

View File

@@ -283,7 +283,7 @@
var/eyes_over_markings = FALSE //VOREStation edit
/obj/item/organ/external/head/Initialize()
if(config.allow_headgibs)
if(CONFIG_GET(flag/allow_headgibs)) // CHOMPEdit
cannot_gib = FALSE
return ..()
@@ -391,7 +391,7 @@
continue
var/datum/sprite_accessory/marking/mark_style = markings[M]["datum"]
var/icon/mark_s = new/icon("icon" = mark_style.icon, "icon_state" = "[mark_style.icon_state]-[organ_tag]")
mark_s.Blend(markings[M]["color"], mark_style.color_blend_mode)
mark_s.Blend(markings[M]["color"], mark_style.color_blend_mode)
add_overlay(mark_s) //So when it's not on your body, it has icons
mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons
icon_cache_key += "[M][markings[M]["color"]]"