mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Refactor /mob/unEquip. (#27720)
* Refactor /mob/unEquip. * fix things found in testing * more fixes from testing * fix removal of hooded suits * fix flayers inability to deploy swarmprod * fix changeling blade activation * unnecessary parens * pass default unequip args to proc overrides * fix belts being able to forceMove into full hands
This commit is contained in:
@@ -71,7 +71,7 @@
|
||||
else if(target_direction & SOUTH)
|
||||
x_offset = rand(-12, 12)
|
||||
y_offset = -16
|
||||
if(!user.unEquip(I))
|
||||
if(!user.drop_item_to_ground(I))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You stick [I] to [target_turf].</span>")
|
||||
I.pixel_x = x_offset
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
if(!user.canUnEquip(I))
|
||||
return
|
||||
|
||||
INVOKE_ASYNC(user, TYPE_PROC_REF(/mob, unEquip), I)
|
||||
INVOKE_ASYNC(user, TYPE_PROC_REF(/mob, drop_item_to_ground), I)
|
||||
|
||||
var/list/click_params = params2list(params)
|
||||
//Center the icon where the user clicked.
|
||||
|
||||
@@ -178,20 +178,20 @@
|
||||
if(ismonkeybasic(user))
|
||||
if(require_twohands)
|
||||
to_chat(user, "<span class='notice'>[parent] is too heavy and cumbersome for you to carry!</span>")
|
||||
user.unEquip(parent, force = TRUE)
|
||||
user.drop_item_to_ground(parent, force = TRUE)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[parent] too heavy for you to wield fully.</span>")
|
||||
return
|
||||
if(user.get_inactive_hand())
|
||||
if(require_twohands)
|
||||
to_chat(user, "<span class='notice'>[parent] is too cumbersome to carry in one hand!</span>")
|
||||
user.unEquip(parent, force = TRUE)
|
||||
user.drop_item_to_ground(parent, force = TRUE)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need your other hand to be empty!</span>")
|
||||
return
|
||||
if(!user.has_both_hands())
|
||||
if(require_twohands)
|
||||
user.unEquip(parent, force = TRUE)
|
||||
user.drop_item_to_ground(parent, force = TRUE)
|
||||
to_chat(user, "<span class='warning'>You don't have enough intact hands.</span>")
|
||||
return
|
||||
|
||||
@@ -285,7 +285,7 @@
|
||||
|
||||
// if the item requires two handed drop the item on unwield
|
||||
if(require_twohands && can_drop)
|
||||
user.unEquip(parent, force = TRUE)
|
||||
user.drop_item_to_ground(parent, force = TRUE)
|
||||
|
||||
// Show message if requested
|
||||
if(show_message)
|
||||
@@ -393,7 +393,7 @@
|
||||
INVOKE_ASYNC(src, PROC_REF(unwield), user)
|
||||
|
||||
/datum/component/two_handed/proc/try_drop_item(mob/user)
|
||||
if(user.unEquip(parent))
|
||||
if(user.drop_item_to_ground(parent))
|
||||
user.visible_message("<span class='notice'>[user] loses [user.p_their()] grip on [parent]!</span>")
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user