Skip to content

Commit

Permalink
fixes a ton of bat issues also limits multi-hit to secondary attacks …
Browse files Browse the repository at this point in the history
…for ease of use
  • Loading branch information
dwasint committed Aug 21, 2023
1 parent 8a2fbc2 commit 2400d45
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
28 changes: 12 additions & 16 deletions code/game/objects/items/weaponry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -755,25 +755,21 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
var/relative_direction = get_cardinal_dir(direction_traveled, target_mob)
var/atom/throw_target = get_edge_target_turf(target_mob, relative_direction)
. = ..()
var/passed = TRUE
if(iscarbon(target_mob))
var/mob/living/carbon/target = target_mob
target.stamina.adjust(-force * 2)
if(target.stamina.current > 80 && !target.incapacitated())
passed = FALSE

if(passed)
if(homerun_ready)
user.visible_message(span_userdanger("It's a home run!"))
if(!QDELETED(target_mob))
target_mob.throw_at(throw_target, rand(8,10), 14, user)
SSexplosions.medturf += throw_target
playsound(get_turf(src), 'sound/weapons/homerun.ogg', 100, TRUE)
homerun_ready = FALSE
return
else if(!QDELETED(target_mob) && !target_mob.anchored)
var/whack_speed = (prob(60) ? 1 : 4)
target_mob.throw_at(throw_target, rand(1, 2), whack_speed, user, gentle = TRUE) // sorry friends, 7 speed batting caused wounds to absolutely delete whoever you knocked your target into (and said target)

if(homerun_ready)
user.visible_message(span_userdanger("It's a home run!"))
if(!QDELETED(target_mob))
target_mob.throw_at(throw_target, rand(8,10), 14, user)
SSexplosions.medturf += throw_target
playsound(get_turf(src), 'sound/weapons/homerun.ogg', 100, TRUE)
homerun_ready = FALSE
return
else if(!QDELETED(target_mob) && !target_mob.anchored)
var/whack_speed = (prob(60) ? 1 : 4)
target_mob.throw_at(throw_target, rand(1, 2), whack_speed, user, gentle = TRUE) // sorry friends, 7 speed batting caused wounds to absolutely delete whoever you knocked your target into (and said target)

/obj/item/melee/baseball_bat/Destroy(force)
for(var/target in thrown_datums)
Expand Down
3 changes: 3 additions & 0 deletions monkestation/code/datums/components/multi_hit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
to_chat(user, span_warning("You can't bring youself to swing this!"))
return COMPONENT_CANCEL_ATTACK_CHAIN

if(!(user.istate & ISTATE_SECONDARY))
return

if(iscarbon(user))
var/mob/living/carbon/carbon_user = user
if(carbon_user.stamina.current > 100)
Expand Down

0 comments on commit 2400d45

Please sign in to comment.