Adds the titanium push broom, a janitor-exclusive traitor item (#21496)

* adds it

* fixes the thing

* !! scope size increasing !!

* trait rename

* surplus removing

* Apply suggestions from code review

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* code review commit 2

* fixes a minor issue

* check_grep please have mercy

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

---------

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
JimKil3
2023-07-23 23:28:24 +01:00
committed by GitHub
co-authored by Henri215 Luc
parent b41d4be848
commit 86874ce415
5 changed files with 108 additions and 1 deletions
@@ -1048,4 +1048,82 @@
cart.mybroom = src
cart.put_in_cart(src, user)
/obj/item/twohanded/push_broom/traitor
name = "titanium push broom"
desc = "This is my BROOMSTICK! All of the functionality of a normal broom, but at least half again more robust."
attack_verb = list("smashed", "slammed", "whacked", "thwacked", "swept")
force = 10
force_unwielded = 10
force_wielded = 25
/obj/item/twohanded/push_broom/traitor/Initialize(mapload)
. = ..()
AddComponent(/datum/component/parry, _stamina_constant = 2, _stamina_coefficient = 0.5, _parryable_attack_types = NON_PROJECTILE_ATTACKS)
/obj/item/twohanded/push_broom/traitor/examine(mob/user)
. = ..()
if(isAntag(user))
. += "<span class='warning'>When wielded, the broom has different effects depending on your intent, similar to a martial art. \
Help intent will sweep foes away from you, disarm intent sweeps their legs from under them, grab intent confuses \
and minorly fatigues them, and harm intent hits them normally.</span>"
/obj/item/twohanded/push_broom/traitor/wield(mob/user)
. = ..()
ADD_TRAIT(user, TRAIT_DEFLECTS_PROJECTILES, "pushbroom")
to_chat(user, "<span class='warning'>Your sweeping stance allows you to deflect projectiles.</span>")
/obj/item/twohanded/push_broom/traitor/unwield(mob/user)
. = ..()
if(HAS_TRAIT_FROM(user, TRAIT_DEFLECTS_PROJECTILES, "pushbroom")) //this check is needed because obj/item/twohanded calls unwield() on drop and you'd get the message even if you weren't wielding it before
REMOVE_TRAIT(user, TRAIT_DEFLECTS_PROJECTILES, "pushbroom")
to_chat(user, "<span class='warning'>You stop reflecting projectiles.</span>")
/obj/item/twohanded/push_broom/traitor/attack(mob/target, mob/living/user)
if(!wielded || !ishuman(target))
return ..()
var/mob/living/carbon/human/H = target
switch(user.a_intent)
if(INTENT_HELP)
H.visible_message("<span class='danger'>[user] sweeps [H] away!</span>", \
"<span class='userdanger'>[user] sweeps you away!</span>", \
"<span class='italics'>You hear sweeping.</span>")
playsound(loc, 'sound/weapons/sweeping.ogg', 70, TRUE, -1)
var/atom/throw_target = get_edge_target_turf(H, get_dir(src, get_step_away(H, src)))
H.throw_at(throw_target, 3, 1)
add_attack_logs(user, H, "Swept away with titanium push broom", ATKLOG_ALL)
if(INTENT_DISARM)
if(H.stat || IS_HORIZONTAL(H))
return ..()
H.visible_message("<span class='danger'>[user] sweeps [H]'s legs out from under [H.p_them()]!</span>", \
"<span class='userdanger'>[user] sweeps your legs out from under you!</span>", \
"<span class='italics'>You hear sweeping.</span>")
user.do_attack_animation(H, ATTACK_EFFECT_KICK)
playsound(get_turf(user), 'sound/effects/hit_kick.ogg', 50, TRUE, -1)
H.apply_damage(5, BRUTE)
H.KnockDown(4 SECONDS)
add_attack_logs(user, H, "Leg swept with titanium push broom", ATKLOG_ALL)
if(INTENT_GRAB)
H.visible_message("<span class='danger'>[user] smacks [H] with the brush of [user.p_their()] broom!</span>", \
"<span class='userdanger'>[user] smacks you with the brush of [user.p_their()] broom!</span>", \
"<span class='italics'>You hear a smacking noise.</span>")
user.do_attack_animation(H, ATTACK_EFFECT_DISARM)
playsound(get_turf(user), 'sound/effects/woodhit.ogg', 50, TRUE, -1)
H.AdjustConfused(4 SECONDS, 0, 4 SECONDS) //no stacking infinitely
H.adjustStaminaLoss(15)
add_attack_logs(user, H, "Swept with the brush of the titanium push broom", ATKLOG_ALL)
if(INTENT_HARM)
return ..()
#undef BROOM_PUSH_LIMIT