diff --git a/code/modules/paperwork/desk_bell.dm b/code/modules/paperwork/desk_bell.dm index 3b08769aff3d07..46725315ac1772 100644 --- a/code/modules/paperwork/desk_bell.dm +++ b/code/modules/paperwork/desk_bell.dm @@ -106,3 +106,18 @@ /obj/structure/desk_bell/speed_demon desc = "The cornerstone of any customer service job. This one's been modified for hyper-performance." ring_cooldown_length = 0 + +/obj/structure/desk_bell/MouseDrop(obj/over_object, src_location, over_location) + if(!istype(over_object, /obj/vehicle/ridden/wheelchair)) + return + if(!Adjacent(over_object) || !Adjacent(usr)) + return + var/obj/vehicle/ridden/wheelchair/target = over_object + if(target.bell_attached) + usr.balloon_alert(usr, "already has a bell!") + return + usr.balloon_alert(usr, "attaching bell...") + if(!do_after(usr, 0.5 SECONDS)) + return + target.attach_bell(src) + return ..() diff --git a/code/modules/vehicles/vehicle_actions.dm b/code/modules/vehicles/vehicle_actions.dm index f2ec9cd44f52ee..b74f94521b7233 100644 --- a/code/modules/vehicles/vehicle_actions.dm +++ b/code/modules/vehicles/vehicle_actions.dm @@ -282,6 +282,19 @@ owner.say("Thank you for the fun ride, [clown.name]!") clown_car.increment_thanks_counter() +/datum/action/vehicle/ridden/wheelchair/bell + name = "Bell Ring" + desc = "Ring the bell." + icon_icon = 'icons/obj/bureaucracy.dmi' + button_icon_state = "desk_bell" + check_flags = AB_CHECK_CONSCIOUS + var/bell_cooldown + +/datum/action/vehicle/ridden/wheelchair/bell/Trigger(trigger_flags) + if(TIMER_COOLDOWN_CHECK(src, bell_cooldown)) + return + TIMER_COOLDOWN_START(src, bell_cooldown, 0.5 SECONDS) + playsound(vehicle_ridden_target, 'sound/machines/microwave/microwave-end.ogg', 70) /datum/action/vehicle/ridden/scooter/skateboard/ollie name = "Ollie" diff --git a/code/modules/vehicles/wheelchair.dm b/code/modules/vehicles/wheelchair.dm index 6dee4da1d05b1c..d055615580188b 100644 --- a/code/modules/vehicles/wheelchair.dm +++ b/code/modules/vehicles/wheelchair.dm @@ -14,6 +14,14 @@ var/image/wheels_overlay ///Determines the typepath of what the object folds into var/foldabletype = /obj/item/wheelchair + ///Bell attached to the wheelchair, if we have one. + var/obj/structure/desk_bell/bell_attached + +/obj/vehicle/ridden/wheelchair/generate_actions() + . = ..() + if(!bell_attached) + return + initialize_controller_action_type(/datum/action/vehicle/ridden/wheelchair/bell, VEHICLE_CONTROL_DRIVE) /obj/vehicle/ridden/wheelchair/Initialize(mapload) . = ..() @@ -56,6 +64,9 @@ . = ..() if(has_buckled_mobs()) . += wheels_overlay + if(bell_attached) + . += "wheelchair_bell" + /// I assign the ridable element in this so i don't have to fuss with hand wheelchairs and motor wheelchairs having different subtypes /obj/vehicle/ridden/wheelchair/proc/make_ridable() @@ -117,3 +128,28 @@ var/obj/vehicle/ridden/wheelchair/wheelchair_unfolded = new unfolded_type(location) wheelchair_unfolded.add_fingerprint(user) qdel(src) + + +///attaches bell to the wheelchair +/obj/vehicle/ridden/wheelchair/proc/attach_bell(obj/structure/desk_bell/bell) + bell_attached = bell + bell.forceMove(src) + generate_actions() + update_appearance() + +/obj/vehicle/ridden/wheelchair/examine(mob/user) + . =..() + if(bell_attached) + . += span_notice("There is \a [bell_attached] attached to the handle.") + +/obj/vehicle/ridden/wheelchair/Destroy() + if(bell_attached) + remove_bell() + return ..() + +/obj/vehicle/ridden/wheelchair/proc/remove_bell() + bell_attached.forceMove(get_turf(src)) + usr.visible_message(span_notice("[bell_attached] falls off!")) + bell_attached = null + update_appearance() + diff --git a/icons/obj/vehicles.dmi b/icons/obj/vehicles.dmi index 9056106ea67880..7c0b84b8869786 100644 Binary files a/icons/obj/vehicles.dmi and b/icons/obj/vehicles.dmi differ