From 628c5db0723fb9e34869bf21e4d89aad7082b825 Mon Sep 17 00:00:00 2001
From: Alphas00 <154434082+Alphas00@users.noreply.github.com>
Date: Mon, 23 Dec 2024 14:02:01 +0100
Subject: [PATCH] Adipohazard Mutation
Added the Adipohazard mutation, which causes others to fatten when touching or being touched by someone with the mutation.
---
.../code/datums/mutations/adipohazard.dm | 181 ++++++++++++++++++
GainStation13/code/mechanics/fatness.dm | 2 +-
code/__DEFINES/DNA.dm | 1 +
tgstation.dme | 1 +
4 files changed, 184 insertions(+), 1 deletion(-)
create mode 100644 GainStation13/code/datums/mutations/adipohazard.dm
diff --git a/GainStation13/code/datums/mutations/adipohazard.dm b/GainStation13/code/datums/mutations/adipohazard.dm
new file mode 100644
index 0000000000..3742db0258
--- /dev/null
+++ b/GainStation13/code/datums/mutations/adipohazard.dm
@@ -0,0 +1,181 @@
+
+//There was a runtime error. Look into it
+
+/datum/mutation/human/adipohazard
+ name = "Adipohazard"
+ desc = "A mutation that causes swelling upon touching the mutated person."
+ quality = POSITIVE
+ text_gain_indication = "Everything around you feels soft..."
+ text_lose_indication = "The soft feeling around you disappears."
+ difficulty = 14
+ instability = 30
+ power_coeff = 1
+ var/fat_add = 2
+
+/datum/mutation/human/adipohazard/on_life()
+ . = ..()
+ if(owner.pulledby != null)
+ var/mob/living/carbon/C = owner.pulledby
+ var/pwr = GET_MUTATION_POWER(src)
+ C.adjust_fatness(get_fatness_bonus(owner) + (fat_add * pwr), FATTENING_TYPE_RADIATIONS)
+ if(C.grab_state >= GRAB_AGGRESSIVE)
+ C.adjust_fatness(get_fatness_bonus(owner) + ((fat_add * 2) * pwr), FATTENING_TYPE_RADIATIONS)
+ if(prob(5))
+ var/add_text = pick("You feel softer.", "[owner] feels warm to the touch", "It's so nice to touch [owner].", "You don't want to let go of [owner].")
+ to_chat(C, "[add_text]")
+ if(owner.pulling != null)
+ var/mob/living/carbon/C = owner.pulling
+ var/pwr = GET_MUTATION_POWER(src)
+ C.adjust_fatness(get_fatness_bonus(owner) + (fat_add * pwr), FATTENING_TYPE_RADIATIONS)
+ if(C.grab_state >= GRAB_AGGRESSIVE)
+ C.adjust_fatness(get_fatness_bonus(owner) + ((fat_add * 2) * pwr), FATTENING_TYPE_RADIATIONS)
+ if(prob(5))
+ var/add_text = pick("You feel softer.", "[owner] feels warm to the touch", "It's so nice for [owner] to touch.", "You don't want [owner] to let go of you.")
+ to_chat(C, "[add_text]")
+
+/datum/mutation/human/adipohazard/proc/get_fatness_bonus(mob/living/carbon/user)
+ var/fatness_level = get_fatness_level_name(user.fatness)
+ var/fatness_bonus = 0
+ switch(fatness_level)
+ if("Fat", "Fatter")
+ fatness_bonus = 1
+ if("Very Fat", "Obese")
+ fatness_bonus = 2
+ if("Very Obese", "Extremely Obese")
+ fatness_bonus = 3
+ if("Barely Mobile", "Immobile")
+ fatness_bonus = 4
+ if("Blob")
+ fatness_bonus = 5
+ return fatness_bonus
+
+/datum/mutation/human/adipohazard/proc/fatten(mob/living/carbon/toucher, amount = 1)
+ toucher.adjust_fatness(get_fatness_bonus(owner) + (amount * GET_MUTATION_POWER(src)), FATTENING_TYPE_RADIATIONS)
+ to_chat(toucher, "That felt so nice!")
+
+/obj/item/dnainjector/antiadipohazard
+ name = "\improper DNA injector (Anti-Adipohazard)"
+ desc = "No hugs?"
+ remove_mutations = list(ADIPOHAZARD)
+
+/obj/item/dnainjector/adipohazard
+ name = "\improper DNA injector (Adipohazard)"
+ desc = "It's hugs time!"
+ add_mutations = list(ADIPOHAZARD)
+
+/mob/living/carbon/help_shake_act(mob/living/carbon/M)
+ . = ..()
+
+ var/datum/mutation/human/adipohazard/touched_mutation
+ for(var/datum/mutation/human/adipohazard/HM in dna.mutations)
+ if(istype(HM, /datum/mutation/human/adipohazard))
+ touched_mutation = HM
+
+ var/datum/mutation/human/adipohazard/touching_mutation
+ for(var/datum/mutation/human/adipohazard/HM in M.dna.mutations)
+ if(istype(HM, /datum/mutation/human/adipohazard))
+ touching_mutation = HM
+
+ if(on_fire)
+ return
+ if(M == src && check_self_for_injuries())
+ return
+
+ if(touched_mutation)
+ if(health >= 0 && !(HAS_TRAIT(src, TRAIT_FAKEDEATH)))
+ if(mob_run_block(M, 0, M.name, ATTACK_TYPE_UNARMED, 0, null, null, null))
+ return
+ if(lying)
+ if(buckled)
+ return
+ touched_mutation.fatten(M, 5)
+ else if(M.zone_selected == BODY_ZONE_PRECISE_MOUTH)
+ touched_mutation.fatten(M, 1)
+ else if(check_zone(M.zone_selected) == BODY_ZONE_HEAD)
+ touched_mutation.fatten(M, 3)
+ else if(check_zone(M.zone_selected) == BODY_ZONE_R_ARM || check_zone(M.zone_selected) == BODY_ZONE_L_ARM)
+ if((pulling == M) && (grab_state == GRAB_PASSIVE))
+ touched_mutation.fatten(M, 2)
+ else
+ touched_mutation.fatten(M, 1)
+ else
+ touched_mutation.fatten(M, 5)
+
+ if(touching_mutation)
+ if(health >= 0 && !(HAS_TRAIT(src, TRAIT_FAKEDEATH)))
+ if(mob_run_block(M, 0, M.name, ATTACK_TYPE_UNARMED, 0, null, null, null))
+ return
+ if(lying)
+ if(buckled)
+ return
+ touching_mutation.fatten(src, 5)
+ else if(M.zone_selected == BODY_ZONE_PRECISE_MOUTH)
+ touching_mutation.fatten(src, 1)
+ else if(check_zone(M.zone_selected) == BODY_ZONE_HEAD)
+ touching_mutation.fatten(src, 3)
+ else if(check_zone(M.zone_selected) == BODY_ZONE_R_ARM || check_zone(M.zone_selected) == BODY_ZONE_L_ARM)
+ if((pulling == M) && (grab_state == GRAB_PASSIVE))
+ touching_mutation.fatten(src, 2)
+ else
+ touching_mutation.fatten(src, 1)
+ else
+ touching_mutation.fatten(src, 5)
+
+/mob/living/carbon/human/kisstarget(mob/living/L)
+ . = ..()
+ if(isliving(L))
+ if(iscarbon(L))
+ var/datum/mutation/human/adipohazard/touched_mutation
+ var/mob/living/carbon/C = L
+ for(var/datum/mutation/human/adipohazard/HM in C.dna.mutations)
+ if(istype(HM, /datum/mutation/human/adipohazard))
+ touched_mutation = HM
+ if(touched_mutation)
+ touched_mutation.fatten(src, 10)
+
+ var/datum/mutation/human/adipohazard/touching_mutation
+ for(var/datum/mutation/human/adipohazard/HM in dna.mutations)
+ if(istype(HM, /datum/mutation/human/adipohazard))
+ touching_mutation = HM
+ if(touching_mutation)
+ touching_mutation.fatten(L, 10)
+
+/datum/species/disarm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
+ . = ..()
+ var/aim_for_mouth = user.zone_selected == "mouth"
+ var/target_on_help = target.a_intent == INTENT_HELP
+ var/target_aiming_for_mouth = target.zone_selected == "mouth"
+ var/target_restrained = target.restrained()
+ var/same_dir = (target.dir & user.dir)
+ var/aim_for_groin = user.zone_selected == "groin"
+ var/target_aiming_for_groin = target.zone_selected == "groin"
+
+ var/opposite_dir = user.dir == DIRFLIP(target.dir)
+
+ var/datum/mutation/human/adipohazard/touched_mutation
+ for(var/datum/mutation/human/adipohazard/HM in target.dna.mutations)
+ if(istype(HM, /datum/mutation/human/adipohazard))
+ touched_mutation = HM
+
+ var/datum/mutation/human/adipohazard/touching_mutation
+ for(var/datum/mutation/human/adipohazard/HM in user.dna.mutations)
+ if(istype(HM, /datum/mutation/human/adipohazard))
+ touching_mutation = HM
+
+ if(touched_mutation != null && target != user)
+ if(!IS_STAMCRIT(user))
+ if(aim_for_mouth && ( target_on_help || target_restrained || target_aiming_for_mouth))
+ touched_mutation.fatten(user, 4)
+ else if(aim_for_groin && (target == user || target.lying || same_dir || opposite_dir) && (target_on_help || target_restrained || target_aiming_for_groin))
+ touched_mutation.fatten(user, 5)
+ else
+ touched_mutation.fatten(user, 5)
+
+ if(touching_mutation != null && target != user)
+ if(!IS_STAMCRIT(user))
+ if(aim_for_mouth && ( target_on_help || target_restrained || target_aiming_for_mouth))
+ touching_mutation.fatten(target, 4)
+ else if(aim_for_groin && (target == user || target.lying || same_dir || opposite_dir) && (target_on_help || target_restrained || target_aiming_for_groin))
+ touching_mutation.fatten(target, 5)
+ else
+ touching_mutation.fatten(target, 2)
diff --git a/GainStation13/code/mechanics/fatness.dm b/GainStation13/code/mechanics/fatness.dm
index 4315a6570a..5f8b6ecdcb 100644
--- a/GainStation13/code/mechanics/fatness.dm
+++ b/GainStation13/code/mechanics/fatness.dm
@@ -231,7 +231,7 @@ GLOBAL_LIST_INIT(uncapped_resize_areas, list(/area/command/bridge, /area/mainten
if(fatness_amount < FATNESS_LEVEL_MORBIDLY_OBESE)
return "Obese"
if(fatness_amount < FATNESS_LEVEL_EXTREMELY_OBESE)
- return "Morbidly Obese"
+ return "Very Obese"
if(fatness_amount < FATNESS_LEVEL_BARELYMOBILE)
return "Extremely Obese"
if(fatness_amount < FATNESS_LEVEL_IMMOBILE)
diff --git a/code/__DEFINES/DNA.dm b/code/__DEFINES/DNA.dm
index 99f151d6c7..730786b2c0 100644
--- a/code/__DEFINES/DNA.dm
+++ b/code/__DEFINES/DNA.dm
@@ -57,6 +57,7 @@
// GS13 DEFINES
#define FATFANG /datum/mutation/human/fatfang
#define RADFAT /datum/mutation/human/radfat
+#define ADIPOHAZARD /datum/mutation/human/adipohazard
#define UI_CHANGED "ui changed"
#define UE_CHANGED "ue changed"
diff --git a/tgstation.dme b/tgstation.dme
index 322c59b8ff..7b5e4ddf4a 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -3946,6 +3946,7 @@
#include "GainStation13\code\datums\diseases\advance\symptoms\berry.dm"
#include "GainStation13\code\datums\diseases\advance\symptoms\weight_gain.dm"
#include "GainStation13\code\datums\mood_events\needs_events.dm"
+#include "GainStation13\code\datums\mutations\adipohazard.dm"
#include "GainStation13\code\datums\mutations\fatfang.dm"
#include "GainStation13\code\datums\mutations\radfat.dm"
#include "GainStation13\code\datums\status_effects\fatstun.dm"