[MANUAL MIRROR] fixes throw click cooldown not applying (#19214)

* fixes throw click cooldown not applying (#70995)

throw_item never returns anything so it just broke the whole thing. this fixes that

* Update code/modules/mob/living/carbon/carbon.dm

* Update code/modules/mob/living/carbon/carbon.dm

---------

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
This commit is contained in:
lessthanthree
2023-02-07 18:38:02 -08:00
committed by GitHub
parent 6e44c4d1d4
commit 8ec5000be0
+36 -40
View File
@@ -155,21 +155,19 @@
/mob/proc/throw_item(atom/target)
SEND_SIGNAL(src, COMSIG_MOB_THROW, target)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_CARBON_THROW_THING, src, target)
return
return TRUE
/mob/living/carbon/throw_item(atom/target)
. = ..()
throw_mode_off(THROW_MODE_TOGGLE)
if(!target || !isturf(loc))
return
return FALSE
if(istype(target, /atom/movable/screen))
return
return FALSE
var/atom/movable/thrown_thing
var/obj/item/I = get_active_held_item()
var/obj/item/held_item = get_active_held_item()
var/neckgrab_throw = FALSE // we can't check for if it's a neckgrab throw when totaling up power_throw since we've already stopped pulling them by then, so get it early
if(!I)
if(!held_item)
if(pulling && isliving(pulling) && grab_state >= GRAB_AGGRESSIVE)
var/mob/living/throwable_mob = pulling
if(!throwable_mob.buckled)
@@ -179,40 +177,38 @@
stop_pulling()
if(HAS_TRAIT(src, TRAIT_PACIFISM))
to_chat(src, span_notice("You gently let go of [throwable_mob]."))
return
return FALSE
else
thrown_thing = I.on_thrown(src, target)
if(thrown_thing)
if(isliving(thrown_thing))
var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors
var/turf/end_T = get_turf(target)
if(start_T && end_T)
log_combat(src, thrown_thing, "thrown", addition="grab from tile in [AREACOORD(start_T)] towards tile at [AREACOORD(end_T)]")
var/power_throw = 0
if(HAS_TRAIT(src, TRAIT_HULK))
power_throw++
if(HAS_TRAIT(src, TRAIT_DWARF))
power_throw--
if(HAS_TRAIT(thrown_thing, TRAIT_DWARF))
power_throw++
//SKYRAT EDIT ADDITION
if(HAS_TRAIT(src, TRAIT_OVERSIZED))
power_throw++
if(HAS_TRAIT(thrown_thing, TRAIT_OVERSIZED))
power_throw--
//SKYRAT EDIT END
if(neckgrab_throw)
power_throw++
do_attack_animation(target, no_effect = 1) //SKYRAT EDIT ADDITION - AESTHETICS
playsound(loc, 'sound/weapons/punchmiss.ogg', 50, TRUE, -1) //SKYRAT EDIT ADDITION - AESTHETICS
visible_message("<span class='danger'>[src] throws [thrown_thing][power_throw ? " really hard!" : "."]</span>", \
"<span class='danger'>You throw [thrown_thing][power_throw ? " really hard!" : "."]</span>")
log_message("has thrown [thrown_thing] [power_throw ? "really hard" : ""]", LOG_ATTACK)
newtonian_move(get_dir(target, src))
thrown_thing.safe_throw_at(target, thrown_thing.throw_range, thrown_thing.throw_speed + power_throw, src, null, null, null, move_force)
thrown_thing = held_item.on_thrown(src, target)
if(!thrown_thing)
return FALSE
if(isliving(thrown_thing))
var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors
var/turf/end_T = get_turf(target)
if(start_T && end_T)
log_combat(src, thrown_thing, "thrown", addition="grab from tile in [AREACOORD(start_T)] towards tile at [AREACOORD(end_T)]")
var/power_throw = 0
if(HAS_TRAIT(src, TRAIT_HULK))
power_throw++
if(HAS_TRAIT(src, TRAIT_DWARF))
power_throw--
if(HAS_TRAIT(thrown_thing, TRAIT_DWARF))
power_throw++
//SKYRAT EDIT ADDITION
if(HAS_TRAIT(src, TRAIT_OVERSIZED))
power_throw++
if(HAS_TRAIT(thrown_thing, TRAIT_OVERSIZED))
power_throw--
//SKYRAT EDIT END
if(neckgrab_throw)
power_throw++
do_attack_animation(target, no_effect = 1) //SKYRAT EDIT ADDITION - AESTHETICS
playsound(loc, 'sound/weapons/punchmiss.ogg', 50, TRUE, -1) //SKYRAT EDIT ADDITION - AESTHETICS
visible_message("<span class='danger'>[src] throws [thrown_thing][power_throw ? " really hard!" : "."]</span>", \
"<span class='danger'>You throw [thrown_thing][power_throw ? " really hard!" : "."]</span>")
log_message("has thrown [thrown_thing] [power_throw ? "really hard" : ""]", LOG_ATTACK)
newtonian_move(get_dir(target, src))
thrown_thing.safe_throw_at(target, thrown_thing.throw_range, thrown_thing.throw_speed + power_throw, src, null, null, null, move_force)
/mob/living/carbon/proc/canBeHandcuffed()
return FALSE