From c58e7dff8305763f11b445528554f4bfd3033b2c Mon Sep 17 00:00:00 2001 From: evilew Date: Sun, 3 Mar 2024 23:36:18 +0100 Subject: [PATCH] VV's door stuckage code - adds a chance to be stuck in doors if you're fat enough. The chance increases the fatter you are --- GainStation13/code/mechanics/fatness.dm | 2 ++ code/game/machinery/doors/airlock_types.dm | 30 +++++++++++++++++++ .../mob/living/carbon/human/species.dm | 4 +++ 3 files changed, 36 insertions(+) diff --git a/GainStation13/code/mechanics/fatness.dm b/GainStation13/code/mechanics/fatness.dm index 9f8fb21d..29370458 100644 --- a/GainStation13/code/mechanics/fatness.dm +++ b/GainStation13/code/mechanics/fatness.dm @@ -15,6 +15,8 @@ var/weight_gain_rate = 1 //At what rate does the parent mob lose weight? 1 = 100% var/weight_loss_rate = 1 + //Variable related to door stuckage code + var/doorstuck = 0 /** * Adjusts the fatness level of the parent mob. diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm index 7ee1519b..7abe0011 100644 --- a/code/game/machinery/doors/airlock_types.dm +++ b/code/game/machinery/doors/airlock_types.dm @@ -2,6 +2,36 @@ Station Airlocks Regular */ +//obj/machinery/door/airlock/allowed(mob/living/carbon/L) +// if(!density) +// return 1 + + +obj/machinery/door/airlock/Crossed(mob/living/carbon/L) + if(L.fatness > 5000) + if(rand(1, 3) == 1) + L.doorstuck = 1 + L.visible_message ("As you attempt to pass through \the [src], your ample curves get wedged in the narrow opening. You find yourself stuck in the [src] frame, struggling to free yourself from the tight squeeze.") + sleep(100) + L.doorstuck = 0 + L.Knockdown(1) + return + else if(L.fatness > 1890) + if(rand(1, 5) == 1) + L.visible_message ("As you pass through \the [src], you feel a slight brushing against your hips. The [src] frame accommodates your form, but it's a close fit..") + return + else if(L.fatness > 3000) + if(rand(1, 5) == 1) + L.doorstuck = 1 + L.visible_message ("As you attempt to pass through \the [src], your ample curves get wedged in the narrow opening. You find yourself stuck in the [src] frame, struggling to free yourself from the tight squeeze.") + sleep(55) + L.doorstuck = 0 + L.Knockdown(1) + return + if(rand(1, 5) == 5) + L.visible_message ("With great effort, you manage to squeeze your massive form through \the [src]. It's a tight fit, but you successfully navigate the narrow opening, barely avoiding getting stuck.") + return + /obj/machinery/door/airlock/abandoned abandoned = TRUE diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index a7fac686..0f4c22c2 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1592,6 +1592,10 @@ GLOBAL_LIST_EMPTY(roundstart_races) gravity = H.has_gravity() +//GS13 - used in door stuckage code + if(H.doorstuck) + . += 1000 + if(gravity && !flight) //Check for chemicals and innate speedups and slowdowns if we're on the ground if(HAS_TRAIT(H, TRAIT_GOTTAGOFAST)) . -= 1