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
This commit is contained in:
evilew
2024-03-03 23:36:18 +01:00
parent cbe3c15dce
commit c58e7dff83
3 changed files with 36 additions and 0 deletions
+2
View File
@@ -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.
@@ -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 ("<span class='danger'>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.</span>")
sleep(100)
L.doorstuck = 0
L.Knockdown(1)
return
else if(L.fatness > 1890)
if(rand(1, 5) == 1)
L.visible_message ("<span class='danger'>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..</span>")
return
else if(L.fatness > 3000)
if(rand(1, 5) == 1)
L.doorstuck = 1
L.visible_message ("<span class='danger'>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.</span>")
sleep(55)
L.doorstuck = 0
L.Knockdown(1)
return
if(rand(1, 5) == 5)
L.visible_message ("<span class='danger'>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.</span>")
return
/obj/machinery/door/airlock/abandoned
abandoned = TRUE
@@ -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