Magboot and glove fix (#19415)

* Magboot and glove fix

* Update armblade.dm

* Update leash.dm
This commit is contained in:
Cameron Lennox
2026-04-16 10:40:31 -04:00
committed by GitHub
parent bdffa69343
commit 51b00a200c
86 changed files with 278 additions and 360 deletions
+16 -8
View File
@@ -432,18 +432,25 @@
playsound(src, drop_sound, 30, preference = /datum/preference/toggle/drop_sounds)
// apparently called whenever an item is removed from a slot, container, or anything else.
/obj/item/proc/dropped(mob/user)
// TO NOTE:
// Putting an item from your HAND into a POCKET = equipping
// Putting an item from your HAND to ANY INVENTORY SLOT = equipping
// DROPPING an item (from hand or inventory slot) = NOT equipping
// Putting an item from your POCKET into a HAND = NOT equipping
// If you have an item you want an effect when DROPPED but NOT put in the user's inventory, do a loc == user check.
// This whole things needs to be completely replaced by tg's dropped stuff but we're a long way off from that.
/obj/item/proc/dropped(mob/user, equipping, slot)
SHOULD_CALL_PARENT(TRUE)
appearance_flags &= ~NO_CLIENT_COLOR
// Remove any item actions we temporary gave out.
for(var/datum/action/action_item_has as anything in actions)
action_item_has.Remove(user)
if((item_flags & DROPDEL) && loc != user && !QDELETED(src))
qdel(src)
SEND_SIGNAL(src, COMSIG_ITEM_DROPPED, user)
SEND_SIGNAL(user, COMSIG_MOB_DROPPED_ITEM, src)
if(!equipping) //We ONLY send these signals when we ACTUALLY drop the item. Because our item code is stupid, swapping items between your hand is 'dropping' them.
SEND_SIGNAL(src, COMSIG_ITEM_DROPPED, user)
SEND_SIGNAL(user, COMSIG_MOB_DROPPED_ITEM, src)
if((item_flags & DROPDEL) && loc != user && !QDELETED(src))
qdel(src)
if(my_augment && !QDELETED(src))
forceMove(my_augment)
@@ -538,8 +545,9 @@ GLOBAL_LIST_INIT(slot_flags_enumeration, list(
//the mob M is attempting to equip this item into the slot passed through as 'slot'. Return 1 if it can do this and 0 if it can't.
//If you are making custom procs but would like to retain partial or complete functionality of this one, include a 'return ..()' to where you want this to happen.
//Set disable_warning to 1 if you wish it to not give you outputs.
//Set go_over_slot to TRUE if the item can go over an item (ex: magboots going over normal boots)
//Should probably move the bulk of this into mob code some time, as most of it is related to the definition of slots and not item-specific
/obj/item/proc/mob_can_equip(M as mob, slot, disable_warning = FALSE, var/ignore_obstruction = FALSE)
/obj/item/proc/mob_can_equip(mob/M, slot, disable_warning = FALSE, ignore_obstruction = FALSE, go_over_slot)
if(!slot) return 0
if(!M) return 0
@@ -560,7 +568,7 @@ GLOBAL_LIST_INIT(slot_flags_enumeration, list(
return 0
//Next check that the slot is free
if(H.get_equipped_item(slot))
if(H.get_equipped_item(slot) && !go_over_slot)
return 0
//Next check if the slot is accessible.
+1 -1
View File
@@ -333,7 +333,7 @@
usr.client.images.Remove(i)
// Make sure to turn off the colors when we drop the blueprints.
/obj/item/blueprints/dropped(mob/user)
/obj/item/blueprints/dropped(mob/user, equipping, slot)
if(areaColor_turfs.len)
seeAreaColors_remove()
return ..()
+8 -18
View File
@@ -332,27 +332,27 @@
if(message)
to_chat(user, message)
*/
/obj/item/areaeditor/blueprints/dropped(mob/user)
/obj/item/areaeditor/blueprints/dropped(mob/user, equipping, slot)
if(equipping)
return ..()
..()
//clear_viewer()
if(areaColor_turfs.len)
seeAreaColors_remove()
legend = FALSE
/obj/item/areaeditor/proc/get_area_type(area/A)
if (!A)
if(!A)
A = get_area(usr)
if(A.outdoors)
return AREA_SPACE
for (var/type in GLOB.BUILDABLE_AREA_TYPES)
if ( istype(A,type) )
for(var/type in GLOB.BUILDABLE_AREA_TYPES)
if(istype(A,type))
return AREA_SPACE
for (var/type in GLOB.SPECIALS)
if ( istype(A,type) )
for(var/type in GLOB.SPECIALS)
if(istype(A,type))
return AREA_SPECIAL
return AREA_STATION
@@ -776,16 +776,6 @@
if(i.icon_state == "blueprints")
usr.client.images.Remove(i)
//GLOBAL VERB FOR PAPER TO ENABLE ANYONE TO MAKE AN AREA IN BUILDABLE AREAS.
//THIS IS 70 TILES. ANYTHING LARGER SHOULD USE ACTUAL BLUEPRINTS.
@@ -18,7 +18,9 @@
pickup_sound = 'sound/items/pickup/device.ogg'
drop_sound = 'sound/items/drop/device.ogg'
/obj/item/chameleon/dropped(mob/user)
/obj/item/chameleon/dropped(mob/user, equipping, slot)
if(equipping)
return ..()
disrupt()
..()
+1 -1
View File
@@ -100,7 +100,7 @@
RegisterSignal(user, COMSIG_IN_RANGE_OF_IRRADIATION, PROC_REF(on_pre_potential_irradiation))
/obj/item/geiger/dropped(mob/user)
/obj/item/geiger/dropped(mob/user, equipping, slot)
. = ..()
UnregisterSignal(user, COMSIG_IN_RANGE_OF_IRRADIATION)
+1 -1
View File
@@ -81,7 +81,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
. = ..()
update_holder()
/obj/item/gps/dropped(mob/user)
/obj/item/gps/dropped(mob/user, equipping, slot)
. = ..()
update_holder()
@@ -360,7 +360,7 @@
return 0
/obj/item/personal_shield_generator/dropped(mob/user)
/obj/item/personal_shield_generator/dropped(mob/user, equipping, slot)
..()
reattach_gun(user) //A gun attached to a base unit should never exist outside of their base unit or the mob equipping the base unit
@@ -432,7 +432,7 @@
return 0
return 1
/obj/item/gun/energy/gun/generator/dropped(mob/user)
/obj/item/gun/energy/gun/generator/dropped(mob/user, equipping, slot)
..() //update twohanding
if(shield_generator)
shield_generator.reattach_gun(user)
+3 -1
View File
@@ -133,7 +133,9 @@
user_client = new_client
/obj/item/t_scanner/dropped(mob/user)
/obj/item/t_scanner/dropped(mob/user, equipping, slot)
if(equipping)
return ..()
set_user_client(null)
..()
+2 -2
View File
@@ -333,8 +333,8 @@
.=..()
icon_state = "sucker-[vac_power]"
/obj/item/vac_attachment/dropped(mob/user as mob)
.=..()
/obj/item/vac_attachment/dropped(mob/user, equipping, slot)
. = ..()
icon_state = "sucker_drop"
/obj/item/vac_attachment/verb/hide_pack()
+1 -1
View File
@@ -161,7 +161,7 @@
for(var/i in 3 to get_dist(leash_pet, leash_master)) // Move the pet to a minimum of 2 tiles away from the master, so the pet trails behind them.
step_towards(leash_pet, leash_master)
/obj/item/leash/dropped(mob/user)
/obj/item/leash/dropped(mob/user, equipping, slot)
//Drop the leash, and the leash effects stop
. = ..()
if(!leash_pet || !leash_master) //There is no pet. Stop this silliness
+1 -1
View File
@@ -460,7 +460,7 @@
/obj/item/stack/proc/combine_in_loc()
return //STUBBED for now, as it seems to randomly delete stacks
/obj/item/stack/dropped(atom/old_loc)
/obj/item/stack/dropped(mob/user, equipping, slot)
. = ..()
if(isturf(loc))
combine_in_loc()
+1 -1
View File
@@ -46,7 +46,7 @@
else
to_chat(user, span_notice("You don't have a mouth, and can't make much use of \the [src]."))
/obj/item/clothing/mask/chewable/dropped(mob/user)
/obj/item/clothing/mask/chewable/dropped(mob/user, equipping, slot)
STOP_PROCESSING(SSprocessing, src)
..()
@@ -47,12 +47,14 @@ CIGARETTE PACKETS ARE IN FANCY.DM
location.hotspot_expose(700, 5)
return
/obj/item/flame/match/dropped(mob/user)
/obj/item/flame/match/dropped(mob/user, equipping, slot)
if(equipping)
return ..()
//If dropped, put ourselves out
//not before lighting up the turf we land on, though.
if(lit)
spawn(0)
var/turf/location = src.loc
var/turf/location = loc
if(istype(location))
location.hotspot_expose(700, 5)
burn_out()
+3 -1
View File
@@ -307,7 +307,9 @@
if(user) //A ranged legcuff, until proper implementation as items it remains a projectile-only thing.
return 1
/obj/item/handcuffs/legcuffs/bola/dropped(mob/user)
/obj/item/handcuffs/legcuffs/bola/dropped(mob/user, equipping, slot)
if(equipping)
return ..()
..()
visible_message(span_infoplain(span_bold("\The [src]") + " falls apart!"))
@@ -72,7 +72,9 @@
icon_state = "[base_icon][wielded]"
item_state = icon_state
/obj/item/material/twohanded/dropped(mob/user)
/obj/item/material/twohanded/dropped(mob/user, equipping, slot)
if(equipping)
return ..()
..()
if(wielded)
spawn(0)
@@ -562,7 +562,7 @@
return TRUE
return FALSE
/obj/item/medigun_backpack/dropped(mob/user)
/obj/item/medigun_backpack/dropped(mob/user, equipping, slot)
..()
replace_icon()
@@ -263,7 +263,6 @@
* Energy Sword
*/
/obj/item/melee/energy/sword
color
name = "energy sword"
desc = "May the force be within you."
icon_state = "esword"
@@ -285,7 +284,7 @@
projectile_parry_chance = 65
/obj/item/melee/energy/sword/dropped(mob/user)
/obj/item/melee/energy/sword/dropped(mob/user, equipping, slot)
..()
if(!istype(loc,/mob))
deactivate(user)
@@ -145,7 +145,7 @@
else
set_light(0)
/obj/item/melee/shock_maul/dropped(mob/user)
/obj/item/melee/shock_maul/dropped(mob/user, equipping, slot)
..()
if(status)
status = 0
@@ -125,7 +125,7 @@ GLOBAL_LIST_EMPTY(tape_roll_applications)
add_overlay(overlay)
/obj/item/taperoll/dropped(mob/user)
/obj/item/taperoll/dropped(mob/user, equipping, slot)
update_icon()
return ..()
@@ -27,7 +27,7 @@
..(user, slot)
/*
/obj/item/storage/backpack/dropped(mob/user)
/obj/item/storage/backpack/dropped(mob/user, equipping, slot)
if (loc == user && src.use_sound)
if(isbelly(user.loc))
var/obj/belly/B = user.loc
@@ -560,7 +560,7 @@
var/taurtype = /datum/sprite_accessory/tail/taur/horse //Acceptable taur type to be wearing this
var/no_message = "You aren't the appropriate taur type to wear this!"
/obj/item/storage/backpack/saddlebag/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0)
/obj/item/storage/backpack/saddlebag/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE)
if(..())
if(istype(H) && istype(H.tail_style, taurtype))
return 1
@@ -586,7 +586,7 @@
slowdown = 0.5 //And are slower, too...
var/no_message = "You aren't the appropriate taur type to wear this!"
/obj/item/storage/backpack/saddlebag_common/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0)
/obj/item/storage/backpack/saddlebag_common/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE)
if(..())
if(!istype(H))//Error, non HUMAN.
log_runtime("[H] was not a valid human!")
@@ -20,7 +20,7 @@
/obj/item/storage/internal/attack_hand()
return //make sure this is never picked up
/obj/item/storage/internal/mob_can_equip(M as mob, slot, disable_warning = FALSE)
/obj/item/storage/internal/mob_can_equip(mob/M, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE)
return 0 //make sure this is never picked up
//Helper procs to cleanly implement internal storages - storage items that provide inventory slots for other items.
@@ -32,7 +32,7 @@
//items that use internal storage have the option of calling this to emulate default storage MouseDrop behaviour.
//returns 1 if the master item's parent's MouseDrop() should be called, 0 otherwise. It's strange, but no other way of
//doing it without the ability to call another proc's parent, really.
/obj/item/storage/internal/proc/handle_mousedrop(mob/user as mob, obj/over_object as obj)
/obj/item/storage/internal/proc/handle_mousedrop(mob/user, obj/over_object)
if (ishuman(user) || issmall(user)) //so monkeys can take off their backpacks -- Urist
if (istype(user.loc,/obj/mecha)) // stops inventory actions in a mech
@@ -65,7 +65,7 @@
//items that use internal storage have the option of calling this to emulate default storage attack_hand behaviour.
//returns 1 if the master item's parent's attack_hand() should be called, 0 otherwise.
//It's strange, but no other way of doing it without the ability to call another proc's parent, really.
/obj/item/storage/internal/proc/handle_attack_hand(mob/user as mob)
/obj/item/storage/internal/proc/handle_attack_hand(mob/user)
if(ishuman(user))
var/mob/living/carbon/human/H = user
@@ -60,7 +60,7 @@
else
return ..()
/obj/item/storage/laundry_basket/dropped(mob/user)
/obj/item/storage/laundry_basket/dropped(mob/user, equipping, slot)
if(linked)
QDEL_NULL(linked)
return ..()
@@ -78,7 +78,7 @@
name = "second hand"
use_to_pickup = FALSE
/obj/item/storage/laundry_basket/offhand/dropped(mob/user)
/obj/item/storage/laundry_basket/offhand/dropped(mob/user, equipping, slot)
SHOULD_CALL_PARENT(FALSE)
if(user.isEquipped(linked))
user.drop_from_inventory(linked)
@@ -147,7 +147,7 @@
user.AddComponent(/datum/component/recursive_move)
RegisterSignal(user, COMSIG_MOVABLE_ATTEMPTED_MOVE, /obj/item/ore_bag/proc/autoload)
/obj/item/ore_bag/dropped(mob/user)
/obj/item/ore_bag/dropped(mob/user, equipping, slot)
..()
UnregisterSignal(user, COMSIG_MOVABLE_ATTEMPTED_MOVE)
+1 -1
View File
@@ -97,7 +97,7 @@
else
set_light(0)
/obj/item/melee/baton/dropped(mob/user)
/obj/item/melee/baton/dropped(mob/user, equipping, slot)
..()
if(status && grip_safety && !taped_safety)
status = 0
@@ -507,9 +507,9 @@
..()
/obj/item/weldingtool/tubefed/dropped(mob/user)
/obj/item/weldingtool/tubefed/dropped(mob/user, equipping, slot)
..()
if(src.loc != user)
if(loc != user)
mounted_pack.return_nozzle()
to_chat(user, span_notice("\The [src] retracts to its fueltank."))
+1 -1
View File
@@ -13,6 +13,6 @@
remove_verb(H, /mob/living/proc/shred_limb_temp)
..()
/obj/item/beartrap/dropped(mob/user)
/obj/item/beartrap/dropped(mob/user, equipping, slot)
remove_verb(user, /mob/living/proc/shred_limb_temp)
..()
+7 -5
View File
@@ -152,18 +152,20 @@
Img.color = O.color
add_overlay(Img)
/obj/item/tray/dropped(mob/user)
/obj/item/tray/dropped(mob/user, equipping, slot)
if(equipping)
return ..() //Don't bother searching if we're just being put in a pocket/in hands.
..()
var/noTable = null
spawn() //Allows the tray to udpate location, rather than just checking against mob's location
if(isturf(src.loc) && !(locate(/obj/structure/table) in src.loc))
spawn() //Allows the tray to update location, rather than just checking against mob's location
if(isturf(loc) && !(locate(/obj/structure/table) in loc))
noTable = 1
if(isturf(loc) && !(locate(/mob/living) in src.loc))
if(isturf(loc) && !(locate(/mob/living) in loc))
cut_overlays()
for(var/obj/item/I in carrying)
I.forceMove(src.loc)
I.forceMove(loc)
carrying.Remove(I)
if(noTable)
for(var/i = 1, i <= rand(1,2), i++)
+1 -5
View File
@@ -77,11 +77,7 @@
throwforce = 0
force = 0
var/net_type = /obj/effect/energy_net
/obj/item/energy_net/dropped(mob/user)
..()
spawn(10)
if(src) qdel(src)
item_flags = DROPDEL
/obj/item/energy_net/throw_impact(atom/hit_atom)
..()
@@ -26,7 +26,7 @@
nozzle = null
return ..()
/obj/item/weldpack/dropped(mob/user)
/obj/item/weldpack/dropped(mob/user, equipping, slot)
..()
if(nozzle)
user.remove_from_mob(nozzle)
+1 -1
View File
@@ -89,7 +89,7 @@
return TRUE
tgui_interact(user)
/obj/item/canvas/dropped(mob/user)
/obj/item/canvas/dropped(mob/user, equipping, slot)
pixel_x = initial(pixel_x)
pixel_y = initial(pixel_y)
return ..()