diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index 9d484e9ba84..fc48b402d59 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -438,7 +438,8 @@ /obj/item/soap, /obj/item/holosign_creator/janitor, /obj/item/melee/flyswatter, - /obj/item/storage/bag/trash + /obj/item/storage/bag/trash, + /obj/item/twohanded/push_broom ) /obj/item/storage/belt/janitor/full/populate_contents() diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 0b15975a30d..d272bdd57bf 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -10,6 +10,7 @@ * Mjolnnir * Knighthammer * Pyro Claws + * Push Broom */ /*################################################################## @@ -953,3 +954,70 @@ on_cooldown = FALSE flags &= ~NODROP atom_say("Internal plasma canisters recharged. Gloves sufficiently cooled") + +/// Max number of atoms a broom can sweep at once +#define BROOM_PUSH_LIMIT 20 + +/obj/item/twohanded/push_broom + name = "push broom" + desc = "This is my BROOMSTICK! It can be used manually or braced with two hands to sweep items as you move. It has a telescopic handle for compact storage." + icon = 'icons/obj/janitor.dmi' + icon_state = "broom0" + lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi' + righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi' + force = 8 + throwforce = 10 + throw_speed = 3 + throw_range = 7 + w_class = WEIGHT_CLASS_NORMAL + force_unwielded = 8 + force_wielded = 12 + attack_verb = list("swept", "brushed off", "bludgeoned", "whacked") + resistance_flags = FLAMMABLE + +/obj/item/twohanded/push_broom/update_icon_state() + icon_state = "broom[wielded]" + +/obj/item/twohanded/push_broom/wield(mob/user) + . = ..() + to_chat(user, "You brace [src] against the ground in a firm sweeping stance.") + RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(sweep)) + +/obj/item/twohanded/push_broom/unwield(mob/user) + . = ..() + UnregisterSignal(user, COMSIG_MOVABLE_MOVED) + +/obj/item/twohanded/push_broom/afterattack(atom/A, mob/user, proximity) + . = ..() + if(!proximity) + return + sweep(user, A, FALSE) + +/obj/item/twohanded/push_broom/proc/sweep(mob/user, atom/A, moving = TRUE) + SIGNAL_HANDLER + var/turf/current_item_loc = moving ? user.loc : (isturf(A) ? A : A.loc) + if(!isturf(current_item_loc)) + return + var/turf/new_item_loc = get_step(current_item_loc, user.dir) + var/obj/machinery/disposal/target_bin = locate(/obj/machinery/disposal) in new_item_loc.contents + var/trash_amount = 1 + for(var/obj/item/garbage in current_item_loc.contents) + if(!garbage.anchored) + if(target_bin) + garbage.forceMove(target_bin) + else + garbage.Move(new_item_loc, user.dir) + trash_amount++ + if(trash_amount > BROOM_PUSH_LIMIT) + break + if(trash_amount > 1) + if(target_bin) + target_bin.update_icon() + to_chat(user, "You sweep the pile of garbage into [target_bin].") + playsound(loc, 'sound/weapons/thudswoosh.ogg', 10, TRUE, -1) + +/obj/item/twohanded/push_broom/proc/janicart_insert(mob/user, obj/structure/janitorialcart/cart) + cart.mybroom = src + cart.put_in_cart(src, user) + +#undef BROOM_PUSH_LIMIT diff --git a/code/game/objects/structures/crates_lockers/closets/job_closets.dm b/code/game/objects/structures/crates_lockers/closets/job_closets.dm index 5e8c94253a8..433067a7a3f 100644 --- a/code/game/objects/structures/crates_lockers/closets/job_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/job_closets.dm @@ -85,6 +85,8 @@ new /obj/item/caution(src) new /obj/item/caution(src) new /obj/item/caution(src) + new /obj/item/twohanded/push_broom(src) + new /obj/item/twohanded/push_broom(src) new /obj/item/storage/bag/trash(src) new /obj/item/storage/bag/trash(src) new /obj/item/lightreplacer(src) diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index 6e8fa06adf4..a132917b4e3 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -12,8 +12,9 @@ //copypaste sorry var/maximum_volume = 150 var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite - var/obj/item/storage/bag/trash/mybag = null + var/obj/item/storage/bag/trash/mybag = null var/obj/item/mop/mymop = null + var/obj/item/twohanded/push_broom/mybroom = null var/obj/item/reagent_containers/spray/cleaner/myspray = null var/obj/item/lightreplacer/myreplacer = null var/signs = 0 @@ -28,6 +29,7 @@ GLOB.janitorial_equipment -= src QDEL_NULL(mybag) QDEL_NULL(mymop) + QDEL_NULL(mybroom) QDEL_NULL(myspray) QDEL_NULL(myreplacer) return ..() @@ -56,7 +58,12 @@ m.janicart_insert(user, src) else to_chat(user, fail_msg) - + else if(istype(I, /obj/item/twohanded/push_broom)) + if(!mybroom) + var/obj/item/twohanded/push_broom/B = I + B.janicart_insert(user, src) + else + to_chat(user, fail_msg) else if(istype(I, /obj/item/storage/bag/trash)) if(!mybag) var/obj/item/storage/bag/trash/t=I @@ -114,6 +121,8 @@ dat += "[mybag.name]
" if(mymop) dat += "[mymop.name]
" + if(mybroom) + dat += "[mybroom.name]
" if(myspray) dat += "[myspray.name]
" if(myreplacer) @@ -140,6 +149,11 @@ user.put_in_hands(mymop) to_chat(user, "You take [mymop] from [src].") mymop = null + if(href_list["broom"]) + if(mybroom) + user.put_in_hands(mybroom) + to_chat(user, "You take [mybroom] from [src].") + mybroom = null if(href_list["spray"]) if(myspray) user.put_in_hands(myspray) @@ -170,6 +184,8 @@ . += "cart_garbage" if(mymop) . += "cart_mop" + if(mybroom) + . += "cart_broom" if(myspray) . += "cart_spray" if(myreplacer) diff --git a/code/modules/response_team/ert_outfits.dm b/code/modules/response_team/ert_outfits.dm index 47a41cc5ee3..f57ec0374aa 100644 --- a/code/modules/response_team/ert_outfits.dm +++ b/code/modules/response_team/ert_outfits.dm @@ -493,6 +493,7 @@ /obj/item/grenade/chem_grenade/antiweed = 2, /obj/item/reagent_containers/spray/cleaner/advanced = 1, /obj/item/storage/bag/trash = 1, + /obj/item/twohanded/push_broom, /obj/item/storage/box/lights/mixed = 1, /obj/item/melee/flyswatter = 1) diff --git a/code/modules/supply/supply_packs/pack_miscellaneous.dm b/code/modules/supply/supply_packs/pack_miscellaneous.dm index f175b07d055..99210fc9826 100644 --- a/code/modules/supply/supply_packs/pack_miscellaneous.dm +++ b/code/modules/supply/supply_packs/pack_miscellaneous.dm @@ -143,6 +143,7 @@ /obj/item/reagent_containers/glass/bucket, /obj/item/reagent_containers/glass/bucket, /obj/item/mop, + /obj/item/twohanded/push_broom, /obj/item/caution, /obj/item/caution, /obj/item/caution, diff --git a/icons/mob/inhands/equipment/custodial_lefthand.dmi b/icons/mob/inhands/equipment/custodial_lefthand.dmi index a707c315cfa..0714e446bee 100644 Binary files a/icons/mob/inhands/equipment/custodial_lefthand.dmi and b/icons/mob/inhands/equipment/custodial_lefthand.dmi differ diff --git a/icons/mob/inhands/equipment/custodial_righthand.dmi b/icons/mob/inhands/equipment/custodial_righthand.dmi index f42d427a82d..7802b8604c4 100644 Binary files a/icons/mob/inhands/equipment/custodial_righthand.dmi and b/icons/mob/inhands/equipment/custodial_righthand.dmi differ diff --git a/icons/obj/janitor.dmi b/icons/obj/janitor.dmi index 5e70d452c91..4f6c9d6d09b 100644 Binary files a/icons/obj/janitor.dmi and b/icons/obj/janitor.dmi differ