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
3 changes: 3 additions & 0 deletions code/__DEFINES/cooldowns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
//car cooldowns
#define COOLDOWN_CAR_HONK "car_honk"

//wheelchair bell cooldown
#define COOLDOWN_BELL "bell_cooldown"
This conversation was marked as resolved.
Show resolved Hide resolved

//clown car cooldowns
#define COOLDOWN_CLOWNCAR_RANDOMNESS "clown_car_randomness"

Expand Down
16 changes: 16 additions & 0 deletions code/modules/paperwork/desk_bell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,19 @@
/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)))
This conversation was marked as resolved.
Show resolved Hide resolved
return
if(!Adjacent(over_object) || !Adjacent(usr))
return
var/obj/vehicle/ridden/wheelchair/target = over_object
if(target.bell_attached)
to_chat(usr, "[target] already has [target.bell_attached]!")
This conversation was marked as resolved.
Show resolved Hide resolved
return
usr.balloon_alert(usr, "attaching bell...")
if(!do_after(usr, 5))
This conversation was marked as resolved.
Show resolved Hide resolved
return
target.attach_bell(src)
qdel(src)
This conversation was marked as resolved.
Show resolved Hide resolved
return ..()
12 changes: 12 additions & 0 deletions code/modules/vehicles/vehicle_actions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,18 @@
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

/datum/action/vehicle/ridden/wheelchair/bell/Trigger(trigger_flags)
if(TIMER_COOLDOWN_CHECK(src, COOLDOWN_BELL))
return
TIMER_COOLDOWN_START(src, COOLDOWN_BELL, 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
18 changes: 18 additions & 0 deletions code/modules/vehicles/wheelchair.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
var/image/wheels_overlay
///Determines the typepath of what the object folds into
var/foldabletype = /obj/item/wheelchair
///Determines wether the wheelchair has a bell on it or not
This conversation was marked as resolved.
Show resolved Hide resolved
var/bell_attached

/obj/vehicle/ridden/wheelchair/generate_actions()
if(!bell_attached)
return
. = ..()
This conversation was marked as resolved.
Show resolved Hide resolved
initialize_controller_action_type(/datum/action/vehicle/ridden/wheelchair/bell, VEHICLE_CONTROL_DRIVE)

/obj/vehicle/ridden/wheelchair/proc/attach_bell(obj/structure/desk_bell/bell)
bell_attached = bell
src.generate_actions()
add_overlay("wheelchair_bell")
desc += "There is a small bell attached to the handle."


/obj/vehicle/ridden/wheelchair/Initialize(mapload)
. = ..()
Expand Down Expand Up @@ -108,6 +123,9 @@
usr.visible_message(span_notice("[usr] collapses [src]."), span_notice("You collapse [src]."))
var/obj/vehicle/ridden/wheelchair/wheelchair_folded = new foldabletype(get_turf(src))
usr.put_in_hands(wheelchair_folded)
if(bell_attached)
new /obj/structure/desk_bell (get_turf(src))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
new /obj/structure/desk_bell (get_turf(src))
new bell_attached (get_turf(src))

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think this would work

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should do

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tested it later got a runtime

usr.visible_message(span_notice("The bell attached falls off!"))
This conversation was marked as resolved.
Show resolved Hide resolved
qdel(src)

/obj/item/wheelchair/attack_self(mob/user) //Deploys wheelchair on in-hand use
Expand Down
Binary file modified icons/obj/vehicles.dmi
Binary file not shown.