diff --git a/code/__defines/dcs/signals/signals_atom/signals_atom_main.dm b/code/__defines/dcs/signals/signals_atom/signals_atom_main.dm index 81632d25f3..8d0371d9ce 100644 --- a/code/__defines/dcs/signals/signals_atom/signals_atom_main.dm +++ b/code/__defines/dcs/signals/signals_atom/signals_atom_main.dm @@ -182,9 +182,6 @@ #define COMSIG_OBSERVER_TURF_ENTERED "observer_turf_entered" #define COMSIG_OBSERVER_TURF_EXITED "observer_turf_exited" #define COMSIG_OBSERVER_Z_MOVED "observer_z_moved" -#define COMSIG_OBSERVER_ITEM_EQUIPPED "observer_item_equipped" -#define COMSIG_OBSERVER_MOB_UNEQUIPPED "observer_mob_unequipped" -#define COMSIG_OBSERVER_ITEM_UNEQUIPPED "observer_item_unequipped" #define COMSIG_OBSERVER_GLOBALMOVED "observer_global_move" ///called when teleporting into a protected turf: (channel, turf/origin) diff --git a/code/__defines/dcs/signals/signals_mob/signals_mob_main.dm b/code/__defines/dcs/signals/signals_mob/signals_mob_main.dm index eb931bbe46..2c87a44bd7 100644 --- a/code/__defines/dcs/signals/signals_mob/signals_mob_main.dm +++ b/code/__defines/dcs/signals/signals_mob/signals_mob_main.dm @@ -310,7 +310,6 @@ #define COMSIG_GHOST_QUERY_COMPLETE "ghost_query_complete" /// COMSIG used to get messages where they need to go #define COMSIG_VISIBLE_MESSAGE "visible_message" -#define COMSIG_OBSERVER_MOB_EQUIPPED "observer_mob_equipped" ///from end of revival_healing_action(): () #define COMSIG_LIVING_AHEAL "living_post_aheal" diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 93af7cef66..9664983a30 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -68,7 +68,7 @@ var/mob/living/host = null item_flags = DROPDEL | NOSTRIP -/obj/item/tk_grab/dropped(mob/user) +/obj/item/tk_grab/dropped(mob/user, equipping, slot) ..() if(focus && user && loc != user && loc != user.loc) // drop_item() gets called when you tk-attack a table/closet with an item if(focus.Adjacent(loc)) diff --git a/code/datums/components/antags/changeling/powers/armblade.dm b/code/datums/components/antags/changeling/powers/armblade.dm index 55e67c08b4..625f02ad01 100644 --- a/code/datums/components/antags/changeling/powers/armblade.dm +++ b/code/datums/components/antags/changeling/powers/armblade.dm @@ -59,7 +59,7 @@ desc = "A grotesque weapon made out of bone and flesh that cleaves through people as a hot knife through butter." icon = 'icons/obj/weapons.dmi' icon_state = "arm_blade" - w_class = ITEMSIZE_HUGE + w_class = ITEMSIZE_NO_CONTAINER force = 5 throwforce = 0 //Just to be on the safe side throw_range = 0 @@ -81,12 +81,12 @@ span_warningplain("You hear organic matter ripping and tearing!")) src.creator = loc -/obj/item/melee/changeling/dropped(mob/user) - ..() +/obj/item/melee/changeling/dropped(mob/user, equipping, slot) visible_message(span_warning("With a sickening crunch, [creator] reforms their arm!"), span_notice("We assimilate the weapon back into our body."), span_warningplain("You hear organic matter ripping and tearing!")) playsound(src, 'sound/effects/blobattack.ogg', 30, 1) + ..() /obj/item/melee/changeling/Destroy() creator = null diff --git a/code/datums/components/antags/changeling/powers/electric_lockpick.dm b/code/datums/components/antags/changeling/powers/electric_lockpick.dm index 79250e28b9..a4e7f64cd3 100644 --- a/code/datums/components/antags/changeling/powers/electric_lockpick.dm +++ b/code/datums/components/antags/changeling/powers/electric_lockpick.dm @@ -31,6 +31,7 @@ icon = 'icons/obj/weapons.dmi' icon_state = "electric_hand" show_examine = FALSE + w_class = ITEMSIZE_NO_CONTAINER item_flags = DROPDEL | NOSTRIP /obj/item/finger_lockpick/Initialize(mapload) @@ -38,7 +39,9 @@ if(ismob(loc)) to_chat(loc, span_notice("We shape our finger to fit inside electronics, and are ready to force them open.")) -/obj/item/finger_lockpick/dropped(mob/user) +/obj/item/finger_lockpick/dropped(mob/user, equipping, slot) + if(equipping) + return ..() ..() to_chat(user, span_notice("We discreetly shape our finger back to a less suspicious form.")) diff --git a/code/datums/observation/equipped.dm b/code/datums/observation/equipped.dm deleted file mode 100644 index b5a9fc5a95..0000000000 --- a/code/datums/observation/equipped.dm +++ /dev/null @@ -1,40 +0,0 @@ -// Observer Pattern Implementation: Equipped -// Registration type: /mob -// -// Raised when: A mob equips an item. -// -// Arguments that the called proc should expect: -// /mob/equipper: The mob that equipped the item. -// /obj/item/item: The equipped item. -// slot: The slot equipped to. -/* -GLOBAL_DATUM_INIT(mob_equipped_event, /datum/decl/observ/mob_equipped, new) - -/datum/decl/observ/mob_equipped - name = "Mob Equipped" - expected_type = /mob - -// Observer Pattern Implementation: Equipped -// Registration type: /obj/item -// -// Raised when: A mob equips an item. -// -// Arguments that the called proc should expect: -// /obj/item/item: The equipped item. -// /mob/equipper: The mob that equipped the item. -// slot: The slot equipped to. -GLOBAL_DATUM_INIT(item_equipped_event, /datum/decl/observ/item_equipped, new) - -/datum/decl/observ/item_equipped - name = "Item Equipped" - expected_type = /obj/item -*/ -//Deprecated in favor of comsigs -/******************** -* Equipped Handling * -********************/ - -/obj/item/equipped(var/mob/user, var/slot) - . = ..() - SEND_SIGNAL(user, COMSIG_OBSERVER_MOB_EQUIPPED, src, slot) - SEND_SIGNAL(src, COMSIG_OBSERVER_ITEM_EQUIPPED, user, slot) diff --git a/code/datums/observation/unequipped.dm b/code/datums/observation/unequipped.dm deleted file mode 100644 index 0471c298f9..0000000000 --- a/code/datums/observation/unequipped.dm +++ /dev/null @@ -1,45 +0,0 @@ -// Observer Pattern Implementation: Unequipped (dropped) -// Registration type: /mob -// -// Raised when: A mob unequips/drops an item. -// -// Arguments that the called proc should expect: -// /mob/equipped: The mob that unequipped/dropped the item. -// /obj/item/item: The unequipped item. -/* -GLOBAL_DATUM_INIT(mob_unequipped_event, /datum/decl/observ/mob_unequipped, new) - -/datum/decl/observ/mob_unequipped - name = "Mob Unequipped" - expected_type = /mob - -// Observer Pattern Implementation: Unequipped (dropped) -// Registration type: /obj/item -// -// Raised when: A mob unequips/drops an item. -// -// Arguments that the called proc should expect: -// /obj/item/item: The unequipped item. -// /mob/equipped: The mob that unequipped/dropped the item. - -GLOBAL_DATUM_INIT(item_unequipped_event, /datum/decl/observ/item_unequipped, new) - -/datum/decl/observ/item_unequipped - name = "Item Unequipped" - expected_type = /obj/item -*/ -//Deprecated in favor of comsigs - -/********************** -* Unequipped Handling * -**********************/ - -/obj/item/dropped(var/mob/user) - . = ..(user) - //SEND_SIGNAL(user, COMSIG_OBSERVER_MOB_UNEQUIPPED, src) - //SEND_SIGNAL(src, COMSIG_OBSERVER_ITEM_UNEQUIPPED, user) - if(user) // Cannot always guarantee that user won't be null - SEND_SIGNAL(user, COMSIG_OBSERVER_MOB_UNEQUIPPED, src) - SEND_SIGNAL(src, COMSIG_OBSERVER_ITEM_UNEQUIPPED, user) - else - SEND_SIGNAL(src, COMSIG_OBSERVER_ITEM_UNEQUIPPED) diff --git a/code/game/gamemodes/technomancer/core_obj.dm b/code/game/gamemodes/technomancer/core_obj.dm index 565732c374..8d3bf982b3 100644 --- a/code/game/gamemodes/technomancer/core_obj.dm +++ b/code/game/gamemodes/technomancer/core_obj.dm @@ -50,7 +50,7 @@ ..() // Removes the spell buttons from the HUD. -/obj/item/technomancer_core/dropped(mob/user) +/obj/item/technomancer_core/dropped(mob/user, equipping, slot) for(var/atom/movable/screen/ability/obj_based/technomancer/A in wearer.ability_master.ability_objects) wearer.ability_master.remove_ability(A) wearer = null diff --git a/code/game/gamemodes/technomancer/devices/gloves_of_regen.dm b/code/game/gamemodes/technomancer/devices/gloves_of_regen.dm index af6d9cf0a5..ed9ac36ebf 100644 --- a/code/game/gamemodes/technomancer/devices/gloves_of_regen.dm +++ b/code/game/gamemodes/technomancer/devices/gloves_of_regen.dm @@ -30,12 +30,14 @@ ..() -/obj/item/clothing/gloves/regen/dropped(var/mob/user) +/obj/item/clothing/gloves/regen/dropped(mob/user, equipping, slot) + if(equipping) + return ..() + ..() if(!ishuman(user)) return - var/mob/living/carbon/human/H = user if(H.can_feel_pain()) to_chat(H, span_danger("You feel the hypodermic needles as you slide \the [src] off!")) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 4ae24dbac1..cd26f4799b 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -66,7 +66,7 @@ Buildable meters if(make_from.mirrored) do_a_flip() -/obj/item/pipe/dropped(mob/user) +/obj/item/pipe/dropped(mob/user, equipping, slot) if(loc) setPipingLayer(piping_layer) return ..() @@ -271,7 +271,7 @@ Buildable meters to_chat(user, span_notice("You fasten the meter to the pipe.")) qdel(src) -/obj/item/pipe_meter/dropped(mob/user) +/obj/item/pipe_meter/dropped(mob/user, equipping, slot) . = ..() if(loc) setAttachLayer(piping_layer) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 7d8ba93faa..1351d4537c 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -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. diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 6aa6a6513c..01b75b8d69 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -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 ..() diff --git a/code/game/objects/items/blueprints_vr.dm b/code/game/objects/items/blueprints_vr.dm index 67cbeab27f..816e65b9a7 100644 --- a/code/game/objects/items/blueprints_vr.dm +++ b/code/game/objects/items/blueprints_vr.dm @@ -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. diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm index 961ff0ff86..24c9769bcc 100644 --- a/code/game/objects/items/devices/chameleonproj.dm +++ b/code/game/objects/items/devices/chameleonproj.dm @@ -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() ..() diff --git a/code/game/objects/items/devices/geiger.dm b/code/game/objects/items/devices/geiger.dm index 2406e9749b..d0da4d93bb 100644 --- a/code/game/objects/items/devices/geiger.dm +++ b/code/game/objects/items/devices/geiger.dm @@ -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) diff --git a/code/game/objects/items/devices/gps.dm b/code/game/objects/items/devices/gps.dm index 04ffdc83b4..88f0fb663b 100644 --- a/code/game/objects/items/devices/gps.dm +++ b/code/game/objects/items/devices/gps.dm @@ -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() diff --git a/code/game/objects/items/devices/personal_shield_generator_vr.dm b/code/game/objects/items/devices/personal_shield_generator_vr.dm index ed4c2684b8..a76c613fb1 100644 --- a/code/game/objects/items/devices/personal_shield_generator_vr.dm +++ b/code/game/objects/items/devices/personal_shield_generator_vr.dm @@ -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) diff --git a/code/game/objects/items/devices/t_scanner.dm b/code/game/objects/items/devices/t_scanner.dm index 6563ded24f..28969a0196 100644 --- a/code/game/objects/items/devices/t_scanner.dm +++ b/code/game/objects/items/devices/t_scanner.dm @@ -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) ..() diff --git a/code/game/objects/items/devices/vacpack.dm b/code/game/objects/items/devices/vacpack.dm index ac662f8ddd..96b1f20327 100644 --- a/code/game/objects/items/devices/vacpack.dm +++ b/code/game/objects/items/devices/vacpack.dm @@ -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() diff --git a/code/game/objects/items/leash.dm b/code/game/objects/items/leash.dm index 4930a436f0..0bb1aa314f 100644 --- a/code/game/objects/items/leash.dm +++ b/code/game/objects/items/leash.dm @@ -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 diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index f0e85bd52c..322114782f 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -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() diff --git a/code/game/objects/items/weapons/chewables.dm b/code/game/objects/items/weapons/chewables.dm index 2f4990216b..30f8041acd 100644 --- a/code/game/objects/items/weapons/chewables.dm +++ b/code/game/objects/items/weapons/chewables.dm @@ -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) ..() diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index b5082829d9..b5853d2c69 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -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() diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 14a0c72216..a8fb38acf9 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -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!")) diff --git a/code/game/objects/items/weapons/material/twohanded.dm b/code/game/objects/items/weapons/material/twohanded.dm index 8171f48960..62e5ba7873 100644 --- a/code/game/objects/items/weapons/material/twohanded.dm +++ b/code/game/objects/items/weapons/material/twohanded.dm @@ -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) diff --git a/code/game/objects/items/weapons/medigun/medigun_backpack.dm b/code/game/objects/items/weapons/medigun/medigun_backpack.dm index 2b97657267..935914a8fe 100644 --- a/code/game/objects/items/weapons/medigun/medigun_backpack.dm +++ b/code/game/objects/items/weapons/medigun/medigun_backpack.dm @@ -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() diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index 25d930ded3..ac1c97d951 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -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) diff --git a/code/game/objects/items/weapons/melee/shock_maul.dm b/code/game/objects/items/weapons/melee/shock_maul.dm index 0f77d7f403..08ab6bf5fa 100644 --- a/code/game/objects/items/weapons/melee/shock_maul.dm +++ b/code/game/objects/items/weapons/melee/shock_maul.dm @@ -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 diff --git a/code/game/objects/items/weapons/policetape.dm b/code/game/objects/items/weapons/policetape.dm index 85fcd39aa5..8fca168fc7 100644 --- a/code/game/objects/items/weapons/policetape.dm +++ b/code/game/objects/items/weapons/policetape.dm @@ -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 ..() diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm index 650d12aa83..00341c2378 100644 --- a/code/game/objects/items/weapons/storage/backpack.dm +++ b/code/game/objects/items/weapons/storage/backpack.dm @@ -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!") diff --git a/code/game/objects/items/weapons/storage/internal.dm b/code/game/objects/items/weapons/storage/internal.dm index ded7773644..9bc6ce393b 100644 --- a/code/game/objects/items/weapons/storage/internal.dm +++ b/code/game/objects/items/weapons/storage/internal.dm @@ -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 diff --git a/code/game/objects/items/weapons/storage/laundry_basket.dm b/code/game/objects/items/weapons/storage/laundry_basket.dm index b2a82ac9e9..cae504fa41 100644 --- a/code/game/objects/items/weapons/storage/laundry_basket.dm +++ b/code/game/objects/items/weapons/storage/laundry_basket.dm @@ -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) diff --git a/code/game/objects/items/weapons/storage/ore_bag.dm b/code/game/objects/items/weapons/storage/ore_bag.dm index 6fef5bfbfc..17bc64b4fc 100644 --- a/code/game/objects/items/weapons/storage/ore_bag.dm +++ b/code/game/objects/items/weapons/storage/ore_bag.dm @@ -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) diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 6aa019c267..07dbda058a 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -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 diff --git a/code/game/objects/items/weapons/tools/weldingtool.dm b/code/game/objects/items/weapons/tools/weldingtool.dm index 4698377ea6..b8783925af 100644 --- a/code/game/objects/items/weapons/tools/weldingtool.dm +++ b/code/game/objects/items/weapons/tools/weldingtool.dm @@ -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.")) diff --git a/code/game/objects/items/weapons/traps_vr.dm b/code/game/objects/items/weapons/traps_vr.dm index 079165a2eb..96a0f31968 100644 --- a/code/game/objects/items/weapons/traps_vr.dm +++ b/code/game/objects/items/weapons/traps_vr.dm @@ -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) ..() diff --git a/code/game/objects/items/weapons/trays.dm b/code/game/objects/items/weapons/trays.dm index ddbecc8f7c..81941f0011 100644 --- a/code/game/objects/items/weapons/trays.dm +++ b/code/game/objects/items/weapons/trays.dm @@ -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++) diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index 00c13243e0..83ea9a8f85 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -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) ..() diff --git a/code/game/objects/items/weapons/weldbackpack.dm b/code/game/objects/items/weapons/weldbackpack.dm index d2fcd11c76..8e3db413b3 100644 --- a/code/game/objects/items/weapons/weldbackpack.dm +++ b/code/game/objects/items/weapons/weldbackpack.dm @@ -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) diff --git a/code/game/objects/structures/artstuff.dm b/code/game/objects/structures/artstuff.dm index a8d813030e..4d17552b2d 100644 --- a/code/game/objects/structures/artstuff.dm +++ b/code/game/objects/structures/artstuff.dm @@ -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 ..() diff --git a/code/modules/artifice/deadringer.dm b/code/modules/artifice/deadringer.dm index 0a440990ca..28313ad137 100644 --- a/code/modules/artifice/deadringer.dm +++ b/code/modules/artifice/deadringer.dm @@ -22,12 +22,13 @@ STOP_PROCESSING(SSobj, src) . = ..() -/obj/item/deadringer/dropped(mob/user) +/obj/item/deadringer/dropped(mob/user, equipping, slot) + if(equipping) + return ..() //Don't break cloak if we're being put in a pocket. ..() if(timer > 20) reveal() watchowner = null - return /obj/item/deadringer/attack_self(mob/user) . = ..(user) diff --git a/code/modules/artifice/telecube.dm b/code/modules/artifice/telecube.dm index a1cf0d8f86..18ec863e12 100644 --- a/code/modules/artifice/telecube.dm +++ b/code/modules/artifice/telecube.dm @@ -113,7 +113,7 @@ . = ..() update_icon() -/obj/item/telecube/dropped(mob/user) +/obj/item/telecube/dropped(mob/user, equipping, slot) . = ..() update_icon() diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index aac9e2db8d..4c69aa55fa 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -65,7 +65,7 @@ toggle_scan() time = initial(time) -/obj/item/assembly/prox_sensor/dropped(mob/user) +/obj/item/assembly/prox_sensor/dropped(mob/user, equipping, slot) ..() sense() diff --git a/code/modules/awaymissions/redgate.dm b/code/modules/awaymissions/redgate.dm index c710151fe2..3ee4565334 100644 --- a/code/modules/awaymissions/redgate.dm +++ b/code/modules/awaymissions/redgate.dm @@ -1535,7 +1535,7 @@ /* //TODO - make this not trigger when the flag is returned to its original location -/obj/item/laserdome_flag/dropped(mob/user) +/obj/item/laserdome_flag/dropped(mob/user, equipping, slot) . = ..() GLOB.global_announcer.autosay("[src] dropped!","Laserdome Announcer","Entertainment") */ @@ -1700,7 +1700,7 @@ /* //TODO- make this not trigger when the ball is thrown or dunked, only when it's actually dropped -/obj/item/laserdome_hyperball/dropped(mob/user) +/obj/item/laserdome_hyperball/dropped(mob/user, equipping, slot) . = ..() GLOB.global_announcer.autosay("[capitalize(last_team)] fumble!","Laserdome Announcer","Entertainment") */ diff --git a/code/modules/clothing/accessories/accessory_vr.dm b/code/modules/clothing/accessories/accessory_vr.dm index ce203d546e..900776435e 100644 --- a/code/modules/clothing/accessories/accessory_vr.dm +++ b/code/modules/clothing/accessories/accessory_vr.dm @@ -36,7 +36,7 @@ setUniqueSpeciesSprite() ..(S, user) -/obj/item/clothing/accessory/choker/dropped(mob/user) +/obj/item/clothing/accessory/choker/dropped(mob/user, equipping, slot) ..() icon_override = icon_previous_override @@ -74,7 +74,7 @@ setUniqueSpeciesSprite() ..(S, user) -/obj/item/clothing/accessory/collar/dropped(mob/user) +/obj/item/clothing/accessory/collar/dropped(mob/user, equipping, slot) ..() icon_override = icon_previous_override diff --git a/code/modules/clothing/accessories/clothing.dm b/code/modules/clothing/accessories/clothing.dm index 3374b0dd4a..de956f0681 100644 --- a/code/modules/clothing/accessories/clothing.dm +++ b/code/modules/clothing/accessories/clothing.dm @@ -202,7 +202,7 @@ icon_override = 'icons/inventory/accessory/mob.dmi' update_clothing_icon() -/obj/item/clothing/accessory/poncho/dropped(mob/user) //Resets the override to prevent the wrong .dmi from being used because equipped only triggers when wearing ponchos as suits. +/obj/item/clothing/accessory/poncho/dropped(mob/user, equipping, slot) //Resets the override to prevent the wrong .dmi from being used because equipped only triggers when wearing ponchos as suits. ..() icon_override = null diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index e3d96ac75b..d737b48e5d 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -62,7 +62,7 @@ for(var/trait in clothing_traits) ADD_CLOTHING_TRAIT(user, trait) -/obj/item/clothing/dropped(mob/user) +/obj/item/clothing/dropped(mob/user, equipping, slot) ..() if(enables_planes) user.recalculate_vis() @@ -70,7 +70,7 @@ REMOVE_CLOTHING_TRAIT(user, trait) //BS12: Species-restricted clothing check. -/obj/item/clothing/mob_can_equip(M as mob, slot, disable_warning = FALSE) +/obj/item/clothing/mob_can_equip(mob/M, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot) //if we can't equip the item anyway, don't bother with species_restricted (cuts down on spam) if (!..()) @@ -375,55 +375,70 @@ transfer_blood = 0 update_icon() -/obj/item/clothing/gloves/mob_can_equip(mob/user, slot, disable_warning = FALSE) +/obj/item/clothing/gloves/mob_can_equip(mob/user, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = TRUE) var/mob/living/carbon/human/H = user if(slot && slot == slot_gloves) var/obj/item/clothing/G = H.gloves - if(istype(G)) - ring = H.gloves + //Check glove_level, which both accessories and gloves share. + if(istype(G, /obj/item/clothing/accessory) || istype(G, /obj/item/clothing/gloves)) + ring = H.gloves //Ring or gloves both work here. They both have the glove_level var. if(ring.glove_level >= src.glove_level) - to_chat(user, "You are unable to wear \the [src] as \the [H.gloves] are in the way.") ring = null - return 0 - else - H.drop_from_inventory(ring) //Remove the ring (or other under-glove item in the hand slot?) so you can put on the gloves. - ring.forceMove(src) - to_chat(user, "You slip \the [src] on over \the [src.ring].") - if(!(flags & THICKMATERIAL)) - punch_force += ring.punch_force - else + return FALSE ring = null - if(!..()) - if(ring) //Put the ring back on if the check fails. - if(H.equip_to_slot_if_possible(ring, slot_gloves)) - src.ring = null - punch_force = initial(punch_force) - return 0 + //Check overgloves, which only gloves have. + if(istype(G, /obj/item/clothing/gloves)) + gloves = H.gloves + if(gloves.overgloves) + gloves = null + return FALSE + gloves = null - wearer = WEAKREF(H) - return 1 + return ..() -/obj/item/clothing/gloves/dropped(mob/user) +/obj/item/clothing/gloves/equipped(mob/user, slot) + wearer = WEAKREF(user) + return ..() + +/obj/item/clothing/gloves/dropped(mob/user, equipping, slot) ..() punch_force = initial(punch_force) wearer = null if(!ishuman(user)) return - var/mob/living/carbon/human/H = user - if(gloves) //We have nested gloves! Gloves under our gloves! + + //Equipping to our glove slot? Cover our former gloves, if applicable. + if(equipping && slot && slot == slot_gloves) + var/obj/item/clothing/G = H.gloves + if(istype(G)) + if(istype(G, /obj/item/clothing/gloves)) + gloves = H.gloves + H.unEquip(gloves, TRUE, src) + to_chat(user, "You slip \the [src] on over \the [gloves].") + else if(istype(G, /obj/item/clothing/accessory)) + ring = H.gloves + H.unEquip(ring, TRUE, src) + to_chat(user, "You slip \the [src] on over \the [ring].") + if(!(flags & THICKMATERIAL)) + punch_force += gloves.punch_force + return + + //Taking our gloves off? Put our former gloves / ring on. + if(gloves) if(!H.equip_to_slot_if_possible(gloves, slot_gloves)) gloves.forceMove(get_turf(src)) - if(ring) - gloves.ring = ring - src.gloves = null - else if(ring && istype(H)) //We do NOT have gloves under our gloves but have a ring under our glove instead! + gloves = null + return + + if(ring) //We do NOT have gloves under our gloves but have a ring under our glove instead! if(!H.equip_to_slot_if_possible(ring, slot_gloves)) ring.forceMove(get_turf(src)) - src.ring = null + ring = null + return /obj/item/clothing/gloves var/datum/unarmed_attack/special_attack = null //do the gloves have a special unarmed attack? @@ -972,7 +987,7 @@ RemoveHood() ..() -/obj/item/clothing/suit/dropped(mob/user) +/obj/item/clothing/suit/dropped(mob/user, equipping, slot) RemoveHood() ..() diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index d4d20e5ca1..6cd830df8b 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -85,7 +85,7 @@ QDEL_NULL(tgarscreen) . = ..() -/obj/item/clothing/glasses/omnihud/dropped(mob/user) +/obj/item/clothing/glasses/omnihud/dropped(mob/user, equipping, slot) if(tgarscreen) SStgui.close_uis(src) ..() diff --git a/code/modules/clothing/gloves/arm_guards.dm b/code/modules/clothing/gloves/arm_guards.dm index 138943980e..051dad3b63 100644 --- a/code/modules/clothing/gloves/arm_guards.dm +++ b/code/modules/clothing/gloves/arm_guards.dm @@ -9,7 +9,7 @@ pickup_sound = 'sound/items/pickup/axe.ogg' resistance_flags = FIRE_PROOF -/obj/item/clothing/gloves/arm_guard/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = FALSE) +/obj/item/clothing/gloves/arm_guard/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = TRUE) if(..()) //This will only run if no other problems occured when equiping. if(H.wear_suit) if(H.wear_suit.body_parts_covered & ARMS) diff --git a/code/modules/clothing/gloves/gauntlets.dm b/code/modules/clothing/gloves/gauntlets.dm index 3ee8a85fa7..14205aafb8 100644 --- a/code/modules/clothing/gloves/gauntlets.dm +++ b/code/modules/clothing/gloves/gauntlets.dm @@ -13,28 +13,3 @@ overgloves = 1 punch_force = 5 resistance_flags = FIRE_PROOF - -/obj/item/clothing/gloves/gauntlets/mob_can_equip(mob/user, slot, disable_warning = FALSE) - var/mob/living/carbon/human/H = user - if(H.gloves) - gloves = H.gloves - if(!istype(gloves)) - to_chat(user, "You are unable to wear \the [src] as \the [H.gloves] are in the way.") - gloves = null - return 0 - if(gloves.overgloves) - to_chat(user, "You are unable to wear \the [src] as \the [H.gloves] are in the way.") - gloves = null - return 0 - H.drop_from_inventory(gloves) - gloves.forceMove(src) - - if(!..()) - if(gloves) - if(H.equip_to_slot_if_possible(gloves, slot_gloves)) - gloves = null - return 0 - if(gloves) - to_chat(user, "You slip \the [src] on over \the [gloves].") - wearer = WEAKREF(H) - return 1 diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 78f759b9f3..38ab1e6ded 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -279,23 +279,25 @@ to_chat(wearer, span_danger("The inside of your head hurts...")) wearer.adjustBrainLoss(brainloss_cost) -/obj/item/clothing/head/psy_crown/equipped(var/mob/living/carbon/human/H) +/obj/item/clothing/head/psy_crown/equipped(mob/living/carbon/human/user) ..() - if(istype(H) && H.head == src && H.is_sentient()) + if(istype(user) && user.head == src && user.is_sentient()) START_PROCESSING(SSobj, src) if(flavor_equip) - to_chat(H, flavor_equip) + to_chat(user, flavor_equip) -/obj/item/clothing/head/psy_crown/dropped(var/mob/living/carbon/human/H) +/obj/item/clothing/head/psy_crown/dropped(mob/living/carbon/human/user, equipping, slot) + if(equipping || loc == user) + return ..() ..() STOP_PROCESSING(SSobj, src) - if(H.is_sentient()) - if(loc == H) // Still inhand. + if(user.is_sentient()) + if(loc == user) // Still inhand. if(flavor_unequip) - to_chat(H, flavor_unequip) + to_chat(user, flavor_unequip) return if(flavor_drop) - to_chat(H, flavor_drop) + to_chat(user, flavor_drop) /obj/item/clothing/head/psy_crown/Destroy() STOP_PROCESSING(SSobj, src) diff --git a/code/modules/clothing/head/pilot_helmet.dm b/code/modules/clothing/head/pilot_helmet.dm index bdfcdf60d3..a2606383d6 100644 --- a/code/modules/clothing/head/pilot_helmet.dm +++ b/code/modules/clothing/head/pilot_helmet.dm @@ -177,7 +177,7 @@ user.client.screen |= pilot_hud user.client.images |= raw_images -/obj/item/clothing/head/pilot/dropped(mob/user) +/obj/item/clothing/head/pilot/dropped(mob/user, equipping, slot) . = ..() if(user.client) user.client.screen -= pilot_hud diff --git a/code/modules/clothing/head/soft_caps.dm b/code/modules/clothing/head/soft_caps.dm index 73b39ca0ce..78551a5651 100644 --- a/code/modules/clothing/head/soft_caps.dm +++ b/code/modules/clothing/head/soft_caps.dm @@ -8,7 +8,9 @@ body_parts_covered = 0 special_handling = TRUE -/obj/item/clothing/head/soft/dropped(mob/user) +/obj/item/clothing/head/soft/dropped(mob/user, equipping, slot) + if(equipping) + return ..() icon_state = initial(icon_state) flipped = FALSE ..() diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index e17860b0ca..51f2a94408 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -246,7 +246,7 @@ c.remove(eye) eye.setLoc(user) -/obj/item/clothing/mask/ai/dropped(mob/user) +/obj/item/clothing/mask/ai/dropped(mob/user, equipping, slot) ..() if(eye.owner == user) for(var/datum/chunk/c in eye.visibleChunks) diff --git a/code/modules/clothing/masks/monitor.dm b/code/modules/clothing/masks/monitor.dm index 7e578ce608..b06b994938 100644 --- a/code/modules/clothing/masks/monitor.dm +++ b/code/modules/clothing/masks/monitor.dm @@ -30,7 +30,7 @@ icon_state = GLOB.monitor_states[monitor_state_index] to_chat(H, span_notice("\The [src] connects to your display output.")) -/obj/item/clothing/mask/monitor/dropped(mob/user) +/obj/item/clothing/mask/monitor/dropped(mob/user, equipping, slot) canremove = TRUE return ..() diff --git a/code/modules/clothing/masks/tesh_synth_facemask.dm b/code/modules/clothing/masks/tesh_synth_facemask.dm index fe92314461..aa82b86015 100644 --- a/code/modules/clothing/masks/tesh_synth_facemask.dm +++ b/code/modules/clothing/masks/tesh_synth_facemask.dm @@ -16,22 +16,22 @@ ..() var/mob/living/carbon/human/H = loc if(istype(H) && H.wear_mask == src) - canremove = 0 + canremove = FALSE maskmaster = H START_PROCESSING(SSprocessing, src) -/obj/item/clothing/mask/synthfacemask/dropped(mob/user) - canremove = 1 +/obj/item/clothing/mask/synthfacemask/dropped(mob/user, equipping, slot) + canremove = TRUE maskmaster = null STOP_PROCESSING(SSprocessing, src) - return ..() + ..() /obj/item/clothing/mask/synthfacemask/Destroy() maskmaster = null . = ..() STOP_PROCESSING(SSprocessing, src) -/obj/item/clothing/mask/synthfacemask/mob_can_equip(var/mob/living/carbon/human/user, var/slot, var/disable_warning = FALSE) +/obj/item/clothing/mask/synthfacemask/mob_can_equip(mob/living/carbon/human/user, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if (!..()) return 0 if(istype(user)) diff --git a/code/modules/clothing/shoes/leg_guards.dm b/code/modules/clothing/shoes/leg_guards.dm index 4f713db32f..79f9176d7c 100644 --- a/code/modules/clothing/shoes/leg_guards.dm +++ b/code/modules/clothing/shoes/leg_guards.dm @@ -11,17 +11,17 @@ pickup_sound = 'sound/items/pickup/boots.ogg' resistance_flags = FIRE_PROOF -/obj/item/clothing/shoes/leg_guard/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = FALSE) +/obj/item/clothing/shoes/leg_guard/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = TRUE) if(..()) //This will only run if no other problems occured when equiping. if(H.wear_suit) if(H.wear_suit.body_parts_covered & LEGS) to_chat(H, span_warning("You can't wear \the [src] with \the [H.wear_suit], it's in the way.")) - return 0 + return FALSE for(var/obj/item/clothing/accessory/A in H.wear_suit) if(A.body_parts_covered & LEGS) to_chat(H, span_warning("You can't wear \the [src] with \the [H.wear_suit]'s [A], it's in the way.")) - return 0 - return 1 + return FALSE + return TRUE /obj/item/clothing/shoes/leg_guard/laserproof name = "ablative leg guards" diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index 954ee26738..da085c2d58 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -64,44 +64,49 @@ user.update_inv_shoes() //so our mob-overlays update user.update_mob_action_buttons() -/obj/item/clothing/shoes/magboots/mob_can_equip(mob/user, slot, disable_warning = FALSE) +/obj/item/clothing/shoes/magboots/mob_can_equip(mob/user, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = TRUE) var/mob/living/carbon/human/H = user if(H.shoes) shoes = H.shoes if(istype(shoes, /obj/item/clothing/shoes) && shoes.overshoes) - if(slot && slot == slot_shoes) + if(slot && slot == slot_shoes && !disable_warning) to_chat(user, "You are unable to wear \the [src] as \the [H.shoes] are in the way.") shoes = null - return 0 - H.drop_from_inventory(shoes) //Remove the old shoes so you can put on the magboots. - shoes.forceMove(src) + return FALSE + shoes = null + return ..() - if(!..()) - if(shoes) //Put the old shoes back on if the check fails. - if(H.equip_to_slot_if_possible(shoes, slot_shoes)) - src.shoes = null - return 0 +/obj/item/clothing/shoes/magboots/equipped(mob/user, slot) - if (shoes) - if(slot && slot == slot_shoes) - to_chat(user, "You slip \the [src] on over \the [shoes].") + var/mob/living/carbon/human/H = user + if(slot && slot != slot_shoes) + return ..() set_slowdown() wearer = WEAKREF(H) - return 1 + ..() -/obj/item/clothing/shoes/magboots/dropped(mob/user) +/obj/item/clothing/shoes/magboots/dropped(mob/user, equipping, slot) ..() wearer = null var/mob/living/carbon/human/H = user - if(!ishuman(H) || !shoes) + if(!ishuman(H)) return - if(!H.equip_to_slot_if_possible(shoes, slot_shoes)) - shoes.forceMove(get_turf(src)) - shoes = null + //Equipping shoes. If you put it so you can put your shoes somewhere BUT your shoe slot, make sure this shit works. + if(equipping && (slot == slot_shoes)) + if(H.shoes && H.shoes != src) + shoes = H.shoes + H.unEquip(shoes, TRUE, src) + to_chat(user, "You slip \the [src] on over \the [shoes].") + return + + if(shoes) + if(!H.equip_to_slot_if_possible(shoes, slot_shoes, FALSE, TRUE, TRUE, TRUE)) + shoes.forceMove(get_turf(src)) + shoes = null /obj/item/clothing/shoes/magboots/examine(mob/user) . = ..() @@ -125,12 +130,12 @@ return //voxboots suffer no slowdown penalties! //In case they somehow come off while enabled. -/obj/item/clothing/shoes/magboots/vox/dropped(mob/user) - ..(user) - if(src.magpulse) +/obj/item/clothing/shoes/magboots/vox/dropped(mob/user, equipping, slot) + ..() + if(magpulse) user.visible_message("The [src] go limp as they are removed from [user]'s feet.", "The [src] go limp as they are removed from your feet.") item_flags &= ~NOSLIP - magpulse = 0 + magpulse = FALSE canremove = TRUE /obj/item/clothing/shoes/magboots/vox/examine(mob/user) diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index d8aabb6ef0..40465e126d 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -802,7 +802,7 @@ for(var/piece in list("helmet","gauntlets","chest","boots")) toggle_piece(piece, H, ONLY_DEPLOY) -/obj/item/rig/dropped(mob/user) +/obj/item/rig/dropped(mob/user, equipping, slot) . = ..(user) // So the next user will see the boot animation tgui_shared_states?.Cut() diff --git a/code/modules/clothing/spacesuits/spacesuits.dm b/code/modules/clothing/spacesuits/spacesuits.dm index cd35fd18ab..f37a3f2238 100644 --- a/code/modules/clothing/spacesuits/spacesuits.dm +++ b/code/modules/clothing/spacesuits/spacesuits.dm @@ -104,7 +104,7 @@ check_limb_support(M) ..() -/obj/item/clothing/suit/space/dropped(mob/user) +/obj/item/clothing/suit/space/dropped(mob/user, equipping, slot) check_limb_support(user) ..() diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm index 01d212391e..3856a58389 100644 --- a/code/modules/clothing/spacesuits/void/void.dm +++ b/code/modules/clothing/spacesuits/void/void.dm @@ -103,7 +103,7 @@ to_chat(M, "Your suit's cooling unit deploys.") cooler.canremove = FALSE -/obj/item/clothing/suit/space/void/dropped(mob/user) +/obj/item/clothing/suit/space/void/dropped(mob/user, equipping, slot) ..() var/mob/living/carbon/human/H diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index 4ff2ff5c87..4974d52584 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -11,7 +11,7 @@ siemens_coefficient = 0.6 resistance_flags = FIRE_PROOF -/obj/item/clothing/suit/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = FALSE) +/obj/item/clothing/suit/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) //This will only run if no other problems occured when equiping. for(var/obj/item/clothing/I in list(H.gloves, H.shoes)) if(I && (src.body_parts_covered & ARMS && I.body_parts_covered & ARMS) ) @@ -538,7 +538,7 @@ |ACCESSORY_SLOT_ARMOR_M) blood_overlay_type = "armor" -/obj/item/clothing/suit/armor/pcarrier/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = FALSE) +/obj/item/clothing/suit/armor/pcarrier/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) //This will only run if no other problems occured when equiping. if(H.gloves) if(H.gloves.body_parts_covered & ARMS) diff --git a/code/modules/clothing/suits/armor_vr.dm b/code/modules/clothing/suits/armor_vr.dm index 4ec093cf97..e55d0cca37 100644 --- a/code/modules/clothing/suits/armor_vr.dm +++ b/code/modules/clothing/suits/armor_vr.dm @@ -19,7 +19,7 @@ icon_state = "wolf_item" item_state = "heavy_wolf_armor" -/obj/item/clothing/suit/armor/vest/wolftaur/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/suit/armor/vest/wolftaur/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, /datum/sprite_accessory/tail/taur/wolf)) return ..() diff --git a/code/modules/clothing/suits/lasertag.dm b/code/modules/clothing/suits/lasertag.dm index 95a0fa2ab1..573ffe2b5f 100644 --- a/code/modules/clothing/suits/lasertag.dm +++ b/code/modules/clothing/suits/lasertag.dm @@ -89,7 +89,7 @@ else user.visible_message(span_notice("[src]'s healing function has been turned off!")) -/obj/item/clothing/suit/lasertag/dropped() +/obj/item/clothing/suit/lasertag/dropped(mob/user, equipping, slot) ..() STOP_PROCESSING(SSobj, src) visible_message(span_notice("[src] is unequipped, its health going back to full!")) diff --git a/code/modules/clothing/suits/miscellaneous_vr.dm b/code/modules/clothing/suits/miscellaneous_vr.dm index 67924c7d22..b7af7fd6d3 100644 --- a/code/modules/clothing/suits/miscellaneous_vr.dm +++ b/code/modules/clothing/suits/miscellaneous_vr.dm @@ -30,7 +30,7 @@ body_parts_covered = UPPER_TORSO|ARMS pixel_x = -16 -/obj/item/clothing/suit/drake_cloak/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/suit/drake_cloak/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, /datum/sprite_accessory/tail/taur/drake)) return ..() @@ -47,7 +47,7 @@ pixel_x = -16 armor = list(melee = 5, bullet = 5, laser = 5, energy = 5, bomb = 5, bio = 0, rad = 0)//Minor armor for fluff. -/obj/item/clothing/suit/barding/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/suit/barding/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, /datum/sprite_accessory/tail/taur/horse)) return ..() diff --git a/code/modules/clothing/suits/shibari.dm b/code/modules/clothing/suits/shibari.dm index 1074943b7e..64db279ef7 100644 --- a/code/modules/clothing/suits/shibari.dm +++ b/code/modules/clothing/suits/shibari.dm @@ -58,7 +58,7 @@ if(user.hud_used && user.hud_used.move_intent) user.hud_used.move_intent.icon_state = "walking" -/obj/item/clothing/suit/shibari/dropped(var/mob/living/user) +/obj/item/clothing/suit/shibari/dropped(mob/user, equipping, slot) ..() if(ishuman(user)) var/mob/living/carbon/human/H = user diff --git a/code/modules/food/glass/bottle.dm b/code/modules/food/glass/bottle.dm index 6cfa294cec..073fb4d46f 100644 --- a/code/modules/food/glass/bottle.dm +++ b/code/modules/food/glass/bottle.dm @@ -21,7 +21,7 @@ ..() update_icon() -/obj/item/reagent_containers/glass/bottle/dropped(mob/user) +/obj/item/reagent_containers/glass/bottle/dropped(mob/user, equipping, slot) ..() update_icon() diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index 61fd804306..90e8e469a8 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -567,7 +567,7 @@ i++ -/obj/item/hand/dropped(mob/user) +/obj/item/hand/dropped(mob/user, equipping, slot) ..() if(locate(/obj/structure/table, loc)) src.update_icon(user.dir) diff --git a/code/modules/holomap/mapper.dm b/code/modules/holomap/mapper.dm index 6668d11ca3..b5bedca118 100644 --- a/code/modules/holomap/mapper.dm +++ b/code/modules/holomap/mapper.dm @@ -120,7 +120,7 @@ return ..() -/obj/item/mapping_unit/dropped(mob/user) +/obj/item/mapping_unit/dropped(mob/user, equipping, slot) ..() if(loc != user) // Not just a juggle hide_device() diff --git a/code/modules/hydroponics/backtank.dm b/code/modules/hydroponics/backtank.dm index 6dfcae437a..933d000c2b 100644 --- a/code/modules/hydroponics/backtank.dm +++ b/code/modules/hydroponics/backtank.dm @@ -115,7 +115,7 @@ else return ..() -/obj/item/watertank/dropped(mob/user) +/obj/item/watertank/dropped(mob/user, equipping, slot) ..() remove_noz(user) diff --git a/code/modules/integrated_electronics/core/assemblies/clothing.dm b/code/modules/integrated_electronics/core/assemblies/clothing.dm index 8374bd764c..471bf95f8b 100644 --- a/code/modules/integrated_electronics/core/assemblies/clothing.dm +++ b/code/modules/integrated_electronics/core/assemblies/clothing.dm @@ -104,7 +104,7 @@ wearer = WEAKREF(user) ..() -/obj/item/clothing/under/circuitry/dropped(mob/user) // Remove wearer var. +/obj/item/clothing/under/circuitry/dropped(mob/user, equipping, slot) // Remove wearer var. wearer = null ..() @@ -125,7 +125,7 @@ wearer = WEAKREF(user) ..() -/obj/item/clothing/gloves/circuitry/dropped(mob/user) +/obj/item/clothing/gloves/circuitry/dropped(mob/user, equipping, slot) wearer = null ..() @@ -146,7 +146,7 @@ wearer = WEAKREF(user) ..() -/obj/item/clothing/glasses/circuitry/dropped(mob/user) +/obj/item/clothing/glasses/circuitry/dropped(mob/user, equipping, slot) wearer = null ..() @@ -167,7 +167,7 @@ wearer = WEAKREF(user) ..() -/obj/item/clothing/shoes/circuitry/dropped(mob/user) +/obj/item/clothing/shoes/circuitry/dropped(mob/user, equipping, slot) wearer = null ..() @@ -188,7 +188,7 @@ wearer = WEAKREF(user) ..() -/obj/item/clothing/head/circuitry/dropped(mob/user) +/obj/item/clothing/head/circuitry/dropped(mob/user, equipping, slot) wearer = null ..() @@ -211,7 +211,7 @@ wearer = WEAKREF(user) ..() -/obj/item/clothing/ears/circuitry/dropped(mob/user) +/obj/item/clothing/ears/circuitry/dropped(mob/user, equipping, slot) wearer = null ..() @@ -232,6 +232,6 @@ wearer = WEAKREF(user) ..() -/obj/item/clothing/suit/circuitry/dropped(mob/user) +/obj/item/clothing/suit/circuitry/dropped(mob/user, equipping, slot) wearer = null ..() diff --git a/code/modules/mining/kinetic_crusher.dm b/code/modules/mining/kinetic_crusher.dm index d154819635..3e438703b2 100644 --- a/code/modules/mining/kinetic_crusher.dm +++ b/code/modules/mining/kinetic_crusher.dm @@ -232,7 +232,7 @@ . = ..() START_PROCESSING(SSprocessing, src) -/obj/item/kinetic_crusher/machete/gauntlets/dropped(mob/user) +/obj/item/kinetic_crusher/machete/gauntlets/dropped(mob/user, equipping, slot) ready_toggle(TRUE) STOP_PROCESSING(SSprocessing, src) . = ..() @@ -290,7 +290,7 @@ /obj/item/offhand/crushergauntlets var/obj/item/kinetic_crusher/machete/gauntlets/linked -/obj/item/offhand/crushergauntlets/dropped(mob/user) +/obj/item/offhand/crushergauntlets/dropped(mob/user, equipping, slot) SHOULD_CALL_PARENT(FALSE) if(linked.wielded) linked.ready_toggle(TRUE) @@ -299,7 +299,7 @@ name = "\improper mounted proto-kinetic gear" var/obj/item/rig_module/gauntlets/storing_module -/obj/item/kinetic_crusher/machete/gauntlets/rig/dropped(mob/user) +/obj/item/kinetic_crusher/machete/gauntlets/rig/dropped(mob/user, equipping, slot) . = ..(user) if(storing_module) src.forceMove(storing_module) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 3e0617861e..001826e1af 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -52,7 +52,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( /* Inventory manipulation */ -/mob/proc/put_in_any_hand_if_possible(obj/item/W as obj, del_on_fail = 0, disable_warning = 1, redraw_mob = 1) +/mob/proc/put_in_any_hand_if_possible(obj/item/W, del_on_fail = 0, disable_warning = 1, redraw_mob = 1) if(equip_to_slot_if_possible(W, slot_l_hand, del_on_fail, disable_warning, redraw_mob)) return 1 else if(equip_to_slot_if_possible(W, slot_r_hand, del_on_fail, disable_warning, redraw_mob)) @@ -63,7 +63,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( //set del_on_fail to have it delete W if it fails to equip //set disable_warning to disable the 'you are unable to equip that' warning. //unset redraw_mob to prevent the mob from being redrawn at the end. -/mob/proc/equip_to_slot_if_possible(obj/item/W as obj, slot, del_on_fail = 0, disable_warning = 0, redraw_mob = 1, ignore_obstructions = 1) +/mob/proc/equip_to_slot_if_possible(obj/item/W, slot, del_on_fail = 0, disable_warning = 0, redraw_mob = 1, ignore_obstructions = 1) if(!W) return 0 if(!W.mob_can_equip(src, slot, disable_warning, ignore_obstructions)) @@ -80,19 +80,19 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( //This is an UNSAFE proc. It merely handles the actual job of equipping. All the checks on whether you can or can't eqip need to be done before! Use mob_can_equip() for that task. //In most cases you will want to use equip_to_slot_if_possible() -/mob/proc/equip_to_slot(obj/item/W as obj, slot) +/mob/proc/equip_to_slot(obj/item/W, slot) return //This is just a commonly used configuration for the equip_to_slot_if_possible() proc, used to equip people when the rounds tarts and when events happen and such. -/mob/proc/equip_to_slot_or_del(obj/item/W as obj, slot, ignore_obstructions = 1) +/mob/proc/equip_to_slot_or_del(obj/item/W, slot, ignore_obstructions = 1) return equip_to_slot_if_possible(W, slot, 1, 1, 0, ignore_obstructions) //hurgh. these feel hacky, but they're the only way I could get the damn thing to work. I guess they could be handy for antag spawners too? -/mob/proc/equip_voidsuit_to_slot_or_del_with_refit(obj/item/clothing/suit/space/void/W as obj, slot, species = SPECIES_HUMAN) +/mob/proc/equip_voidsuit_to_slot_or_del_with_refit(obj/item/clothing/suit/space/void/W, slot, species = SPECIES_HUMAN) W.refit_for_species(species) return equip_to_slot_if_possible(W, slot, 1, 1, 0) -/mob/proc/equip_voidhelm_to_slot_or_del_with_refit(obj/item/clothing/head/helmet/space/void/W as obj, slot, species = SPECIES_HUMAN) +/mob/proc/equip_voidhelm_to_slot_or_del_with_refit(obj/item/clothing/head/helmet/space/void/W, slot, species = SPECIES_HUMAN) W.refit_for_species(species) return equip_to_slot_if_possible(W, slot, 1, 1, 0) @@ -164,7 +164,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( return 0 I.forceMove(drop_location()) I.reset_plane_and_layer() - has_unequipped(I) + has_unequipped(I, FALSE) return 0 // Removes an item from inventory and places it in the target atom. @@ -178,9 +178,10 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( return remove_from_mob(W, target) /// This proc is called after an item has been removed from a mob but before it has been officially deslotted. -/mob/proc/has_unequipped(obj/item/item) //, silent = FALSE) //TODO: Add silent some other time. +/// equipping = true tells the item we are EQUIPPING it. +/mob/proc/has_unequipped(obj/item/item, equipping, slot) //, silent = FALSE) //TODO: Add silent some other time. SHOULD_CALL_PARENT(TRUE) - item.dropped(src) //, silent) + item.dropped(src, equipping, slot) //, silent) //update_equipment_speed_mods() return TRUE @@ -261,7 +262,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( item_dropping.forceMove(target) else item_dropping.dropInto(drop_location()) - has_unequipped(item_dropping) + has_unequipped(item_dropping, FALSE) //SEND_SIGNAL(item_dropping, COMSIG_ITEM_POST_UNEQUIP, item_dropping, target) SEND_SIGNAL(src, COMSIG_MOB_UNEQUIPPED_ITEM, item_dropping, target) return TRUE diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 5783a46714..2db22b5f4a 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -224,7 +224,7 @@ This saves us from having to call add_fingerprint() any time something is put in //This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible() -/mob/living/carbon/human/equip_to_slot(obj/item/W as obj, slot) +/mob/living/carbon/human/equip_to_slot(obj/item/W, slot) if(!slot) return @@ -236,7 +236,7 @@ This saves us from having to call add_fingerprint() any time something is put in return W.loc = src - has_unequipped(W) //TG calls attempt_insert -> transferItemToLoc -> doUnEquip -> has_unequipped. This is where we do it instead since we don't have storage datums. + has_unequipped(W, TRUE, slot) //TG calls attempt_insert -> transferItemToLoc -> doUnEquip -> has_unequipped. This is where we do it instead since we don't have storage datums. switch(slot) if(slot_back) src.back = W diff --git a/code/modules/mob/living/silicon/robot/robot_simple_items.dm b/code/modules/mob/living/silicon/robot/robot_simple_items.dm index f1bed67633..ba74909672 100644 --- a/code/modules/mob/living/silicon/robot/robot_simple_items.dm +++ b/code/modules/mob/living/silicon/robot/robot_simple_items.dm @@ -118,7 +118,7 @@ color = chosen_item.color selected_item = chosen_item -/obj/item/robotic_multibelt/dropped(mob/user) +/obj/item/robotic_multibelt/dropped(mob/user, equipping, slot) ..() //We go back to our initial values. original_state() diff --git a/code/modules/mob/living/simple_mob/subtypes/humanoid/mercs/mercs.dm b/code/modules/mob/living/simple_mob/subtypes/humanoid/mercs/mercs.dm index 62bf8208df..a37d7e62db 100644 --- a/code/modules/mob/living/simple_mob/subtypes/humanoid/mercs/mercs.dm +++ b/code/modules/mob/living/simple_mob/subtypes/humanoid/mercs/mercs.dm @@ -562,7 +562,7 @@ loot_list = list(/obj/item/material/knife/tacknife/combatknife = 100) /mob/living/simple_mob/humanoid/merc/melee/sword/poi - loot_list = list(/obj/item/melee/energy/sword/color = 20, + loot_list = list(/obj/item/melee/energy/sword = 20, /obj/item/shield/energy = 40 ) diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/swoopie.dm b/code/modules/mob/living/simple_mob/subtypes/vore/swoopie.dm index dca741a08f..668211205a 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/swoopie.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/swoopie.dm @@ -335,7 +335,7 @@ icon = 'icons/mob/vacpack_swoop.dmi' item_state = null -/obj/item/vac_attachment/swoopie/dropped(mob/user) //This should fix it sitting on the ground until the next life() tick +/obj/item/vac_attachment/swoopie/dropped(mob/user, equipping, slot) //This should fix it sitting on the ground until the next life() tick . = ..() if(!vac_owner) return diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index eb23f671b5..cd54eef4ba 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -818,7 +818,7 @@ return ..() -/obj/item/gun/dropped(mob/living/user) // Ditto as above, we remove the HUD. Pending porting TGMC code to clean up this fucking nightmare of spaghetti. +/obj/item/gun/dropped(mob/user, equipping, slot) // Ditto as above, we remove the HUD. Pending porting TGMC code to clean up this fucking nightmare of spaghetti. user.hud_used.remove_ammo_hud(user, src) ..() diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator_vr.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator_vr.dm index 153b38516c..db531295b2 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator_vr.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator_vr.dm @@ -180,7 +180,7 @@ if(power_supply.charge < charge_cost) attempt_reload() -/obj/item/gun/energy/kinetic_accelerator/dropped(mob/user) +/obj/item/gun/energy/kinetic_accelerator/dropped(mob/user, equipping, slot) . = ..() if(!QDELING(src) && !holds_charge) // Put it on a delay because moving item from slot to hand diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index c9f0d677ca..a2b432294d 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -187,7 +187,7 @@ ..() update_icon() -/obj/item/reagent_containers/glass/beaker/dropped(mob/user) +/obj/item/reagent_containers/glass/beaker/dropped(mob/user, equipping, slot) ..() update_icon() diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index e302b2f4a4..7f2d6ffbf6 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -59,7 +59,7 @@ ..() update_icon() -/obj/item/reagent_containers/syringe/dropped(mob/user) +/obj/item/reagent_containers/syringe/dropped(mob/user, equipping, slot) ..() update_icon() diff --git a/code/modules/vore/fluffstuff/custom_clothes_vr.dm b/code/modules/vore/fluffstuff/custom_clothes_vr.dm index ebcb365331..5b2ec98773 100644 --- a/code/modules/vore/fluffstuff/custom_clothes_vr.dm +++ b/code/modules/vore/fluffstuff/custom_clothes_vr.dm @@ -502,7 +502,7 @@ species_restricted = null -/obj/item/clothing/head/helmet/space/void/engineering/hazmat/fluff/screehelm/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/head/helmet/space/void/engineering/hazmat/fluff/screehelm/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) if(H.ckey != "scree") to_chat(H, span_warning("Your face and whoever is meant for this helmet are too different.")) @@ -524,7 +524,7 @@ species_restricted = null -/obj/item/clothing/suit/space/void/engineering/hazmat/fluff/screespess/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/suit/space/void/engineering/hazmat/fluff/screespess/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) if(H.ckey != "scree") to_chat(H, span_warning("The gloves only have three fingers, not to mention the accommodation for extra limbs.")) @@ -556,7 +556,7 @@ slot_head_str = 'icons/vore/custom_onmob_32x48_vr.dmi' ) -/obj/item/clothing/head/fluff/avida/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/head/fluff/avida/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) var/static/list/allowed_ear_names = list("Bnnuy Ears", "Bnnuy Ears 2") //check if wearer's ear sprite is compatible with trimmed icon @@ -577,7 +577,7 @@ default_worn_icon = 'icons/vore/custom_clothes_mob.dmi' item_state_slots = list(slot_r_hand_str = "alurane-vines_r", slot_l_hand_str = "alurane-vines_l") -/obj/item/clothing/under/fluff/aluranevines/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/under/fluff/aluranevines/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) if(H.ckey != "natje") to_chat(H, span_warning("Wrapping vines around yourself is a quite an... Odd idea. You decide otherwise.")) @@ -719,7 +719,7 @@ light_overlay = "helmet_light" -/obj/item/clothing/head/helmet/space/fluff/joan/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/head/helmet/space/fluff/joan/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) if(H.ckey != "joanrisu") to_chat(H, span_warning("You try to fit on the helmet, but it doesn't fit.")) @@ -745,7 +745,7 @@ default_worn_icon = 'icons/vore/custom_clothes_mob.dmi' -/obj/item/clothing/suit/space/fluff/joan/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/suit/space/fluff/joan/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) if(H.ckey != "joanrisu") to_chat(H, span_warning("You try to fit into the suit, to no avail.")) @@ -1150,7 +1150,7 @@ Departamental Swimsuits, for general use icon = 'icons/mob/taursuits_wolf.dmi' icon_state = "jessiecoat" -/obj/item/clothing/suit/storage/hooded/wintercoat/jessie/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/suit/storage/hooded/wintercoat/jessie/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, /datum/sprite_accessory/tail/taur/wolf)) return ..() @@ -1167,7 +1167,7 @@ Departamental Swimsuits, for general use icon_state = "katesuit" item_state_slots = null -/obj/item/clothing/suit/armor/vest/wolftaur/kate/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/suit/armor/vest/wolftaur/kate/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, /datum/sprite_accessory/tail/taur/wolf)) return ..() @@ -1197,7 +1197,7 @@ Departamental Swimsuits, for general use light_overlay = "helmet_light" species_restricted = null -/obj/item/clothing/head/helmet/space/fluff/kate/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/head/helmet/space/fluff/kate/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) if(H.ckey != "samanthafyre") to_chat(H, span_warning("You try to fit on the helmet, but it doesn't fit.")) @@ -1521,7 +1521,7 @@ Departamental Swimsuits, for general use default_worn_icon = 'icons/vore/custom_clothes_mob.dmi' species_restricted = null -/obj/item/clothing/head/helmet/space/void/security/hasd/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/head/helmet/space/void/security/hasd/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) if(H.ckey != "silencedmp5a5") to_chat(H, span_warning("...The faceplate is clearly not made for your anatomy, thus, does not fit.")) @@ -1538,7 +1538,7 @@ Departamental Swimsuits, for general use icon_state = "hasd_suit" pixel_x = -16 -/obj/item/clothing/suit/space/void/security/hasd/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/suit/space/void/security/hasd/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..() && istype(H) && H.ckey == "silencedmp5a5") return 1 else @@ -1649,12 +1649,11 @@ Departamental Swimsuits, for general use species_restricted = list("exclude", SPECIES_TESHARI) -/obj/item/clothing/under/fluff/slime_skeleton/mob_can_equip(M as mob, slot, disable_warning = FALSE) +/obj/item/clothing/under/fluff/slime_skeleton/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(!..()) return 0 - if(ishuman(M)) - var/mob/living/carbon/human/H = M + if(ishuman(H)) if(!(H.get_species() == SPECIES_PROMETHEAN)) //Only wearable by slimes, since species_restricted actually checks bodytype, not species return 0 @@ -1704,7 +1703,7 @@ Departamental Swimsuits, for general use icon_override = 'icons/vore/custom_clothes_mob.dmi' update_clothing_icon() -/obj/item/clothing/accessory/poncho/roles/cloak/hop/fluff/pip/dropped() +/obj/item/clothing/accessory/poncho/roles/cloak/hop/fluff/pip/dropped(mob/user, equipping, slot) ..() icon_override = 'icons/vore/custom_clothes_mob.dmi' @@ -1781,7 +1780,7 @@ Departamental Swimsuits, for general use icon_state = "nikki_outfit" sensor_mode = 3 // I'm a dumbass and forget these all the time please understand :( -/obj/item/clothing/under/skirt/outfit/fluff/nikki/mob_can_equip(var/mob/living/carbon/human/M, slot, disable_warning = 0) +/obj/item/clothing/under/skirt/outfit/fluff/nikki/mob_can_equip(mob/living/carbon/human/M, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) if (M.ckey == "ryumi") return 1 @@ -1796,7 +1795,7 @@ Departamental Swimsuits, for general use default_worn_icon = 'icons/vore/custom_clothes_mob.dmi' icon_state = "nikki_boots" -/obj/item/clothing/shoes/fluff/nikki/mob_can_equip(var/mob/living/carbon/human/M, slot, disable_warning = 0) +/obj/item/clothing/shoes/fluff/nikki/mob_can_equip(mob/living/carbon/human/M, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) if (M.ckey == "ryumi") return 1 @@ -2055,7 +2054,7 @@ Departamental Swimsuits, for general use icon_override = 'icons/vore/custom_clothes_mob.dmi' update_clothing_icon() -/obj/item/clothing/accessory/poncho/roles/cloak/fluff/cloakglowing/dropped(mob/user) +/obj/item/clothing/accessory/poncho/roles/cloak/fluff/cloakglowing/dropped(mob/user, equipping, slot) ..() icon_override = 'icons/vore/custom_clothes_mob.dmi' diff --git a/code/modules/vore/fluffstuff/custom_items_vr.dm b/code/modules/vore/fluffstuff/custom_items_vr.dm index 55d3bc8b87..ccb0e839e3 100644 --- a/code/modules/vore/fluffstuff/custom_items_vr.dm +++ b/code/modules/vore/fluffstuff/custom_items_vr.dm @@ -458,7 +458,7 @@ item_state = "serdy_armor" body_parts_covered = CHEST|LEGS|ARMS //It's a full body suit, minus hands and feet. Arms and legs should be protected, not just the torso. Retains normal security armor values still. -/obj/item/clothing/suit/armor/vest/wolftaur/serdy/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/suit/armor/vest/wolftaur/serdy/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(istype(H) && istype(H.tail_style, /datum/sprite_accessory/tail/taur/wolf)) return ..() else @@ -1000,12 +1000,11 @@ else set_light(0) -/obj/item/melee/baton/fluff/stunstaff/dropped(mob/user) +/obj/item/melee/baton/fluff/stunstaff/dropped(mob/user, equipping, slot) ..() if(wielded) - wielded = 0 - spawn(0) - update_held_icon() + wielded = FALSE + update_held_icon() /obj/item/melee/baton/fluff/stunstaff/attack_self(mob/user) . = ..(user) @@ -1119,7 +1118,7 @@ allowed = list(/obj/item/shield/fluff/wolfgirlshield) damtype = HALLOSS -/obj/item/melee/fluffstuff/wolfgirlsword/dropped(mob/user) +/obj/item/melee/fluffstuff/wolfgirlsword/dropped(mob/user, equipping, slot) ..() if(!istype(loc,/mob)) deactivate(user) @@ -1215,7 +1214,7 @@ icon_override = 'icons/vore/custom_clothes_vr.dmi' icon_state = "tiemgogs" -/obj/item/clothing/glasses/welding/tiemgogs/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/clothing/glasses/welding/tiemgogs/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) if(H.ckey != "radiantaurora") to_chat(H, span_warning("These don't look like they were made to fit you...")) @@ -1255,12 +1254,12 @@ return ..() -/obj/item/rig/nikki/mob_can_equip(var/mob/living/carbon/human/M, slot, disable_warning = 0) // Feel free to (try to) put Nikki's hat on! The necklace though is a flat-out no-go. +/obj/item/rig/nikki/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) // Feel free to (try to) put Nikki's hat on! The necklace though is a flat-out no-go. if(..()) - if (M.ckey == "ryumi") + if(H.ckey == "ryumi") return 1 - else if (M.get_active_hand() == src) - to_chat(M, span_warning("For some reason, the necklace seems to never quite get past your head when you try to put it on... Weird, it looked like it would fit.")) + else if (H.get_active_hand() == src) + to_chat(H, span_warning("For some reason, the necklace seems to never quite get past your head when you try to put it on... Weird, it looked like it would fit.")) return 0 //Nickcrazy - Damon Bones Xrim @@ -1641,7 +1640,7 @@ slot_flags = SLOT_MASK | SLOT_OCLOTHING replacementType = /obj/item/remote_scene_tool/tally_doll -/obj/item/remote_scene_tool/tally_necklace/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) +/obj/item/remote_scene_tool/tally_necklace/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = FALSE, ignore_obstruction, go_over_slot = FALSE) if(..()) if(H.ckey != "bricker98") if(!disable_warning) diff --git a/code/modules/vore/resizing/holder_vr.dm b/code/modules/vore/resizing/holder_vr.dm index 0c53cbb63d..75cbc72f2f 100644 --- a/code/modules/vore/resizing/holder_vr.dm +++ b/code/modules/vore/resizing/holder_vr.dm @@ -1,5 +1,5 @@ -/obj/item/holder/dropped(mob/user) - if (held_mob?.loc != src || isturf(loc)) +/obj/item/holder/dropped(mob/user, equipping, slot) + if(held_mob?.loc != src || isturf(loc)) var/held = held_mob dump_mob() held_mob = held diff --git a/maps/submaps/pois_vr/debris_field/debrisfield_things.dm b/maps/submaps/pois_vr/debris_field/debrisfield_things.dm index 0b0f17d181..1dbdc48cc0 100644 --- a/maps/submaps/pois_vr/debris_field/debrisfield_things.dm +++ b/maps/submaps/pois_vr/debris_field/debrisfield_things.dm @@ -243,7 +243,7 @@ i just hope whatever happens, she finds the mercy we werent equipped to give her say_list_type = /datum/say_list/merc/drone/tanker_escort corpse = /obj/effect/landmark/mobcorpse/syndicatesoldier/drone/tanker loot_list = list(/obj/item/poi/broken_drone_circuit/phoron_tanker = 100, - /obj/item/shield/energy = 100, /obj/item/melee/energy/sword/color = 20) + /obj/item/shield/energy = 100, /obj/item/melee/energy/sword = 20) min_oxy = 0 max_oxy = 0 min_tox = 0 diff --git a/vorestation.dme b/vorestation.dme index d3cfaa5887..584a6c7df8 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -913,14 +913,12 @@ #include "code\datums\managed_browsers\feedback_form.dm" #include "code\datums\managed_browsers\feedback_viewer.dm" #include "code\datums\observation\destroyed.dm" -#include "code\datums\observation\equipped.dm" #include "code\datums\observation\helpers.dm" #include "code\datums\observation\moved.dm" #include "code\datums\observation\power_change.dm" #include "code\datums\observation\shuttle_added.dm" #include "code\datums\observation\stat_set.dm" #include "code\datums\observation\turf_enterexit.dm" -#include "code\datums\observation\unequipped.dm" #include "code\datums\outfits\_defines.dm" #include "code\datums\outfits\horror_killers.dm" #include "code\datums\outfits\misc.dm"