Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

You can attach a bell to your wheelchair #67821

Merged
merged 19 commits into from Jun 24, 2022
15 changes: 15 additions & 0 deletions code/modules/paperwork/desk_bell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..()
13 changes: 13 additions & 0 deletions code/modules/vehicles/vehicle_actions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
36 changes: 36 additions & 0 deletions code/modules/vehicles/wheelchair.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
This conversation was marked as resolved.
Show resolved Hide resolved
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()

Binary file modified icons/obj/vehicles.dmi
Binary file not shown.