Skip to content

Commit dffa234

Browse files
Cadet00NPC1314
andauthored
Double bed fix FOR REAL THIS TIME (#1197)
* Made changes to stress events,and re-added & touched up heart attacks in rogfatstam. * Added way to save people from heart attacks (Please update my PR and not make a new one, please god) * Please work? Pretty please? * Update roguechair.dm Fixed Indentation. --------- Co-authored-by: NPC1314 <110836368+NPC1314@users.noreply.github.com>
1 parent ec654b0 commit dffa234

File tree

3 files changed

+22
-24
lines changed

3 files changed

+22
-24
lines changed

code/game/objects/buckling.dm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,13 @@
118118
//Handle any extras after buckling
119119
//Called on buckle_mob()
120120
/atom/movable/proc/post_buckle_mob(mob/living/M)
121-
121+
if(buckle_lying)
122+
M.update_cone_show()
123+
M.layer = BELOW_MOB_LAYER
122124
//same but for unbuckle
123125
/atom/movable/proc/post_unbuckle_mob(mob/living/M)
124-
126+
if(buckle_lying)
127+
M.update_cone_show()
125128
//Wrapper procs that handle sanity and user feedback
126129
/atom/movable/proc/user_buckle_mob(mob/living/M, mob/user, check_loc = TRUE)
127130
if(!in_range(user, src) || !isturf(user.loc) || user.incapacitated() || M.anchored)

code/game/objects/structures/beds_chairs/roguechair.dm

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,9 @@
297297
/obj/structure/bed/rogue
298298
icon_state = "bed"
299299
icon = 'icons/roguetown/misc/structure.dmi'
300-
anchored = TRUE
301-
can_buckle = TRUE
300+
anchored = 1
301+
can_buckle = 1
302+
buckle_lying = 1
302303
buckle_lying = 90
303304
pixel_y = 5
304305
sleepy = 2
@@ -309,34 +310,27 @@
309310
/obj/structure/bed/rogue/inn
310311
icon_state = "inn_bed"
311312
sleepy = 3
312-
313+
// Borbop's double bed code, thank you Borbop. --Cadet
313314
/obj/structure/bed/rogue/inn/double
314315
icon_state = "double"
316+
max_buckled_mobs = 2
315317
pixel_y = 0
316318
sleepy = 3
317319
debris = list(/obj/item/grown/log/tree/small = 2)
318-
//////WIP This will essentially allow for multiple mobs to buckle, just needs to change mousedrop function
319-
/obj/structure/bed/rogue/inn/double
320-
// var/list/buckled_mobs = list() shouldnts be needed
321-
/*
322-
/obj/structure/bed/rogue/inn/double/post_buckle_mob(mob/living/M)
320+
/// The mob who buckled to this bed second, to avoid other mobs getting pixel-shifted before they unbuckle.
321+
var/mob/living/goldilocks
322+
323+
/obj/structure/bed/rogue/inn/double/post_buckle_mob(mob/living/target)
323324
. = ..()
324-
if(!buckled_mobs)
325-
buckled_mobs = list()
326-
buckled_mobs += M
327-
M.set_mob_offsets("bed_buckle", _x = buckled_mobs.len * 10, _y = 5)
325+
if(length(buckled_mobs) > 1 && !goldilocks) // Push the second buckled mob a bit higher from the normal lying position
326+
target.set_mob_offsets("bed_buckle", _x = 0, _y = 13)
327+
goldilocks = target
328328

329-
/obj/structure/bed/rogue/inn/double/post_unbuckle_mob(mob/living/M)
329+
/obj/structure/bed/rogue/inn/double/post_unbuckle_mob(mob/living/target)
330330
. = ..()
331-
if(M in buckled_mobs)
332-
buckled_mobs -= M
333-
M.reset_offsets("bed_buckle")
331+
if(target == goldilocks)
332+
goldilocks = null
334333

335-
var/x_offset = 0
336-
for(var/mob/living/buckled_mob in buckled_mobs)
337-
buckled_mob.set_mob_offsets("bed_buckle", _x = x_offset, _y = 5)
338-
x_offset += 10
339-
*/
340334

341335

342336
// ------------ DECENT BEDS ----------------------

code/game/objects/structures/bedsheet_bin.dm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ LINEN BINS
1212
righthand_file = 'icons/mob/inhands/misc/bedsheet_righthand.dmi'
1313
icon_state = "sheetwhite"
1414
item_state = "sheetwhite"
15-
layer = MOB_LAYER
15+
layer = OBJ_LAYER
16+
plane = GAME_PLANE_UPPER
1617
throwforce = 0
1718
throw_speed = 1
1819
throw_range = 2

0 commit comments

Comments
 (0)