mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 03:55:11 +01:00
Brooms Upgraded: Disposal Bin Edition (#49433)
* clean sensation * speedmerge hack * mso.webm * Update code/game/objects/items/twohanded.dm Co-Authored-By: nemvar <47324920+nemvar@users.noreply.github.com> Co-authored-by: nemvar <47324920+nemvar@users.noreply.github.com> Co-authored-by: spookydonut <github@spooksoftware.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/obj/item/broom
|
||||
name = "broom"
|
||||
/obj/item/pushbroom
|
||||
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"
|
||||
@@ -13,58 +13,63 @@
|
||||
attack_verb = list("swept", "brushed off", "bludgeoned", "whacked")
|
||||
resistance_flags = FLAMMABLE
|
||||
|
||||
/obj/item/broom/Initialize()
|
||||
/obj/item/pushbroom/Initialize()
|
||||
. = ..()
|
||||
RegisterSignal(src, COMSIG_TWOHANDED_WIELD, .proc/on_wield)
|
||||
RegisterSignal(src, COMSIG_TWOHANDED_UNWIELD, .proc/on_unwield)
|
||||
|
||||
/obj/item/broom/ComponentInitialize()
|
||||
/obj/item/pushbroom/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/two_handed, force_unwielded=8, force_wielded=12, icon_wielded="broom1")
|
||||
|
||||
/obj/item/broom/update_icon_state()
|
||||
/obj/item/pushbroom/update_icon_state()
|
||||
icon_state = "broom0"
|
||||
|
||||
/// triggered on wield of two handed item
|
||||
/obj/item/broom/proc/on_wield(obj/item/source, mob/user)
|
||||
/obj/item/pushbroom/proc/on_wield(obj/item/source, mob/user)
|
||||
to_chat(user, "<span class='notice'>You brace the [src] against the ground in a firm sweeping stance.</span>")
|
||||
RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/sweep)
|
||||
|
||||
/// triggered on unwield of two handed item
|
||||
/obj/item/broom/proc/on_unwield(obj/item/source, mob/user)
|
||||
/obj/item/pushbroom/proc/on_unwield(obj/item/source, mob/user)
|
||||
UnregisterSignal(user, COMSIG_MOVABLE_MOVED)
|
||||
|
||||
/obj/item/broom/afterattack(atom/A, mob/user, proximity)
|
||||
/obj/item/pushbroom/afterattack(atom/A, mob/user, proximity)
|
||||
. = ..()
|
||||
if(!proximity)
|
||||
return
|
||||
sweep(user, A, FALSE)
|
||||
|
||||
/obj/item/broom/proc/sweep(mob/user, atom/A, moving = TRUE)
|
||||
/obj/item/pushbroom/proc/sweep(mob/user, atom/A, moving = TRUE)
|
||||
var/turf/target
|
||||
if (!moving)
|
||||
if (isturf(A))
|
||||
target = A
|
||||
else
|
||||
if (isturf(A.loc))
|
||||
target = A.loc
|
||||
else
|
||||
return
|
||||
target = A.loc
|
||||
else
|
||||
target = user.loc
|
||||
if (locate(/obj/structure/table) in target.contents)
|
||||
return
|
||||
var/i = 0
|
||||
var/turf/target_turf = get_step(target, user.dir)
|
||||
var/obj/machinery/disposal/bin/target_bin = locate(/obj/machinery/disposal/bin) in target_turf.contents
|
||||
for(var/obj/item/garbage in target.contents)
|
||||
if(!garbage.anchored)
|
||||
garbage.Move(get_step(target, user.dir), user.dir)
|
||||
i++
|
||||
if(i >= 20)
|
||||
if (target_bin)
|
||||
garbage.forceMove(target_bin)
|
||||
else
|
||||
garbage.Move(target_turf, user.dir)
|
||||
i++
|
||||
if(i > 19)
|
||||
break
|
||||
if(i >= 1)
|
||||
if(i > 0)
|
||||
if (target_bin)
|
||||
target_bin.update_icon()
|
||||
to_chat(user, "<span class='notice'>You sweep the pile of garbage into [target_bin].</span>")
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 30, TRUE, -1)
|
||||
|
||||
/obj/item/broom/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J) //bless you whoever fixes this copypasta
|
||||
/obj/item/pushbroom/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J) //bless you whoever fixes this copypasta
|
||||
J.put_in_cart(src, user)
|
||||
J.mybroom=src
|
||||
J.update_icon()
|
||||
|
||||
@@ -539,7 +539,7 @@
|
||||
/obj/item/melee/flyswatter,
|
||||
/obj/item/assembly/mousetrap,
|
||||
/obj/item/paint/paint_remover,
|
||||
/obj/item/broom
|
||||
/obj/item/pushbroom
|
||||
))
|
||||
|
||||
/obj/item/storage/belt/janitor/full/PopulateContents()
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
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
|
||||
var/obj/item/mop/mymop
|
||||
var/obj/item/broom/mybroom
|
||||
var/obj/item/pushbroom/mybroom
|
||||
var/obj/item/reagent_containers/spray/cleaner/myspray
|
||||
var/obj/item/lightreplacer/myreplacer
|
||||
var/signs = 0
|
||||
@@ -51,9 +51,9 @@
|
||||
m.janicart_insert(user, src)
|
||||
else
|
||||
to_chat(user, fail_msg)
|
||||
else if(istype(I, /obj/item/broom))
|
||||
else if(istype(I, /obj/item/pushbroom))
|
||||
if(!mybroom)
|
||||
var/obj/item/broom/b=I
|
||||
var/obj/item/pushbroom/b=I
|
||||
b.janicart_insert(user,src)
|
||||
else
|
||||
to_chat(user, fail_msg)
|
||||
|
||||
Reference in New Issue
Block a user