Throw Mode QoL Tweaks

This commit is contained in:
Cerebulon
2021-08-24 20:22:26 +01:00
parent 53118573a9
commit 4ff9b181e0
4 changed files with 41 additions and 19 deletions
+6 -2
View File
@@ -1,9 +1,13 @@
/mob/living/carbon/human/verb/give(var/mob/living/carbon/target in living_mobs(1))
/mob/living/verb/give(var/mob/living/target in living_mobs(1))
set category = "IC"
set name = "Give"
do_give(target)
/mob/living/proc/do_give(var/mob/living/carbon/human/target)
// TODO : Change to incapacitated() on merge.
if(src.stat || src.lying || src.resting || src.handcuffed)
if(src.incapacitated())
return
if(!istype(target) || target.stat || target.lying || target.resting || target.handcuffed || target.client == null)
return
+30 -10
View File
@@ -839,9 +839,9 @@
if(lying)
density = 0
if(l_hand)
if(l_hand)
unEquip(l_hand)
if(r_hand)
if(r_hand)
unEquip(r_hand)
for(var/obj/item/weapon/holder/holder in get_mob_riding_slots())
unEquip(holder)
@@ -984,14 +984,13 @@
swap_hand()
/mob/living/throw_item(atom/target)
src.throw_mode_off()
if(usr.stat || !target)
return
if(target.type == /obj/screen) return
if(stat || !target || istype(target, /obj/screen))
return FALSE
var/atom/movable/item = src.get_active_hand()
if(!item) return
if(!item)
return FALSE
var/throw_range = item.throw_range
if (istype(item, /obj/item/weapon/grab))
@@ -1011,10 +1010,30 @@
if((N.health + N.halloss) < config.health_threshold_crit || N.stat == DEAD)
N.adjustBruteLoss(rand(10,30))
src.drop_from_inventory(G)
return TRUE
else
return FALSE
src.drop_from_inventory(item)
if(!item || !isturf(item.loc))
return
if(!item)
return FALSE //Grab processing has a chance of returning null
if(a_intent == I_HELP && Adjacent(target) && isitem(item))
var/obj/item/I = item
if(ishuman(target))
var/mob/living/carbon/human/H = target
if(H.in_throw_mode && H.a_intent == I_HELP && unEquip(I))
H.put_in_hands(I) // If this fails it will just end up on the floor, but that's fitting for things like dionaea.
visible_message("<b>[src]</b> hands \the [H] \a [I].", SPAN_NOTICE("You give \the [target] \a [I]."))
else
to_chat(src, SPAN_NOTICE("You offer \the [I] to \the [target]."))
do_give(H)
return TRUE
remove_from_mob(I)
make_item_drop_sound(I)
I.forceMove(get_turf(target))
return TRUE
drop_from_inventory(item)
//actually throw it!
src.visible_message("<span class='warning'>[src] has thrown [item].</span>")
@@ -1035,6 +1054,7 @@
item.throw_at(target, throw_range, item.throw_speed, src)
return TRUE
/mob/living/get_sound_env(var/pressure_factor)
if (hallucination)
+1 -1
View File
@@ -1111,7 +1111,7 @@
//Throwing stuff
/mob/proc/throw_item(atom/target)
return
return FALSE
/mob/proc/will_show_tooltip()
if(alpha <= EFFECTIVE_INVIS)