From 4453b091551b2017e8a9d2e95f2f6731e419e4f2 Mon Sep 17 00:00:00 2001 From: Metis <100518708+sheepishgoat@users.noreply.github.com> Date: Sat, 31 Aug 2024 02:25:06 -0400 Subject: [PATCH] It's not this easy, is it? It's that easy. --- code/__DEFINES/combat.dm | 4 ++++ code/modules/mob/living/carbon/damage_procs.dm | 7 +++++++ code/modules/mob/living/damage_procs.dm | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm index 9de2e282..2aa6ffe9 100644 --- a/code/__DEFINES/combat.dm +++ b/code/__DEFINES/combat.dm @@ -10,6 +10,10 @@ #define CLONE "clone" #define STAMINA "stamina" #define BRAIN "brain" +// GS13 EDIT +#define FAT "fat" +/// What is the rate that one damage is converted to fatness? +#define FAT_DAMAGE_TO_FATNESS 4 //bitflag damage defines used for suicide_act #define BRUTELOSS (1<<0) diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm index 27a793b5..a1d7e6f4 100644 --- a/code/modules/mob/living/carbon/damage_procs.dm +++ b/code/modules/mob/living/carbon/damage_procs.dm @@ -120,6 +120,13 @@ adjustStaminaLoss(diff, updating, forced) +/mob/living/carbon/applyFatnessDamage(amount) + if(!check_weight_prefs(FATTENING_TYPE_WEAPON)) //Typically, this kind of damage would be applied to people through weapons. + return FALSE + + adjust_fatness((amount * FAT_DAMAGE_TO_FATNESS), FATTENING_TYPE_WEAPON) + + /** adjustOrganLoss * inputs: slot (organ slot, like ORGAN_SLOT_HEART), amount (damage to be done), and maximum (currently an arbitrarily large number, can be set so as to limit damage) * outputs: diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 60ba3cb7..8c9acf82 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -25,6 +25,8 @@ adjustCloneLoss(damage * hit_percent) if(STAMINA) adjustStaminaLoss(damage * hit_percent) + if(FAT) + applyFatnessDamage(damage * hit_percent) return 1 /mob/living/proc/apply_damage_type(damage = 0, damagetype = BRUTE) //like apply damage except it always uses the damage procs @@ -230,6 +232,10 @@ /mob/living/proc/setStaminaLoss(amount, updating_stamina = TRUE, forced = FALSE) return +/// Apply fatness damage from weapons or items that have the fatness damage type. +/mob/living/proc/applyFatnessDamage(amount) + return + // heal ONE external organ, organ gets randomly selected from damaged ones. /mob/living/proc/heal_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE) adjustBruteLoss(-brute, FALSE) //zero as argument for no instant health update