diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm index 66c60659c23..08647a4cb00 100644 --- a/code/game/objects/items/weapons/extinguisher.dm +++ b/code/game/objects/items/weapons/extinguisher.dm @@ -165,8 +165,10 @@ if(O.anchored) return var/obj/structure/bed/stool/chair/C - if(istype(O, /obj/structure/bed/stool/chair)) - C = O + if(!istype(O, /obj/structure/bed/stool/chair/office)) + return + + C = O var/list/move_speed = list(1, 1, 1, 2, 2, 3) for(var/i in 1 to 6) diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 7c5ade5a281..a57808a286e 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -33,6 +33,10 @@ var/held_item = null // Set to null if you don't want people to pick this up. slowdown = 5 + var/driving = FALSE // Shit for wheelchairs. Doesn't really get used here, but it's for code cleanliness. + var/mob/living/pulling = null + var/propelled = 0 // Check for fire-extinguisher-driven chairs + /obj/structure/bed/Initialize() . = ..() LAZYADD(can_buckle, /mob/living) @@ -215,6 +219,67 @@ padding_material.place_sheet(get_turf(src)) ..() +/obj/structure/bed/Move() + . = ..() + if(makes_rolling_sound) + playsound(src, 'sound/effects/roll.ogg', 50, 1) + if(buckled && !istype(src, /obj/structure/bed/roller)) + var/mob/living/occupant = buckled + if(!driving) + occupant.buckled_to = null + occupant.Move(src.loc) + occupant.buckled_to = src + if (occupant && (src.loc != occupant.loc)) + if (propelled) + for (var/mob/O in src.loc) + if (O != occupant) + Collide(O) + else + unbuckle() + if (pulling && (get_dist(src, pulling) > 1)) + pulling.pulledby = null + to_chat(pulling, SPAN_WARNING("You lost your grip!")) + pulling = null + else + if (occupant && (src.loc != occupant.loc)) + src.forceMove(occupant.loc) // Failsafe to make sure the wheelchair stays beneath the occupant after driving + +/obj/structure/bed/Collide(atom/A) + . = ..() + if(!buckled) + return + + if(propelled || (pulling && (pulling.a_intent == I_HURT))) + var/mob/living/occupant = unbuckle() + + if (pulling && (pulling.a_intent == I_HURT)) + occupant.throw_at(A, 3, 3, pulling) + else if (propelled) + occupant.throw_at(A, 3, propelled) + + var/def_zone = ran_zone() + occupant.throw_at(A, 3, propelled) + occupant.apply_effect(6, STUN) + occupant.apply_effect(6, WEAKEN) + occupant.apply_effect(6, STUTTER) + occupant.apply_damage(10, BRUTE, def_zone) + playsound(src.loc, "punch", 50, 1, -1) + if(isliving(A)) + var/mob/living/victim = A + def_zone = ran_zone() + victim.apply_effect(6, STUN) + victim.apply_effect(6, WEAKEN) + victim.apply_effect(6, STUTTER) + victim.apply_damage(10, BRUTE, def_zone) + + if(pulling) + occupant.visible_message(SPAN_DANGER("[pulling] has thrusted \the [name] into \the [A], throwing \the [occupant] out of it!")) + pulling.attack_log += "\[[time_stamp()]\] Crashed [occupant.name]'s ([occupant.ckey]) [name] into \a [A]" + occupant.attack_log += "\[[time_stamp()]\] Thrusted into \a [A] by [pulling.name] ([pulling.ckey]) with \the [name]" + msg_admin_attack("[pulling.name] ([pulling.ckey]) has thrusted [occupant.name]'s ([occupant.ckey]) [name] into \a [A] (JMP)",ckey=key_name(pulling),ckey_target=key_name(occupant)) + else + occupant.visible_message(SPAN_DANGER("[occupant] crashed into \the [A]!")) + /obj/structure/bed/psych name = "psychiatrist's couch" desc = "For prime comfort during psychiatric evaluations." @@ -393,8 +458,6 @@ /obj/structure/bed/roller/Move() ..() - if(makes_rolling_sound) - playsound(src, 'sound/effects/roll.ogg', 100, 1) if(buckled) if(buckled.buckled_to == src) buckled.forceMove(src.loc) diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index 7b5e4abd7da..510e71533ad 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -8,7 +8,6 @@ buckle_dir = 0 buckle_lying = 0 //force people to sit up in chairs when buckled_to obj_flags = OBJ_FLAG_ROTATABLE_ANCHORED - var/propelled = 0 // Check for fire-extinguisher-driven chairs held_item = /obj/item/material/stool/chair/ /obj/structure/bed/stool/chair/Initialize() @@ -251,71 +250,6 @@ can_pad = FALSE - var/driving = FALSE // Shit for wheelchairs. Doesn't really get used here, but it's for code cleanliness. - var/mob/living/pulling = null - -/obj/structure/bed/stool/chair/office/Move() - . = ..() - if(makes_rolling_sound) - playsound(src, 'sound/effects/roll.ogg', 50, 1) - if(buckled) - var/mob/living/occupant = buckled - if(!driving) - occupant.buckled_to = null - occupant.Move(src.loc) - occupant.buckled_to = src - if (occupant && (src.loc != occupant.loc)) - if (propelled) - for (var/mob/O in src.loc) - if (O != occupant) - Collide(O) - else - unbuckle() - if (pulling && (get_dist(src, pulling) > 1)) - pulling.pulledby = null - to_chat(pulling, SPAN_WARNING("You lost your grip!")) - pulling = null - else - if (occupant && (src.loc != occupant.loc)) - src.forceMove(occupant.loc) // Failsafe to make sure the wheelchair stays beneath the occupant after driving - - -/obj/structure/bed/stool/chair/office/Collide(atom/A) - . = ..() - if(!buckled) - return - - if(propelled || (pulling && (pulling.a_intent == I_HURT))) - var/mob/living/occupant = unbuckle() - - if (pulling && (pulling.a_intent == I_HURT)) - occupant.throw_at(A, 3, 3, pulling) - else if (propelled) - occupant.throw_at(A, 3, propelled) - - var/def_zone = ran_zone() - occupant.throw_at(A, 3, propelled) - occupant.apply_effect(6, STUN) - occupant.apply_effect(6, WEAKEN) - occupant.apply_effect(6, STUTTER) - occupant.apply_damage(10, BRUTE, def_zone) - playsound(src.loc, "punch", 50, 1, -1) - if(isliving(A)) - var/mob/living/victim = A - def_zone = ran_zone() - victim.apply_effect(6, STUN) - victim.apply_effect(6, WEAKEN) - victim.apply_effect(6, STUTTER) - victim.apply_damage(10, BRUTE, def_zone) - - if(pulling) - occupant.visible_message(SPAN_DANGER("[pulling] has thrusted \the [name] into \the [A], throwing \the [occupant] out of it!")) - pulling.attack_log += "\[[time_stamp()]\] Crashed [occupant.name]'s ([occupant.ckey]) [name] into \a [A]" - occupant.attack_log += "\[[time_stamp()]\] Thrusted into \a [A] by [pulling.name] ([pulling.ckey]) with \the [name]" - msg_admin_attack("[pulling.name] ([pulling.ckey]) has thrusted [occupant.name]'s ([occupant.ckey]) [name] into \a [A] (JMP)",ckey=key_name(pulling),ckey_target=key_name(occupant)) - else - occupant.visible_message(SPAN_DANGER("[occupant] crashed into \the [A]!")) - /obj/structure/bed/stool/chair/office/light icon_state = "officechair_white_preview" base_icon = "officechair_white" diff --git a/html/changelogs/ChairMovementFix.yml b/html/changelogs/ChairMovementFix.yml new file mode 100644 index 00000000000..abbabbd9031 --- /dev/null +++ b/html/changelogs/ChairMovementFix.yml @@ -0,0 +1,7 @@ +author: TheGreyWolf + +delete-after: True + +changes: + - bugfix: "People can now be properly moved in all moveable chairs again." + - bugfix: "Only office chairs, wheelchairs & subtypes can now be propelled using a fire extinguisher."