mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 14:37:04 +01:00
Merge pull request #7204 from Crazylemon64/tk_refactor
Tk refactor+Remote tool use
This commit is contained in:
@@ -6,11 +6,22 @@
|
||||
if(hand) return l_hand
|
||||
else return r_hand
|
||||
|
||||
/mob/proc/is_in_active_hand(obj/item/I)
|
||||
var/obj/item/item_to_test = get_active_hand()
|
||||
|
||||
return item_to_test && item_to_test.is_equivalent(I)
|
||||
|
||||
|
||||
//Returns the thing in our inactive hand
|
||||
/mob/proc/get_inactive_hand()
|
||||
if(hand) return r_hand
|
||||
else return l_hand
|
||||
|
||||
/mob/proc/is_in_inactive_hand(obj/item/I)
|
||||
var/obj/item/item_to_test = get_inactive_hand()
|
||||
|
||||
return item_to_test && item_to_test.is_equivalent(I)
|
||||
|
||||
//Returns if a certain item can be equipped to a certain slot.
|
||||
// Currently invalid for two-handed items - call obj/item/mob_can_equip() instead.
|
||||
/mob/proc/can_equip(obj/item/I, slot, disable_warning = 0)
|
||||
@@ -119,6 +130,9 @@
|
||||
else if(I == l_hand)
|
||||
l_hand = null
|
||||
update_inv_l_hand()
|
||||
else if(I in tkgrabbed_objects)
|
||||
var/obj/item/tk_grab/tkgrab = tkgrabbed_objects[I]
|
||||
unEquip(tkgrab, force)
|
||||
|
||||
if(I)
|
||||
if(client)
|
||||
|
||||
@@ -535,18 +535,19 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
return
|
||||
|
||||
/mob/living/carbon/throw_item(atom/target)
|
||||
throw_mode_off()
|
||||
if(!target || !isturf(loc))
|
||||
return
|
||||
if(istype(target, /obj/screen))
|
||||
if(!target || !isturf(loc) || istype(target, /obj/screen))
|
||||
throw_mode_off()
|
||||
return
|
||||
|
||||
var/atom/movable/thrown_thing
|
||||
var/obj/item/I = src.get_active_hand()
|
||||
|
||||
if(!I || (I.flags & NODROP))
|
||||
if(!I || I.override_throw(src, target) || (I.flags & NODROP))
|
||||
throw_mode_off()
|
||||
return
|
||||
|
||||
throw_mode_off()
|
||||
var/atom/movable/thrown_thing
|
||||
|
||||
if(istype(I, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = I
|
||||
var/mob/throwable_mob = G.get_mob_if_throwable() //throw the person instead of the grab
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
for(var/mob/dead/observer/M in following_mobs)
|
||||
M.following = null
|
||||
following_mobs = null
|
||||
QDEL_LIST_ASSOC_VAL(tkgrabbed_objects)
|
||||
for(var/I in tkgrabbed_objects)
|
||||
qdel(tkgrabbed_objects[I])
|
||||
tkgrabbed_objects = null
|
||||
if(buckled)
|
||||
buckled.unbuckle_mob()
|
||||
if(viewing_alternate_appearances)
|
||||
|
||||
@@ -198,3 +198,5 @@
|
||||
var/list/actions = list()
|
||||
|
||||
var/list/progressbars = null //for stacking do_after bars
|
||||
|
||||
var/list/tkgrabbed_objects = list() // Assoc list of items to TK grabs
|
||||
|
||||
Reference in New Issue
Block a user