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:
warriorstar-orion
2025-01-10 01:58:35 +00:00
committed by GitHub
parent 17602326bc
commit 0eafad8475
213 changed files with 587 additions and 585 deletions
+1 -1
View File
@@ -300,7 +300,7 @@
var/atom/movable/M = A
if(isliving(M.loc))
var/mob/living/L = M.loc
L.unEquip(M)
L.drop_item_to_ground(M)
M.forceMove(src)
///Return the air if we can analyze it
+2 -2
View File
@@ -17,7 +17,7 @@
for(var/obj/item/W in H)
if(istype(W, /obj/item/bio_chip))
continue
H.unEquip(W)
H.drop_item_to_ground(W)
H.regenerate_icons()
ADD_TRAIT(H, TRAIT_IMMOBILIZED, TRANSFORMING_TRAIT)
@@ -51,7 +51,7 @@
continue
if(istype(W, /obj/item/bio_chip))
continue
H.unEquip(W)
H.drop_item_to_ground(W)
H.regenerate_icons()
ADD_TRAIT(H, TRAIT_IMMOBILIZED, TRANSFORMING_TRAIT)
ADD_TRAIT(H, TRAIT_HANDS_BLOCKED, TRANSFORMING_TRAIT)
+1 -1
View File
@@ -472,7 +472,7 @@
if(ismob(the_item.loc) && isitem(the_item))
var/obj/item/eaten = the_item
var/mob/the_owner = the_item.loc
if(!the_owner.unEquip(eaten, FALSE, TRUE))
if(!the_owner.drop_item_to_ground(eaten, silent = TRUE))
to_chat(user, "<span class='warning'>You can't eat [the_item], it won't go down your throat!</span>")
return
user.visible_message("<span class='danger'>[user] eats [the_item].</span>")
+1 -1
View File
@@ -121,7 +121,7 @@
/datum/action/innate/cult/use_dagger/Activate()
var/obj/item/melee/cultblade/dagger/D = owner.find_item(/obj/item/melee/cultblade/dagger)
if(D)
owner.remove_from_mob(D)
owner.unequip(D)
owner.put_in_hands(D)
D.activate_self(owner)
else
+8 -8
View File
@@ -40,7 +40,7 @@
if(!IS_CULTIST(user))
user.Weaken(10 SECONDS)
user.unEquip(src, 1)
user.drop_item_to_ground(src, force = TRUE)
user.visible_message("<span class='warning'>A powerful force shoves [user] away from [target]!</span>",
"<span class='cultlarge'>\"You shouldn't play with sharp things. You'll poke someone's eye out.\"</span>")
if(ishuman(user))
@@ -70,7 +70,7 @@
if(HAS_TRAIT(user, TRAIT_HULK))
to_chat(user, "<span class='danger'>You can't seem to hold the blade properly!</span>")
user.unEquip(src, TRUE)
user.drop_item_to_ground(src, force = TRUE)
/obj/item/restraints/legcuffs/bola/cult
name = "runed bola"
@@ -175,7 +175,7 @@
if(!IS_CULTIST(user)) // Todo: Make this only happen when actually equipped to the correct slot. (For all cult items)
to_chat(user, "<span class='cultlarge'>\"I wouldn't advise that.\"</span>")
to_chat(user, "<span class='warning'>An overwhelming sense of nausea overpowers you!</span>")
user.unEquip(src, 1)
user.drop_item_to_ground(src, force = TRUE)
user.Confused(20 SECONDS)
user.Weaken(10 SECONDS)
@@ -212,7 +212,7 @@
if(!IS_CULTIST(user))
to_chat(user, "<span class='cultlarge'>\"I wouldn't advise that.\"</span>")
to_chat(user, "<span class='warning'>An overwhelming sense of nausea overpowers you!</span>")
user.unEquip(src, 1)
user.drop_item_to_ground(src, force = TRUE)
user.Confused(20 SECONDS)
user.Weaken(10 SECONDS)
else if(slot == ITEM_SLOT_OUTER_SUIT)
@@ -278,7 +278,7 @@
..()
if(!IS_CULTIST(user))
to_chat(user, "<span class='cultlarge'>\"You want to be blind, do you?\"</span>")
user.unEquip(src, 1)
user.drop_item_to_ground(src, force = TRUE)
user.Confused(60 SECONDS)
user.Weaken(10 SECONDS)
user.EyeBlind(60 SECONDS)
@@ -292,7 +292,7 @@
/obj/item/shuttle_curse/attack_self__legacy__attackchain(mob/living/user)
if(!IS_CULTIST(user))
user.unEquip(src, 1)
user.drop_item_to_ground(src, force = TRUE)
user.Weaken(10 SECONDS)
to_chat(user, "<span class='warning'>A powerful force shoves you away from [src]!</span>")
return
@@ -345,7 +345,7 @@
to_chat(user, "<span class='warning'>[src] is dull and unmoving in your hands.</span>")
return
if(!IS_CULTIST(user))
user.unEquip(src, TRUE)
user.drop_item_to_ground(src, force = TRUE)
step(src, pick(GLOB.alldirs))
to_chat(user, "<span class='warning'>[src] flickers out of your hands, too eager to move!</span>")
return
@@ -664,7 +664,7 @@
cooldown = world.time + 20
if(isliving(spear.loc))
var/mob/living/L = spear.loc
L.unEquip(spear)
L.drop_item_to_ground(spear)
L.visible_message("<span class='warning'>An unseen force pulls the blood spear from [L]'s hands!</span>")
spear.throw_at(owner, 10, 2, null, dodgeable = FALSE)
+1 -1
View File
@@ -1002,7 +1002,7 @@ structure_check() searches for nearby cultist structures required for the invoca
new_human.visible_message("<span class='warning'>[new_human] suddenly dissolves into bones and ashes.</span>",
"<span class='cultlarge'>Your link to the world fades. Your form breaks apart.</span>")
for(var/obj/item/I in new_human.get_all_slots())
new_human.unEquip(I)
new_human.drop_item_to_ground(I)
new_human.mind.remove_antag_datum(/datum/antagonist/cultist, silent_removal = TRUE)
new_human.dust()
+1 -1
View File
@@ -219,7 +219,7 @@ GLOBAL_VAR(bomb_set)
return
if(istype(O, /obj/item/nuke_core/plutonium) && removal_stage == NUKE_CORE_FULLY_EXPOSED)
if(do_after(user, 2 SECONDS, target = src))
if(!user.unEquip(O))
if(!user.drop_item_to_ground(O))
to_chat(user, "<span class='notice'>The [O] is stuck to your hand!</span>")
return
user.visible_message("<span class='notice'>[user] puts [O] back in [src].</span>", "<span class='notice'>You put [O] back in [src].</span>")
+1 -1
View File
@@ -752,7 +752,7 @@ GLOBAL_LIST_EMPTY(multiverse)
victim.revive()
for(var/obj/item/item in victim)
victim.unEquip(item)
victim.drop_item_to_ground(item)
var/skeleton_type = pick("roman", "pirate", "yand", "clown")
+1 -1
View File
@@ -682,7 +682,7 @@
for(var/obj/item/I in H)
if(istype(I, /obj/item/bio_chip))
continue
H.unEquip(I)
H.drop_item_to_ground(I)
/datum/tarot/reversed/the_magician
name = "I - The Magician?"
+1 -1
View File
@@ -459,7 +459,7 @@
to_chat(user, "<span class='notice'><b>Capture successful!</b>:</span> [M.real_name]'s soul has been ripped from [user.p_their()] body and stored within the soul stone.")
if(!isrobot(M))
for(var/obj/item/I in M)
M.unEquip(I)
M.drop_item_to_ground(I)
var/target_body = M
if(isbrain(M))
+1 -1
View File
@@ -1112,7 +1112,7 @@
magichead.flags |= NODROP | DROPDEL //curses!
magichead.flags_inv = null //so you can still see their face
magichead.voicechange = TRUE //NEEEEIIGHH
if(!user.unEquip(user.wear_mask))
if(!user.drop_item_to_ground(user.wear_mask))
qdel(user.wear_mask)
user.equip_to_slot_if_possible(magichead, ITEM_SLOT_MASK, TRUE, TRUE)
qdel(src)
+3 -9
View File
@@ -86,7 +86,7 @@
to_chat(user, "<span class='notice'>A spectral hand appears from your spellbook and pulls a brand new plasmaman envirosuit, complete with helmet, from the void, then drops it on the floor.</span>")
new /obj/item/clothing/head/helmet/space/plasmaman/assistant(get_turf(user))
new /obj/item/clothing/under/plasmaman/assistant(get_turf(user))
user.unEquip(user.wear_id)
user.drop_item_to_ground(user.wear_id)
user.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey/glorf, ITEM_SLOT_JUMPSUIT) //Just in case they're naked
var/obj/item/card/id/wizid = new /obj/item/card/id(src)
user.equip_to_slot_or_del(wizid, ITEM_SLOT_ID)
@@ -130,14 +130,8 @@
destroy_spellbook = TRUE
/datum/spellbook_entry/loadout/fireball/OnBuy(mob/living/carbon/human/user, obj/item/spellbook/book)
if(user.wear_suit)
var/jumpsuit = user.wear_suit
user.unEquip(user.wear_suit, TRUE)
qdel(jumpsuit)
if(user.head)
var/head = user.head
user.unEquip(user.head, TRUE)
qdel(head)
qdel(user.wear_suit)
qdel(user.head)
// Part of Sacred Flame
to_chat(user, "<span class='notice'>You feel fireproof.</span>")
@@ -49,7 +49,7 @@
// Upgrades!
else if(is_type_in_list(I, possible_upgrades) && !is_type_in_list(I, upgrades)) // Is a possible upgrade and isn't in the camera already.
if(!user.unEquip(I))
if(!user.drop_item_to_ground(I))
to_chat(user, "<span class='warning'>[I] is stuck!</span>")
return
to_chat(user, "<span class='notice'>You attach [I] into the assembly inner circuits.</span>")
+2 -2
View File
@@ -538,10 +538,10 @@
var/mob/M = inserted.loc
if(!M.get_active_hand() == inserted)
return //not sure how this would happen, but smartfridges check for it so
if(!M.drop_item())
if(!M.unequip(inserted))
to_chat(inserter, "<span class='warning'>[inserted] is stuck to you!</span>")
return
M.unEquip(inserted)
inserted.forceMove(src)
to_chat(inserter, "<span class='notice'>You insert [inserted] into [src]'s organ storage.</span>")
SStgui.try_update_ui(inserter, src)
@@ -131,7 +131,8 @@
var/mob/M = obj.loc
if(istype(M))
M.unEquip(obj, TRUE) //Holoweapons should always drop.
// Holoweapons should always drop.
M.drop_item_to_ground(obj, force = TRUE)
if(!silent)
var/obj/old_obj = obj
+1 -2
View File
@@ -334,8 +334,7 @@
/obj/machinery/cryopod/proc/despawn_occupant()
//Drop all items into the pod.
for(var/obj/item/I in occupant)
occupant.unEquip(I)
I.forceMove(src)
occupant.transfer_item_to(I, src)
handle_contents(I)
//Delete all items not on the preservation list.
+1 -2
View File
@@ -1024,12 +1024,11 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
if(note)
to_chat(user, "<span class='warning'>There's already something pinned to this airlock! Use wirecutters or your hands to remove it.</span>")
return
if(!user.unEquip(C))
if(!user.transfer_item_to(C, src))
to_chat(user, "<span class='warning'>For some reason, you can't attach [C]!</span>")
return
C.add_fingerprint(user)
user.create_log(MISC_LOG, "put [C] on", src)
C.forceMove(src)
user.visible_message("<span class='notice'>[user] pins [C] to [src].</span>", "<span class='notice'>You pin [C] to [src].</span>")
note = C
update_icon()
+2 -2
View File
@@ -924,7 +924,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
if(isrobot(user))
return
var/obj/item/gun/energy/E = I //typecasts the item to an energy gun
if(!user.unEquip(I))
if(!user.unequip(I))
to_chat(user, "<span class='notice'>\the [I] is stuck to your hand, you cannot put it in \the [src]</span>")
return
if(!E.can_fit_in_turrets)
@@ -953,7 +953,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
if(4)
if(isprox(I))
if(!user.unEquip(I))
if(!user.unequip(I, src))
to_chat(user, "<span class='notice'>\the [I] is stuck to your hand, you cannot put it in \the [src]</span>")
return
build_step = 5
+1 -1
View File
@@ -189,7 +189,7 @@
// Remove and recycle the equipped items
if(eat_victim_items)
for(var/obj/item/I in L.get_equipped_items(TRUE))
if(L.unEquip(I))
if(L.drop_item_to_ground(I))
eat(I, sound = 0)
// Instantly lie down, also go unconscious from the pain, before you die.
+1 -2
View File
@@ -51,10 +51,9 @@
if(istype(I, /obj/item/gps))
var/obj/item/gps/L = I
if(L.locked_location && !(stat & (NOPOWER|BROKEN)))
if(!user.unEquip(L))
if(!user.transfer_item_to(L, src))
to_chat(user, "<span class='warning'>[I] is stuck to your hand, you cannot put it in [src]</span>")
return
L.forceMove(src)
locked = L
to_chat(user, "<span class='caution'>You insert the GPS device into [src]'s slot.</span>")
else
+1 -1
View File
@@ -232,7 +232,7 @@
var/mob/living/carbon/human/H = M
if(isobj(H.shoes) && !(H.shoes.flags & NODROP))
var/thingy = H.shoes
H.unEquip(H.shoes)
H.drop_item_to_ground(thingy)
walk_away(thingy,chassis,15,2)
spawn(20)
if(thingy)
+2 -2
View File
@@ -771,7 +771,7 @@
return
else if(istype(W, /obj/item/mecha_parts/mecha_tracking))
if(!user.unEquip(W))
if(!user.drop_item_to_ground(W))
to_chat(user, "<span class='notice'>\the [W] is stuck to your hand, you cannot put it in \the [src]</span>")
return
@@ -1232,7 +1232,7 @@
else if(mmi_as_oc.brainmob.stat)
to_chat(user, "Beta-rhythm below acceptable level.")
return FALSE
if(!user.unEquip(mmi_as_oc))
if(!user.drop_item_to_ground(mmi_as_oc))
to_chat(user, "<span class='notice'>\the [mmi_as_oc] is stuck to your hand, you cannot put it in \the [src]</span>")
return FALSE
var/mob/living/brain/brainmob = mmi_as_oc.brainmob
+8 -13
View File
@@ -231,7 +231,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
QDEL_NULL(hidden_uplink)
if(ismob(loc))
var/mob/m = loc
m.unEquip(src, 1)
m.unequip(src, force = TRUE)
QDEL_LIST_CONTENTS(actions)
master = null
@@ -342,27 +342,22 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
if(affecting && affecting.receive_damage(0, 5)) // 5 burn damage
H.UpdateDamageIcon()
if(isstorage(src.loc))
/// If the item is in a storage item, take it out
var/obj/item/storage/S = src.loc
S.remove_from_storage(src)
if(..())
return
if(throwing)
throwing.finalize(FALSE)
if(loc == user)
if(HAS_TRAIT(user, TRAIT_I_WANT_BRAINS) || !user.unEquip(src, silent = TRUE))
if(isliving(loc))
if(loc == user)
if(HAS_TRAIT(user, TRAIT_I_WANT_BRAINS) || !user.unequip(src))
return FALSE
else
return FALSE
if(flags & ABSTRACT)
return FALSE
else
if(isliving(loc))
return FALSE
pickup(user)
add_fingerprint(user)
if(!user.put_in_active_hand(src))
@@ -376,7 +371,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
if(!A.has_fine_manipulation && !HAS_TRAIT(src, TRAIT_XENO_INTERACTABLE))
if(src in A.contents) // To stop Aliens having items stuck in their pockets
A.unEquip(src)
A.drop_item_to_ground(src)
to_chat(user, "<span class='warning'>Your claws aren't capable of such fine manipulation!</span>")
return
attack_hand(A)
+1 -1
View File
@@ -10,7 +10,7 @@
if(length(contents) >= max_butts)
to_chat(user, "This ashtray is full.")
return
if(!user.unEquip(I))
if(!user.unequip(I))
return
I.forceMove(src)
+1 -1
View File
@@ -100,7 +100,7 @@
new/obj/item/trash/candle(src.loc)
if(ismob(src.loc))
var/mob/M = src.loc
M.unEquip(src, 1) //src is being deleted anyway
M.drop_item_to_ground(src, force = TRUE) //src is being deleted anyway
qdel(src)
if(isturf(loc)) //start a fire if possible
var/turf/T = loc
+1 -1
View File
@@ -411,7 +411,7 @@
)
selected_disguise = disguise_spraypaint_items[selected_disguise][is_cardborg_head]
playsound(user, 'sound/effects/spray.ogg', 5, TRUE, 5)
user.unEquip(target)
user.unequip(target)
user.put_in_hands(new selected_disguise()) // Spawn the desired cardborg item.
qdel(target) // Get rid of the old one.
@@ -77,7 +77,7 @@
return
if(istype(I, /obj/item/shard))
if(!user.unEquip(I))
if(!user.drop_item_to_ground(I))
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
return
@@ -88,7 +88,7 @@
if(istype(I, /obj/item/light))
var/obj/item/light/L = I
if(!user.unEquip(L))
if(!user.drop_item_to_ground(L))
to_chat(user, "<span class='warning'>[L] is stuck to your hand!</span>")
return
@@ -48,16 +48,15 @@
var/obj/item/assembly/shock_kit/A = new /obj/item/assembly/shock_kit(user)
A.icon = 'icons/obj/assemblies.dmi'
if(!user.unEquip(W))
if(!user.unequip(W))
to_chat(user, "<span class='notice'>\the [W] is stuck to your hand, you cannot attach it to \the [src]!</span>")
return
W.loc = A
W.forceMove(A)
W.master = A
A.part1 = W
user.unEquip(src)
loc = A
user.transfer_item_to(src, A)
master = A
A.part2 = src
@@ -409,7 +409,7 @@
to_chat(user, "The headset can't hold another key!")
return
if(!user.unEquip(key))
if(!user.drop_item_to_ground(key))
to_chat(user, "<span class='warning'>[key] is stuck to your hand, you can't insert it in [src].</span>")
return
+1 -1
View File
@@ -332,7 +332,7 @@ SLIME SCANNER
to_chat(user, "<span class='notice'>An upgrade is already installed on [src].</span>")
return
if(!user.unEquip(I))
if(!user.unequip(I))
to_chat(user, "<span class='warning'>[src] is stuck to your hand!</span>")
return
@@ -32,18 +32,16 @@
return
if(!tank_one)
if(!user.unEquip(I))
if(!user.transfer_item_to(I, src))
return
tank_one = I
I.forceMove(src)
to_chat(user, "<span class='notice'>You attach the tank to the transfer valve.</span>")
if(I.w_class > w_class)
w_class = I.w_class
else if(!tank_two)
if(!user.unEquip(I))
if(!user.transfer_item_to(I, src))
return
tank_two = I
I.forceMove(src)
to_chat(user, "<span class='notice'>You attach the tank to the transfer valve.</span>")
if(I.w_class > w_class)
w_class = I.w_class
@@ -59,9 +57,9 @@
if(attached_device)
to_chat(user, "<span class='warning'>There is already a device attached to the valve, remove it first.</span>")
return
user.remove_from_mob(A)
if(!user.transfer_item_to(A, src))
return
attached_device = A
A.forceMove(src)
to_chat(user, "<span class='notice'>You attach [A] to the valve controls and secure it.</span>")
A.holder = src
A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb).
+1 -1
View File
@@ -151,7 +151,7 @@
to_chat(user, "You armed the robot frame")
M.use(1)
if(user.get_inactive_hand()==src)
user.unEquip(src)
user.unequip(src)
user.put_in_inactive_hand(B)
qdel(src)
if(istype(W, /obj/item/robot_parts/l_leg))
+1 -1
View File
@@ -20,7 +20,7 @@
return
if(!user.get_inactive_hand()) // We ballin
user.unEquip(src)
user.unequip(src)
user.put_in_inactive_hand(src)
else
to_chat(user, "<span class='warning'>You can't dribble to an occupied hand!</span>")
+1 -1
View File
@@ -87,7 +87,7 @@ GLOBAL_LIST_INIT(rod_recipes, list (
var/replace = user.is_in_inactive_hand(src)
use(2)
if(get_amount() <= 0 && replace)
user.unEquip(src, 1)
user.drop_item_to_ground(src, force = TRUE)
if(new_item)
user.put_in_hands(new_item)
+1 -1
View File
@@ -91,7 +91,7 @@
animate_fading_leap_up(user)
for(var/obj/item/W in user)
user.unEquip(W)
user.drop_item_to_ground(W)
user.dust()
return OBLITERATION
+1 -1
View File
@@ -153,7 +153,7 @@
playsound(loc, 'sound/effects/supermatter.ogg', 50, TRUE, -1)
for(var/obj/item/W in user)
user.unEquip(W)
user.drop_item_to_ground(W)
user.dust()
return OBLITERATION
+1 -1
View File
@@ -85,7 +85,7 @@
new /obj/item/restraints/handcuffs/cable/zipties/used(user.loc)
for(var/obj/item/W in user)
user.unEquip(W)
user.drop_item_to_ground(W)
user.dust()
return OBLITERATION
+1 -1
View File
@@ -118,7 +118,7 @@
return
for(var/obj/item/W in user)
user.unEquip(W)
user.drop_item_to_ground(W)
for(var/mob/living/M in orange(2, src))
// you're close enough, it's pretty fuckin bright
+3 -6
View File
@@ -146,7 +146,7 @@
animate(holder_obj, pixel_z = 1000, time = 50)
for(var/obj/item/W in user)
user.unEquip(W)
user.drop_item_to_ground(W)
user.notransform = TRUE
icon = null
@@ -226,8 +226,6 @@
else
to_chat(user, "<span class='notice'>You attach the ends of the two plastic swords, making a single double-bladed toy! You're fake-cool.</span>")
new /obj/item/dualsaber/toy(user.loc)
user.unEquip(attacking)
user.unEquip(src)
qdel(attacking)
qdel(src)
@@ -287,7 +285,7 @@
"<span class='notice'>You hear a gentle tapping.</span>"
)
playsound(loc, 'sound/weapons/tap.ogg', vary = TRUE)
target.unEquip(cig, TRUE)
target.drop_item_to_ground(cig, TRUE)
return TRUE
/obj/item/toy/sword/chaosprank/after_attack(atom/target, mob/user, proximity_flag, click_parameters)
@@ -1457,8 +1455,7 @@
to_chat(user, "<span class='alert'>\The [attacking] is too far away to feed into \the [src]!</span>")
else
to_chat(user, "<span class='notice'>You feed \the [attacking] [bicon(attacking)] into \the [src]!</span>")
user.unEquip(attacking)
attacking.forceMove(src)
user.transfer_item_to(attacking, src)
stored_minature = attacking
else
to_chat(user, "<span class='warning'>You stop feeding \the [attacking] into \the [src]'s mini-input.</span>")
+1 -1
View File
@@ -351,7 +351,7 @@
return SHAME
user.visible_message("<span class='suicide'>[user] deconstructs [user.p_themselves()] with [src]!</span>")
for(var/obj/item/W in user) // Do not delete all their stuff.
user.unEquip(W) // Dump everything on the floor instead.
user.drop_item_to_ground(W) // Dump everything on the floor instead.
flags &= ~NODROP // NODROP must be removed so the RCD doesn't get dusted along with them. Having this come after the unequipping puts the RCD on top of the pile of stuff.
user.dust() // (held items fall to the floor when dusting).
return OBLITERATION
@@ -41,7 +41,7 @@
if(case)
to_chat(user, "<span class='warning'>There's already a bio-chip in the pad!</span>")
return
user.unEquip(C)
user.unequip(C)
C.forceMove(src)
case = C
update_icon(UPDATE_ICON_STATE)
+1 -2
View File
@@ -210,9 +210,8 @@
if(G.registered_name != registered_name && G.registered_name != "NOT SPECIFIED")
to_chat(user, "The guest pass cannot be attached to this ID.")
return
if(!user.unEquip(G))
if(!user.transfer_item_to(G, src))
return
G.loc = src
guest_pass = G
/obj/item/card/id/GetID()
@@ -80,13 +80,10 @@
to_chat(user, "<span class='notice'>[src] is already full!</span>")
return
if(!user.unEquip(I))
return
to_chat(user, "<span class='notice'>You put [I] into [src].</span>")
canisters += I
I.forceMove(src)
update_canister_stats()
if(user.transfer_item_to(I, src))
canisters += I
to_chat(user, "<span class='notice'>You put [I] into [src].</span>")
update_canister_stats()
/obj/item/chemical_flamethrower/proc/update_canister_stats()
if(!length(canisters))
+6 -6
View File
@@ -98,7 +98,7 @@ LIGHTERS ARE IN LIGHTERS.DM
// If the target has no cig, try to give them the cig.
var/mob/living/carbon/M = target
if(istype(M) && user.zone_selected == "mouth" && !M.wear_mask && user.a_intent == INTENT_HELP)
user.unEquip(src, TRUE)
user.drop_item_to_ground(src, force = TRUE)
M.equip_to_slot_if_possible(src, ITEM_SLOT_MASK)
if(target != user)
user.visible_message(
@@ -207,7 +207,7 @@ LIGHTERS ARE IN LIGHTERS.DM
e.set_up(round(reagents.get_reagent_amount("plasma") / 2.5, 1), get_turf(src), 0, 0)
e.start()
if(ismob(M))
M.unEquip(src, TRUE)
M.drop_item_to_ground(src, force = TRUE)
qdel(src)
return
@@ -217,7 +217,7 @@ LIGHTERS ARE IN LIGHTERS.DM
e.set_up(round(reagents.get_reagent_amount("fuel") / 5, 1), get_turf(src), 0, 0)
e.start()
if(ismob(M))
M.unEquip(src, TRUE)
M.drop_item_to_ground(src, force = TRUE)
qdel(src)
return
@@ -289,7 +289,7 @@ LIGHTERS ARE IN LIGHTERS.DM
if(ismob(loc))
var/mob/living/M = loc
to_chat(M, "<span class='notice'>Your [name] goes out.</span>")
M.unEquip(src, TRUE) //Force the un-equip so the overlays update
M.drop_item_to_ground(src, force = TRUE) //Force the un-equip so the overlays update
STOP_PROCESSING(SSobj, src)
qdel(src)
@@ -390,8 +390,8 @@ LIGHTERS ARE IN LIGHTERS.DM
to_chat(user, "<span class='warning'>You need to dry this first!</span>")
return
user.unEquip(plant, TRUE)
user.unEquip(src, TRUE)
user.unequip(plant, TRUE)
user.unequip(src, TRUE)
var/obj/item/clothing/mask/cigarette/rollie/custom/custom_rollie = new (get_turf(user))
custom_rollie.reagents.maximum_volume = plant.reagents.total_volume
plant.reagents.trans_to(custom_rollie, plant.reagents.total_volume)
+2 -2
View File
@@ -174,7 +174,7 @@
/obj/item/defibrillator/proc/remove_paddles(mob/user) // from your hands
var/mob/living/carbon/human/M = user
if(paddles in get_both_hands(M))
M.unEquip(paddles)
M.drop_item_to_ground(paddles)
paddles_on_defib = TRUE
update_icon(UPDATE_OVERLAYS)
return
@@ -387,7 +387,7 @@
/obj/item/shockpaddles/proc/check_defib_exists(mainunit, mob/living/carbon/human/M, obj/O)
if(!mainunit || !istype(mainunit, /obj/item/defibrillator)) //To avoid weird issues from admin spawns
M?.unEquip(O)
M?.unequip(O)
qdel(O)
return FALSE
else
+1 -1
View File
@@ -165,7 +165,7 @@
/obj/item/dice/d20/fate/equipped(mob/user, slot)
if(!ishuman(user) || !user.mind || iswizard(user))
to_chat(user, "<span class='warning'>You feel the magic of the dice is restricted to ordinary humans! You should leave it alone.</span>")
user.unEquip(src)
user.drop_item_to_ground(src)
/obj/item/dice/d20/fate/proc/create_smoke(amount)
var/datum/effect_system/smoke_spread/smoke = new
@@ -35,11 +35,10 @@
/obj/item/grenade/plastic/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(!nadeassembly && istype(I, /obj/item/assembly))
var/obj/item/assembly/A = I
if(!user.unEquip(I))
if(!user.transfer_item_to(A, src))
return ..()
nadeassembly = A
A.master = src
A.loc = src
assemblyattacher = user.ckey
to_chat(user, "<span class='notice'>You add [A] to [src].</span>")
playsound(src, 'sound/weapons/tap.ogg', 20, 1)
@@ -86,8 +85,9 @@
to_chat(user, "<span class='notice'>You start planting [src].[isnull(nadeassembly) ? " The timer is set to [det_time]..." : ""]</span>")
if(do_after(user, 1.5 SECONDS * toolspeed, target = AM))
if(!user.unEquip(src))
if(!user.unequip(src))
return
target = AM
loc = null
@@ -119,7 +119,7 @@
if(!ispath(gift_type,/obj/item)) return
var/obj/item/I = new gift_type(M)
M.unEquip(src, 1)
M.unequip(src, force = TRUE)
M.put_in_hands(I)
I.add_fingerprint(M)
qdel(src)
@@ -61,7 +61,7 @@
return TRUE
var/obj/item/grenade/bananade/G = new /obj/item/grenade/bananade
user.unEquip(src)
user.drop_item_to_ground(src)
user.put_in_hands(G)
G.deliveryamt = deliveryamt
to_chat(user, "<span class='notice'>You lock the assembly shut, readying it for HONK.</span>")
@@ -83,7 +83,7 @@
/obj/item/grenade/proc/update_mob()
if(ismob(loc))
var/mob/M = loc
M.unEquip(src)
M.drop_item_to_ground(src)
/obj/item/grenade/screwdriver_act(mob/living/user, obj/item/I)
if(!modifiable_timer)
+5 -3
View File
@@ -26,11 +26,13 @@
/obj/item/restraints/proc/finish_resist_restraints(mob/living/carbon/user, break_cuffs, silent)
if(!silent)
user.visible_message("<span class='danger'>[user] manages to [break_cuffs ? "break" : "remove"] [src]!</span>", "<span class='notice'>You successfully [break_cuffs ? "break" : "remove"] [src].</span>")
user.unEquip(src)
user.unequip(src)
if(break_cuffs)
qdel(src)
return TRUE
else
forceMove(user.drop_location())
//////////////////////////////
// MARK: HANDCUFFS
@@ -273,7 +275,7 @@
if(!R.use(1))
to_chat(user, "<span class='warning'>[R.amount > 1 ? "These rods" : "This rod"] somehow can't be used for crafting!</span>")
return
if(!user.unEquip(src))
if(!user.unequip(src))
return
var/obj/item/wirerod/W = new /obj/item/wirerod(get_turf(src))
if(!remove_item_from_storage(user))
@@ -290,7 +292,7 @@
to_chat(user, "<span class='notice'>You begin to apply [I] to [src]...</span>")
if(do_after(user, 3.5 SECONDS * M.toolspeed, target = src))
if(!M.use(6) || !user.unEquip(src))
if(!M.use(6) || !user.unequip(src))
return
var/obj/item/restraints/legcuffs/bola/S = new /obj/item/restraints/legcuffs/bola(get_turf(src))
to_chat(user, "<span class='notice'>You make some weights out of [I] and tie them to [src].</span>")
@@ -53,7 +53,7 @@
user.adjustBruteLoss(force)
user.adjustFireLoss(sanctify_force)
user.Weaken(10 SECONDS)
user.unEquip(src, 1)
user.drop_item_to_ground(src, force = TRUE)
user.visible_message("<span class='warning'>[src] slips out of the grip of [user] as they try to pick it up, bouncing upwards and smacking [user.p_them()] in the face!</span>", \
"<span class='warning'>[src] slips out of your grip as you pick it up, bouncing upwards and smacking you in the face!</span>")
playsound(get_turf(user), 'sound/effects/hit_punch.ogg', 50, TRUE, -1)
@@ -279,8 +279,6 @@
if(src.hacked) // That's right, we'll only check the "original" esword.
newSaber.hacked = TRUE
newSaber.item_color = "rainbow"
user.unEquip(W)
user.unEquip(src)
qdel(W)
qdel(src)
user.put_in_hands(newSaber)
@@ -81,7 +81,7 @@
return
if(I.flags & ABSTRACT)
return
if(!user.unEquip(I))
if(!user.unequip(I))
to_chat(user, "<span class='notice'>[I] doesn't seem to want to go into [src]!</span>")
return
I.forceMove(src)
@@ -56,7 +56,7 @@
if(I.w_class > w_class)
to_chat(user, "<span class='warning'>[I] is too large to fit into [src]!</span>")
return FALSE
if(!user.unEquip(I) || I.flags & (ABSTRACT | NODROP | DROPDEL))
if(!user.unequip(I) || I.flags & (ABSTRACT | NODROP | DROPDEL))
to_chat(user, "<span class='warning'>You can't put [I] into [src]!</span>")
return FALSE
loaded_items.Add(I)
@@ -144,7 +144,7 @@
if(tank)
to_chat(user, "<span class='warning'>[src] already has a tank.</span>")
return
if(!user.unEquip(new_tank))
if(!user.unequip(new_tank))
return
to_chat(user, "<span class='notice'>You hook [new_tank] up to [src].</span>")
new_tank.forceMove(src)
+1 -1
View File
@@ -79,7 +79,7 @@
if(tank)
to_chat(user, "<span class='warning'>[src] already has a tank.</span>")
return
if(!user.unEquip(thetank))
if(!user.unequip(thetank))
return
to_chat(user, "<span class='notice'>As you hook [thetank] up to [src], the fist locks into place around your arm.</span>")
tank = thetank
+1 -1
View File
@@ -52,7 +52,7 @@
/obj/item/staff/broom/attackby__legacy__attackchain(obj/O, mob/user)
if(istype(O, /obj/item/clothing/mask/horsehead))
new/obj/item/staff/broom/horsebroom(get_turf(src))
user.unEquip(O)
user.unequip(O)
qdel(O)
qdel(src)
return
@@ -70,11 +70,17 @@
if(!M.restrained() && !M.stat && can_use())
switch(over_object.name)
if("r_hand")
if(M.unEquip(src, silent = TRUE))
M.put_in_r_hand(src)
if(M.unequip(src))
if(M.r_hand)
M.drop_item_to_ground(src)
else
M.put_in_r_hand(src)
if("l_hand")
if(M.unEquip(src, silent = TRUE))
M.put_in_l_hand(src)
if(M.unequip(src))
if(M.l_hand)
M.drop_item_to_ground(src)
else
M.put_in_l_hand(src)
add_fingerprint(usr)
return
@@ -49,10 +49,10 @@
if(!user.restrained() && !user.stat)
switch(over_object.name)
if("r_hand")
user.unEquip(master_item, silent = TRUE)
user.unequip(master_item)
user.put_in_r_hand(master_item)
if("l_hand")
user.unEquip(master_item, silent = TRUE)
user.unequip(master_item)
user.put_in_l_hand(master_item)
master_item.add_fingerprint(user)
return 0
@@ -150,11 +150,11 @@
if(!M.restrained() && !M.stat)
switch(over_object.name)
if("r_hand")
if(!M.unEquip(src, silent = TRUE))
if(!M.unequip(src))
return
M.put_in_r_hand(src)
if("l_hand")
if(!M.unEquip(src, silent = TRUE))
if(!M.unequip(src))
return
M.put_in_l_hand(src)
add_fingerprint(usr)
@@ -445,7 +445,7 @@
if(user)
if(!Adjacent(user) && !isnewplayer(user))
return FALSE
if(!user.unEquip(I, silent = TRUE))
if(!user.unequip(I))
return FALSE
user.update_icons() //update our overlays
if(QDELING(I))
+1 -1
View File
@@ -130,7 +130,7 @@
if(C.maxcharge < hitcost)
to_chat(user, "<span class='warning'>[src] requires a higher capacity cell!</span>")
return
if(!user.unEquip(I))
if(!user.unequip(I))
return
I.forceMove(src)
cell = I
@@ -70,8 +70,7 @@
return
master = F
F.ptank = src
user.unEquip(src)
loc = F
user.transfer_item_to(src, F)
F.update_icon()
else
return ..()
@@ -68,7 +68,7 @@
/obj/item/watertank/proc/remove_noz()
if(ismob(noz.loc))
var/mob/M = noz.loc
M.unEquip(noz, 1)
M.drop_item_to_ground(noz, force = TRUE)
return
/obj/item/watertank/attack_hand(mob/user)
@@ -84,13 +84,13 @@
if("r_hand")
if(H.r_hand)
return
if(!H.unEquip(src))
if(!H.unequip(src))
return
H.put_in_r_hand(src)
if("l_hand")
if(H.l_hand)
return
if(!H.unEquip(src))
if(!H.unequip(src))
return
H.put_in_l_hand(src)
return
+2 -2
View File
@@ -146,7 +146,7 @@
if(HAS_TRAIT(user, TRAIT_HULK))
to_chat(user, "<span class='warning'>You grip the blade too hard and accidentally drop it!</span>")
if(HAS_TRAIT(src, TRAIT_WIELDED))
user.unEquip(src)
user.drop_item_to_ground(src)
return
..()
if(HAS_TRAIT(user, TRAIT_CLUMSY) && HAS_TRAIT(src, TRAIT_WIELDED) && prob(40) && force)
@@ -385,7 +385,7 @@
//Putting heads on spears
/obj/item/spear/attackby__legacy__attackchain(obj/item/I, mob/living/user)
if(istype(I, /obj/item/organ/external/head))
if(user.unEquip(src) && user.drop_item())
if(user.unequip(src) && user.drop_item())
to_chat(user, "<span class='notice'>You stick [I] onto the spear and stand it upright on the ground.</span>")
var/obj/structure/headspear/HS = new /obj/structure/headspear(get_turf(src))
var/matrix/M = matrix()
+4 -4
View File
@@ -142,8 +142,8 @@
S.add_plasmaglass()
S.update_icon()
if(!remove_item_from_storage(user))
user.unEquip(src)
user.unEquip(I)
user.unequip(src)
user.unequip(I)
user.put_in_hands(S)
to_chat(user, "<span class='notice'>You fasten the glass shard to the top of the rod with the cable.</span>")
@@ -154,8 +154,8 @@
var/obj/item/melee/baton/cattleprod/P = new /obj/item/melee/baton/cattleprod
if(!remove_item_from_storage(user))
user.unEquip(src)
user.unEquip(I)
user.unequip(src)
user.unequip(I)
user.put_in_hands(P)
to_chat(user, "<span class='notice'>You fasten [I] to the top of the rod with the cable.</span>")
+1 -1
View File
@@ -33,7 +33,7 @@
if(do_after(user, 1 SECONDS, target = user) && !QDELETED(src))
to_chat(user, "<span class='notice'>You begin to open the envelope.</span>")
playsound(loc, 'sound/items/poster_ripped.ogg', 50, TRUE)
user.unEquip(src)
user.unequip(src)
for(var/obj/item/I in contents)
user.put_in_hands(I)
qdel(src)
@@ -66,7 +66,7 @@
if(HAS_TRAIT(F, TRAIT_WIELDED))
to_chat(user, "<span class='warning'>Unwield \the [F] first.</span>")
return
if(!user.unEquip(F, FALSE))
if(!user.unequip(F, FALSE))
to_chat(user, "<span class='warning'>\The [F] stays stuck to your hands!</span>")
return
fireaxe = F
+1 -1
View File
@@ -35,7 +35,7 @@
return ..()
/obj/structure/janitorialcart/proc/put_in_cart(mob/user, obj/item/I)
if(!user.unEquip(I)) // We can do this here because everything below wants to
if(!user.unequip(I)) // We can do this here because everything below wants to
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
return
+1 -1
View File
@@ -34,7 +34,7 @@
attacking_mop.wet_mop(src, user)
return
if(!user.unEquip(attacking_mop))
if(!user.drop_item_to_ground(attacking_mop))
to_chat(user, "<span class='notice'>[attacking_mop] is stuck to your hand!</span>")
return
@@ -91,7 +91,7 @@
if(istype(H.shoes, /obj/item/clothing/shoes/slippers))
sleep_ratio *= 2
// take your shoes off first, you filthy animal
H.unEquip(H.shoes)
H.drop_item_to_ground(H.shoes)
var/extinguished_candle = FALSE
for(var/obj/item/candle/C in range(2, src))
@@ -587,7 +587,7 @@
/obj/item/chair/stool/attack__legacy__attackchain(mob/M as mob, mob/user as mob)
if(prob(5) && isliving(M))
user.visible_message("<span class='danger'>[user] breaks [src] over [M]'s back!.</span>")
user.unEquip(src)
user.unequip(src)
var/obj/item/stack/sheet/metal/m = new/obj/item/stack/sheet/metal
m.loc = get_turf(src)
qdel(src)
+1 -1
View File
@@ -733,7 +733,7 @@
S.anchored = FALSE
S.dir = user.dir
S.update_icon()
user.unEquip(src, 1)
user.unequip(src, force = TRUE)
qdel(src)
if(prob(50))
new /obj/item/stack/sheet/cardboard(T)