mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 10:03:50 +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:
committed by
GitHub
parent
17602326bc
commit
0eafad8475
@@ -1160,7 +1160,7 @@
|
||||
|
||||
//strip their stuff and stick it in the crate
|
||||
for(var/obj/item/I in M)
|
||||
if(M.unEquip(I))
|
||||
if(M.drop_item_to_ground(I))
|
||||
I.loc = locker
|
||||
I.layer = initial(I.layer)
|
||||
I.plane = initial(I.plane)
|
||||
@@ -1302,7 +1302,7 @@
|
||||
return
|
||||
|
||||
for(var/obj/item/I in M)
|
||||
M.unEquip(I)
|
||||
M.drop_item_to_ground(I)
|
||||
if(I)
|
||||
I.loc = M.loc
|
||||
I.layer = initial(I.layer)
|
||||
@@ -1334,7 +1334,7 @@
|
||||
return
|
||||
|
||||
for(var/obj/item/I in M)
|
||||
M.unEquip(I)
|
||||
M.drop_item_to_ground(I)
|
||||
if(I)
|
||||
I.loc = M.loc
|
||||
I.layer = initial(I.layer)
|
||||
@@ -1390,7 +1390,7 @@
|
||||
return
|
||||
|
||||
for(var/obj/item/I in M)
|
||||
M.unEquip(I)
|
||||
M.drop_item_to_ground(I)
|
||||
if(I)
|
||||
I.loc = M.loc
|
||||
I.layer = initial(I.layer)
|
||||
@@ -2212,7 +2212,7 @@
|
||||
logmsg = "floor cluwne"
|
||||
if("Shamebrero")
|
||||
if(H.head)
|
||||
H.unEquip(H.head, TRUE)
|
||||
H.drop_item_to_ground(H.head, force = TRUE)
|
||||
var/obj/item/clothing/head/sombrero/shamebrero/S = new(H.loc)
|
||||
H.equip_to_slot_or_del(S, ITEM_SLOT_HEAD)
|
||||
logmsg = "shamebrero"
|
||||
@@ -2963,7 +2963,7 @@
|
||||
if(!security)
|
||||
//strip their stuff before they teleport into a cell :downs:
|
||||
for(var/obj/item/W in H)
|
||||
H.unEquip(W)
|
||||
H.drop_item_to_ground(W)
|
||||
if(H.client)
|
||||
H.client.screen -= W
|
||||
if(W)
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
var/obj/item/slot_item_ID = H.get_item_by_slot(ITEM_SLOT_ID)
|
||||
qdel(slot_item_ID)
|
||||
var/obj/item/slot_item_hand = H.get_item_by_slot(ITEM_SLOT_RIGHT_HAND)
|
||||
H.unEquip(slot_item_hand)
|
||||
H.drop_item_to_ground(slot_item_hand)
|
||||
|
||||
var/obj/item/multisword/pure_evil/multi = new(H)
|
||||
H.equip_to_slot_or_del(multi, ITEM_SLOT_RIGHT_HAND)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
return
|
||||
|
||||
for(var/obj/item/W in M)
|
||||
M.unEquip(W)
|
||||
M.drop_item_to_ground(W)
|
||||
|
||||
log_admin("[key_name(usr)] made [key_name(M)] drop everything!")
|
||||
message_admins("[key_name_admin(usr)] made [key_name_admin(M)] drop everything!", 1)
|
||||
@@ -28,7 +28,7 @@
|
||||
return
|
||||
//strip their stuff before they teleport into a cell :downs:
|
||||
for(var/obj/item/W in M)
|
||||
M.unEquip(W)
|
||||
M.drop_item_to_ground(W)
|
||||
//teleport person to cell
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
|
||||
@@ -84,9 +84,7 @@
|
||||
|
||||
/datum/action/changeling/biodegrade/proc/dissolve_restraint(mob/living/carbon/human/user, obj/O)
|
||||
if(O && (user.handcuffed == O || user.legcuffed == O || user.wear_suit == O))
|
||||
user.unEquip(O)
|
||||
O.visible_message("<span class='warning'>[O] dissolves into a puddle of sizzling goop.</span>")
|
||||
O.forceMove(get_turf(user))
|
||||
qdel(O)
|
||||
|
||||
/datum/action/changeling/biodegrade/proc/open_closet(mob/living/carbon/human/user, obj/structure/closet/C)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
/datum/action/changeling/weapon/sting_action(mob/user)
|
||||
SEND_SIGNAL(user, COMSIG_MOB_WEAPON_APPEARS)
|
||||
if(!user.drop_item())
|
||||
if(user.get_active_hand() && !user.drop_item())
|
||||
to_chat(user, "[user.get_active_hand()] is stuck to your hand, you cannot grow a [weapon_name_simple] over it!")
|
||||
return FALSE
|
||||
var/obj/item/W = new weapon_type(user, silent, src)
|
||||
@@ -97,15 +97,14 @@
|
||||
..(H, target)
|
||||
|
||||
/datum/action/changeling/suit/sting_action(mob/living/carbon/human/user)
|
||||
if(!user.unEquip(user.wear_suit))
|
||||
to_chat(user, "\the [user.wear_suit] is stuck to your body, you cannot grow a [suit_name_simple] over it!")
|
||||
return FALSE
|
||||
if(!user.unEquip(user.head))
|
||||
to_chat(user, "\the [user.head] is stuck on your head, you cannot grow a [helmet_name_simple] over it!")
|
||||
return FALSE
|
||||
|
||||
user.unEquip(user.head)
|
||||
user.unEquip(user.wear_suit)
|
||||
if(user.wear_suit)
|
||||
if(!user.drop_item_to_ground(user.wear_suit))
|
||||
to_chat(user, "\the [user.wear_suit] is stuck to your body, you cannot grow a [suit_name_simple] over it!")
|
||||
return FALSE
|
||||
if(user.head)
|
||||
if(!user.drop_item_to_ground(user.head))
|
||||
to_chat(user, "\the [user.head] is stuck on your head, you cannot grow a [helmet_name_simple] over it!")
|
||||
return FALSE
|
||||
|
||||
user.equip_to_slot_if_possible(new suit_type(user), ITEM_SLOT_OUTER_SUIT, TRUE, TRUE)
|
||||
user.equip_to_slot_if_possible(new helmet_type(user), ITEM_SLOT_HEAD, TRUE, TRUE)
|
||||
@@ -438,7 +437,7 @@
|
||||
var/mob/living/carbon/human/H = loc
|
||||
H.visible_message("<span class='warning'>With a sickening crunch, [H] reforms [H.p_their()] shield into an arm!</span>", "<span class='notice'>We assimilate our shield into our body</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>")
|
||||
playsound(loc, 'sound/effects/bone_break_2.ogg', 100, TRUE)
|
||||
H.unEquip(src, 1)
|
||||
H.unequip(src, force = TRUE)
|
||||
qdel(src)
|
||||
return FALSE
|
||||
else
|
||||
@@ -576,9 +575,9 @@
|
||||
// you've torn it up, get rid of it.
|
||||
new /obj/effect/decal/cleanable/shreds(owner.loc)
|
||||
// just unequip them since they qdel on drop
|
||||
owner.unEquip(src, TRUE, TRUE)
|
||||
owner.drop_item_to_ground(src, force = TRUE, silent = TRUE)
|
||||
if(istype(owner.head, /obj/item/clothing/head/helmet/changeling))
|
||||
owner.unEquip(owner.head, TRUE, TRUE)
|
||||
owner.drop_item_to_ground(owner.head, force = TRUE, silent = TRUE)
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ RESTRICT_TYPE(/datum/antagonist/cultist)
|
||||
if(remove_gear_on_removal)
|
||||
for(var/I in H.contents)
|
||||
if(is_type_in_list(I, CULT_CLOTHING))
|
||||
H.unEquip(I)
|
||||
H.drop_item_to_ground(I)
|
||||
return ..()
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
create_new_weapon()
|
||||
weapon_ref.flags |= (ABSTRACT | NODROP) // Just in case the item doesn't start with both of these, or somehow loses them.
|
||||
|
||||
if(!user.drop_item() || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
|
||||
if(HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || (user.get_active_hand() && !user.drop_item()))
|
||||
flayer.send_swarm_message("We cannot manifest [weapon_ref] into our active hand...")
|
||||
return FALSE
|
||||
|
||||
@@ -53,8 +53,7 @@
|
||||
SIGNAL_HANDLER // COMSIG_MOB_WILLINGLY_DROP + COMSIG_FLAYER_RETRACT_IMPLANTS
|
||||
if(!any_hand && !istype(owner.get_active_hand(), weapon_type))
|
||||
return
|
||||
INVOKE_ASYNC(owner, TYPE_PROC_REF(/mob, unEquip), weapon_ref, TRUE)
|
||||
INVOKE_ASYNC(weapon_ref, TYPE_PROC_REF(/atom/movable, forceMove), owner) // Just kinda shove it into the user
|
||||
owner.transfer_item_to(weapon_ref, owner, force = TRUE, silent = TRUE)
|
||||
owner.update_inv_l_hand()
|
||||
owner.update_inv_r_hand()
|
||||
playsound(get_turf(owner), 'sound/mecha/mechmove03.ogg', 25, TRUE, ignore_walls = FALSE)
|
||||
|
||||
@@ -362,7 +362,7 @@
|
||||
|
||||
if(M.back) //Lets not bork modsuits in funny ways.
|
||||
var/obj/modsuit_safety = M.back
|
||||
M.unEquip(modsuit_safety)
|
||||
M.drop_item_to_ground(modsuit_safety)
|
||||
stuff_to_transfer += modsuit_safety
|
||||
// Regular items get removed in second
|
||||
for(var/obj/item/I in M)
|
||||
@@ -385,14 +385,14 @@
|
||||
qdel(I)
|
||||
continue
|
||||
|
||||
if(M.unEquip(I))
|
||||
if(M.drop_item_to_ground(I))
|
||||
stuff_to_transfer += I
|
||||
|
||||
// Remove accessories from the suit if present
|
||||
if(length(H.w_uniform?.accessories))
|
||||
for(var/obj/item/clothing/accessory/A in H.w_uniform.accessories)
|
||||
H.w_uniform.detach_accessory(A, null)
|
||||
H.unEquip(A)
|
||||
H.drop_item_to_ground(A)
|
||||
stuff_to_transfer += A
|
||||
|
||||
// Transfer it all (or drop it if not possible)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
src.color = pick(GLOB.random_color_list)
|
||||
var/prize_inside = pick(possible_contents)
|
||||
spawn(10)
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
if(ispath(prize_inside,/obj/item/stack))
|
||||
var/amount = pick(5, 10, 15, 25, 50)
|
||||
new prize_inside(user.loc, amount)
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
/obj/machinery/prize_counter/attackby__legacy__attackchain(obj/item/O, mob/user, params)
|
||||
if(istype(O, /obj/item/stack/tickets))
|
||||
var/obj/item/stack/tickets/T = O
|
||||
if(user.unEquip(T)) //Because if you can't drop it for some reason, you shouldn't be increasing the tickets var
|
||||
if(user.drop_item_to_ground(T))
|
||||
tickets += T.amount
|
||||
SStgui.update_uis(src)
|
||||
qdel(T)
|
||||
|
||||
@@ -34,12 +34,14 @@
|
||||
return FALSE
|
||||
if(!A1.remove_item_from_storage(src))
|
||||
if(user)
|
||||
user.remove_from_mob(A1)
|
||||
A1.forceMove(src)
|
||||
user.transfer_item_to(A1, src)
|
||||
else
|
||||
A1.forceMove(src)
|
||||
if(!A2.remove_item_from_storage(src))
|
||||
if(user)
|
||||
user.remove_from_mob(A2)
|
||||
A2.forceMove(src)
|
||||
user.transfer_item_to(A2, src)
|
||||
else
|
||||
A2.forceMove(src)
|
||||
A1.holder = src
|
||||
A2.holder = src
|
||||
a_left = A1
|
||||
@@ -171,7 +173,7 @@
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return FALSE
|
||||
user.unEquip(src, TRUE, TRUE)
|
||||
user.unequip(src, force = TRUE)
|
||||
if(a_left)
|
||||
a_left.holder = null
|
||||
a_left.forceMove(T)
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
var/obj/item/onetankbomb/R = new /obj/item/onetankbomb(loc)
|
||||
|
||||
M.drop_item() //Remove the assembly from your hands
|
||||
M.remove_from_mob(src) //Remove the tank from your character,in case you were holding it
|
||||
M.unequip(src) //Remove the tank from your character,in case you were holding it
|
||||
M.put_in_hands(R) //Equips the bomb if possible, or puts it on the floor.
|
||||
|
||||
R.bombassembly = S //Tell the bomb about its assembly part
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
if(!usr.canUnEquip(src))
|
||||
return
|
||||
|
||||
user.unEquip(src)
|
||||
user.drop_item_to_ground(src)
|
||||
|
||||
if(src)
|
||||
user.put_in_hands(src)
|
||||
@@ -508,7 +508,7 @@
|
||||
|
||||
/obj/item/clothing/head/proc/attach_hat(obj/item/clothing/head/hat, mob/user, unequip = FALSE)
|
||||
if(can_attach_hat(hat))
|
||||
if(unequip && !user.unEquip(hat)) // Make absolutely sure this hat is removed from hands
|
||||
if(unequip && !user.drop_item_to_ground(hat)) // Make absolutely sure this hat is removed from hands
|
||||
return FALSE
|
||||
|
||||
attached_hats += hat
|
||||
@@ -571,13 +571,13 @@
|
||||
flags_cover |= MASKCOVERSMOUTH
|
||||
if(H.head == src)
|
||||
if(isnull(user.get_item_by_slot(slot_flags)))
|
||||
user.unEquip(src)
|
||||
user.drop_item_to_ground(src)
|
||||
user.equip_to_slot(src, slot_flags)
|
||||
else if(flags_inv == HIDEFACE) //Means that only things like bandanas and balaclavas will be affected since they obscure the identity of the wearer.
|
||||
if(H.l_hand && H.r_hand) //If both hands are occupied, drop the object on the ground.
|
||||
user.unEquip(src)
|
||||
user.drop_item_to_ground(src)
|
||||
else //Otherwise, put it in an available hand, the active one preferentially.
|
||||
user.unEquip(src)
|
||||
user.drop_item_to_ground(src)
|
||||
user.put_in_hands(src)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You push \the [src] out of the way.</span>")
|
||||
@@ -598,13 +598,13 @@
|
||||
flags &= ~AIRTIGHT
|
||||
if(user.wear_mask == src)
|
||||
if(isnull(user.get_item_by_slot(slot_flags)))
|
||||
user.unEquip(src)
|
||||
user.drop_item_to_ground(src)
|
||||
user.equip_to_slot(src, slot_flags)
|
||||
else if(initial(flags_inv) == HIDEFACE) //Means that you won't have to take off and put back on simple things like breath masks which, realistically, can just be pulled down off your face.
|
||||
if(H.l_hand && H.r_hand) //If both hands are occupied, drop the object on the ground.
|
||||
user.unEquip(src)
|
||||
user.drop_item_to_ground(src)
|
||||
else //Otherwise, put it in an available hand, the active one preferentially.
|
||||
user.unEquip(src)
|
||||
user.drop_item_to_ground(src)
|
||||
user.put_in_hands(src)
|
||||
H.wear_mask_update(src, toggle_off = up)
|
||||
usr.update_inv_wear_mask()
|
||||
@@ -697,7 +697,7 @@
|
||||
if(hidden_blade)
|
||||
to_chat(user, "<span class='notice'>There is already something in [src]!</span>")
|
||||
return
|
||||
if(!user.unEquip(I))
|
||||
if(!user.drop_item_to_ground(I))
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] places [I] into their [name]!</span>", \
|
||||
"<span class='notice'>You place [I] into the side of your [name]!</span>")
|
||||
@@ -820,10 +820,10 @@
|
||||
if(istype(O, /obj/item/storage/internal)) //If it's a pocket...
|
||||
if(O.contents) //Check to see if the pocket's got anything in it.
|
||||
for(var/obj/item/I in O.contents) //Dump the pocket out onto the floor below the user.
|
||||
user.unEquip(I,1)
|
||||
user.drop_item_to_ground(I, force = TRUE)
|
||||
|
||||
user.visible_message("<span class='warning'>[user] bellows, [pick("shredding", "ripping open", "tearing off")] [user.p_their()] jacket in a fit of rage!</span>","<span class='warning'>You accidentally [pick("shred", "rend", "tear apart")] [src] with your [pick("excessive", "extreme", "insane", "monstrous", "ridiculous", "unreal", "stupendous")] [pick("power", "strength")]!</span>")
|
||||
user.unEquip(src)
|
||||
user.drop_item_to_ground(src)
|
||||
qdel(src) //Now that the pockets have been emptied, we can safely destroy the jacket.
|
||||
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!"))
|
||||
user.update_inv_wear_suit()
|
||||
@@ -901,7 +901,7 @@
|
||||
return
|
||||
|
||||
user.visible_message("<span class='danger'>[user] manages to [break_restraints ? "break" : "remove"] [src]!</span>", "<span class='notice'>You successfully [break_restraints ? "break" : "remove"] [src].</span>")
|
||||
user.unEquip(src)
|
||||
user.drop_item_to_ground(src)
|
||||
|
||||
//////////////////////////////
|
||||
// MARK: SPACE SUIT
|
||||
@@ -1068,7 +1068,7 @@
|
||||
|
||||
/obj/item/clothing/under/proc/attach_accessory(obj/item/clothing/accessory/A, mob/user, unequip = FALSE)
|
||||
if(can_attach_accessory(A))
|
||||
if(unequip && !user.unEquip(A)) // Make absolutely sure this accessory is removed from hands
|
||||
if(unequip && !user.drop_item_to_ground(A)) // Make absolutely sure this accessory is removed from hands
|
||||
return FALSE
|
||||
|
||||
accessories += A
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
if(prescription)
|
||||
to_chat(H, "<span class='warning'>You can't possibly imagine how adding more lenses would improve [src].</span>")
|
||||
return
|
||||
H.unEquip(I)
|
||||
H.drop_item_to_ground(I)
|
||||
upgrade_prescription(I)
|
||||
to_chat(H, "<span class='notice'>You fit [src] with lenses from [I].</span>")
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
if(cell)
|
||||
to_chat(user, "<span class='warning'>[src] already has a cell!</span>")
|
||||
return
|
||||
if(!user.unEquip(I))
|
||||
if(!user.drop_item_to_ground(I))
|
||||
return
|
||||
I.forceMove(src)
|
||||
cell = I
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
to_chat(user, "<span class='warning'>You cannot install the upgrade to [src] while wearing it.</span>")
|
||||
return
|
||||
|
||||
if(user.unEquip(I))
|
||||
if(user.temperature_expose(I))
|
||||
I.forceMove(src)
|
||||
jetpack = I
|
||||
to_chat(user, "<span class='notice'>You successfully install the jetpack into [src].</span>")
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
/obj/item/clothing/suit/armor/vest/security/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/clothing/accessory/holobadge))
|
||||
if(user.unEquip(I))
|
||||
if(user.drop_item_to_ground(I))
|
||||
add_fingerprint(user)
|
||||
I.forceMove(src)
|
||||
attached_badge = I
|
||||
|
||||
@@ -44,9 +44,10 @@
|
||||
suit_adjusted = 0
|
||||
if(ishuman(hood.loc))
|
||||
var/mob/living/carbon/H = hood.loc
|
||||
H.unEquip(hood, 1)
|
||||
H.transfer_item_to(hood, src, force = TRUE)
|
||||
H.update_inv_wear_suit()
|
||||
hood.forceMove(src)
|
||||
else
|
||||
hood.forceMove(src)
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtons()
|
||||
|
||||
@@ -1422,7 +1422,7 @@
|
||||
return
|
||||
var/abaya_type = options[choice]
|
||||
var/obj/item/clothing/suit/hooded/abaya/abaya = new abaya_type(get_turf(src))
|
||||
L.unEquip(src, silent = TRUE)
|
||||
L.unequip(src)
|
||||
L.put_in_active_hand(abaya)
|
||||
to_chat(L, "<span class='notice'>You are now wearing \a [choice]. Allahu Akbar!</span>")
|
||||
qdel(src)
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
var/mob/living/carbon/H = helmet.loc
|
||||
if(helmet.on)
|
||||
helmet.attack_self__legacy__attackchain(H)
|
||||
H.unEquip(helmet, TRUE)
|
||||
helmet.forceMove(src)
|
||||
H.transfer_item_to(helmet, src, force = TRUE)
|
||||
H.update_inv_wear_suit()
|
||||
to_chat(H, "<span class='notice'>The helmet on the hardsuit disengages.</span>")
|
||||
playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1)
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
return
|
||||
|
||||
holstered = W
|
||||
user.unEquip(holstered)
|
||||
holstered.loc = src
|
||||
user.unequip(holstered)
|
||||
holstered.forceMove(src)
|
||||
holstered.add_fingerprint(user)
|
||||
user.visible_message("<span class='notice'>[user] holsters [holstered].</span>", "<span class='notice'>You holster [holstered].</span>")
|
||||
|
||||
|
||||
@@ -134,12 +134,12 @@
|
||||
if(istype(gunkit_to_use, /obj/item/weaponcrafting/gunkit/sparker)) //Snowflake checking, but I don't want a person with a self assembling kit to be robbed
|
||||
var/obj/item/gun_produceda = new gunkit_to_use.outcome
|
||||
var/obj/item/gun_producedb = new gunkit_to_use.outcome
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
user.put_in_hands(gun_produceda)
|
||||
user.put_in_hands(gun_producedb)
|
||||
else
|
||||
var/obj/item/gun_produced = new gunkit_to_use.outcome
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
user.put_in_hands(gun_produced)
|
||||
qdel(gunkit_to_use)
|
||||
qdel(src)
|
||||
@@ -150,7 +150,7 @@
|
||||
if(istype(W,/obj/item/pipe))
|
||||
to_chat(user, "You attach the shotgun barrel to the receiver. The pins seem loose.")
|
||||
var/obj/item/weaponcrafting/ishotgunconstruction/I = new /obj/item/weaponcrafting/ishotgunconstruction
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
user.put_in_hands(I)
|
||||
qdel(W)
|
||||
qdel(src)
|
||||
@@ -166,7 +166,7 @@
|
||||
|
||||
/obj/item/weaponcrafting/ishotgunconstruction/screwdriver_act(mob/living/user, obj/item/I)
|
||||
var/obj/item/weaponcrafting/ishotgunconstruction2/C = new /obj/item/weaponcrafting/ishotgunconstruction2
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
user.put_in_hands(C)
|
||||
to_chat(user, "<span class='notice'>You screw the pins into place, securing the pipe to the receiver.</span>")
|
||||
qdel(src)
|
||||
@@ -182,7 +182,7 @@
|
||||
if(istype(W,/obj/item/weaponcrafting/stock))
|
||||
to_chat(user, "You attach the stock to the receiver-barrel assembly.")
|
||||
var/obj/item/weaponcrafting/ishotgunconstruction3/I = new /obj/item/weaponcrafting/ishotgunconstruction3
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
user.put_in_hands(I)
|
||||
qdel(W)
|
||||
qdel(src)
|
||||
@@ -200,7 +200,7 @@
|
||||
var/obj/item/stack/package_wrap/C = I
|
||||
if(C.use(5))
|
||||
var/obj/item/gun/projectile/revolver/doublebarrel/improvised/W = new /obj/item/gun/projectile/revolver/doublebarrel/improvised
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
user.put_in_hands(W)
|
||||
to_chat(user, "<span class='notice'>You tie the wrapping paper around the stock and the barrel to secure it.</span>")
|
||||
qdel(src)
|
||||
|
||||
@@ -1613,7 +1613,7 @@
|
||||
playsound(src, 'sound/effects/spray.ogg', 5, TRUE, 5)
|
||||
var/obj/item/clothing/head/helmet/space/plasmaman/lf53_fluff/F = new(P.loc)
|
||||
if(P == H.head)
|
||||
H.unEquip(P, TRUE, TRUE)
|
||||
H.unequip(P, force = TRUE)
|
||||
H.equip_to_slot(F, ITEM_SLOT_HEAD, TRUE)
|
||||
H.update_inv_head()
|
||||
qdel(P)
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
if(isstorage(I.loc)) //in a container.
|
||||
var/obj/item/storage/U = I.loc
|
||||
U.remove_from_storage(I, src)
|
||||
else if(!user.is_holding(I) || !user.unEquip(I)) //in a hand
|
||||
else if(!user.is_holding(I) || !user.unequip(I)) //in a hand
|
||||
return
|
||||
|
||||
user.visible_message("<span class='notice'>[user] puts [I] into [src].</span>", "<span class='notice'>You put [I] inside [src].</span>",\
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
if(is_type_in_list(O,acceptable_items))
|
||||
if(istype(O, /obj/item/food))
|
||||
var/obj/item/food/S = O
|
||||
user.unEquip(S)
|
||||
user.drop_item_to_ground(S)
|
||||
if(S.reagents && !S.reagents.total_volume) //This prevents us from using empty foods, should one occur due to some sort of error
|
||||
to_chat(user, "<span class='warning'>[S] is gone, oh no!</span>")
|
||||
qdel(S) //Delete the food object because it is useless even as food due to the lack of reagents
|
||||
@@ -60,24 +60,24 @@
|
||||
if(C.can_opened && C.reagents.total_volume) //This prevents us from using opened cans that still have something in them
|
||||
to_chat(user, "<span class='warning'>Only unopened cans and bottles can be processed to ensure product integrity.</span>")
|
||||
return 0
|
||||
user.unEquip(C)
|
||||
user.drop_item_to_ground(C)
|
||||
if(!C.reagents.total_volume) //Empty cans get recycled, even if they have somehow remained unopened due to some sort of error
|
||||
recycle_container(C)
|
||||
else //Full cans that are unopened get inserted for processing as ingredients
|
||||
insert_item(C, user)
|
||||
return 1
|
||||
else
|
||||
user.unEquip(O)
|
||||
user.drop_item_to_ground(O)
|
||||
insert_item(O, user)
|
||||
return 1
|
||||
else if(istype(O, /obj/item/trash/can)) //Crushed cans (and bottles) are returnable still
|
||||
var/obj/item/trash/can/C = O
|
||||
user.unEquip(C)
|
||||
user.drop_item_to_ground(C)
|
||||
recycle_container(C)
|
||||
return 1
|
||||
else if(istype(O, /obj/item/stack/sheet)) //Sheets of materials can replenish the machine's supply of drink containers (when people inevitably don't return them)
|
||||
var/obj/item/stack/sheet/S = O
|
||||
user.unEquip(S)
|
||||
user.drop_item_to_ground(S)
|
||||
process_sheets(S)
|
||||
return 1
|
||||
else //If it doesn't qualify in the above checks, we don't want it. Inform the person so they (ideally) stop trying to put the nuke disc in.
|
||||
|
||||
@@ -356,7 +356,7 @@ do {\
|
||||
to_chat(user, "<span class='warning'>Merging [snack] and [src] together is going to make a mess.</span>")
|
||||
return
|
||||
|
||||
if(!user.unEquip(snack))
|
||||
if(!user.unequip(snack))
|
||||
to_chat(user, "<span class='warning'>[snack] is stuck to your hand!</span>")
|
||||
return
|
||||
|
||||
|
||||
@@ -115,9 +115,9 @@
|
||||
var/obj/item/restraints/handcuffs/twimsts/L = new /obj/item/restraints/handcuffs/twimsts
|
||||
L.create_reagents(100)
|
||||
reagents.copy_to(L, reagents.total_volume)
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
var/obj/item/trash_item = generate_trash(user)
|
||||
user.unEquip(trash_item)
|
||||
user.drop_item_to_ground(trash_item)
|
||||
user.put_in_hands(L)
|
||||
qdel(src)
|
||||
|
||||
|
||||
@@ -607,7 +607,7 @@
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] starts removing the payload and wires from [src].</span>")
|
||||
if(I.use_tool(src, user, 4 SECONDS, volume = 50))
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
user.visible_message("<span class='notice'>[user] removes the insides of [src]!</span>")
|
||||
var/obj/item/stack/cable_coil/C = new /obj/item/stack/cable_coil(src.loc)
|
||||
C.amount = 3
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
if(M == user)
|
||||
to_chat(user, "<span class='notice'>You finish eating [src].</span>")
|
||||
user.visible_message("<span class='notice'>[M] finishes eating [src].</span>")
|
||||
user.unEquip(src) //so icons update :[
|
||||
user.unequip(src) //so icons update :[
|
||||
Post_Consume(M)
|
||||
var/obj/item/trash_item = generate_trash(user)
|
||||
user.put_in_hands(trash_item)
|
||||
@@ -167,7 +167,6 @@
|
||||
return ..()
|
||||
if(reagents && !reagents.total_volume) // Shouldn't be needed but it checks to see if it has anything left in it.
|
||||
to_chat(user, "<span class='warning'>None of [src] left, oh no!</span>")
|
||||
M.unEquip(src) //so icons update :[
|
||||
qdel(src)
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -402,16 +402,14 @@
|
||||
continue
|
||||
if(O.flags & NODROP || stealthmode)
|
||||
qdel(O) //they are already dead by now
|
||||
H.unEquip(O)
|
||||
O.loc = loc
|
||||
H.transfer_item_to(O, loc)
|
||||
O.throw_at(get_edge_target_turf(src, gib_throw_dir), rand(1, 5), 15)
|
||||
sleep(1)
|
||||
|
||||
for(var/obj/item/clothing/C in H)
|
||||
if(C.flags & NODROP || stealthmode)
|
||||
qdel(C)
|
||||
H.unEquip(C)
|
||||
C.loc = loc
|
||||
H.transfer_item_to(C, loc)
|
||||
C.throw_at(get_edge_target_turf(src, gib_throw_dir), rand(1, 5), 15)
|
||||
sleep(1)
|
||||
|
||||
|
||||
@@ -358,12 +358,14 @@
|
||||
else if(ismob(I.loc))
|
||||
var/mob/M = I.loc
|
||||
if(M.get_active_hand() == I)
|
||||
if(!M.drop_item())
|
||||
if(M.transfer_item_to(I, src))
|
||||
// TODO: Use COMSIG_ATOM_ENTERED/EXITED to update item quantities
|
||||
// instead of having to fiddle with the values everywhere
|
||||
item_quants[I.name] += 1
|
||||
return TRUE
|
||||
else
|
||||
to_chat(user, "<span class='warning'>\The [I] is stuck to you!</span>")
|
||||
return FALSE
|
||||
else
|
||||
M.unEquip(I)
|
||||
I.forceMove(src)
|
||||
else
|
||||
I.forceMove(src)
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@
|
||||
|
||||
if(is_screen_atom(over))
|
||||
if(!remove_item_from_storage(get_turf(M)))
|
||||
M.unEquip(src)
|
||||
M.drop_item_to_ground(src)
|
||||
switch(over.name)
|
||||
if("r_hand")
|
||||
if(M.put_in_r_hand(src))
|
||||
@@ -527,7 +527,7 @@
|
||||
|
||||
H.cards += cards
|
||||
cards.Cut()
|
||||
user.unEquip(src, force = 1)
|
||||
user.unequip(src, force = TRUE)
|
||||
qdel(src)
|
||||
|
||||
H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
|
||||
@@ -1031,7 +1031,7 @@
|
||||
"<span class='notice'>You play \the [selected].</span>",
|
||||
"<span class='notice'>You hear a card being played.</span>"
|
||||
)
|
||||
user.unEquip(new_hand)
|
||||
user.drop_item_to_ground(new_hand)
|
||||
var/atom/drop_location = get_step(user, user.dir)
|
||||
var/obj/item/cardhand/hand_on_the_table = locate(/obj/item/cardhand) in drop_location
|
||||
if(istype(hand_on_the_table) && parent_deck_id == hand_on_the_table.parent_deck_id)
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
if(istype(I, /obj/item/honey_frame))
|
||||
var/obj/item/honey_frame/HF = I
|
||||
if(length(honey_frames) < BEEBOX_MAX_FRAMES)
|
||||
if(!user.unEquip(HF))
|
||||
if(!user.unequip(HF))
|
||||
return
|
||||
visible_message("<span class='notice'>[user] adds a frame to the apiary.</span>")
|
||||
HF.forceMove(src)
|
||||
@@ -165,7 +165,7 @@
|
||||
return
|
||||
|
||||
var/obj/item/queen_bee/qb = I
|
||||
if(!user.unEquip(qb))
|
||||
if(!user.drop_item_to_ground(qb))
|
||||
return
|
||||
qb.queen.forceMove(src)
|
||||
bees += qb.queen
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
if(length(stored_plants) >= max_storable_plants)
|
||||
to_chat(user, "<span class='warning'>[src] can't hold any more plants!</span>")
|
||||
return
|
||||
if(!user.unEquip(O))
|
||||
if(!user.drop_item_to_ground(O))
|
||||
return
|
||||
|
||||
O.forceMove(src)
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
if(biomass >= biomass_capacity && potassium >= potassium_capacity)
|
||||
to_chat(user, "<span class='warning'>[src] can't hold any more biomass, and its contents are saturated with potassium!</span>")
|
||||
return
|
||||
if(!user.unEquip(O))
|
||||
if(!user.drop_item_to_ground(O))
|
||||
return
|
||||
|
||||
O.forceMove(src)
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
/obj/item/food/grown/shell/attack_self__legacy__attackchain(mob/user)
|
||||
if(!do_after(user, 1.5 SECONDS, target = user))
|
||||
return
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
if(trash)
|
||||
var/obj/item/T = generate_trash()
|
||||
user.put_in_hands(T)
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
/obj/item/food/grown/firelemon/proc/update_mob()
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
M.unEquip(src)
|
||||
M.drop_item_to_ground(src)
|
||||
|
||||
/obj/item/food/grown/firelemon/ex_act(severity)
|
||||
qdel(src) //Ensuring that it's deleted by its own explosion
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
if(W.sharp)
|
||||
to_chat(user, "<span class='notice'>You use [W] to fashion a pipe out of the corn cob!</span>")
|
||||
new /obj/item/clothing/mask/cigarette/pipe/cobpipe (user.loc)
|
||||
user.unEquip(src)
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
|
||||
@@ -244,7 +244,6 @@
|
||||
force -= rand(1, (force / 3) + 1)
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>All the petals have fallen off [src] from violent whacking!</span>")
|
||||
usr.unEquip(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/grown/novaflower/pickup(mob/living/carbon/human/user)
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
force -= rand(1, (force / 3) + 1) // When you whack someone with it, leaves fall off
|
||||
else
|
||||
to_chat(usr, "All the leaves have fallen off the nettle from violent whacking.")
|
||||
usr.unEquip(src)
|
||||
usr.unequip(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/grown/nettle/basic
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
to_chat(user, "<span class='notice'>You cut the potato into wedges with [W].</span>")
|
||||
var/obj/item/food/grown/potato/wedges/Wedges = new /obj/item/food/grown/potato/wedges
|
||||
if(!remove_item_from_storage(user))
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
user.put_in_hands(Wedges)
|
||||
qdel(src)
|
||||
else
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
to_chat(user, "<span class='notice'>You sharpen the carrot into a shiv with [I].</span>")
|
||||
var/obj/item/kitchen/knife/shiv/carrot/Shiv = new ()
|
||||
if(!remove_item_from_storage(user))
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
user.put_in_hands(Shiv)
|
||||
qdel(src)
|
||||
else
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
K.health = K.maxHealth
|
||||
K.visible_message("<span class='notice'>The Killer Tomato growls as it suddenly awakens.</span>")
|
||||
if(user)
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
message_admins("[key_name_admin(user)] released a killer tomato at [ADMIN_COORDJMP(T)]")
|
||||
log_game("[key_name(user)] released a killer tomato at [COORD(T)]")
|
||||
qdel(src)
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
if(leaf.dry)
|
||||
user.show_message("<span class='notice'>You wrap \the [W] around the log, turning it into a torch!</span>")
|
||||
var/obj/item/flashlight/flare/torch/T = new /obj/item/flashlight/flare/torch(user.loc)
|
||||
usr.unEquip(W)
|
||||
user.unequip(leaf)
|
||||
usr.put_in_active_hand(T)
|
||||
qdel(leaf)
|
||||
qdel(src)
|
||||
|
||||
@@ -831,7 +831,7 @@
|
||||
if(!myseed)
|
||||
if(istype(O, /obj/item/seeds/kudzu))
|
||||
investigate_log("had Kudzu planted in it by [key_name(user)] at ([x],[y],[z])","kudzu")
|
||||
user.unEquip(O)
|
||||
user.unequip(O)
|
||||
to_chat(user, "<span class='notice'>You plant [O].</span>")
|
||||
dead = FALSE
|
||||
myseed = O
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
if(!original_seed)
|
||||
return FALSE
|
||||
|
||||
if(user && !user.unEquip(source_item, silent = TRUE)) //couldn't drop the item
|
||||
if(user && !user.drop_item_to_ground(source_item, silent = TRUE)) //couldn't drop the item
|
||||
return FALSE
|
||||
|
||||
if(seed_count == -1)
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
MARTIAL_ARTS_ACT_CHECK
|
||||
A.do_attack_animation(D, ATTACK_EFFECT_DISARM)
|
||||
var/obj/item/I = D.get_active_hand()
|
||||
if(prob(60) && D.unEquip(I))
|
||||
if(prob(60) && D.drop_item_to_ground(I))
|
||||
if(!(QDELETED(I) || (I.flags & ABSTRACT)))
|
||||
A.put_in_hands(I)
|
||||
D.visible_message("<span class='danger'>[A] has disarmed [D]!</span>", \
|
||||
|
||||
@@ -257,7 +257,7 @@
|
||||
if(istype(T, denied_type) || istype(src, T.denied_type))
|
||||
to_chat(user, "<span class='warning'>You can't seem to attach [src] to [H]. Maybe remove a few trophies?</span>")
|
||||
return FALSE
|
||||
if(!user.unEquip(src))
|
||||
if(!user.unequip(src))
|
||||
return
|
||||
forceMove(H)
|
||||
H.trophies += src
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
to_chat(user, "<span class='notice'>You start planting [src].</span>")
|
||||
if(!do_after(user, (2.5 SECONDS) * toolspeed, target = AM))
|
||||
return
|
||||
if(!user.unEquip(src))
|
||||
if(!user.unequip(src))
|
||||
return
|
||||
target = AM
|
||||
forceMove(AM)
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
to_chat(user, "<span class='notice'>There's an ID inserted already.</span>")
|
||||
return
|
||||
|
||||
if(!user.unEquip(I))
|
||||
if(!user.drop_item_to_ground(I))
|
||||
return
|
||||
|
||||
I.forceMove(src)
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
var/obj/item/I = ui.user.get_active_hand()
|
||||
if(istype(I, /obj/item/card/id/prisoner))
|
||||
if(!ui.user.unEquip(I))
|
||||
if(!ui.user.drop_item_to_ground(I))
|
||||
return
|
||||
I.forceMove(src)
|
||||
inserted_id_uid = I.UID()
|
||||
|
||||
@@ -39,11 +39,11 @@
|
||||
user.visible_message("<span class='hierophant_warning'>[user] fades out, leaving [user.p_their()] belongings behind!</span>")
|
||||
for(var/obj/item/I in user)
|
||||
if(I != src)
|
||||
user.unEquip(I)
|
||||
user.drop_item_to_ground(I)
|
||||
for(var/turf/T in RANGE_TURFS(1, user))
|
||||
var/obj/effect/temp_visual/hierophant/blast/B = new(T, user, TRUE)
|
||||
B.damage = 0
|
||||
user.unEquip(src) //Drop us last, so it goes on top of their stuff
|
||||
user.drop_item_to_ground(src) //Drop us last, so it goes on top of their stuff
|
||||
qdel(user)
|
||||
return OBLITERATION
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
playsound(loc, "rustle", 50, TRUE, -5)
|
||||
|
||||
if(istype(over_object, /atom/movable/screen/inventory/hand))
|
||||
if(!M.unEquip(src))
|
||||
if(!M.unequip(src))
|
||||
return
|
||||
M.put_in_active_hand(src)
|
||||
else
|
||||
|
||||
@@ -379,7 +379,7 @@
|
||||
if(ishuman(owner) && !QDELETED(owner))
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/thief = loc
|
||||
thief.unEquip(src, TRUE, TRUE) // You're not my owner!
|
||||
thief.drop_item_to_ground(src, force = TRUE, silent = TRUE) // You're not my owner!
|
||||
if(owner.stat == DEAD)
|
||||
qdel(src) // Oh no! Oh well a new rod will be made from the STATUS_EFFECT_HIPPOCRATIC_OATH
|
||||
return
|
||||
|
||||
@@ -140,11 +140,11 @@
|
||||
|
||||
//Drops the item in our left hand
|
||||
/mob/proc/drop_l_hand(force = FALSE)
|
||||
return unEquip(l_hand, force) //All needed checks are in unEquip
|
||||
return drop_item_to_ground(l_hand, force)
|
||||
|
||||
//Drops the item in our right hand
|
||||
/mob/proc/drop_r_hand(force = FALSE)
|
||||
return unEquip(r_hand, force) //Why was this not calling unEquip in the first place jesus fuck.
|
||||
return drop_item_to_ground(r_hand, force)
|
||||
|
||||
//Drops the item in our active hand.
|
||||
/mob/proc/drop_item()
|
||||
@@ -153,57 +153,103 @@
|
||||
else
|
||||
return drop_r_hand()
|
||||
|
||||
//Here lie unEquip and before_item_take, already forgotten and not missed.
|
||||
|
||||
/mob/proc/canUnEquip(obj/item/I, force)
|
||||
if(!I)
|
||||
return TRUE
|
||||
if((I.flags & NODROP) && !force)
|
||||
return FALSE
|
||||
|
||||
if((SEND_SIGNAL(I, COMSIG_ITEM_PRE_UNEQUIP, force) & COMPONENT_ITEM_BLOCK_UNEQUIP) && !force)
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/mob/proc/unEquip(obj/item/I, force, silent = FALSE) //Force overrides NODROP for things like wizarditis and admin undress.
|
||||
if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for NODROP.
|
||||
return 1
|
||||
/**
|
||||
* Unequip `target` and drop it at our current location.
|
||||
*
|
||||
* Returns `FALSE` if the unequip failed, and `target` if it succeeded. Returns
|
||||
* `FALSE` if there is no target to drop. If the caller cares about handling the
|
||||
* resultant dropped object, they are responsible for ensuring that the thing
|
||||
* actually exists. This is to ensure that the return value is meaningful and that
|
||||
* a nonexistant item being unequipped and returning null is not interpreted as
|
||||
* a failure.
|
||||
*
|
||||
* However, if you don't care about the return value, feel free to pass in possibly
|
||||
* nonexistant objects, such as when dropping anything in a slot for a spell/virus
|
||||
* that replaces existing clothing.
|
||||
*/
|
||||
/mob/proc/drop_item_to_ground(obj/item/target, force = FALSE, silent = FALSE, drop_inventory = TRUE)
|
||||
if(isnull(target))
|
||||
return FALSE
|
||||
|
||||
if(!canUnEquip(I, force))
|
||||
return 0
|
||||
var/try_unequip = unequip_to(target, drop_location(), force, silent, drop_inventory, no_move = FALSE)
|
||||
|
||||
if(I == r_hand)
|
||||
if(!try_unequip || !target)
|
||||
return FALSE
|
||||
|
||||
return target
|
||||
|
||||
/**
|
||||
* Unequip `target` and relocate it to `destination`.
|
||||
*
|
||||
* Returns `FALSE` if the transfer failed for any reason, and `TRUE` if it succeeded.
|
||||
*/
|
||||
/mob/proc/transfer_item_to(obj/item/target, atom/destination, force = FALSE, silent = TRUE)
|
||||
return unequip_to(target, destination, force, silent, no_move = FALSE)
|
||||
|
||||
/**
|
||||
* Unequip `target` without relocating it.
|
||||
*
|
||||
* Returns `FALSE` if the transfer failed for any reason, and `TRUE` if it succeeded.
|
||||
*
|
||||
* A destination cannot be specified; you must either `forceMove` or `qdel` it.
|
||||
* If you intend to `qdel` it immediately, it is not necessary to call this;
|
||||
* [/obj/item/proc/Destroy] will perform the necessary unequipping.
|
||||
*/
|
||||
/mob/proc/unequip(obj/item/target, force = FALSE, drop_inventory = TRUE)
|
||||
return unequip_to(target, null, force, silent = TRUE, drop_inventory = drop_inventory, no_move = TRUE)
|
||||
|
||||
/**
|
||||
* Central proc for unequipping items. Cannot be called but can be overridden so
|
||||
* long as default arg values are preserved. Use [/mob/proc/unequip],
|
||||
* [/mob/proc/drop_item_to_ground], or [/mob/proc/transfer_item_to] instead.
|
||||
*
|
||||
* - `target`: The object to unequip.
|
||||
* - `destination`: The location the object should be unequipped to, if applicable.
|
||||
* - `force`: Override `NODROP` for things like wizarditis and admin undress.
|
||||
* - `silent`: Whether the unequip should play a sound.
|
||||
* - `drop_inventory`: Whether items in the dropped item's slots (such as uniform pockets) should be dropped.
|
||||
* - `no_move`: Whether we should attempt to move the item to `destination` or expect the caller to.
|
||||
*/
|
||||
/mob/proc/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE)
|
||||
PROTECTED_PROC(TRUE)
|
||||
|
||||
if((target.flags & NODROP) && !force)
|
||||
return FALSE
|
||||
|
||||
if((SEND_SIGNAL(target, COMSIG_ITEM_PRE_UNEQUIP, destination, force, silent, drop_inventory, no_move) & COMPONENT_ITEM_BLOCK_UNEQUIP) && !force)
|
||||
return FALSE
|
||||
|
||||
if(target == r_hand)
|
||||
r_hand = null
|
||||
update_inv_r_hand()
|
||||
else if(I == l_hand)
|
||||
else if(target == 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)
|
||||
else if(target in tkgrabbed_objects)
|
||||
var/obj/item/tk_grab/tkgrab = tkgrabbed_objects[target]
|
||||
unequip_to(tkgrab, destination, force, silent, drop_inventory, no_move)
|
||||
|
||||
if(I)
|
||||
if(target)
|
||||
if(client)
|
||||
client.screen -= I
|
||||
var/turf/drop_loc = drop_location()
|
||||
if(drop_loc)
|
||||
I.forceMove(drop_loc)
|
||||
else
|
||||
I.moveToNullspace()
|
||||
I.dropped(src, silent)
|
||||
if(I)
|
||||
I.layer = initial(I.layer)
|
||||
I.plane = initial(I.plane)
|
||||
return 1
|
||||
|
||||
|
||||
//Attemps to remove an object on a mob. Will not move it to another area or such, just removes from the mob.
|
||||
/mob/proc/remove_from_mob(obj/O)
|
||||
unEquip(O)
|
||||
O.screen_loc = null
|
||||
return 1
|
||||
client.screen -= target
|
||||
target.layer = initial(target.layer)
|
||||
target.plane = initial(target.plane)
|
||||
if(!no_move && !(target.flags & DROPDEL))
|
||||
if(isnull(destination))
|
||||
target.moveToNullspace()
|
||||
else
|
||||
target.forceMove(destination)
|
||||
target.dropped(src, silent)
|
||||
|
||||
return TRUE
|
||||
|
||||
//Outdated but still in use apparently. This should at least be a human proc.
|
||||
//Daily reminder to murder this - Remie.
|
||||
@@ -258,7 +304,7 @@
|
||||
var/list/items = list()
|
||||
items |= get_equipped_items(TRUE)
|
||||
for(var/I in items)
|
||||
unEquip(I)
|
||||
drop_item_to_ground(I)
|
||||
drop_l_hand()
|
||||
drop_r_hand()
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
//can't unequip since it can't equip anything // why the fuck is this it's own file
|
||||
/mob/living/carbon/alien/larva/unEquip(obj/item/I, force, silent = FALSE)
|
||||
/mob/living/carbon/alien/larva/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE)
|
||||
return
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
/obj/item/clothing/mask/facehugger/attack__legacy__attackchain(mob/living/M, mob/user)
|
||||
..()
|
||||
user.unEquip(src)
|
||||
user.drop_item_to_ground(src)
|
||||
Attach(M)
|
||||
|
||||
/obj/item/clothing/mask/facehugger/examine(mob/user)
|
||||
@@ -129,7 +129,7 @@
|
||||
var/obj/item/clothing/W = target.wear_mask
|
||||
if(W.flags & NODROP)
|
||||
return FALSE
|
||||
target.unEquip(W)
|
||||
target.drop_item_to_ground(W)
|
||||
|
||||
target.visible_message("<span class='danger'>[src] tears [W] off of [target]'s face!</span>", \
|
||||
"<span class='userdanger'>[src] tears [W] off of [target]'s face!</span>")
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
for(var/obj/item in get_all_slots())
|
||||
if(QDELETED(item))
|
||||
continue
|
||||
unEquip(item, silent = TRUE)
|
||||
drop_item_to_ground(item, silent = TRUE)
|
||||
qdel(item)
|
||||
QDEL_LIST_CONTENTS(internal_organs)
|
||||
QDEL_LIST_CONTENTS(stomach_contents)
|
||||
@@ -704,7 +704,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
|
||||
|
||||
else if(!(I.flags & ABSTRACT)) //can't throw abstract items
|
||||
thrown_thing = I
|
||||
unEquip(I, silent = TRUE)
|
||||
drop_item_to_ground(I, silent = TRUE)
|
||||
|
||||
if(HAS_TRAIT(src, TRAIT_PACIFISM) && I.throwforce)
|
||||
to_chat(src, "<span class='notice'>You set [I] down gently on the ground.</span>")
|
||||
@@ -733,25 +733,26 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
|
||||
/mob/living/carbon/get_restraining_item()
|
||||
return handcuffed
|
||||
|
||||
/mob/living/carbon/unEquip(obj/item/I, force, silent = FALSE) //THIS PROC DID NOT CALL ..()
|
||||
. = ..() //Sets the default return value to what the parent returns.
|
||||
if(!. || !I) //We don't want to set anything to null if the parent returned 0.
|
||||
/mob/living/carbon/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE)
|
||||
. = ..()
|
||||
|
||||
if(!. || !target) //We don't want to set anything to null if the parent returned 0.
|
||||
return
|
||||
|
||||
if(I == back)
|
||||
if(target == back)
|
||||
back = null
|
||||
update_inv_back()
|
||||
else if(I == wear_mask)
|
||||
else if(target == wear_mask)
|
||||
if(ishuman(src)) //If we don't do this hair won't be properly rebuilt.
|
||||
return
|
||||
wear_mask = null
|
||||
update_inv_wear_mask()
|
||||
else if(I == handcuffed)
|
||||
else if(target == handcuffed)
|
||||
handcuffed = null
|
||||
if(buckled && buckled.buckle_requires_restraints)
|
||||
unbuckle()
|
||||
update_handcuffed()
|
||||
else if(I == legcuffed)
|
||||
else if(target == legcuffed)
|
||||
legcuffed = null
|
||||
toggle_move_intent()
|
||||
update_inv_legcuffed()
|
||||
@@ -932,7 +933,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
|
||||
to_chat(src, "<span class='notice'>You get rid of [I]!</span>")
|
||||
if(I.security_lock)
|
||||
I.do_break()
|
||||
unEquip(I)
|
||||
drop_item_to_ground(I)
|
||||
remove_status_effect(STATUS_EFFECT_REMOVE_MUZZLE)
|
||||
|
||||
/mob/living/carbon/proc/cuff_resist(obj/item/restraints/restraints, break_cuffs)
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
to_chat(receiver, "<span class='warning'>[I] stays stuck to [giver]'s hand when you try to take it!</span>")
|
||||
return
|
||||
UnregisterSignal(I, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED)) // We don't want these triggering `cancel_give` at this point, since the give is successful.
|
||||
giver.unEquip(I)
|
||||
giver.drop_item_to_ground(I)
|
||||
receiver.put_in_hands(I)
|
||||
I.add_fingerprint(receiver)
|
||||
I.on_give(giver, receiver)
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
visible_message("<span class='notice'>[src] seems to have [p_their()] hands full!</span>")
|
||||
return
|
||||
visible_message("<span class='notice'>[src] drops [in_hand] and picks up [thing] instead!</span>")
|
||||
unEquip(in_hand)
|
||||
unequip(in_hand)
|
||||
in_hand.forceMove(old_loc)
|
||||
else
|
||||
visible_message("<span class='notice'>[src] picks up [thing]!</span>")
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
thing.throw_at(get_edge_target_turf(src, pick(GLOB.alldirs)), rand(1, 3), 5)
|
||||
|
||||
for(var/obj/item/I in get_equipped_items(include_pockets = TRUE))
|
||||
unEquip(I, TRUE)
|
||||
I.forceMove(get_turf(src))
|
||||
drop_item_to_ground(I, force = TRUE)
|
||||
if(!QDELETED(I)) // This is in case moving to the turf deletes the atom.
|
||||
I.throw_at(get_edge_target_turf(src, pick(GLOB.alldirs)), rand(1, 3), 5)
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@
|
||||
)
|
||||
if(cig.lit)
|
||||
to_chat(user, "<span class='userdanger'>The lit [cig] burns on the way down!")
|
||||
user.unEquip(cig)
|
||||
user.unequip(cig)
|
||||
qdel(cig)
|
||||
H.adjustFireLoss(5)
|
||||
return TRUE
|
||||
|
||||
@@ -67,42 +67,45 @@
|
||||
if(ITEM_SLOT_ACCESSORY)
|
||||
return TRUE
|
||||
|
||||
/mob/living/carbon/human/unEquip(obj/item/I, force, silent = FALSE)
|
||||
/mob/living/carbon/human/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE)
|
||||
. = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should.
|
||||
if(!. || !I)
|
||||
if(!. || !target)
|
||||
return
|
||||
|
||||
if(I == wear_suit)
|
||||
if(s_store)
|
||||
unEquip(s_store, 1) //It makes no sense for your suit storage to stay on you if you drop your suit.
|
||||
if(target == wear_suit)
|
||||
if(s_store && drop_inventory)
|
||||
// It makes no sense for your suit storage to stay on you if you drop your suit.
|
||||
drop_item_to_ground(s_store, force = TRUE)
|
||||
wear_suit = null
|
||||
if(I.flags_inv & HIDEJUMPSUIT)
|
||||
if(target.flags_inv & HIDEJUMPSUIT)
|
||||
update_inv_w_uniform()
|
||||
if(I.flags_inv & HIDESHOES)
|
||||
if(target.flags_inv & HIDESHOES)
|
||||
update_inv_shoes()
|
||||
if(I.flags_inv & HIDEGLOVES)
|
||||
if(target.flags_inv & HIDEGLOVES)
|
||||
update_inv_gloves()
|
||||
update_inv_wear_suit()
|
||||
else if(I == w_uniform)
|
||||
if(r_store)
|
||||
unEquip(r_store, 1) //Again, makes sense for pockets to drop.
|
||||
if(l_store)
|
||||
unEquip(l_store, 1)
|
||||
if(wear_id)
|
||||
unEquip(wear_id)
|
||||
if(belt && !(belt.flags_2 & ALLOW_BELT_NO_JUMPSUIT_2))
|
||||
unEquip(belt)
|
||||
else if(target == w_uniform)
|
||||
//Again, makes sense for pockets to drop.
|
||||
if(drop_inventory)
|
||||
if(r_store)
|
||||
drop_item_to_ground(r_store, force = TRUE)
|
||||
if(l_store)
|
||||
drop_item_to_ground(l_store, force = TRUE)
|
||||
if(wear_id)
|
||||
drop_item_to_ground(wear_id, force = TRUE)
|
||||
if(belt && !(belt.flags_2 & ALLOW_BELT_NO_JUMPSUIT_2))
|
||||
drop_item_to_ground(belt, force = TRUE)
|
||||
w_uniform = null
|
||||
update_inv_w_uniform()
|
||||
else if(I == gloves)
|
||||
else if(target == gloves)
|
||||
gloves = null
|
||||
update_inv_gloves()
|
||||
else if(I == neck)
|
||||
else if(target == neck)
|
||||
neck = null
|
||||
update_inv_neck()
|
||||
else if(I == glasses)
|
||||
else if(target == glasses)
|
||||
glasses = null
|
||||
var/obj/item/clothing/glasses/G = I
|
||||
var/obj/item/clothing/glasses/G = target
|
||||
if(G.tint)
|
||||
update_tint()
|
||||
if(G.prescription)
|
||||
@@ -111,71 +114,71 @@
|
||||
update_sight()
|
||||
update_inv_glasses()
|
||||
update_client_colour()
|
||||
else if(I == head)
|
||||
else if(target == head)
|
||||
head = null
|
||||
if(I.flags & BLOCKHAIR || I.flags & BLOCKHEADHAIR)
|
||||
if(target.flags & BLOCKHAIR || target.flags & BLOCKHEADHAIR)
|
||||
update_hair() //rebuild hair
|
||||
update_fhair()
|
||||
update_head_accessory()
|
||||
// Bandanas and paper hats go on the head but are not head clothing
|
||||
if(istype(I,/obj/item/clothing/head))
|
||||
var/obj/item/clothing/head/hat = I
|
||||
if(istype(target, /obj/item/clothing/head))
|
||||
var/obj/item/clothing/head/hat = target
|
||||
if(hat.vision_flags || hat.see_in_dark || !isnull(hat.lighting_alpha))
|
||||
update_sight()
|
||||
if(I.flags_inv & HIDEEARS)
|
||||
if(target.flags_inv & HIDEEARS)
|
||||
update_inv_ears()
|
||||
head_update(I)
|
||||
head_update(target)
|
||||
update_inv_head()
|
||||
update_misc_effects()
|
||||
else if(I == r_ear)
|
||||
else if(target == r_ear)
|
||||
r_ear = null
|
||||
update_inv_ears()
|
||||
else if(I == l_ear)
|
||||
else if(target == l_ear)
|
||||
l_ear = null
|
||||
update_inv_ears()
|
||||
else if(I == shoes)
|
||||
else if(target == shoes)
|
||||
shoes = null
|
||||
update_inv_shoes()
|
||||
else if(I == belt)
|
||||
else if(target == belt)
|
||||
belt = null
|
||||
update_inv_belt()
|
||||
else if(I == wear_mask)
|
||||
else if(target == wear_mask)
|
||||
wear_mask = null
|
||||
if(I.flags & BLOCKHAIR || I.flags & BLOCKHEADHAIR)
|
||||
if(target.flags & BLOCKHAIR || target.flags & BLOCKHEADHAIR)
|
||||
update_hair() //rebuild hair
|
||||
update_fhair()
|
||||
update_head_accessory()
|
||||
if(internal && !get_organ_slot("breathing_tube"))
|
||||
internal = null
|
||||
if(I.flags_inv & HIDEEARS)
|
||||
if(target.flags_inv & HIDEEARS)
|
||||
update_inv_ears()
|
||||
wear_mask_update(I, toggle_off = FALSE)
|
||||
wear_mask_update(target, toggle_off = FALSE)
|
||||
sec_hud_set_ID()
|
||||
update_misc_effects()
|
||||
update_inv_wear_mask()
|
||||
else if(I == wear_id)
|
||||
else if(target == wear_id)
|
||||
wear_id = null
|
||||
sec_hud_set_ID()
|
||||
update_inv_wear_id()
|
||||
else if(I == wear_pda)
|
||||
else if(target == wear_pda)
|
||||
wear_pda = null
|
||||
update_inv_wear_pda()
|
||||
else if(I == r_store)
|
||||
else if(target == r_store)
|
||||
r_store = null
|
||||
update_inv_pockets()
|
||||
else if(I == l_store)
|
||||
else if(target == l_store)
|
||||
l_store = null
|
||||
update_inv_pockets()
|
||||
else if(I == s_store)
|
||||
else if(target == s_store)
|
||||
s_store = null
|
||||
update_inv_s_store()
|
||||
else if(I == back)
|
||||
else if(target == back)
|
||||
back = null
|
||||
update_inv_back()
|
||||
else if(I == r_hand)
|
||||
else if(target == r_hand)
|
||||
r_hand = null
|
||||
update_inv_r_hand()
|
||||
else if(I == l_hand)
|
||||
else if(target == l_hand)
|
||||
l_hand = null
|
||||
update_inv_l_hand()
|
||||
update_action_buttons_icon()
|
||||
@@ -326,7 +329,7 @@
|
||||
update_inv_s_store()
|
||||
if(ITEM_SLOT_IN_BACKPACK)
|
||||
if(get_active_hand() == I)
|
||||
unEquip(I)
|
||||
drop_item_to_ground(I)
|
||||
if(ismodcontrol(back))
|
||||
var/obj/item/mod/control/C = back
|
||||
if(C.bag)
|
||||
|
||||
@@ -1453,7 +1453,7 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
|
||||
..()
|
||||
if(current_size >= STAGE_THREE)
|
||||
for(var/obj/item/hand in get_both_hands(src))
|
||||
if(prob(current_size * 5) && hand.w_class >= ((11-current_size)/2) && unEquip(hand))
|
||||
if(prob(current_size * 5) && hand.w_class >= ((11-current_size)/2) && drop_item_to_ground(hand))
|
||||
step_towards(hand, src)
|
||||
to_chat(src, "<span class='warning'>\The [S] pulls \the [hand] from your grip!</span>")
|
||||
rad_act(current_size * 3)
|
||||
|
||||
@@ -92,12 +92,12 @@
|
||||
if((E.body_part == HAND_LEFT) || (E.body_part == ARM_LEFT))
|
||||
if(!l_hand)
|
||||
continue
|
||||
if(!unEquip(l_hand))
|
||||
if(!drop_item_to_ground(l_hand))
|
||||
continue
|
||||
else
|
||||
if(!r_hand)
|
||||
continue
|
||||
if(!unEquip(r_hand))
|
||||
if(!drop_item_to_ground(r_hand))
|
||||
continue
|
||||
|
||||
if(!E.properly_attached)
|
||||
@@ -116,12 +116,12 @@
|
||||
if((E.body_part == HAND_LEFT) || (E.body_part == ARM_LEFT))
|
||||
if(!l_hand)
|
||||
continue
|
||||
if(!unEquip(l_hand))
|
||||
if(!drop_item_to_ground(l_hand))
|
||||
continue
|
||||
else
|
||||
if(!r_hand)
|
||||
continue
|
||||
if(!unEquip(r_hand))
|
||||
if(!drop_item_to_ground(r_hand))
|
||||
continue
|
||||
|
||||
custom_emote(EMOTE_VISIBLE, "drops what [p_they()] [p_were()] holding, [p_their()] [E.name] malfunctioning!")
|
||||
|
||||
@@ -636,7 +636,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
|
||||
// Automatically drop anything in store / id / belt if you're not wearing a uniform. //CHECK IF NECESARRY
|
||||
for(var/obj/item/thing in uniform_slots) // whoever made this
|
||||
if(thing) // you're a piece of fucking garbage
|
||||
unEquip(thing) // why the fuck would you goddamn do this motherfucking shit
|
||||
drop_item_to_ground(thing) // why the fuck would you goddamn do this motherfucking shit
|
||||
if(client) // INVENTORY CODE IN FUCKING ICON CODE
|
||||
client.screen -= thing // WHAT THE FUCKING FUCK BAY GODDAMNIT
|
||||
// **I FUCKING HATE YOU AAAAAAAAAA**
|
||||
|
||||
@@ -370,7 +370,7 @@
|
||||
continue
|
||||
var/obj/item/thing = H.get_item_by_slot(slot_id)
|
||||
if(thing && (!thing.species_exception || !is_type_in_list(src, thing.species_exception)))
|
||||
H.unEquip(thing)
|
||||
H.drop_item_to_ground(thing)
|
||||
if(H.hud_used)
|
||||
H.hud_used.update_locked_slots()
|
||||
H.ventcrawler = ventcrawler
|
||||
|
||||
@@ -372,7 +372,7 @@
|
||||
/datum/species/golem/sand/handle_death(gibbed, mob/living/carbon/human/H)
|
||||
H.visible_message("<span class='danger'>[H] turns into a pile of sand!</span>")
|
||||
for(var/obj/item/W in H)
|
||||
H.unEquip(W)
|
||||
H.drop_item_to_ground(W)
|
||||
for(var/i=1, i <= rand(3, 5), i++)
|
||||
new /obj/item/stack/ore/glass(get_turf(H))
|
||||
qdel(H)
|
||||
@@ -406,7 +406,7 @@
|
||||
playsound(H, "shatter", 70, 1)
|
||||
H.visible_message("<span class='danger'>[H] shatters!</span>")
|
||||
for(var/obj/item/W in H)
|
||||
H.unEquip(W)
|
||||
H.drop_item_to_ground(W)
|
||||
for(var/i=1, i <= rand(3, 5), i++)
|
||||
new /obj/item/shard(get_turf(H))
|
||||
qdel(H)
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
|
||||
/datum/species/plasmaman/after_equip_job(datum/job/J, mob/living/carbon/human/H)
|
||||
if(!H.mind || !H.mind.assigned_role || H.mind.assigned_role != "Clown" && H.mind.assigned_role != "Mime")
|
||||
H.unEquip(H.wear_mask)
|
||||
H.drop_item_to_ground(H.wear_mask)
|
||||
|
||||
H.equip_or_collect(new /obj/item/clothing/mask/breath(H), ITEM_SLOT_MASK)
|
||||
var/tank_pref = H.client && H.client.prefs ? H.client.prefs.active_character.speciesprefs : null
|
||||
@@ -202,7 +202,7 @@
|
||||
else
|
||||
internal_tank = new /obj/item/tank/internals/plasmaman/belt/full(H)
|
||||
if(!H.equip_to_appropriate_slot(internal_tank) && !H.put_in_any_hand_if_possible(internal_tank))
|
||||
H.unEquip(H.l_hand)
|
||||
H.drop_item_to_ground(H.l_hand)
|
||||
H.equip_or_collect(internal_tank, ITEM_SLOT_LEFT_HAND)
|
||||
to_chat(H, "<span class='boldannounceooc'>Could not find an empty slot for internals! Please report this as a bug.</span>")
|
||||
stack_trace("Failed to equip plasmaman with a tank, with the job [J.type]")
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
|
||||
/datum/species/vox/after_equip_job(datum/job/J, mob/living/carbon/human/H)
|
||||
if(!H.mind || !H.mind.assigned_role || H.mind.assigned_role != "Clown" && H.mind.assigned_role != "Mime")
|
||||
H.unEquip(H.wear_mask)
|
||||
H.drop_item_to_ground(H.wear_mask)
|
||||
|
||||
H.equip_or_collect(new /obj/item/clothing/mask/breath/vox/respirator(H), ITEM_SLOT_MASK)
|
||||
var/tank_pref = H.client && H.client.prefs ? H.client.prefs.active_character.speciesprefs : null
|
||||
@@ -90,7 +90,7 @@
|
||||
internal_tank = new /obj/item/tank/internals/emergency_oxygen/double/vox(H)
|
||||
if(!H.equip_to_appropriate_slot(internal_tank))
|
||||
if(!H.put_in_any_hand_if_possible(internal_tank))
|
||||
H.unEquip(H.l_hand)
|
||||
H.drop_item_to_ground(H.l_hand)
|
||||
H.equip_or_collect(internal_tank, ITEM_SLOT_LEFT_HAND)
|
||||
to_chat(H, "<span class='boldannounceooc'>Could not find an empty slot for internals! Please report this as a bug</span>")
|
||||
H.internal = internal_tank
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/datum/superheroes/proc/equip(mob/living/carbon/human/H)
|
||||
H.rename_character(H.real_name, name)
|
||||
for(var/obj/item/W in H.get_all_slots())
|
||||
H.unEquip(W)
|
||||
H.drop_item_to_ground(W)
|
||||
H.equip_to_slot_or_del(new /obj/item/radio/headset(H), ITEM_SLOT_LEFT_EAR)
|
||||
|
||||
/datum/superheroes/proc/fixflags(mob/living/carbon/human/H)
|
||||
@@ -222,7 +222,7 @@
|
||||
// No `update_dna=0` here because the character is being over-written
|
||||
target.change_eye_color(1,1,1)
|
||||
for(var/obj/item/W in target.get_all_slots())
|
||||
target.unEquip(W)
|
||||
target.drop_item_to_ground(W)
|
||||
target.rename_character(target.real_name, "Generic Henchman ([rand(1, 1000)])")
|
||||
target.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey/greytide(target), ITEM_SLOT_JUMPSUIT)
|
||||
target.equip_to_slot_or_del(new /obj/item/clothing/shoes/black/greytide(target), ITEM_SLOT_SHOES)
|
||||
|
||||
@@ -481,12 +481,12 @@
|
||||
var/mob/living/carbon/C = src
|
||||
|
||||
if(C.handcuffed && !initial(C.handcuffed))
|
||||
C.unEquip(C.handcuffed)
|
||||
C.drop_item_to_ground(C.handcuffed)
|
||||
C.handcuffed = initial(C.handcuffed)
|
||||
C.update_handcuffed()
|
||||
|
||||
if(C.legcuffed && !initial(C.legcuffed))
|
||||
C.unEquip(C.legcuffed)
|
||||
C.drop_item_to_ground(C.legcuffed)
|
||||
C.legcuffed = initial(C.legcuffed)
|
||||
C.update_inv_legcuffed()
|
||||
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
/mob/living/silicon/pai/proc/force_fold_out()
|
||||
if(ismob(card.loc))
|
||||
var/mob/holder = card.loc
|
||||
holder.unEquip(card)
|
||||
holder.drop_item_to_ground(card)
|
||||
else if(istype(card.loc, /obj/item/pda))
|
||||
var/obj/item/pda/holder = card.loc
|
||||
holder.pai = null
|
||||
@@ -343,7 +343,7 @@
|
||||
if(istype(H))
|
||||
var/mob/living/M = H.loc
|
||||
if(istype(M))
|
||||
M.unEquip(H)
|
||||
M.drop_item_to_ground(H)
|
||||
H.loc = get_turf(src)
|
||||
loc = get_turf(H)
|
||||
|
||||
|
||||
@@ -239,9 +239,9 @@
|
||||
while(slot_start != slot_num) //If we wrap around without finding any free slots, just give up.
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/unEquip(obj/item/I, force, silent = FALSE)
|
||||
if(I == module_active)
|
||||
uneq_active(I)
|
||||
/mob/living/silicon/robot/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE)
|
||||
if(target == module_active)
|
||||
uneq_active(target)
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/robot/proc/update_module_icon()
|
||||
|
||||
@@ -539,7 +539,7 @@
|
||||
to_chat(user, "<span class='warning'>[item_to_add] does not fit on the head of [src]!</span>")
|
||||
return FALSE
|
||||
|
||||
if(!user.unEquip(item_to_add))
|
||||
if(!user.transfer_item_to(item_to_add, src))
|
||||
to_chat(user, "<span class='warning'>[item_to_add] is stuck to your hand, you cannot put it on [src]!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -547,7 +547,6 @@
|
||||
"<span class='notice'>[user] puts [item_to_add] on [real_name].</span>",
|
||||
"<span class='notice'>You put [item_to_add] on [real_name].</span>"
|
||||
)
|
||||
item_to_add.forceMove(src)
|
||||
silicon_hat = item_to_add
|
||||
update_icons()
|
||||
|
||||
@@ -578,7 +577,7 @@
|
||||
|
||||
/mob/living/silicon/proc/drop_hat()
|
||||
if(silicon_hat)
|
||||
unEquip(silicon_hat)
|
||||
drop_item_to_ground(silicon_hat)
|
||||
null_hat()
|
||||
update_icons()
|
||||
return TRUE
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
/obj/item/bucket_sensor/attackby__legacy__attackchain(obj/item/W, mob/user as mob, params)
|
||||
..()
|
||||
if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm))
|
||||
if(!user.unEquip(W))
|
||||
if(!user.unequip(W))
|
||||
return
|
||||
qdel(W)
|
||||
var/turf/T = get_turf(loc)
|
||||
@@ -25,7 +25,7 @@
|
||||
A.name = created_name
|
||||
A.robot_arm = W.type
|
||||
to_chat(user, "<span class='notice'>You add the robot arm to the bucket and sensor assembly. Beep boop!</span>")
|
||||
user.unEquip(src, 1)
|
||||
user.unequip(src, force = TRUE)
|
||||
qdel(src)
|
||||
|
||||
else if(is_pen(W))
|
||||
@@ -64,7 +64,7 @@
|
||||
switch(build_step)
|
||||
if(0,1)
|
||||
if(istype(W, /obj/item/robot_parts/l_leg) || istype(W, /obj/item/robot_parts/r_leg))
|
||||
if(!user.unEquip(W))
|
||||
if(!user.unequip(W))
|
||||
return
|
||||
qdel(W)
|
||||
build_step++
|
||||
@@ -78,7 +78,7 @@
|
||||
else if(istype(W, /obj/item/clothing/suit/bluetag))
|
||||
newcolor = "b"
|
||||
if(newcolor || istype(W, /obj/item/clothing/suit/armor/vest))
|
||||
if(!user.unEquip(W))
|
||||
if(!user.unequip(W))
|
||||
return
|
||||
lasercolor = newcolor
|
||||
qdel(W)
|
||||
@@ -105,7 +105,7 @@
|
||||
if(!istype(W, /obj/item/clothing/head/helmet))
|
||||
return
|
||||
|
||||
if(!user.unEquip(W))
|
||||
if(!user.unequip(W))
|
||||
return
|
||||
qdel(W)
|
||||
build_step++
|
||||
@@ -114,7 +114,7 @@
|
||||
|
||||
if(5)
|
||||
if(isprox(W))
|
||||
if(!user.unEquip(W))
|
||||
if(!user.unequip(W))
|
||||
return
|
||||
qdel(W)
|
||||
build_step++
|
||||
@@ -153,7 +153,7 @@
|
||||
new_name = "disabler ED-209 assembly"
|
||||
else
|
||||
return
|
||||
if(!user.unEquip(W))
|
||||
if(!user.unequip(W))
|
||||
return
|
||||
build_step++
|
||||
to_chat(user, "<span class='notice'>You add [W] to [src].</span>")
|
||||
@@ -166,14 +166,14 @@
|
||||
|
||||
if(9)
|
||||
if(istype(W, /obj/item/stock_parts/cell))
|
||||
if(!user.unEquip(W))
|
||||
if(!user.unequip(W))
|
||||
return
|
||||
build_step++
|
||||
to_chat(user, "<span class='notice'>You complete the ED-209.</span>")
|
||||
var/turf/T = get_turf(src)
|
||||
new /mob/living/simple_animal/bot/ed209(T,created_name,lasercolor)
|
||||
qdel(W)
|
||||
user.unEquip(src, 1)
|
||||
user.unequip(src, force = TRUE)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/ed209_assembly/screwdriver_act(mob/living/user, obj/item/I)
|
||||
@@ -280,7 +280,7 @@
|
||||
B.update_icon(UPDATE_ICON_STATE)
|
||||
user.put_in_hands(B)
|
||||
to_chat(user, "<span class='notice'>You add the tiles into the empty toolbox. They protrude from the top.</span>")
|
||||
user.unEquip(src, 1)
|
||||
user.unequip(src, force = TRUE)
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need 10 floor tiles to start building a floorbot.</span>")
|
||||
@@ -299,7 +299,7 @@
|
||||
B.update_icon(UPDATE_ICON_STATE)
|
||||
user.put_in_hands(B)
|
||||
to_chat(user, "<span class='notice'>You add the sensor to the toolbox and tiles.</span>")
|
||||
user.unEquip(src, 1)
|
||||
user.unequip(src, force = TRUE)
|
||||
qdel(src)
|
||||
|
||||
else if(is_pen(W))
|
||||
@@ -321,7 +321,7 @@
|
||||
A.name = created_name
|
||||
A.robot_arm = W.type
|
||||
to_chat(user, "<span class='notice'>You add the robot arm to the odd looking toolbox assembly. Boop beep!</span>")
|
||||
user.unEquip(src, 1)
|
||||
user.unequip(src, force = TRUE)
|
||||
qdel(src)
|
||||
|
||||
//Medbot Assembly
|
||||
@@ -349,7 +349,7 @@
|
||||
qdel(I)
|
||||
user.put_in_hands(A)
|
||||
to_chat(user, "<span class='notice'>You add the robot arm to the first aid kit.</span>")
|
||||
user.unEquip(src, 1)
|
||||
user.unequip(src, force = TRUE)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/firstaid_arm_assembly
|
||||
@@ -423,7 +423,7 @@
|
||||
S.robot_arm = robot_arm
|
||||
else
|
||||
new /mob/living/simple_animal/bot/medbot/syndicate(T) //Syndicate medibots are a special case that have so many unique vars on them, it's not worth passing them through construction phases
|
||||
user.unEquip(src, 1)
|
||||
user.unequip(src, force = TRUE)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/firstaid_arm_assembly/update_name()
|
||||
@@ -455,7 +455,7 @@
|
||||
var/obj/item/secbot_assembly/A = new /obj/item/secbot_assembly
|
||||
user.put_in_hands(A)
|
||||
to_chat(user, "<span class='notice'>You add the signaler to the helmet.</span>")
|
||||
user.unEquip(src, 1)
|
||||
user.unequip(src, force = TRUE)
|
||||
qdel(src)
|
||||
|
||||
|
||||
@@ -470,14 +470,14 @@
|
||||
to_chat(user, "<span class='notice'>You weld the hole in [src] shut!</span>")
|
||||
|
||||
else if(isprox(I) && (build_step == 1))
|
||||
if(!user.unEquip(I))
|
||||
if(!user.unequip(I))
|
||||
return
|
||||
build_step++
|
||||
to_chat(user, "<span class='notice'>You add the prox sensor to [src]!</span>")
|
||||
qdel(I)
|
||||
|
||||
else if(((istype(I, /obj/item/robot_parts/l_arm)) || (istype(I, /obj/item/robot_parts/r_arm))) && (build_step == 2))
|
||||
if(!user.unEquip(I))
|
||||
if(!user.unequip(I))
|
||||
return
|
||||
build_step++
|
||||
to_chat(user, "<span class='notice'>You add the robot arm to [src]!</span>")
|
||||
@@ -485,7 +485,7 @@
|
||||
qdel(I)
|
||||
|
||||
else if((istype(I, /obj/item/melee/baton)) && (build_step >= 3))
|
||||
if(!user.unEquip(I))
|
||||
if(!user.unequip(I))
|
||||
return
|
||||
build_step++
|
||||
to_chat(user, "<span class='notice'>You complete the Securitron! Beep boop.</span>")
|
||||
@@ -509,7 +509,7 @@
|
||||
var/obj/item/griefsky_assembly/A = new /obj/item/griefsky_assembly(get_turf(src))
|
||||
user.put_in_hands(A)
|
||||
to_chat(user, "<span class='notice'>You adjust the arm slots for extra weapons!</span>")
|
||||
user.unEquip(src, 1)
|
||||
user.unequip(src, force = TRUE)
|
||||
qdel(src)
|
||||
|
||||
update_appearance(UPDATE_NAME|UPDATE_OVERLAYS)
|
||||
@@ -567,14 +567,14 @@
|
||||
/obj/item/griefsky_assembly/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if((istype(I, /obj/item/melee/energy/sword)) && (build_step < 3))
|
||||
if(!user.unEquip(I))
|
||||
if(!user.unequip(I))
|
||||
return
|
||||
build_step++
|
||||
to_chat(user, "<span class='notice'>You add an energy sword to [src]!.</span>")
|
||||
qdel(I)
|
||||
|
||||
else if((istype(I, /obj/item/melee/energy/sword)) && (build_step == 3))
|
||||
if(!user.unEquip(I))
|
||||
if(!user.unequip(I))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You complete General Griefsky!.</span>")
|
||||
new /mob/living/simple_animal/bot/secbot/griefsky(get_turf(src))
|
||||
@@ -582,14 +582,14 @@
|
||||
qdel(src)
|
||||
|
||||
else if((istype(I, /obj/item/toy/sword)) && (toy_step < 3))
|
||||
if(!user.unEquip(I))
|
||||
if(!user.unequip(I))
|
||||
return
|
||||
toy_step++
|
||||
to_chat(user, "<span class='notice'>You add a toy sword to [src]!.</span>")
|
||||
qdel(I)
|
||||
|
||||
else if((istype(I, /obj/item/toy/sword)) && (toy_step == 3))
|
||||
if(!user.unEquip(I))
|
||||
if(!user.unequip(I))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You complete Genewul Giftskee!.</span>")
|
||||
new /mob/living/simple_animal/bot/secbot/griefsky/toy(get_turf(src))
|
||||
@@ -626,7 +626,7 @@
|
||||
qdel(W)
|
||||
user.put_in_hands(A)
|
||||
to_chat(user, "<span class='notice'>You add the robot arm to the honkbot.</span>")
|
||||
user.unEquip(src, 1)
|
||||
user.unequip(src, force = TRUE)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/honkbot_arm_assembly
|
||||
@@ -644,21 +644,21 @@
|
||||
..()
|
||||
if(build_step == 0)
|
||||
if(istype(W, /obj/item/assembly/prox_sensor))
|
||||
if(!user.unEquip(W))
|
||||
if(!user.unequip(W))
|
||||
return
|
||||
build_step++
|
||||
to_chat(user, "<span class='notice'>You add the proximity sensor to [src].</span>")
|
||||
qdel(W)
|
||||
else if(build_step == 1)
|
||||
if(istype(W, /obj/item/bikehorn))
|
||||
if(!user.unEquip(W))
|
||||
if(!user.unequip(W))
|
||||
return
|
||||
build_step++
|
||||
to_chat(user, "<span class='notice'>You add the bikehorn to [src]! Honk!</span>")
|
||||
qdel(W)
|
||||
else if(build_step == 2)
|
||||
if(istype(W, /obj/item/instrument/trombone))
|
||||
if(!user.unEquip(W))
|
||||
if(!user.unequip(W))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You add the trombone to [src]! Heeeenk!</span>")
|
||||
qdel(W)
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
ADD_TRAIT(adult.mind, TRAIT_XENOBIO_SPAWNED_HUMAN, ROUNDSTART_TRAIT)
|
||||
|
||||
for(var/obj/item/W in contents)
|
||||
unEquip(W)
|
||||
drop_item_to_ground(W)
|
||||
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
return
|
||||
return
|
||||
|
||||
if(user && !user.unEquip(item_to_add))
|
||||
if(user && !user.drop_item_to_ground(item_to_add))
|
||||
to_chat(user, "<span class='warning'>\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s head!</span>")
|
||||
return 0
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
mind.transfer_to(C)
|
||||
if(pcollar)
|
||||
var/the_collar = pcollar
|
||||
unEquip(pcollar)
|
||||
drop_item_to_ground(pcollar)
|
||||
C.add_collar(the_collar)
|
||||
qdel(src)
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
adult.real_name = adult.dna.species.get_random_name()
|
||||
adult.name = adult.real_name
|
||||
for(var/obj/item/W in contents)
|
||||
unEquip(W)
|
||||
drop_item_to_ground(W)
|
||||
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
@@ -470,7 +470,7 @@ Difficulty: Hard
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/hierophant/devour(mob/living/L)
|
||||
for(var/obj/item/W in L)
|
||||
if(!L.unEquip(W))
|
||||
if(!L.drop_item_to_ground(W))
|
||||
qdel(W)
|
||||
visible_message("<span class='hierophant_warning'>\"[pick(kill_phrases)]\"</span>")
|
||||
visible_message("<span class='hierophant_warning'>[src] annihilates [L]!</span>","<span class='userdanger'>You annihilate [L], restoring your health!</span>")
|
||||
|
||||
@@ -582,7 +582,7 @@
|
||||
if(C.r_hand && C.r_hand.w_class <= WEIGHT_CLASS_SMALL)
|
||||
stolen_item = C.r_hand
|
||||
|
||||
if(stolen_item && C.unEquip(stolen_item))
|
||||
if(stolen_item && C.drop_item_to_ground(stolen_item))
|
||||
try_grab_item(stolen_item)
|
||||
visible_message("<span class='notice'>[src] grabs [held_item] out of [C]'s hand!</span>", "<span class='notice'>You snag [held_item] out of [C]'s hand!</span>", "You hear the sounds of wings flapping furiously.")
|
||||
return held_item
|
||||
|
||||
@@ -504,12 +504,12 @@
|
||||
if(ITEM_SLOT_COLLAR)
|
||||
add_collar(W)
|
||||
|
||||
/mob/living/simple_animal/unEquip(obj/item/I, force, silent = FALSE)
|
||||
/mob/living/simple_animal/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE)
|
||||
. = ..()
|
||||
if(!. || !I)
|
||||
if(!. || !target)
|
||||
return
|
||||
|
||||
if(I == pcollar)
|
||||
if(target == pcollar)
|
||||
pcollar = null
|
||||
regenerate_icons()
|
||||
|
||||
@@ -593,7 +593,7 @@
|
||||
/mob/living/simple_animal/proc/add_collar(obj/item/petcollar/P, mob/user)
|
||||
if(!istype(P) || QDELETED(P) || pcollar)
|
||||
return
|
||||
if(user && !user.unEquip(P))
|
||||
if(user && !user.drop_item_to_ground(P))
|
||||
return
|
||||
P.forceMove(src)
|
||||
P.equipped(src)
|
||||
@@ -611,7 +611,7 @@
|
||||
|
||||
var/obj/old_collar = pcollar
|
||||
|
||||
unEquip(pcollar)
|
||||
drop_item_to_ground(pcollar)
|
||||
|
||||
if(user)
|
||||
user.put_in_hands(old_collar)
|
||||
|
||||
@@ -266,7 +266,7 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/slime/unEquip(obj/item/I, force, silent = FALSE)
|
||||
/mob/living/simple_animal/slime/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE)
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/slime/start_pulling(atom/movable/AM, state, force = pull_force, show_message = FALSE)
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
var/mob/M = src.loc //Get our mob holder (if any).
|
||||
|
||||
if(istype(M))
|
||||
M.unEquip(src)
|
||||
M.drop_item_to_ground(src)
|
||||
to_chat(M, "[src] wriggles out of your grip!")
|
||||
to_chat(L, "You wriggle out of [M]'s grip!")
|
||||
else if(isitem(loc))
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
if(notransform)
|
||||
return
|
||||
for(var/obj/item/W in src)
|
||||
unEquip(W)
|
||||
drop_item_to_ground(W)
|
||||
notransform = TRUE
|
||||
icon = null
|
||||
invisibility = 101
|
||||
@@ -56,7 +56,7 @@
|
||||
if(notransform)
|
||||
return
|
||||
for(var/obj/item/W in src)
|
||||
unEquip(W)
|
||||
drop_item_to_ground(W)
|
||||
|
||||
notransform = TRUE
|
||||
icon = null
|
||||
@@ -124,7 +124,7 @@
|
||||
if(notransform)
|
||||
return
|
||||
for(var/obj/item/W in src)
|
||||
unEquip(W)
|
||||
drop_item_to_ground(W)
|
||||
regenerate_icons()
|
||||
notransform = TRUE
|
||||
icon = null
|
||||
@@ -154,7 +154,7 @@
|
||||
return
|
||||
notransform = TRUE
|
||||
for(var/obj/item/I in src)
|
||||
unEquip(I)
|
||||
drop_item_to_ground(I)
|
||||
regenerate_icons()
|
||||
icon = null
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
@@ -185,7 +185,7 @@
|
||||
if(notransform)
|
||||
return
|
||||
for(var/obj/item/W in src)
|
||||
unEquip(W)
|
||||
drop_item_to_ground(W)
|
||||
regenerate_icons()
|
||||
notransform = TRUE
|
||||
icon = null
|
||||
@@ -211,7 +211,7 @@
|
||||
if(notransform)
|
||||
return
|
||||
for(var/obj/item/W in src)
|
||||
unEquip(W)
|
||||
drop_item_to_ground(W)
|
||||
|
||||
regenerate_icons()
|
||||
notransform = TRUE
|
||||
@@ -250,7 +250,7 @@
|
||||
if(notransform)
|
||||
return
|
||||
for(var/obj/item/W in src)
|
||||
unEquip(W)
|
||||
drop_item_to_ground(W)
|
||||
regenerate_icons()
|
||||
notransform = TRUE
|
||||
icon = null
|
||||
@@ -279,7 +279,7 @@
|
||||
return
|
||||
|
||||
for(var/obj/item/W in get_all_slots())
|
||||
unEquip(W)
|
||||
drop_item_to_ground(W)
|
||||
|
||||
regenerate_icons()
|
||||
notransform = TRUE
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
if(part in overslotting_parts)
|
||||
var/obj/item/overslot = wearer.get_item_by_slot(part.slot_flags)
|
||||
if(overslot)
|
||||
wearer.unEquip(overslot, TRUE)
|
||||
wearer.drop_item_to_ground(overslot, force = TRUE)
|
||||
overslotting_parts[part] = overslot
|
||||
overslot.forceMove(part)
|
||||
RegisterSignal(part, COMSIG_ATOM_EXITED, PROC_REF(on_overslot_exit))
|
||||
@@ -104,8 +104,7 @@
|
||||
to_chat(user, "<span class='warning'>You already have retracted there!</span>")
|
||||
playsound(src, 'sound/machines/scanbuzz.ogg', 25, TRUE, SILENCED_SOUND_EXTRARANGE)
|
||||
part.flags &= ~NODROP
|
||||
wearer.unEquip(part, TRUE)
|
||||
part.forceMove(src)
|
||||
wearer.transfer_item_to(part, src, force = TRUE)
|
||||
if(overslotting_parts[part])
|
||||
UnregisterSignal(part, COMSIG_ATOM_EXITED)
|
||||
var/obj/item/overslot = overslotting_parts[part]
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
to_chat(wearer, "<span class='warning'>Retract parts first!</span>")
|
||||
playsound(src, 'sound/machines/scanbuzz.ogg', 25, FALSE, SILENCED_SOUND_EXTRARANGE)
|
||||
return
|
||||
if(!M.unEquip(src, silent = TRUE))
|
||||
if(!M.unequip(src, force = TRUE))
|
||||
return
|
||||
M.put_in_active_hand(src)
|
||||
else
|
||||
|
||||
@@ -148,8 +148,7 @@
|
||||
to_chat(mod.wearer, "<span class='notice'>[src] deactivated.</span>")
|
||||
|
||||
if(device)
|
||||
mod.wearer.unEquip(device, 1)
|
||||
device.forceMove(src)
|
||||
mod.wearer.transfer_item_to(device, src, force = TRUE)
|
||||
UnregisterSignal(mod.wearer, COMSIG_ATOM_EXITED)
|
||||
UnregisterSignal(mod.wearer, COMSIG_MOB_WILLINGLY_DROP)
|
||||
else
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
if(!ishuman(user))
|
||||
return
|
||||
var/mob/living/carbon/human/human_user = user
|
||||
if(human_user.get_item_by_slot(ITEM_SLOT_BACK) && !human_user.unEquip(human_user.get_item_by_slot(ITEM_SLOT_BACK)))
|
||||
if(human_user.get_item_by_slot(ITEM_SLOT_BACK) && !human_user.drop_item_to_ground(human_user.get_item_by_slot(ITEM_SLOT_BACK)))
|
||||
return
|
||||
if(!human_user.equip_to_slot_if_possible(mod, ITEM_SLOT_BACK, disable_warning = TRUE))
|
||||
return
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
return
|
||||
holstered = holding
|
||||
mod.wearer.visible_message("<span class='notice'>[mod.wearer] holsters [holstered].</span>", "<span class='notice'>You holster [holstered].</span>")
|
||||
mod.wearer.unEquip(mod.wearer.get_active_hand())
|
||||
mod.wearer.unequip(mod.wearer.get_active_hand())
|
||||
holstered.forceMove(src)
|
||||
else if(mod.wearer.put_in_active_hand(holstered))
|
||||
mod.wearer.visible_message("<span class='warning'>[mod.wearer] draws [msg], ready to shoot!</span>", \
|
||||
|
||||
@@ -386,7 +386,7 @@ GLOBAL_LIST_EMPTY(allNewscasters)
|
||||
return
|
||||
if(ishuman(usr))
|
||||
var/obj/item/photo/P = usr.get_active_hand()
|
||||
if(istype(P) && usr.unEquip(P))
|
||||
if(istype(P) && usr.drop_item_to_ground(P))
|
||||
photo = P
|
||||
P.forceMove(src)
|
||||
usr.visible_message("<span class='notice'>[usr] inserts [P] into [src]'s photo slot.</span>",\
|
||||
|
||||
@@ -52,8 +52,7 @@
|
||||
if(!is_pen(P))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You slide [P] into [src].</span>")
|
||||
user.unEquip(P)
|
||||
P.forceMove(src)
|
||||
user.transfer_item_to(P, src)
|
||||
containedpen = P
|
||||
else
|
||||
if(!containedpen)
|
||||
@@ -96,7 +95,7 @@
|
||||
|
||||
/obj/item/clipboard/attackby__legacy__attackchain(obj/item/W, mob/user)
|
||||
if(isPaperwork(W)) //If it's a photo, paper bundle, or piece of paper, place it on the clipboard.
|
||||
user.unEquip(W)
|
||||
user.unequip(W)
|
||||
W.forceMove(src)
|
||||
to_chat(user, "<span class='notice'>You clip [W] onto [src].</span>")
|
||||
playsound(loc, "pageturn", 50, 1)
|
||||
|
||||
@@ -44,8 +44,7 @@
|
||||
to_chat(user, "<span class='notice'>There's already a signaller attached!</span>")
|
||||
return
|
||||
var/obj/item/assembly/signaler/signal = I
|
||||
user.unEquip(signal)
|
||||
signal.forceMove(src)
|
||||
user.transfer_item_to(signal, src)
|
||||
attached_signaler = signal
|
||||
if(signal.receiving)
|
||||
RegisterSignal(attached_signaler, COMSIG_ASSEMBLY_PULSED, PROC_REF(on_signal))
|
||||
@@ -83,7 +82,7 @@
|
||||
|
||||
if(over_object == M)
|
||||
if(!remove_item_from_storage(M))
|
||||
M.unEquip(src)
|
||||
M.unequip(src)
|
||||
M.put_in_hands(src)
|
||||
anchored = FALSE
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
/obj/structure/filingcabinet/proc/insert(obj/item/O, mob/user)
|
||||
if(!is_type_in_list(O, accepted_items))
|
||||
return
|
||||
if(!user.unEquip(O))
|
||||
if(!user.unequip(O))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You put [O.name] in [src].</span>")
|
||||
O.loc = src
|
||||
|
||||
@@ -415,38 +415,38 @@
|
||||
B.name = name
|
||||
else if(P.name != "paper" && P.name != "photo")
|
||||
B.name = P.name
|
||||
user.unEquip(P)
|
||||
user.drop_item_to_ground(P)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/h_user = user
|
||||
if(h_user.r_hand == src)
|
||||
h_user.unEquip(src)
|
||||
h_user.unequip(src)
|
||||
h_user.put_in_r_hand(B)
|
||||
else if(h_user.l_hand == src)
|
||||
h_user.unEquip(src)
|
||||
h_user.unequip(src)
|
||||
h_user.put_in_l_hand(B)
|
||||
else if(h_user.l_store == src)
|
||||
h_user.unEquip(src)
|
||||
h_user.unequip(src)
|
||||
B.loc = h_user
|
||||
B.layer = ABOVE_HUD_LAYER
|
||||
B.plane = ABOVE_HUD_PLANE
|
||||
h_user.l_store = B
|
||||
h_user.update_inv_pockets()
|
||||
else if(h_user.r_store == src)
|
||||
h_user.unEquip(src)
|
||||
h_user.unequip(src)
|
||||
B.loc = h_user
|
||||
B.layer = ABOVE_HUD_LAYER
|
||||
B.plane = ABOVE_HUD_PLANE
|
||||
h_user.r_store = B
|
||||
h_user.update_inv_pockets()
|
||||
else if(h_user.head == src)
|
||||
h_user.unEquip(src)
|
||||
h_user.unequip(src)
|
||||
h_user.put_in_hands(B)
|
||||
else if(!isturf(src.loc))
|
||||
src.loc = get_turf(h_user)
|
||||
if(h_user.client) h_user.client.screen -= src
|
||||
h_user.put_in_hands(B)
|
||||
to_chat(user, "<span class='notice'>You clip [P] to [(src.name == "paper") ? "the paper" : src.name].</span>")
|
||||
src.loc = B
|
||||
forceMove(B)
|
||||
P.loc = B
|
||||
B.amount++
|
||||
B.update_icon()
|
||||
@@ -481,7 +481,7 @@
|
||||
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10))
|
||||
user.visible_message("<span class='warning'>[user] accidentally ignites [user.p_themselves()]!</span>", \
|
||||
"<span class='userdanger'>You miss the paper and accidentally light yourself on fire!</span>")
|
||||
user.unEquip(P)
|
||||
user.drop_item_to_ground(P)
|
||||
user.adjust_fire_stacks(1)
|
||||
user.IgniteMob()
|
||||
return
|
||||
@@ -489,7 +489,7 @@
|
||||
if(!Adjacent(user)) //to prevent issues as a result of telepathically lighting a paper
|
||||
return
|
||||
|
||||
user.unEquip(src)
|
||||
user.drop_item_to_ground(src)
|
||||
user.visible_message("<span class='danger'>[user] lights [src] ablaze with [P]!</span>", "<span class='danger'>You light [src] on fire!</span>")
|
||||
fire_act()
|
||||
|
||||
|
||||
@@ -40,8 +40,7 @@
|
||||
if(screen == 2)
|
||||
screen = 1
|
||||
to_chat(user, "<span class='notice'>You add [(P.name == "paper") ? "the paper" : P.name] to [(src.name == "paper bundle") ? "the paper bundle" : src.name].</span>")
|
||||
user.unEquip(P)
|
||||
P.loc = src
|
||||
user.transfer_item_to(P, src)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.update_inv_l_hand()
|
||||
@@ -53,14 +52,12 @@
|
||||
if(screen == 2)
|
||||
screen = 1
|
||||
to_chat(user, "<span class='notice'>You add [(W.name == "photo") ? "the photo" : W.name] to [(src.name == "paper bundle") ? "the paper bundle" : src.name].</span>")
|
||||
user.unEquip(W)
|
||||
W.loc = src
|
||||
user.transfer_item_to(W, src)
|
||||
|
||||
else if(W.get_heat())
|
||||
burnpaper(W, user)
|
||||
|
||||
else if(istype(W, /obj/item/paper_bundle))
|
||||
user.unEquip(W)
|
||||
for(var/obj/O in W)
|
||||
O.loc = src
|
||||
O.add_fingerprint(usr)
|
||||
@@ -91,8 +88,6 @@
|
||||
user.visible_message("<span class='[class]'>[user] burns right through [src], turning it to ash. It flutters through the air before settling on the floor in a heap.</span>", \
|
||||
"<span class='[class]'>You burn right through [src], turning it to ash. It flutters through the air before settling on the floor in a heap.</span>")
|
||||
|
||||
user.unEquip(src)
|
||||
|
||||
new /obj/effect/decal/cleanable/ash(get_turf(src))
|
||||
qdel(src)
|
||||
|
||||
@@ -168,7 +163,7 @@
|
||||
to_chat(usr, "<span class='notice'>You remove [W] from the bundle.</span>")
|
||||
if(amount == 1)
|
||||
var/obj/item/paper/P = get_page(1)
|
||||
usr.unEquip(src)
|
||||
usr.unequip(src)
|
||||
usr.put_in_hands(P)
|
||||
usr.unset_machine() // Ensure the bundle GCs
|
||||
for(var/obj/O in src) // just in case we somehow lose something (it's happened, especially with photos)
|
||||
@@ -219,7 +214,6 @@
|
||||
O.plane = initial(O.plane)
|
||||
O.add_fingerprint(user)
|
||||
|
||||
user.unEquip(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/paper_bundle/update_desc()
|
||||
|
||||
@@ -37,18 +37,18 @@
|
||||
|
||||
if(over_object == M)
|
||||
if(!remove_item_from_storage(M))
|
||||
M.unEquip(src)
|
||||
M.drop_item_to_ground(src)
|
||||
M.put_in_hands(src)
|
||||
|
||||
else if(is_screen_atom(over_object))
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
if(!remove_item_from_storage(M))
|
||||
M.unEquip(src)
|
||||
M.drop_item_to_ground(src)
|
||||
M.put_in_r_hand(src)
|
||||
if("l_hand")
|
||||
if(!remove_item_from_storage(M))
|
||||
M.unEquip(src)
|
||||
M.drop_item_to_ground(src)
|
||||
M.put_in_l_hand(src)
|
||||
|
||||
add_fingerprint(M)
|
||||
|
||||
@@ -74,14 +74,14 @@
|
||||
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10))
|
||||
user.visible_message("<span class='warning'>[user] accidentally ignites [user.p_themselves()]!</span>", \
|
||||
"<span class='userdanger'>You miss [src] and accidentally light yourself on fire!</span>")
|
||||
user.unEquip(P)
|
||||
user.drop_item_to_ground(P)
|
||||
user.adjust_fire_stacks(1)
|
||||
user.IgniteMob()
|
||||
return
|
||||
|
||||
if(!in_range(user, src)) //to prevent issues as a result of telepathically lighting a paper
|
||||
return
|
||||
user.unEquip(src)
|
||||
user.drop_item_to_ground(src)
|
||||
user.visible_message("<span class='danger'>[user] lights [src] on fire with [P]!</span>", "<span class='danger'>You lights [src] on fire!</span>")
|
||||
fire_act()
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
if((!in_range(src, user)) || user.stat || user.restrained())
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You fold [src] into the shape of a plane!</span>")
|
||||
user.unEquip(src)
|
||||
user.unequip(src) // forceMove happens in paperplane/Initialize
|
||||
I = new /obj/item/paperplane(user, src)
|
||||
user.put_in_hands(I)
|
||||
else
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
"<span class='[class]'>You burn right through [src], turning it to ash. It flutters through the air before settling on the floor in a heap.</span>")
|
||||
|
||||
if(user.is_in_inactive_hand(src))
|
||||
user.unEquip(src)
|
||||
user.unequip(src)
|
||||
|
||||
new /obj/effect/decal/cleanable/ash(get_turf(src))
|
||||
qdel(src)
|
||||
@@ -149,10 +149,10 @@
|
||||
if((!M.restrained() && !M.stat && M.back == src))
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
M.unEquip(src)
|
||||
M.unequip(src)
|
||||
M.put_in_r_hand(src)
|
||||
if("l_hand")
|
||||
M.unEquip(src)
|
||||
M.unequip(src)
|
||||
M.put_in_l_hand(src)
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
@@ -424,7 +424,7 @@
|
||||
..()
|
||||
var/obj/item/projectile/bullet/reusable/foam_dart/FD = BB
|
||||
if((is_pen(A)) && modified && !FD.pen)
|
||||
if(!user.unEquip(A))
|
||||
if(!user.unequip(A)) // forceMove happens in add_pen
|
||||
return
|
||||
add_pen(A)
|
||||
to_chat(user, "<span class='notice'>You insert [A] into [src].</span>")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user