diff --git a/GainStation13/code/machinery/doors/airlock_types.dm b/GainStation13/code/machinery/doors/airlock_types.dm new file mode 100644 index 0000000000..7e2d83ab6c --- /dev/null +++ b/GainStation13/code/machinery/doors/airlock_types.dm @@ -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("[L] gets stuck in the doorway!") + to_chat(L, "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.") + 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("[L] gets stuck in the doorway!") + to_chat(L, "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.") + 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, "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 ..() + + else if(L.fatness > (stuckage_weight / 2)) + if(rand(1, 5) == 1) + L.visible_message("[L]'s hips brush against the doorway...") + to_chat(L, "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 ..() + + 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("[L] gets stuck in the doorway!") + to_chat(L, "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.") + 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("[L] gets stuck in the doorway!") + to_chat(L, "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.") + 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, "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 ..() + + else if(L.fatness > (stuckage_weight / 2)) + if(rand(1, 5) == 1) + L.visible_message("[L]'s hips brush against the doorway...") + to_chat(L, "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 ..() + + 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) diff --git a/GainStation13/sound/effects/crossed.ogg b/GainStation13/sound/effects/crossed.ogg new file mode 100644 index 0000000000..276d7f25a8 Binary files /dev/null and b/GainStation13/sound/effects/crossed.ogg differ diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index e4be50e19c..b90dcf1e60 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -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(\ - "[M] buckles [M.p_them()]self to [src].",\ - "You buckle yourself to [src].",\ - "You hear metal clanking.") - else - M.visible_message(\ - "[user] buckles [M] to [src]!",\ - "[user] buckles you to [src]!",\ - "You hear metal clanking.") + 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(\ + "[user] buckles [M] to [src]!",\ + "[user] buckles you to [src]!",\ + "You hear metal clanking.") + 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(\ + "[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! ",\ + "You slowly try to buckle yourself to [src]. But it breaks under your massive ass!",\ + "You hear metal clanking.") + 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(\ + "[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. .",\ + "You buckle yourself to [src].The [src] is cracking and is barely able to hold your weight ",\ + "You hear metal clanking.") + playsound(loc, 'GainStation13/sound/effects/crossed.ogg', 50, 1) + else if(C.fatness >= (breaking_weight / 3)) + M.visible_message(\ + "[M] buckles [M.p_them()]self to the creaking [src] as their weight spreads all over it.",\ + "You buckle yourself to [src].The [src] is creaking as you shuffle a bit ",\ + "You hear metal clanking.") + 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) diff --git a/tgstation.dme b/tgstation.dme index 451ba7fbed..05eb38ec55 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -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"