Merge pull request #34 from AlManiak/deature/buckle-stuckage-weight

Feature/buckle stuckage weight
This commit is contained in:
evilew
2024-12-02 22:36:17 +01:00
committed by GitHub
4 changed files with 129 additions and 11 deletions
@@ -0,0 +1,88 @@
//GS13 Port - stuckage code
/obj/machinery/door/airlock/Crossed(mob/living/carbon/L)
if(!istype(L))
return ..()
var/stuckage_weight = L?.client?.prefs?.stuckage
if(isnull(stuckage_weight) || (stuckage_weight < 10))
return ..() // They aren't able to get stuck
if(L.fatness > (stuckage_weight * 2))
if(rand(1, 3) == 1)
L.doorstuck = 1
L.visible_message("<span class'danger'>[L] gets stuck in the doorway!</span>")
to_chat(L, "<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>")
L.Stun(100, updating = TRUE, ignore_canstun = TRUE)
addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/machinery/door/airlock/, AsyncDoorstuckCall), L), 100)
//sleep(100)
return ..()
else if(L.fatness > stuckage_weight)
if(rand(1, 5) == 1)
L.doorstuck = 1
L.visible_message("<span class'danger'>[L] gets stuck in the doorway!</span>")
to_chat(L, "<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>")
L.Stun(55, updating = TRUE, ignore_canstun = TRUE)
addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/machinery/door/airlock/, AsyncDoorstuckCall), L), 55)
//sleep(55)
return ..()
if(rand(1, 5) == 5)
to_chat(L, "<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 ..()
else if(L.fatness > (stuckage_weight / 2))
if(rand(1, 5) == 1)
L.visible_message("<span class'danger'>[L]'s hips brush against the doorway...</span>")
to_chat(L, "<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 ..()
return ..()
/obj/structure/mineral_door/Crossed(mob/living/carbon/L)
if(!istype(L))
return ..()
var/stuckage_weight = L?.client?.prefs?.stuckage
if(isnull(stuckage_weight) || (stuckage_weight < 10))
return ..() // They aren't able to get stuck
if(L.fatness > (stuckage_weight * 2))
if(rand(1, 3) == 1)
L.doorstuck = 1
L.visible_message("<span class'danger'>[L] gets stuck in the doorway!</span>")
to_chat(L, "<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>")
L.Stun(100, updating = TRUE, ignore_canstun = TRUE)
addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/structure/mineral_door/, AsyncDoorstuckCall), L), 100)
//sleep(100)
return ..()
else if(L.fatness > stuckage_weight)
if(rand(1, 5) == 1)
L.doorstuck = 1
L.visible_message("<span class'danger'>[L] gets stuck in the doorway!</span>")
to_chat(L, "<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>")
L.Stun(55, updating = TRUE, ignore_canstun = TRUE)
addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/structure/mineral_door/, AsyncDoorstuckCall), L), 55)
//sleep(55)
return ..()
if(rand(1, 5) == 5)
to_chat(L, "<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 ..()
else if(L.fatness > (stuckage_weight / 2))
if(rand(1, 5) == 1)
L.visible_message("<span class'danger'>[L]'s hips brush against the doorway...</span>")
to_chat(L, "<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 ..()
return ..()
// Callback proc to replace sleep function
/obj/machinery/door/airlock/proc/AsyncDoorstuckCall(mob/living/carbon/L)
L.doorstuck = 0
L.Knockdown(1)
// Callback proc to replace sleep function
/obj/structure/mineral_door/proc/AsyncDoorstuckCall(mob/living/carbon/L)
L.doorstuck = 0
L.Knockdown(1)
Binary file not shown.
+40 -11
View File
@@ -144,18 +144,47 @@
return FALSE
add_fingerprint(user)
// GS13 Port - Buckle changes
. = buckle_mob(M, check_loc = check_loc)
if(.)
if(M == user)
M.visible_message(\
"<span class='notice'>[M] buckles [M.p_them()]self to [src].</span>",\
"<span class='notice'>You buckle yourself to [src].</span>",\
"<span class='italics'>You hear metal clanking.</span>")
else
M.visible_message(\
"<span class='warning'>[user] buckles [M] to [src]!</span>",\
"<span class='warning'>[user] buckles you to [src]!</span>",\
"<span class='italics'>You hear metal clanking.</span>")
if(!.)
return
if (!istype(M, /mob/living/carbon))
return
var/mob/living/carbon/C = M
var/breaking_weight = M?.client?.prefs?.chair_breakage
if(isnull(breaking_weight) || (breaking_weight < 10) || (M != user) || ((breaking_weight / 3) > C.fatness))
M.visible_message(\
"<span class='warning'>[user] buckles [M] to [src]!</span>",\
"<span class='warning'>[user] buckles you to [src]!</span>",\
"<span class='italics'>You hear metal clanking.</span>")
return
if ((C.fatness >= breaking_weight) && istype(src, /obj/structure/chair)) //GS13 stuff - chair breaking mechanics
var/obj/structure/chair/chairToBreak = src
M.visible_message(\
"<span class='notice'>[M] slowly buckles [M.p_them()]self to [src]. their movements slow and deliberate. As [M] settles into the seat, a sudden, violent crash echoes through the air. [M]'s massive weight mercilessly crushes the poor [src], reducing it to pieces! </span>",\
"<span class='notice'>You slowly try to buckle yourself to [src]. But it breaks under your massive ass!</span>",\
"<span class='italics'>You hear metal clanking.</span>")
playsound(loc, 'sound/effects/snap.ogg', 50, 1)
playsound(loc, 'sound/effects/woodhit.ogg', 50, 1)
playsound(loc, 'sound/effects/bodyfall4.ogg', 50, 1)
// Destroy the src object. If the chair can be deconstructed, do that as well..
chairToBreak.deconstruct()
//src.Destroy()
else if(C.fatness >= (breaking_weight / 2))
M.visible_message(\
"<span class='notice'>[M] buckles [M.p_them()]self to the creaking [src]. The [src] protests audibly under the weight as [M]'s ample form settles onto its surface. .</span>",\
"<span class='notice'>You buckle yourself to [src].The [src] is cracking and is barely able to hold your weight </span>",\
"<span class='italics'>You hear metal clanking.</span>")
playsound(loc, 'GainStation13/sound/effects/crossed.ogg', 50, 1)
else if(C.fatness >= (breaking_weight / 3))
M.visible_message(\
"<span class='notice'>[M] buckles [M.p_them()]self to the creaking [src] as their weight spreads all over it.</span>",\
"<span class='notice'>You buckle yourself to [src].The [src] is creaking as you shuffle a bit </span>",\
"<span class='italics'>You hear metal clanking.</span>")
playsound(loc, 'GainStation13/sound/effects/crossed.ogg', 50, 1)
//GS13 End
/atom/movable/proc/user_unbuckle_mob(mob/living/buckled_mob, mob/user)
var/mob/living/M = unbuckle_mob(buckled_mob)
+1
View File
@@ -3977,6 +3977,7 @@
#include "GainStation13\code\machinery\feeding_tube.dm"
#include "GainStation13\code\machinery\feeding_tube_industrial.dm"
#include "GainStation13\code\machinery\gym.dm"
#include "GainStation13\code\machinery\doors\airlock_types.dm"
#include "GainStation13\code\machinery\powered_quantum_pad.dm"
#include "GainStation13\code\machinery\supply_teleporter.dm"
#include "GainStation13\code\mechanics\calorite.dm"