From fbd9c367c0f8f5559f9d0662026c6258613d8b49 Mon Sep 17 00:00:00 2001 From: DZD Date: Wed, 18 Feb 2015 13:22:41 -0500 Subject: [PATCH] NODROP flag addition & handling - Purges canremove - Implements functionality for NODROP flag, replaces canremove - Refactors mob inventory unequipping. --- code/ZAS/Airflow.dm | 2 +- code/ZAS/Atom.dm | 2 +- code/__HELPERS/global_lists.dm | 2 +- code/datums/mind.dm | 2 +- code/datums/spells/horsemask.dm | 5 +- code/datums/spells/summonitem.dm | 2 +- code/game/atoms_movable.dm | 3 +- code/game/dna/dna_misc.dm | 4 +- code/game/dna/genes/monkey.dm | 4 +- .../gamemodes/changeling/powers/humanform.dm | 2 +- .../gamemodes/changeling/powers/lesserform.dm | 2 +- .../gamemodes/changeling/powers/mutations.dm | 16 +- code/game/gamemodes/cult/runes.dm | 2 +- code/game/gamemodes/events/ninja_equipment.dm | 4 +- code/game/gamemodes/events/space_ninja.dm | 20 +- code/game/gamemodes/wizard/soulstone.dm | 2 +- code/game/gamemodes/wizard/spellbook.dm | 7 +- code/game/machinery/autolathe.dm | 14 +- code/game/machinery/biogenerator.dm | 18 +- code/game/machinery/bots/cleanbot.dm | 2 +- code/game/machinery/bots/ed209bot.dm | 2 +- code/game/machinery/bots/farmbot.dm | 10 +- code/game/machinery/bots/floorbot.dm | 6 +- code/game/machinery/bots/medbot.dm | 4 +- code/game/machinery/bots/secbot.dm | 4 +- code/game/machinery/camera/tracking.dm | 6 +- .../machinery/computer/HolodeckControl.dm | 3 +- code/game/machinery/cryopod.dm | 10 +- code/game/machinery/drying_rack.dm | 8 +- code/game/machinery/kitchen/juicer.dm | 10 +- code/game/machinery/kitchen/microwave.dm | 20 +- code/game/machinery/kitchen/smartfridge.dm | 4 +- code/game/machinery/portable_turret.dm | 26 ++- code/game/machinery/recycler.dm | 2 +- code/game/machinery/teleporter.dm | 6 +- code/game/mecha/equipment/weapons/weapons.dm | 2 +- code/game/mecha/mecha.dm | 8 +- code/game/objects/items.dm | 29 ++- code/game/objects/items/ashtray.dm | 2 +- code/game/objects/items/candle.dm | 3 +- code/game/objects/items/devices/modkit.dm | 4 +- .../items/devices/radio/electropack.dm | 8 +- code/game/objects/items/robot/robot_parts.dm | 2 +- .../game/objects/items/stacks/sheets/light.dm | 6 +- code/game/objects/items/stacks/stack.dm | 6 +- code/game/objects/items/stacks/tiles/light.dm | 2 +- code/game/objects/items/toys.dm | 33 ++-- .../objects/items/weapons/chrono_eraser.dm | 2 +- .../objects/items/weapons/cigs_lighters.dm | 13 +- code/game/objects/items/weapons/defib.dm | 6 +- .../objects/items/weapons/dna_injector.dm | 2 +- .../objects/items/weapons/gift_wrappaper.dm | 2 +- .../items/weapons/grenades/bananade.dm | 2 +- .../items/weapons/grenades/ghettobomb.dm | 4 +- .../objects/items/weapons/grenades/grenade.dm | 2 +- code/game/objects/items/weapons/handcuffs.dm | 2 +- .../items/weapons/implants/implanter.dm | 2 +- .../objects/items/weapons/storage/bags.dm | 2 +- .../objects/items/weapons/storage/belt.dm | 4 +- .../objects/items/weapons/storage/firstaid.dm | 6 +- .../objects/items/weapons/storage/internal.dm | 14 +- .../objects/items/weapons/storage/storage.dm | 16 +- .../objects/items/weapons/tanks/tank_types.dm | 2 +- .../objects/items/weapons/tanks/watertank.dm | 4 +- code/game/objects/items/weapons/tools.dm | 6 +- code/game/objects/items/weapons/weaponry.dm | 8 +- .../structures/stool_bed_chair_nest/stools.dm | 4 +- code/game/objects/structures/tables_racks.dm | 13 +- code/game/turfs/turf.dm | 4 +- code/modules/admin/topic.dm | 54 +++--- code/modules/admin/verbs/randomverbs.dm | 6 +- code/modules/clothing/clothing.dm | 10 +- code/modules/clothing/glasses/glasses.dm | 6 +- code/modules/clothing/head/misc.dm | 2 +- code/modules/clothing/masks/miscellaneous.dm | 6 +- code/modules/clothing/spacesuits/alien.dm | 6 +- .../modules/clothing/spacesuits/chronosuit.dm | 8 +- code/modules/clothing/spacesuits/rig.dm | 18 +- code/modules/clothing/suits/miscellaneous.dm | 2 +- .../clothing/under/accessories/holster.dm | 4 +- code/modules/clothing/under/color.dm | 4 +- .../computer3/computers/HolodeckControl.dm | 2 +- code/modules/destilery/main.dm | 8 +- code/modules/mining/manufacturing.dm | 4 +- code/modules/mining/satchel_ore_boxdm.dm | 2 +- code/modules/mob/inventory.dm | 111 ++++------- .../living/carbon/alien/humanoid/inventory.dm | 27 +-- .../carbon/alien/humanoid/update_icons.dm | 2 +- .../living/carbon/alien/larva/inventory.dm | 2 +- .../living/carbon/alien/special/facehugger.dm | 15 +- code/modules/mob/living/carbon/carbon.dm | 44 +++-- code/modules/mob/living/carbon/human/human.dm | 10 +- .../living/carbon/human/human_attackhand.dm | 14 +- .../mob/living/carbon/human/human_damage.dm | 2 +- .../mob/living/carbon/human/human_defense.dm | 2 +- .../mob/living/carbon/human/inventory.dm | 181 +++++++----------- .../living/carbon/human/plasmaman/species.dm | 6 +- .../mob/living/carbon/human/update_icons.dm | 8 +- .../mob/living/carbon/metroid/metroid.dm | 20 +- .../modules/mob/living/carbon/monkey/diona.dm | 2 +- .../mob/living/carbon/monkey/inventory.dm | 16 +- .../mob/living/carbon/monkey/monkey.dm | 18 +- code/modules/mob/living/living.dm | 10 +- code/modules/mob/living/silicon/ai/ai.dm | 8 +- code/modules/mob/living/silicon/pai/pai.dm | 2 +- .../mob/living/simple_animal/parrot.dm | 2 +- code/modules/mob/mob.dm | 24 +-- code/modules/mob/transform_procs.dm | 20 +- code/modules/organs/organ_external.dm | 26 +-- code/modules/paperwork/clipboard.dm | 4 +- code/modules/paperwork/paper.dm | 16 +- code/modules/paperwork/paper_bundle.dm | 12 +- code/modules/paperwork/photography.dm | 6 +- code/modules/power/antimatter/control.dm | 2 +- code/modules/power/cable.dm | 2 +- code/modules/reagents/Chemistry-Machinery.dm | 6 +- .../reagent_containers/food/snacks.dm | 6 +- .../reagent_containers/food/snacks/grown.dm | 4 +- .../reagents/reagent_containers/glass.dm | 2 +- .../reagents/reagent_containers/pill.dm | 6 +- .../reagents/reagent_containers/syringes.dm | 2 +- code/modules/recycling/disposal.dm | 6 +- code/modules/supermatter/supermatter.dm | 2 +- code/modules/telesci/telesci_computer.dm | 2 +- code/modules/vehicles/vehicle.dm | 2 +- code/modules/virus2/curer.dm | 2 +- code/modules/virus2/effect.dm | 16 +- code/world.dm | 4 +- 128 files changed, 618 insertions(+), 659 deletions(-) diff --git a/code/ZAS/Airflow.dm b/code/ZAS/Airflow.dm index 1b2296bffd9..c18b0228338 100644 --- a/code/ZAS/Airflow.dm +++ b/code/ZAS/Airflow.dm @@ -253,7 +253,7 @@ zone/proc/movables() continue . += A -//ULTRALIGHT - only file where this is still used, hence why it's in here +//ULTRALIGHT - only file where this is still used, hence why it's in here #define UL_I_FALLOFF_SQUARE 0 #define UL_I_FALLOFF_ROUND 1 #define ul_FalloffStyle UL_I_FALLOFF_ROUND // Sets the lighting falloff to be either squared or circular. diff --git a/code/ZAS/Atom.dm b/code/ZAS/Atom.dm index 8d479ecfb14..fdc187e0e5f 100644 --- a/code/ZAS/Atom.dm +++ b/code/ZAS/Atom.dm @@ -29,7 +29,7 @@ atom/proc/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0) return 0 return 1 - + //Convenience function for atoms to update turfs they occupy /atom/movable/proc/update_nearby_tiles(need_rebuild) if(!air_master) diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index fd062539852..515f1788f66 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -44,7 +44,7 @@ var/global/list/facial_hair_styles_male_list = list() var/global/list/facial_hair_styles_female_list = list() var/global/list/skin_styles_female_list = list() //unused //Underwear -var/global/list/underwear_m = list("White", "Grey", "Green", "Blue", "Black", "Mankini", "None") +var/global/list/underwear_m = list("White", "Grey", "Green", "Blue", "Black", "Mankini", "None") var/global/list/underwear_f = list("Red", "White", "Yellow", "Blue", "Black", "Thong", "None") var/global/list/underwear_list = underwear_m + underwear_f //undershirt diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 35733590f64..caea97b2f7d 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -1070,7 +1070,7 @@ datum/mind switch(href_list["common"]) if("undress") for(var/obj/item/W in current) - current.drop_from_inventory(W) + current.unEquip(W, 1) if("takeuplink") take_uplink() memory = null//Remove any memory they may have had. diff --git a/code/datums/spells/horsemask.dm b/code/datums/spells/horsemask.dm index b04969d2d98..3e1f82f98f9 100644 --- a/code/datums/spells/horsemask.dm +++ b/code/datums/spells/horsemask.dm @@ -35,12 +35,13 @@ return var/obj/item/clothing/mask/horsehead/magichead = new /obj/item/clothing/mask/horsehead - magichead.canremove = 0 //curses! + magichead.flags |= NODROP //curses! magichead.flags_inv = null //so you can still see their face magichead.voicechange = 1 //NEEEEIIGHH target.visible_message( "[target]'s face lights up in fire, and after the event a horse's head takes its place!", \ "Your face burns up, and shortly after the fire you realise you have the face of a horse!") - target.drop_from_inventory(target.wear_mask) + if(!target.unEquip(target.wear_mask)) + del target.wear_mask target.equip_to_slot_if_possible(magichead, slot_wear_mask, 1, 1) flick("e_flash", target.flash) diff --git a/code/datums/spells/summonitem.dm b/code/datums/spells/summonitem.dm index cca82c3c0c0..05b835605d4 100644 --- a/code/datums/spells/summonitem.dm +++ b/code/datums/spells/summonitem.dm @@ -59,7 +59,7 @@ item_to_retrive = null break - M.u_equip(item_to_retrive) + M.unEquip(item_to_retrive) if(ishuman(M)) //Edge case housekeeping var/mob/living/carbon/human/C = M diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index b80fe3249f6..5d4a4539e65 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -99,7 +99,8 @@ src.throw_impact(A,speed) /atom/movable/proc/throw_at(atom/target, range, speed, thrower) - if(!target || !src) return 0 + if(!target || !src || (flags & NODROP)) + return 0 //use a modified version of Bresenham's algorithm to get from the atom's current position to that of the target src.throwing = 1 diff --git a/code/game/dna/dna_misc.dm b/code/game/dna/dna_misc.dm index 13ddefd5514..6b237f5a00e 100644 --- a/code/game/dna/dna_misc.dm +++ b/code/game/dna/dna_misc.dm @@ -410,7 +410,7 @@ for(var/obj/item/W in (H.contents-implants)) if (W==H.w_uniform) // will be teared continue - H.drop_from_inventory(W) + H.unEquip(W) M.monkeyizing = 1 M.canmove = 0 M.icon = null @@ -483,7 +483,7 @@ W.loc = null if(!connected) for(var/obj/item/W in (Mo.contents-implants)) - Mo.drop_from_inventory(W) + Mo.unEquip(W) M.monkeyizing = 1 M.canmove = 0 M.icon = null diff --git a/code/game/dna/genes/monkey.dm b/code/game/dna/genes/monkey.dm index e1faba73a75..c810b0dd88c 100644 --- a/code/game/dna/genes/monkey.dm +++ b/code/game/dna/genes/monkey.dm @@ -22,7 +22,7 @@ for(var/obj/item/W in (H.contents-implants)) if (W==H.w_uniform) // will be teared continue - H.drop_from_inventory(W) + H.unEquip(W) M.monkeyizing = 1 M.canmove = 0 M.icon = null @@ -93,7 +93,7 @@ W.loc = null if(!connected) for(var/obj/item/W in (Mo.contents-implants)) - Mo.drop_from_inventory(W) + Mo.unEquip(W) M.monkeyizing = 1 M.canmove = 0 M.icon = null diff --git a/code/game/gamemodes/changeling/powers/humanform.dm b/code/game/gamemodes/changeling/powers/humanform.dm index b50c23197c4..81828120875 100644 --- a/code/game/gamemodes/changeling/powers/humanform.dm +++ b/code/game/gamemodes/changeling/powers/humanform.dm @@ -31,7 +31,7 @@ implants += I for(var/obj/item/W in src) - user.u_equip(W) + user.unEquip(W) if (user.client) user.client.screen -= W if (W) diff --git a/code/game/gamemodes/changeling/powers/lesserform.dm b/code/game/gamemodes/changeling/powers/lesserform.dm index 0069b7cbfd2..f8ebed5798e 100644 --- a/code/game/gamemodes/changeling/powers/lesserform.dm +++ b/code/game/gamemodes/changeling/powers/lesserform.dm @@ -42,7 +42,7 @@ C.dna = null for(var/obj/item/W in C) - C.drop_from_inventory(W) + C.unEquip(W) for(var/obj/T in C) del(T) diff --git a/code/game/gamemodes/changeling/powers/mutations.dm b/code/game/gamemodes/changeling/powers/mutations.dm index 2e28f82cf77..555075d22e0 100644 --- a/code/game/gamemodes/changeling/powers/mutations.dm +++ b/code/game/gamemodes/changeling/powers/mutations.dm @@ -34,7 +34,7 @@ ..(user, target) /obj/effect/proc_holder/changeling/weapon/sting_action(var/mob/user) - if(!user.drop_item() && user.get_active_hand()) + if(!user.drop_item()) user << "The [user.get_active_hand()] is stuck to your hand, you cannot grow a [weapon_name_simple] over it!" return var/obj/item/W = new weapon_type(user) @@ -83,15 +83,15 @@ ..(H, target) /obj/effect/proc_holder/changeling/suit/sting_action(var/mob/living/carbon/human/user) - if(user.wear_suit && !user.wear_suit.canremove) + if(!user.unEquip(user.wear_suit)) user << "\the [user.wear_suit] is stuck to your body, you cannot grow a [suit_name_simple] over it!" return - if(user.head && !user.head.canremove) + if(!user.unEquip(user.head)) user << "\the [user.head] is stuck on your head, you cannot grow a [helmet_name_simple] over it!" return - user.u_equip(user.head) - user.u_equip(user.wear_suit) + user.unEquip(user.head) + user.unEquip(user.wear_suit) user.equip_to_slot_if_possible(new suit_type(user), slot_wear_suit, 1, 1, 1) user.equip_to_slot_if_possible(new helmet_type(user), slot_head, 1, 1, 1) @@ -221,7 +221,7 @@ if(ishuman(loc)) var/mob/living/carbon/human/H = loc H.visible_message("With a sickening crunch, [H] reforms his shield into an arm!", "We assimilate our shield into our body", "ERROR: 110223 \black UNABLE TO LOCATE MASK\nABORTING..." return 0 affecting = U - canremove = 0 + flags |= NODROP slowdown = 0 n_hood = U:head - n_hood.canremove=0 + n_hood.flags |= NODROP n_shoes = U:shoes - n_shoes.canremove=0 + n_shoes.flags |= NODROP n_shoes.slowdown-- n_gloves = U:gloves - n_gloves.canremove=0 + n_gloves.flags |= NODROP n_mask = U:wear_mask - n_mask.canremove=0 + n_mask.flags |= NODROP return 1 //This proc allows the suit to be taken off. /obj/item/clothing/suit/space/space_ninja/proc/unlock_suit() affecting = null - canremove = 1 + flags |= NODROP slowdown = 1 icon_state = "s-ninja" if(n_hood)//Should be attached, might not be attached. - n_hood.canremove=1 + n_hood.flags |= NODROP if(n_shoes) - n_shoes.canremove=1 + n_shoes.flags |= NODROP n_shoes.slowdown++ if(n_gloves) n_gloves.icon_state = "s-ninja" n_gloves.item_state = "s-ninja" - n_gloves.canremove=1 + n_gloves.flags |= NODROP n_gloves.candrain=0 n_gloves.draining=0 if(n_mask) - n_mask.canremove=1 + n_mask.flags |= NODROP //Allows the mob to grab a stealth icon. /mob/proc/NinjaStealthActive(atom/A)//A is the atom which we are using as the overlay. diff --git a/code/game/gamemodes/wizard/soulstone.dm b/code/game/gamemodes/wizard/soulstone.dm index 20cf7da809f..3110498f73e 100644 --- a/code/game/gamemodes/wizard/soulstone.dm +++ b/code/game/gamemodes/wizard/soulstone.dm @@ -116,7 +116,7 @@ U << "\red Capture failed!: \black The soul stone is full! Use or free an existing soul to make room." else for(var/obj/item/W in T) - T.drop_from_inventory(W) + T.unEquip(W) new /obj/effect/decal/remains/human(T.loc) //Spawns a skeleton T.invisibility = 101 var/atom/movable/overlay/animation = new /atom/movable/overlay( T.loc ) diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index a88ddcc1bc7..5beafdeb055 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -554,12 +554,13 @@ if(istype(user, /mob/living/carbon/human)) user <<"HOR-SIE HAS RISEN" var/obj/item/clothing/mask/horsehead/magichead = new /obj/item/clothing/mask/horsehead - magichead.canremove = 0 //curses! + magichead.flags |= NODROP //curses! magichead.flags_inv = null //so you can still see their face magichead.voicechange = 1 //NEEEEIIGHH - user.drop_from_inventory(user.wear_mask) + if(!user.unEquip(user.wear_mask)) + del user.wear_mask user.equip_to_slot_if_possible(magichead, slot_wear_mask, 1, 1) - del(src) + del src else user <<"I say thee neigh" diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 143853269dc..09cf2db6cd8 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -44,7 +44,7 @@ "Medical", "Miscellaneous", "Security", - "Tools" + "Tools" ) /obj/machinery/autolathe/New() @@ -61,7 +61,7 @@ wires = new(src) files = new /datum/research/autolathe(src) matching_designs = list() - + /obj/machinery/autolathe/upgraded/New() ..() component_parts = list() @@ -72,7 +72,7 @@ component_parts += new /obj/item/weapon/stock_parts/manipulator/pico(null) component_parts += new /obj/item/weapon/stock_parts/console_screen(null) RefreshParts() - + /obj/machinery/autolathe/interact(mob/user) if(shocked && !(stat & NOPOWER)) shock(user,50) @@ -151,7 +151,7 @@ flick("autolathe_r",src)//plays glass insertion animation stack.use(amount) else - if(!user.before_take_item(O)) + if(!user.unEquip(O)) user << "/the [O] is stuck to your hand, you can't put it in \the [src]!" O.loc = src icon_state = "autolathe" @@ -234,14 +234,14 @@ g_amount = 0 busy = 0 src.updateUsrDialog() - + if(href_list["search"]) matching_designs.Cut() for(var/datum/design/D in files.known_designs) if(findtext(D.name,href_list["to_search"])) matching_designs.Add(D) - + else usr << "The autolathe is busy. Please wait for completion of previous operation." @@ -315,7 +315,7 @@ dat += "" return dat - + /obj/machinery/autolathe/proc/search_win(mob/user) var/dat = "Return to main menu" dat += "

Search results:


" diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm index 0a9eca25078..24335ebd65a 100644 --- a/code/game/machinery/biogenerator.dm +++ b/code/game/machinery/biogenerator.dm @@ -55,12 +55,12 @@ if(beaker) user << "A container is already loaded into the machine." else - user.before_take_item(O) + user.unEquip(O) O.loc = src beaker = O user << "You add the container to the machine." updateUsrDialog() - + if(!processing) if(default_deconstruction_screwdriver(user, "biogen-empty-o", "biogen-empty", O)) if(beaker) @@ -72,7 +72,7 @@ if(exchange_parts(user, O)) return - else if(istype(O, /obj/item/weapon/crowbar)) + else if(istype(O, /obj/item/weapon/crowbar)) else if(panel_open) user << "Close the maintenance panel first." else if(processing) @@ -105,13 +105,13 @@ if(i >= 10) user << "The biogenerator is full! Activate it." else - user.before_take_item(O) + user.unEquip(O) O.loc = src user << "You put [O.name] in [src.name]" - default_deconstruction_crowbar(O) - + default_deconstruction_crowbar(O) + update_icon() return @@ -246,14 +246,14 @@ if(in_beaker) if(check_container_volume(10)) return 0 else beaker.reagents.add_reagent("left4zed",10) - else + else new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(src.loc) if("rh") if (check_cost(25/efficiency)) return 0 if(in_beaker) if(check_container_volume(10)) return 0 else beaker.reagents.add_reagent("robustharvest",10) - else + else new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(src.loc) if("wallet") if (check_cost(100/efficiency)) return 0 @@ -324,7 +324,7 @@ else if(href_list["menu"]) menustat = "menu" updateUsrDialog() - + else if(href_list["inbeaker"]) in_beaker = !in_beaker updateUsrDialog() \ No newline at end of file diff --git a/code/game/machinery/bots/cleanbot.dm b/code/game/machinery/bots/cleanbot.dm index 5c4d3bf9200..e30bfa45283 100644 --- a/code/game/machinery/bots/cleanbot.dm +++ b/code/game/machinery/bots/cleanbot.dm @@ -272,7 +272,7 @@ text("[on ? "On" : "Off"]")) var/obj/machinery/bot/cleanbot/A = new /obj/machinery/bot/cleanbot(T) A.name = created_name user << "You add the robot arm to the bucket and sensor assembly. Beep boop!" - user.before_take_item(src, 1) + user.unEquip(src, 1) qdel(src) else if (istype(W, /obj/item/weapon/pen)) diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index 8e6855a8dbf..cd398eaf8f6 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -672,7 +672,7 @@ Auto Patrol[]"}, new /obj/machinery/bot/ed209(T,created_name,lasercolor) user.drop_item() qdel(W) - user.before_take_item(src, 1) + user.unEquip(src, 1) qdel(src) diff --git a/code/game/machinery/bots/farmbot.dm b/code/game/machinery/bots/farmbot.dm index f2981c70fe1..3c13b04ff96 100644 --- a/code/game/machinery/bots/farmbot.dm +++ b/code/game/machinery/bots/farmbot.dm @@ -544,7 +544,7 @@ A.loc = src.loc user << "You add the robot arm to the [src]" src.loc = A //Place the water tank into the assembly, it will be needed for the finished bot - user.u_equip(S) + user.unEquip(S) del(S) /obj/item/weapon/farmbot_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob) @@ -553,21 +553,21 @@ src.build_step++ user << "You add the plant analyzer to [src]!" src.name = "farmbot assembly" - user.u_equip(W) + user.unEquip(W) del(W) else if(( istype(W, /obj/item/weapon/reagent_containers/glass/bucket)) && (src.build_step == 1)) src.build_step++ user << "You add a bucket to [src]!" src.name = "farmbot assembly with bucket" - user.u_equip(W) + user.unEquip(W) del(W) else if(( istype(W, /obj/item/weapon/minihoe)) && (src.build_step == 2)) src.build_step++ user << "You add a minihoe to [src]!" src.name = "farmbot assembly with bucket and minihoe" - user.u_equip(W) + user.unEquip(W) del(W) else if((isprox(W)) && (src.build_step == 3)) @@ -579,7 +579,7 @@ S.tank = wTank S.loc = get_turf(src) S.name = src.created_name - user.u_equip(W) + user.unEquip(W) del(W) del(src) diff --git a/code/game/machinery/bots/floorbot.dm b/code/game/machinery/bots/floorbot.dm index eede1892d76..3752796f90f 100644 --- a/code/game/machinery/bots/floorbot.dm +++ b/code/game/machinery/bots/floorbot.dm @@ -491,7 +491,7 @@ obj/machinery/bot/floorbot/process_scan(var/scan_target) var/obj/item/weapon/toolbox_tiles/B = new /obj/item/weapon/toolbox_tiles user.put_in_hands(B) user << "You add the tiles into the empty toolbox. They protrude from the top." - user.before_take_item(src, 1) + user.unEquip(src, 1) qdel(src) else user << "You need 10 floor tiles to start building a floorbot." @@ -505,7 +505,7 @@ obj/machinery/bot/floorbot/process_scan(var/scan_target) B.created_name = created_name user.put_in_hands(B) user << "You add the sensor to the toolbox and tiles!" - user.before_take_item(src, 1) + user.unEquip(src, 1) qdel(src) else if (istype(W, /obj/item/weapon/pen)) @@ -525,7 +525,7 @@ obj/machinery/bot/floorbot/process_scan(var/scan_target) var/obj/machinery/bot/floorbot/A = new /obj/machinery/bot/floorbot(T) A.name = created_name user << "You add the robot arm to the odd looking toolbox assembly! Boop beep!" - user.before_take_item(src, 1) + user.unEquip(src, 1) qdel(src) else if (istype(W, /obj/item/weapon/pen)) var/t = stripped_input(user, "Enter new robot name", name, created_name,MAX_NAME_LEN) diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index c77a5477e13..084514ecd85 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -564,7 +564,7 @@ qdel(S) user.put_in_hands(A) user << "You add the robot arm to the first aid kit." - user.before_take_item(src, 1) + user.unEquip(src, 1) qdel(src) @@ -598,5 +598,5 @@ var/obj/machinery/bot/medbot/S = new /obj/machinery/bot/medbot(T) S.skin = skin S.name = created_name - user.before_take_item(src, 1) + user.unEquip(src, 1) qdel(src) \ No newline at end of file diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index fecf5cdcb26..2fb8118564e 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -52,7 +52,7 @@ desc = "It's Officer Pingsky! Delegated to satellite guard duty for harbouring anti-human sentiment." radio_frequency = AIPRIV_FREQ radio_name = "AI Private" - + /obj/machinery/bot/secbot/ofitser name = "Prison Ofitser" desc = "It's Prison Ofitser! Powered by the tears and sweat of prisoners." @@ -428,7 +428,7 @@ Auto Patrol: []"}, var/obj/item/weapon/secbot_assembly/A = new /obj/item/weapon/secbot_assembly user.put_in_hands(A) user << "You add the signaler to the helmet." - user.before_take_item(src, 1) + user.unEquip(src, 1) qdel(src) else return diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index 47c27591e99..74eb5381e2e 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -132,7 +132,8 @@ //Cameras can't track people wearing an agent card or a ninja hood. if(H.wear_id && istype(H.wear_id.GetID(), /obj/item/weapon/card/id/syndicate)) continue - + if(istype(H.head, /obj/item/clothing/head/helmet/space/space_ninja) && (H.head.flags & NODROP)) + continue // Now, are they viewable by a camera? (This is last because it's the most intensive check) if(!near_camera(M)) continue @@ -194,6 +195,9 @@ if(H.digitalcamo) U.ai_cancel_tracking(1) return + if(H.head && istype(H.head, /obj/item/clothing/head/helmet/space/space_ninja) && (H.head.flags & NODROP)) + U.ai_cancel_tracking(1) + return if(istype(target.loc,/obj/effect/dummy)) U.ai_cancel_tracking() diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm index 98f91fecc61..8490e37c042 100644 --- a/code/game/machinery/computer/HolodeckControl.dm +++ b/code/game/machinery/computer/HolodeckControl.dm @@ -269,8 +269,7 @@ if(isobj(obj)) var/mob/M = obj.loc if(ismob(M)) - M.u_equip(obj) - M.update_icons() //so their overlays update + M.unEquip(obj, 1) //Holoweapons should always drop. if(!silent) var/obj/oldobj = obj diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 6f7018c1cf4..804c0d92e3e 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -283,7 +283,7 @@ /obj/machinery/cryopod/robot/despawn_occupant() var/mob/living/silicon/robot/R = occupant if(!istype(R)) return ..() - + R.contents -= R.mmi del(R.mmi) for(var/obj/item/I in R.module) // the tools the borg has; metal, glass, guns etc @@ -299,7 +299,7 @@ /obj/machinery/cryopod/proc/despawn_occupant() //Drop all items into the pod. for(var/obj/item/W in occupant) - occupant.drop_from_inventory(W) + occupant.unEquip(W) W.loc = src if(W.contents.len) //Make sure we catch anything not handled by del() on the items. @@ -388,7 +388,7 @@ //Make an announcement and log the person entering storage. control_computer.frozen_crew += "[occupant.real_name]" - + var/ailist[] = list() for (var/mob/living/silicon/ai/A in living_mob_list) ailist += A @@ -397,7 +397,7 @@ announcer.say(";[occupant.real_name] [on_store_message]") else announce.autosay("[occupant.real_name] [on_store_message]", "[on_store_name]") - + visible_message("\The [src] hums and hisses as it moves [occupant.real_name] into storage.", 3) // Delete the mob. @@ -460,7 +460,7 @@ //Despawning occurs when process() is called with an occupant without a client. src.add_fingerprint(M) - + /obj/machinery/cryopod/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob) diff --git a/code/game/machinery/drying_rack.dm b/code/game/machinery/drying_rack.dm index d776fc3bef3..48d213a3326 100644 --- a/code/game/machinery/drying_rack.dm +++ b/code/game/machinery/drying_rack.dm @@ -35,7 +35,7 @@ if(is_type_in_list(W,accepted)) if(!running) if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/meat)) - user.u_equip(W) + user.unEquip(W) del(W) user << "You add the meat to the drying rack." src.running = 1 @@ -48,7 +48,7 @@ src.running = 0 return if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/grown/grapes)) - user.u_equip(W) + user.unEquip(W) del(W) user << "You add the grapes to the drying rack." src.running = 1 @@ -61,7 +61,7 @@ src.running = 0 return if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/grown/greengrapes)) - user.u_equip(W) + user.unEquip(W) del(W) user << "You add the green grapes to the drying rack." src.running = 1 @@ -79,7 +79,7 @@ var/obj/item/weapon/reagent_containers/food/snacks/grown/B = W B.reagents.trans_to(src, B.reagents.total_volume) user << "You add the [W] to the drying rack." - user.u_equip(W) + user.unEquip(W) del(W) src.running = 1 use_power = 2 diff --git a/code/game/machinery/kitchen/juicer.dm b/code/game/machinery/kitchen/juicer.dm index b237f8223f6..89ead24fddb 100644 --- a/code/game/machinery/kitchen/juicer.dm +++ b/code/game/machinery/kitchen/juicer.dm @@ -37,7 +37,9 @@ if (beaker) return 1 else - user.before_take_item(O) + if(!user.unEquip(O)) + user << "\the [O] is stuck to your hand, you cannot put it in \the [src]" + return 0 O.loc = src beaker = O src.verbs += /obj/machinery/juicer/verb/detach @@ -45,9 +47,11 @@ src.updateUsrDialog() return 0 if (!is_type_in_list(O, allowed_items)) - user << "It looks as not containing any juice." + user << "It doesn't look like that contains any juice." return 1 - user.before_take_item(O) + if(!user.unEquip(O)) + user << "\the [O] is stuck to your hand, you cannot put it in \the [src]" + return 0 O.loc = src src.updateUsrDialog() return 0 diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm index 0268755bb1a..6eb988f98c5 100644 --- a/code/game/machinery/kitchen/microwave.dm +++ b/code/game/machinery/kitchen/microwave.dm @@ -49,7 +49,7 @@ component_parts += new /obj/item/weapon/stock_parts/micro_laser(null) component_parts += new /obj/item/weapon/stock_parts/console_screen(null) component_parts += new /obj/item/stack/cable_coil(null, 2) - RefreshParts() + RefreshParts() /obj/machinery/microwave/upgraded/New() @@ -59,14 +59,14 @@ component_parts += new /obj/item/weapon/stock_parts/micro_laser/ultra(null) component_parts += new /obj/item/weapon/stock_parts/console_screen(null) component_parts += new /obj/item/stack/cable_coil(null, 2) - RefreshParts() + RefreshParts() /obj/machinery/microwave/RefreshParts() var/E for(var/obj/item/weapon/stock_parts/micro_laser/M in component_parts) E += M.rating - efficiency = E - + efficiency = E + /******************* * Item Adding ********************/ @@ -87,11 +87,11 @@ return else if(!anchored) anchored = 1 - user << "The [src] is now secured." + user << "The [src] is now secured." return - + default_deconstruction_crowbar(O) - + if(src.broken > 0) if(src.broken == 2 && istype(O, /obj/item/weapon/screwdriver)) // If it's broken and they're using a screwdriver user.visible_message( \ @@ -150,8 +150,10 @@ "\blue [user] has added one of [O] to \the [src].", \ "\blue You add one of [O] to \the [src].") else - // user.before_take_item(O) //This just causes problems so far as I can tell. -Pete - user.drop_item() + // user.unEquip(O) //This just causes problems so far as I can tell. -Pete + if(!user.drop_item()) + user << "\the [O] is stuck to your hand, you cannot put it in \the [src]" + return 0 O.loc = src user.visible_message( \ "\blue [user] has added \the [O] to \the [src].", \ diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm index 7f8ba253582..1e178bf54ff 100644 --- a/code/game/machinery/kitchen/smartfridge.dm +++ b/code/game/machinery/kitchen/smartfridge.dm @@ -85,7 +85,9 @@ user << "\The [src] is full." return 1 else - user.before_take_item(O) + if(!user.unEquip(O)) + usr << "\the [O] is stuck to your hand, you cannot put it in \the [src]" + return O.loc = src if(item_quants[O.name]) item_quants[O.name]++ diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 31da7e13203..73895ca2ec9 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -714,13 +714,15 @@ Status: []
"}, if(1) if(istype(W, /obj/item/stack/sheet/metal)) - if(W:amount>=2) // requires 2 metal sheets + var/obj/item/stack/sheet/metal/M = W + if(M.amount>=2) // requires 2 metal sheets user << "\blue You add some metal armor to the interior frame." build_step = 2 - W:amount -= 2 + M.amount -= 2 icon_state = "turret_frame2" - if(W:amount <= 0) - del(W) + if(M.amount <= 0) + user.unEquip(M, 1) //We're deleting it anyway, so no point in having NODROP fuck shit up. + del(M) return else if(istype(W, /obj/item/weapon/wrench)) @@ -758,6 +760,9 @@ Status: []
"}, if(istype(W, /obj/item/weapon/gun/energy)) // the gun installation part var/obj/item/weapon/gun/energy/E = W // typecasts the item to an energy gun + if(!user.unEquip(W)) + user << "\the [W] is stuck to your hand, you cannot put it in \the [src]" + return installation = W.type // installation becomes W.type gun_charge = E.power_supply.charge // the gun's charge is stored in src.gun_charge user << "\blue You add \the [W] to the turret." @@ -773,6 +778,9 @@ Status: []
"}, if(4) if(isprox(W)) + if(!user.unEquip(W)) + user << "\the [W] is stuck to your hand, you cannot put it in \the [src]" + return build_step = 5 user << "\blue You add the prox sensor to the turret." del(W) @@ -791,12 +799,14 @@ Status: []
"}, if(6) if(istype(W, /obj/item/stack/sheet/metal)) - if(W:amount>=2) + var/obj/item/stack/sheet/metal/M = W + if(M.amount>=2) user << "\blue You add some metal armor to the exterior frame." build_step = 7 - W:amount -= 2 - if(W:amount <= 0) - del(W) + M.amount -= 2 + if(M.amount <= 0) + user.unEquip(M, 1) //If we don't force-unequip, bugs happen because the item was deleted without updating the neccesary stuff + del(M) return else if(istype(W, /obj/item/weapon/screwdriver)) diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index 27e46c668b5..5e39eba0d79 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -138,7 +138,7 @@ var/const/SAFETY_COOLDOWN = 100 // Remove and recycle the equipped items. for(var/obj/item/I in L.get_equipped_items()) - if(L.u_equip(I)) + if(L.unEquip(I)) recycle(I, 0) // Instantly lie down, also go unconscious from the pain, before you die. diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 1aabc4b6d6d..e50b6a11280 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -43,7 +43,9 @@ else if(istype(I, /obj/item/device/gps)) var/obj/item/device/gps/L = I if(L.locked_location && !(stat & (NOPOWER|BROKEN))) - user.before_take_item(L) + if(!user.unEquip(L)) + user << "\the [I] is stuck to your hand, you cannot put it in \the [src]" + return L.loc = src locked = L user << "You insert the GPS device into the [name]'s slot." @@ -279,7 +281,7 @@ component_parts += new /obj/item/bluespace_crystal/artificial(null) component_parts += new /obj/item/weapon/stock_parts/matter_bin(null) RefreshParts() - + /obj/machinery/teleport/hub/upgraded/New() ..() component_parts = list() diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index a4c8b5a527a..fc8c5ee658a 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -158,7 +158,7 @@ var/mob/living/carbon/human/H = M if(isobj(H.shoes)) var/thingy = H.shoes - H.drop_from_inventory(H.shoes) + H.unEquip(H.shoes) walk_away(thingy,chassis,15,2) spawn(20) if(thingy) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index e62872c9664..a6f60bd1c41 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -809,7 +809,9 @@ return else if(istype(W, /obj/item/mecha_parts/mecha_tracking)) - user.drop_from_inventory(W) + if(!user.unEquip(W)) + user << "\the [W] is stuck to your hand, you cannot put it in \the [src]" + return W.forceMove(src) user.visible_message("[user] attaches [W] to [src].", "You attach [W] to [src]") return @@ -1118,7 +1120,9 @@ else if(mmi_as_oc.brainmob.stat) user << "Beta-rhythm below acceptable level." return 0 - user.drop_from_inventory(mmi_as_oc) + if(!user.unEquip(mmi_as_oc)) + user << "\the [mmi_as_oc] is stuck to your hand, you cannot put it in \the [src]" + return var/mob/brainmob = mmi_as_oc.brainmob brainmob.reset_view(src) /* diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 4cab37f9b68..e4490460dca 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -33,7 +33,6 @@ var/permeability_coefficient = 1 // for chemicals/diseases var/siemens_coefficient = 1 // for electrical admittance/conductance (electrocution checks and shit) var/slowdown = 0 // How much clothing is slowing you down. Negative values speeds you up - var/canremove = 1 //Mostly for Ninja code at this point but basically will not allow the item to be removed if set to 0. /N var/reflect_chance = 0 //This var dictates what % of a time an object will reflect an energy based weapon's shot var/armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) var/list/allowed = null //suit storage stuff. @@ -54,7 +53,7 @@ /obj/item/Destroy() if(istype(src.loc, /mob)) var/mob/H = src.loc - H.drop_from_inventory(src) // items at the very least get unequipped from their mob before being deleted + H.unEquip(src) // items at the very least get unequipped from their mob before being deleted if(reagents && istype(reagents)) reagents.my_atom = null reagents.delete() @@ -149,19 +148,16 @@ S.remove_from_storage(src) src.throwing = 0 - if (src.loc == user) - //canremove==0 means that object may not be removed. You can still wear it. This only applies to clothing. /N - if(!src.canremove) + if (loc == user) + if(!user.unEquip(src)) return 0 - else - user.u_equip(src) else - if(isliving(src.loc)) + if(isliving(loc)) return 0 user.next_move = max(user.next_move+2,world.time + 2) - src.pickup(user) + pickup(user) add_fingerprint(user) user.put_in_active_hand(src) return 1 @@ -174,7 +170,7 @@ if(!A.has_fine_manipulation || w_class >= 4) if(src in A.contents) // To stop Aliens having items stuck in their pockets - A.drop_from_inventory(src) + A.unEquip(src) user << "Your claws aren't capable of such fine manipulation." return @@ -185,11 +181,8 @@ M.client.screen -= src src.throwing = 0 if (src.loc == user) - //canremove==0 means that object may not be removed. You can still wear it. This only applies to clothing. /N - if(istype(src, /obj/item/clothing) && !src:canremove) + if(!user.unEquip(src)) return - else - user.u_equip(src) else if(istype(src.loc, /mob/living)) return @@ -205,7 +198,7 @@ if(!A.has_fine_manipulation || w_class >= 4) if(src in A.contents) // To stop Aliens having items stuck in their pockets - A.drop_from_inventory(src) + A.unEquip(src) user << "Your claws aren't capable of such fine manipulation." return attack_paw(A) @@ -420,6 +413,8 @@ return 0 return 1 if(slot_l_store) + if(flags & NODROP) //Pockets aren't visible, so you can't move NODROP items into them. + return 0 if(H.l_store) return 0 if(!H.w_uniform) @@ -431,6 +426,8 @@ if( w_class <= 2 || (slot_flags & SLOT_POCKET) ) return 1 if(slot_r_store) + if(flags & NODROP) + return 0 if(H.r_store) return 0 if(!H.w_uniform) @@ -443,6 +440,8 @@ return 1 return 0 if(slot_s_store) + if(flags & NODROP) //Suit storage NODROP items drop if you take a suit off, this is to prevent people exploiting this. + return 0 if(H.s_store) return 0 if(!H.wear_suit) diff --git a/code/game/objects/items/ashtray.dm b/code/game/objects/items/ashtray.dm index 5ec88ac8bdf..5e6274b7cf0 100644 --- a/code/game/objects/items/ashtray.dm +++ b/code/game/objects/items/ashtray.dm @@ -21,7 +21,7 @@ if (contents.len >= max_butts) user << "This ashtray is full." return - user.u_equip(W) + user.unEquip(W) W.loc = src if (istype(W,/obj/item/clothing/mask/cigarette)) diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index b47a2a30684..61f341f0362 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -59,7 +59,8 @@ if(!wax) new/obj/item/trash/candle(src.loc) if(istype(src.loc, /mob)) - src.dropped() + var/mob/M = src.loc + M.unEquip(src, 1) //src is being deleted anyway del(src) update_icon() if(istype(loc, /turf)) //start a fire if possible diff --git a/code/game/objects/items/devices/modkit.dm b/code/game/objects/items/devices/modkit.dm index 6e23e94d4ad..61c83fdc462 100644 --- a/code/game/objects/items/devices/modkit.dm +++ b/code/game/objects/items/devices/modkit.dm @@ -23,7 +23,7 @@ if(!parts) user << "This kit has no parts for this modification left." - user.drop_from_inventory(src) + user.unEquip(src) del(src) return @@ -59,7 +59,7 @@ parts &= ~MODKIT_SUIT if(!parts) - user.drop_from_inventory(src) + user.unEquip(src) del(src) /obj/item/device/modkit/examine() diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index 686fd4e3ae1..b737f9d92ca 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -35,18 +35,22 @@ var/obj/item/assembly/shock_kit/A = new /obj/item/assembly/shock_kit( user ) A.icon = 'icons/obj/assemblies.dmi' - user.drop_from_inventory(W) + if(!user.unEquip(W)) + user << "\the [W] is stuck to your hand, you cannot attach it to \the [src]!" + return W.loc = A W.master = A A.part1 = W - user.drop_from_inventory(src) + user.unEquip(src) loc = A master = A A.part2 = src user.put_in_hands(A) A.add_fingerprint(user) + if(src.flags & NODROP) + A.flags |= NODROP /obj/item/device/radio/electropack/Topic(href, href_list) //..() diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 07475fcba43..c28dc6ac883 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -109,7 +109,7 @@ user << "You armed the robot frame" W:use(1) if (user.get_inactive_hand()==src) - user.before_take_item(src) + user.unEquip(src) user.put_in_inactive_hand(B) del(src) if(istype(W, /obj/item/robot_parts/l_leg)) diff --git a/code/game/objects/items/stacks/sheets/light.dm b/code/game/objects/items/stacks/sheets/light.dm index a43dda1323e..51aed957168 100644 --- a/code/game/objects/items/stacks/sheets/light.dm +++ b/code/game/objects/items/stacks/sheets/light.dm @@ -19,17 +19,17 @@ amount-- new/obj/item/stack/sheet/glass(user.loc) if(amount <= 0) - user.drop_from_inventory(src) + user.unEquip(src, 1) del(src) if(istype(O,/obj/item/stack/sheet/metal)) var/obj/item/stack/sheet/metal/M = O M.amount-- if(M.amount <= 0) - user.drop_from_inventory(M) + user.unEquip(src, 1) del(M) amount-- new/obj/item/stack/tile/light(user.loc) if(amount <= 0) - user.drop_from_inventory(src) + user.unEquip(src, 1) del(src) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index e3d457fc477..a4f2cc60829 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -145,7 +145,7 @@ if (src.amount<=0) var/oldsrc = src src = null //dont kill proc after del() - usr.before_take_item(oldsrc) + usr.unEquip(oldsrc, 1) del(oldsrc) if (istype(O,/obj/item)) usr.put_in_hands(O) @@ -167,7 +167,7 @@ amount -= used if (amount <= 0) if(usr) - usr.before_take_item(src, 1) + usr.unEquip(src, 1) qdel(src) return 1 @@ -185,7 +185,7 @@ usr << "You add new [item.singular_name] to the stack. It now contains [item.amount] [item.singular_name]\s." if(!oldsrc) break - + /obj/item/stack/proc/get_amount() return amount diff --git a/code/game/objects/items/stacks/tiles/light.dm b/code/game/objects/items/stacks/tiles/light.dm index 9693e536847..688c3347116 100644 --- a/code/game/objects/items/stacks/tiles/light.dm +++ b/code/game/objects/items/stacks/tiles/light.dm @@ -32,5 +32,5 @@ amount-- new/obj/item/stack/light_w(user.loc) if(amount <= 0) - user.drop_from_inventory(src) + user.unEquip(src, 1) del(src) \ No newline at end of file diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index b49e23724b9..b338a1c259a 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -384,9 +384,13 @@ user << "You try to attach the end of the plastic sword to... itself. You're not very smart, are you?" if(ishuman(user)) user.adjustBrainLoss(10) + else if((W.flags & NODROP) || (flags & NODROP)) + user << "\the [flags & NODROP ? src : W] is stuck to your hand, you can't attach it to \the [flags & NODROP ? W : src]!" else user << "You attach the ends of the two plastic swords, making a single double-bladed toy! You're fake-cool." new /obj/item/weapon/twohanded/dualsaber/toy(user.loc) + user.unEquip(W) + user.unEquip(src) del(W) del(src) @@ -703,8 +707,10 @@ obj/item/toy/cards/deck/attackby(obj/item/toy/cards/singlecard/C, mob/living/use ..() if(istype(C)) if(C.parentdeck == src) + if(!user.unEquip(C)) + user << "The card is stuck to your hand, you can't add it to the deck!" + return src.cards += C.cardname - user.u_equip(C) user.visible_message("[user] adds a card to the bottom of the deck.","You add the card to the bottom of the deck.") del(C) else @@ -721,8 +727,10 @@ obj/item/toy/cards/deck/attackby(obj/item/toy/cards/cardhand/C, mob/living/user) ..() if(istype(C)) if(C.parentdeck == src) + if(!user.unEquip(C)) + user << "The hand of cards is stuck to your hand, you can't add it to the deck!" + return src.cards += C.currenthand - user.u_equip(C) user.visible_message("[user] puts their hand of cards in the deck.", "You put the hand of cards in the deck.") del(C) else @@ -739,22 +747,19 @@ obj/item/toy/cards/deck/MouseDrop(atom/over_object) if(usr.stat || !ishuman(usr) || !usr.canmove || usr.restrained()) return if(Adjacent(usr)) - if(over_object == M) + if(over_object == M && loc != M) M.put_in_hands(src) usr << "You pick up the deck." else if(istype(over_object, /obj/screen)) switch(over_object.name) - if("r_hand") - M.u_equip(src) - M.put_in_r_hand(src) - usr << "You pick up the deck." if("l_hand") - M.u_equip(src) M.put_in_l_hand(src) - usr << "You pick up the deck." + else if("r_hand") + M.put_in_r_hand(src) + usr << "You pick up the deck." else - usr<< "You can't reach it from here." + usr << "You can't reach it from here." @@ -814,7 +819,7 @@ obj/item/toy/cards/cardhand/Topic(href, href_list) N.parentdeck = src.parentdeck N.cardname = src.currenthand[1] N.apply_card_vars(N,O) - cardUser.u_equip(src) + cardUser.unEquip(src) N.pickup(cardUser) cardUser.put_in_any_hand_if_possible(N) cardUser << "You also take [currenthand[1]] and hold it." @@ -826,7 +831,7 @@ obj/item/toy/cards/cardhand/attackby(obj/item/toy/cards/singlecard/C, mob/living if(istype(C)) if(C.parentdeck == src.parentdeck) src.currenthand += C.cardname - user.u_equip(C) + user.unEquip(C) user.visible_message("[user] adds a card to their hand.", "You add the [C.cardname] to your hand.") interact(user) if(currenthand.len > 4) @@ -902,7 +907,7 @@ obj/item/toy/cards/singlecard/attackby(obj/item/I, mob/living/user) H.currenthand += src.cardname H.parentdeck = C.parentdeck H.apply_card_vars(H,C) - user.u_equip(C) + user.unEquip(C) H.pickup(user) user.put_in_active_hand(H) user << "You combine the [C.cardname] and the [src.cardname] into a hand." @@ -915,7 +920,7 @@ obj/item/toy/cards/singlecard/attackby(obj/item/I, mob/living/user) var/obj/item/toy/cards/cardhand/H = I if(H.parentdeck == parentdeck) H.currenthand += cardname - user.u_equip(src) + user.unEquip(src) user.visible_message("[user] adds a card to \his hand.", "You add the [cardname] to your hand.") H.interact(user) if(H.currenthand.len > 4) diff --git a/code/game/objects/items/weapons/chrono_eraser.dm b/code/game/objects/items/weapons/chrono_eraser.dm index a3b92ee4dbd..15640ba0670 100644 --- a/code/game/objects/items/weapons/chrono_eraser.dm +++ b/code/game/objects/items/weapons/chrono_eraser.dm @@ -44,11 +44,11 @@ item_state = "chronogun" icon_override = 'icons/mob/in-hand/guns.dmi' w_class = 3.0 - canremove = 0 projectile_type = "/obj/item/projectile/energy/chrono_beam" fire_sound = 'sound/weapons/Laser.ogg' charge_cost = 0 fire_delay = 50 + flags = NODROP var/obj/item/weapon/chrono_eraser/TED = null var/obj/effect/chrono_field/field = null var/turf/startpos = null diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index ccc23bdddf1..33b7f064e14 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -137,12 +137,18 @@ CIGARETTE PACKETS ARE IN FANCY.DM var/datum/effect/effect/system/reagents_explosion/e = new() e.set_up(round(reagents.get_reagent_amount("plasma") / 2.5, 1), get_turf(src), 0, 0) e.start() + if(ismob(loc)) + var/mob/M = loc + M.unEquip(src, 1) del(src) return if(reagents.get_reagent_amount("fuel")) // the fuel explodes, too, but much less violently var/datum/effect/effect/system/reagents_explosion/e = new() e.set_up(round(reagents.get_reagent_amount("fuel") / 5, 1), get_turf(src), 0, 0) e.start() + if(ismob(loc)) + var/mob/M = loc + M.unEquip(src, 1) del(src) return flags &= ~NOREACT // allowing reagents to react after being lit @@ -193,8 +199,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM if(ismob(loc)) var/mob/living/M = loc M << "Your [name] goes out." - M.u_equip(src) //un-equip it so the overlays can update - M.update_inv_wear_mask(0) + M.unEquip(src, 1) //Force the un-equip so the overlays update processing_objects.Remove(src) del(src) @@ -524,10 +529,10 @@ obj/item/weapon/rollingpaperpack/attack_self(mob/user) else if(istype(over_object, /obj/screen)) switch(over_object.name) if("r_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_r_hand(src) if("l_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_l_hand(src) /obj/item/weapon/rollingpaperpack/examine() diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index b65a1904116..c94e6de7dcf 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -160,7 +160,7 @@ /obj/item/weapon/defibrillator/proc/remove_paddles(mob/user) var/mob/living/carbon/human/M = user if(paddles in get_both_hands(M)) - M.u_equip(paddles) + M.unEquip(paddles) update_icon() return @@ -196,7 +196,7 @@ paddles.cooldown = 0 paddles.update_icon() update_icon() - + /obj/item/weapon/defibrillator/compact name = "compact defibrillator" desc = "A belt-equipped defibrillator that can be rapidly deployed." @@ -292,7 +292,7 @@ /obj/item/weapon/twohanded/shockpaddles/proc/check_defib_exists(mainunit, var/mob/living/carbon/human/M, var/obj/O) if (!mainunit || !istype(mainunit, /obj/item/weapon/defibrillator)) //To avoid weird issues from admin spawns - M.u_equip(O) + M.unEquip(O) qdel(O) return 0 else diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 3e4831f701e..3cc4caebb33 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -93,7 +93,7 @@ spawn(0)//this prevents the collapse of space-time continuum if (user) - user.drop_from_inventory(src) + user.unEquip(src) del(src) return uses diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm index 0af739fdccd..a1bd6e79f47 100644 --- a/code/game/objects/items/weapons/gift_wrappaper.dm +++ b/code/game/objects/items/weapons/gift_wrappaper.dm @@ -109,7 +109,7 @@ if(!ispath(gift_type,/obj/item)) return var/obj/item/I = new gift_type(M) - M.u_equip(src) + M.unEquip(src, 1) M.put_in_hands(I) I.add_fingerprint(M) del(src) diff --git a/code/game/objects/items/weapons/grenades/bananade.dm b/code/game/objects/items/weapons/grenades/bananade.dm index 986fae6a358..119a72d59a6 100644 --- a/code/game/objects/items/weapons/grenades/bananade.dm +++ b/code/game/objects/items/weapons/grenades/bananade.dm @@ -49,7 +49,7 @@ var/turf/T if(istype(I, /obj/item/weapon/screwdriver)) if(fillamt) var/obj/item/weapon/grenade/bananade/G = new /obj/item/weapon/grenade/bananade - user.before_take_item(src) + user.unEquip(src) user.put_in_hands(G) G.deliveryamt = src.fillamt user << "You lock the assembly shut, readying it for HONK." diff --git a/code/game/objects/items/weapons/grenades/ghettobomb.dm b/code/game/objects/items/weapons/grenades/ghettobomb.dm index 8741ccb8576..e4301755a92 100644 --- a/code/game/objects/items/weapons/grenades/ghettobomb.dm +++ b/code/game/objects/items/weapons/grenades/ghettobomb.dm @@ -5,8 +5,8 @@ if(istype(I, /obj/item/device/assembly/igniter)) var/obj/item/device/assembly/igniter/G = I var/obj/item/weapon/grenade/iedcasing/W = new /obj/item/weapon/grenade/iedcasing - user.before_take_item(G) - user.before_take_item(src) + user.unEquip(G) + user.unEquip(src) user.put_in_hands(W) user << "You stuff the [I] in the [src], emptying the contents beforehand." W.underlays += image(src.icon, icon_state = src.icon_state) diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index 2a16ed05b2d..c0ddc3c2359 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -78,7 +78,7 @@ /obj/item/weapon/grenade/proc/update_mob() if(ismob(loc)) var/mob/M = loc - M.drop_from_inventory(src) + M.unEquip(src) /obj/item/weapon/grenade/attackby(obj/item/weapon/W as obj, mob/user as mob) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index f8358122e00..d885b568159 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -143,7 +143,7 @@ var/last_chew = 0 var/obj/item/stack/rods/R = I if (R.use(1)) var/obj/item/weapon/wirerod/W = new /obj/item/weapon/wirerod - user.u_equip(src) + user.unEquip(src) user.put_in_hands(W) user << "You wrap the cable restraint around the top of the rod." del(src) diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm index 22041ccd51b..40e78584f76 100644 --- a/code/game/objects/items/weapons/implants/implanter.dm +++ b/code/game/objects/items/weapons/implants/implanter.dm @@ -145,7 +145,7 @@ user << "\red Something is already scanned inside the implant!" return if(user) - user.u_equip(I) + user.unEquip(I) user.update_icons() //update our overlays c.scanned = I c.scanned.loc = c diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index f96883c6146..c78906a6639 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -208,7 +208,7 @@ break if(!inserted || !S.amount) - usr.u_equip(S) + usr.unEquip(S) usr.update_icons() //update our overlays if (usr.client && usr.s_active != src) usr.client.screen -= S diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index 9dd0b121b9f..c73bdb62a64 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -20,10 +20,10 @@ if (!M.restrained() && !M.stat && can_use()) switch(over_object.name) if("r_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_r_hand(src) if("l_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_l_hand(src) src.add_fingerprint(usr) return diff --git a/code/game/objects/items/weapons/storage/firstaid.dm b/code/game/objects/items/weapons/storage/firstaid.dm index 56c02a49bdf..0cb6ecb6727 100644 --- a/code/game/objects/items/weapons/storage/firstaid.dm +++ b/code/game/objects/items/weapons/storage/firstaid.dm @@ -12,7 +12,7 @@ name = "first-aid kit" desc = "It's an emergency medical kit for those serious boo-boos." icon_state = "firstaid" - icon_override = 'icons/mob/in-hand/medkits.dmi' + icon_override = 'icons/mob/in-hand/medkits.dmi' throw_speed = 2 throw_range = 8 var/empty = 0 @@ -154,10 +154,10 @@ if ((!( M.restrained() ) && !( M.stat ) /*&& M.pocket == src*/)) switch(over_object.name) if("r_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_r_hand(src) if("l_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_l_hand(src) src.add_fingerprint(usr) return diff --git a/code/game/objects/items/weapons/storage/internal.dm b/code/game/objects/items/weapons/storage/internal.dm index 082002a5b9a..44c8aaa5697 100644 --- a/code/game/objects/items/weapons/storage/internal.dm +++ b/code/game/objects/items/weapons/storage/internal.dm @@ -37,19 +37,19 @@ if (!( istype(over_object, /obj/screen) )) return 1 - + //makes sure master_item is equipped before putting it in hand, so that we can't drag it into our hand from miles away. //there's got to be a better way of doing this... - if (!(master_item.loc == user) || (master_item.loc && master_item.loc.loc == user)) + if (!(master_item.loc == user) || (master_item.loc && master_item.loc.loc == user)) return 0 - + if (!( user.restrained() ) && !( user.stat )) switch(over_object.name) if("r_hand") - user.u_equip(master_item) + user.unEquip(master_item) user.put_in_r_hand(master_item) if("l_hand") - user.u_equip(master_item) + user.unEquip(master_item) user.put_in_l_hand(master_item) master_item.add_fingerprint(user) return 0 @@ -70,12 +70,12 @@ H.put_in_hands(master_item) H.r_store = null return 0 - + src.add_fingerprint(user) if (master_item.loc == user) src.open(user) return 0 - + for(var/mob/M in range(1, master_item.loc)) if (M.s_active == src) src.close(M) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index c34c0ca0595..56ac3caff67 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -46,10 +46,12 @@ if (!( M.restrained() ) && !( M.stat )) switch(over_object.name) if("r_hand") - M.u_equip(src) + if(!M.unEquip(src)) + return M.put_in_r_hand(src) if("l_hand") - M.u_equip(src) + if(!M.unEquip(src)) + return M.put_in_l_hand(src) src.add_fingerprint(usr) return @@ -250,15 +252,21 @@ usr << "[src] cannot hold [W] as it's a storage item of the same size." return 0 //To prevent the stacking of same sized storage items. + if(W.flags & NODROP) //SHOULD be handled in unEquip, but better safe than sorry. + usr << "\the [W] is stuck to your hand, you can't put it in \the [src]" + return 0 + return 1 //This proc handles items being inserted. It does not perform any checks of whether an item can or can't be inserted. That's done by can_be_inserted() //The stop_warning parameter will stop the insertion message from being displayed. It is intended for cases where you are inserting multiple items at once, //such as when picking up all the items on a tile with one click. /obj/item/weapon/storage/proc/handle_item_insertion(obj/item/W as obj, prevent_warning = 0) - if(!istype(W)) return 0 + if(!istype(W)) + return 0 if(usr) - usr.u_equip(W) + if(!usr.unEquip(W)) + return 0 usr.update_icons() //update our overlays W.loc = src W.on_enter_storage(src) diff --git a/code/game/objects/items/weapons/tanks/tank_types.dm b/code/game/objects/items/weapons/tanks/tank_types.dm index e41e57c2ac7..21881c27986 100644 --- a/code/game/objects/items/weapons/tanks/tank_types.dm +++ b/code/game/objects/items/weapons/tanks/tank_types.dm @@ -118,7 +118,7 @@ if ((!F.status)||(F.ptank)) return src.master = F F.ptank = src - user.before_take_item(src) + user.unEquip(src) src.loc = F return diff --git a/code/game/objects/items/weapons/tanks/watertank.dm b/code/game/objects/items/weapons/tanks/watertank.dm index 85d4aeacb01..e721c2ab283 100644 --- a/code/game/objects/items/weapons/tanks/watertank.dm +++ b/code/game/objects/items/weapons/tanks/watertank.dm @@ -63,7 +63,7 @@ /obj/item/weapon/watertank/proc/remove_noz(mob/user) var/mob/living/carbon/human/M = user if(noz in get_both_hands(M)) - M.u_equip(noz) + M.unEquip(noz) return /obj/item/weapon/watertank/Destroy() @@ -108,7 +108,7 @@ /proc/check_tank_exists(parent_tank, var/mob/living/carbon/human/M, var/obj/O) if (!parent_tank || !istype(parent_tank, /obj/item/weapon/watertank)) //To avoid weird issues from admin spawns - M.u_equip(O) + M.unEquip(O) qdel(0) return 0 else diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index f19fd9cfc27..f84a3534005 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -194,12 +194,12 @@ if (user.client) user.client.screen -= src if (user.r_hand == src) - user.u_equip(src) + user.unEquip(src) else - user.u_equip(src) + user.unEquip(src) src.master = F src.layer = initial(src.layer) - user.u_equip(src) + user.unEquip(src) if (user.client) user.client.screen -= src src.loc = F diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index cbbde21c7a3..998d24f8abc 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -170,8 +170,8 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob) if(istype(I, /obj/item/weapon/shard)) var/obj/item/weapon/twohanded/spear/S = new /obj/item/weapon/twohanded/spear - user.u_equip(I) - user.u_equip(src) + user.unEquip(I) + user.unEquip(src) user.put_in_hands(S) user << "You fasten the glass shard to the top of the rod with the cable." @@ -181,8 +181,8 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob) else if(istype(I, /obj/item/weapon/wirecutters)) var/obj/item/weapon/melee/baton/cattleprod/P = new /obj/item/weapon/melee/baton/cattleprod - user.u_equip(I) - user.u_equip(src) + user.unEquip(I) + user.unEquip(src) user.put_in_hands(P) user << "You fasten the wirecutters to the top of the rod with the cable, prongs outward." diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm index 25b2a393331..bad562d595a 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm @@ -56,14 +56,14 @@ /obj/item/weapon/stool/attack_self(mob/user as mob) ..() origin.loc = get_turf(src) - user.u_equip(src) + user.unEquip(src) user.visible_message("\blue [user] puts [src] down.", "\blue You put [src] down.") del src /obj/item/weapon/stool/attack(mob/M as mob, mob/user as mob) if (prob(5) && istype(M,/mob/living)) user.visible_message("\red [user] breaks [src] over [M]'s back!.") - user.u_equip(src) + user.unEquip(src) var/obj/item/stack/sheet/metal/m = new/obj/item/stack/sheet/metal m.loc = get_turf(src) del src diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index e71653136f2..279e91db553 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -373,7 +373,8 @@ return if(isrobot(user)) return - user.drop_item() + if(!user.drop_item()) + return if (O.loc != src.loc) step(O, get_dir(O, src)) return @@ -737,7 +738,8 @@ return if(isrobot(user)) return - user.drop_item() + if(!user.drop_item()) + return if (O.loc != src.loc) step(O, get_dir(O, src)) return @@ -750,8 +752,11 @@ return if(isrobot(user)) return - user.drop_item() - if(W && W.loc) W.loc = src.loc + if(!(W.flags & ABSTRACT)) + if(user.drop_item()) + W.Move(loc) + if(W && W.loc) + W.loc = src.loc return /obj/structure/rack/meteorhit(obj/O as obj) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 0a656b903fb..c84a24c12cb 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -249,8 +249,8 @@ if(old_opacity != W.opacity) //opacity has changed. Need to update surrounding lights if(W.lighting_lumcount) //unless we're being illuminated, don't bother (may be buggy, hard to test) - W.UpdateAffectingLights() - + W.UpdateAffectingLights() + if (istype(W,/turf/simulated/floor)) W.RemoveLattice() diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 4388c0a8247..03270acb43f 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -599,13 +599,13 @@ if(counter >= 5) //So things dont get squiiiiished! jobs += "" counter = 0 - + //Drone if(jobban_isbanned(M, "Drone")) jobs += "Drone" else jobs += "Drone" - + //pAI if(jobban_isbanned(M, "pAI")) jobs += "pAI" @@ -675,19 +675,19 @@ jobs += "[replacetext("Ninja", " ", " ")]" else jobs += "[replacetext("Ninja", " ", " ")]" - + //Raider if(jobban_isbanned(M, "raider") || isbanned_dept) jobs += "[replacetext("Raider", " ", " ")]" else jobs += "[replacetext("Raider", " ", " ")]" - + //Mutineer if(jobban_isbanned(M, "mutineer") || isbanned_dept) jobs += "[replacetext("Mutineer", " ", " ")]" else jobs += "[replacetext("Mutineer", " ", " ")]" - + //Blob if(jobban_isbanned(M, "blob") || isbanned_dept) jobs += "[replacetext("Blob", " ", " ")]" @@ -706,12 +706,12 @@ jobs += "Dionaea Nymph" else jobs += "Dionaea Nymph" - + //NPC if(jobban_isbanned(M, "NPC")) jobs += "NPC" else - jobs += "NPC" + jobs += "NPC" //ANTAG HUD if(jobban_isbanned(M, "AntagHUD")) @@ -1149,7 +1149,7 @@ //strip their stuff and stick it in the crate for(var/obj/item/I in M) - M.u_equip(I) + M.unEquip(I) if(I) I.loc = locker I.layer = initial(I.layer) @@ -1170,7 +1170,7 @@ M << "\red You have been sent to the prison station!" log_admin("[key_name(usr)] sent [key_name(M)] to the prison station.") message_admins("\blue [key_name_admin(usr)] sent [key_name_admin(M)] to the prison station.", 1) - + else if(href_list["sendbacktolobby"]) if(!check_rights(R_ADMIN)) return @@ -1193,7 +1193,7 @@ var/mob/new_player/NP = new() NP.ckey = M.ckey - qdel(M) + qdel(M) else if(href_list["tdome1"]) if(!check_rights(R_SERVER|R_EVENT)) return @@ -1210,7 +1210,7 @@ return for(var/obj/item/I in M) - M.u_equip(I) + M.unEquip(I) if(I) I.loc = M.loc I.layer = initial(I.layer) @@ -1239,7 +1239,7 @@ return for(var/obj/item/I in M) - M.u_equip(I) + M.unEquip(I) if(I) I.loc = M.loc I.layer = initial(I.layer) @@ -1290,7 +1290,7 @@ return for(var/obj/item/I in M) - M.u_equip(I) + M.unEquip(I) if(I) I.loc = M.loc I.layer = initial(I.layer) @@ -1666,11 +1666,11 @@ //open a browse window listing the contents instead var/data = "" var/obj/item/weapon/paper_bundle/B = fax - + for (var/page = 1, page <= B.amount + 1, page++) var/obj/pageobj = B.contents[page] data += "Page [page] - [pageobj.name]
" - + usr << browse(data, "window=[B.name]") else usr << "\red The faxed item is not viewable. This is probably a bug, and should be reported on the tracker: [fax.type]" @@ -1678,9 +1678,9 @@ else if (href_list["AdminFaxViewPage"]) var/page = text2num(href_list["AdminFaxViewPage"]) var/obj/item/weapon/paper_bundle/bundle = locate(href_list["paper_bundle"]) - + if (!bundle) return - + if (istype(bundle.contents[page], /obj/item/weapon/paper)) var/obj/item/weapon/paper/P = bundle.contents[page] P.show_content(src.owner, 1) @@ -1688,7 +1688,7 @@ var/obj/item/weapon/photo/H = bundle.contents[page] H.show(src.owner) return - + else if(href_list["CentcommFaxReply"]) var/mob/sender = locate(href_list["CentcommFaxReply"]) var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["originfax"]) @@ -1697,26 +1697,26 @@ if(!input) return var/customname = input(src.owner, "Pick a title for the report", "Title") as text|null - + // Create the reply message var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( null ) //hopefully the null loc won't cause trouble for us P.name = "[command_name()]- [customname]" P.info = input P.update_icon() - P.stamps += "
" + P.stamps += "
" var/image/stampoverlay = image('icons/obj/bureaucracy.dmi') P.x = rand(-2, 0) - P.y = rand(-1, 2) + P.y = rand(-1, 2) P.offset_x += P.x P.offset_y += P.y stampoverlay.pixel_x = P.x stampoverlay.pixel_y = P.y - + if(!P.ico) P.ico = new P.ico += "paper_stamp-cent" stampoverlay.icon_state = "paper_stamp-cent" - + // Stamps if(!P.stamped) P.stamped = new @@ -1729,7 +1729,7 @@ message_admins("[key_name_admin(src.owner)] replied to a fax message from [key_name_admin(sender)]", 1) else src.owner << "\red Message reply failed." - + spawn(100) del(P) return @@ -2033,12 +2033,12 @@ feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","BLOB") message_admins("[key_name_admin(usr)] has triggered a blob.") - new /datum/game_mode/blob() + new /datum/game_mode/blob() if("aliens") feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","ALIEN") message_admins("[key_name_admin(usr)] has triggered an alien infestation.") - new /datum/event/alien_infestation() + new /datum/event/alien_infestation() if("power") feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","P") @@ -2111,7 +2111,7 @@ if(istype(W, /datum/organ/external)) continue //don't strip organs - H.u_equip(W) + H.unEquip(W) if (H.client) H.client.screen -= W if (W) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 9b9c26f7a68..153f7005b2a 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -10,7 +10,7 @@ return for(var/obj/item/W in M) - M.drop_from_inventory(W) + M.unEquip(W) log_admin("[key_name(usr)] made [key_name(M)] drop everything!") message_admins("[key_name_admin(usr)] made [key_name_admin(M)] drop everything!", 1) @@ -28,7 +28,7 @@ return //strip their stuff before they teleport into a cell :downs: for(var/obj/item/W in M) - M.drop_from_inventory(W) + M.unEquip(W) //teleport person to cell M.Paralyse(5) sleep(5) //so they black out before warping @@ -941,7 +941,7 @@ Traitors and the like can also be revived with the previous role mostly intact. choice = input("The shuttle will just return if you call it. Call anyway?") in list("Confirm", "Cancel") if(choice != "Confirm") return - + if(emergency_shuttle.no_escape) choice = input("The shuttle will not be able to leave if you call it. Call anyway?") in list("Confirm", "Cancel") if(choice != "Confirm") diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index c6eb3a0365d..86905b08b8a 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -79,20 +79,20 @@ ..() return - if(!canremove) + if(flags & NODROP) return var/obj/item/clothing/ears/O if(slot_flags & SLOT_TWOEARS ) O = (H.l_ear == src ? H.r_ear : H.l_ear) - user.u_equip(O) + user.unEquip(O) if(!istype(src,/obj/item/clothing/ears/offear)) del(O) O = src else O = src - user.u_equip(src) + user.unEquip(src) if (O) user.put_in_hands(O) @@ -388,10 +388,10 @@ BLIND // can't see anything if (!( usr.restrained() ) && !( usr.stat ) && ( over_object )) switch(over_object.name) if("r_hand") - usr.u_equip(src) + usr.unEquip(src) usr.put_in_r_hand(src) if("l_hand") - usr.u_equip(src) + usr.unEquip(src) usr.put_in_l_hand(src) src.add_fingerprint(usr) return diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 4add6b97783..c787b1a17c5 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -35,7 +35,7 @@ desc = "An implanted replacement for a left eye with meson vision capabilities." icon_state = "cybereye-green" item_state = "eyepatch" - canremove = 0 + flags = NODROP /obj/item/clothing/glasses/science name = "Science Goggles" @@ -88,7 +88,7 @@ desc = "An implanted replacement for a left eye with material vision capabilities." icon_state = "cybereye-blue" item_state = "eyepatch" - canremove = 0 + flags = NODROP /obj/item/clothing/glasses/regular name = "Prescription Glasses" @@ -293,4 +293,4 @@ desc = "An implanted replacement for a left eye with thermal vision capabilities." icon_state = "cybereye-red" item_state = "eyepatch" - canremove = 0 + flags = NODROP diff --git a/code/modules/clothing/head/misc.dm b/code/modules/clothing/head/misc.dm index 8f9138259a3..08afc9b5df9 100644 --- a/code/modules/clothing/head/misc.dm +++ b/code/modules/clothing/head/misc.dm @@ -335,4 +335,4 @@ icon_state = "shamebrero" item_state = "shamebrero" desc = "Once it's on, it never comes off." - canremove = 0 \ No newline at end of file + flags = NODROP \ No newline at end of file diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index 632b6bddd81..2639cacaa5d 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -111,7 +111,7 @@ /obj/item/clothing/mask/horsehead/equipped(mob/user, slot) - if(!canremove) //cursed masks only + if(flags & NODROP) //cursed masks only originalname = user.real_name if(!user.real_name || user.real_name == "Unknown") user.real_name = "A Horse With No Name" //it felt good to be out of the rain @@ -120,12 +120,12 @@ ..() /obj/item/clothing/mask/horsehead/dropped() //this really shouldn't happen, but call it extreme caution - if(!canremove) + if(flags & NODROP) goodbye_horses(loc) ..() /obj/item/clothing/mask/horsehead/Destroy() - if(!canremove) + if(flags & NODROP) goodbye_horses(loc) ..() diff --git a/code/modules/clothing/spacesuits/alien.dm b/code/modules/clothing/spacesuits/alien.dm index ea777bc90a1..f1500bf459f 100644 --- a/code/modules/clothing/spacesuits/alien.dm +++ b/code/modules/clothing/spacesuits/alien.dm @@ -204,7 +204,7 @@ if(src.magpulse) flags &= ~NOSLIP magpulse = 0 - canremove = 1 + flags |= NODROP user << "You relax your deathgrip on the flooring." else //make sure these can only be used when equipped. @@ -218,7 +218,7 @@ flags |= NOSLIP magpulse = 1 - canremove = 0 //kinda hard to take off magclaws when you are gripping them tightly. + flags &= ~NODROP //kinda hard to take off magclaws when you are gripping them tightly. user << "You dig your claws deeply into the flooring, bracing yourself." user << "It would be hard to take off the [src] without relaxing your grip first." @@ -229,7 +229,7 @@ user.visible_message("The [src] go limp as they are removed from [usr]'s feet.", "The [src] go limp as they are removed from your feet.") flags &= ~NOSLIP magpulse = 0 - canremove = 1 + flags &= ~NODROP /obj/item/clothing/shoes/magboots/vox/examine() set src in view() diff --git a/code/modules/clothing/spacesuits/chronosuit.dm b/code/modules/clothing/spacesuits/chronosuit.dm index f1875e34de1..4d6035ba2fe 100644 --- a/code/modules/clothing/spacesuits/chronosuit.dm +++ b/code/modules/clothing/spacesuits/chronosuit.dm @@ -139,9 +139,9 @@ if(user.head && istype(user.head, /obj/item/clothing/head/helmet/space/chronos)) user << "\[ ok \] Mounting /dev/helmet" helmet = user.head - helmet.canremove = 0 + helmet.flags |= NODROP helmet.suit = src - src.canremove = 0 + src.flags |= NODROP user << "\[ ok \] Starting brainwave scanner" user << "\[ ok \] Starting ui display driver" user << "\[ ok \] Initializing chronowalk4-view" @@ -169,11 +169,11 @@ user << "\[ ok \] Stopping ui display driver" user << "\[ ok \] Stopping brainwave scanner" user << "\[ ok \] Unmounting /dev/helmet" - helmet.canremove = 1 + helmet.flags &= ~NODROP helmet.suit = null helmet = null user << "logout" - src.canremove = 1 + src.flags &= ~NODROP cooldown = world.time + cooldowntime * 1.5 activated = 0 activating = 0 diff --git a/code/modules/clothing/spacesuits/rig.dm b/code/modules/clothing/spacesuits/rig.dm index 23ed6f1f9ef..0fe7a90dfab 100644 --- a/code/modules/clothing/spacesuits/rig.dm +++ b/code/modules/clothing/spacesuits/rig.dm @@ -112,7 +112,7 @@ //TODO: Species check, skull damage for forcing an unfitting helmet on? helmet.loc = H H.equip_to_slot(helmet, slot_head) - helmet.canremove = 0 + helmet.flags |= NODROP if(attached_boots && boots) if(H.shoes) @@ -121,7 +121,7 @@ M << "Your suit's boots deploy with a hiss." boots.loc = H H.equip_to_slot(boots, slot_shoes) - boots.canremove = 0 + boots.flags |= NODROP /obj/item/clothing/suit/space/rig/dropped() ..() @@ -132,16 +132,16 @@ H = helmet.loc if(istype(H)) if(helmet && H.head == helmet) - helmet.canremove = 1 - H.drop_from_inventory(helmet) + helmet.flags &= ~NODROP + H.unEquip(helmet) helmet.loc = src if(boots) H = boots.loc if(istype(H)) if(boots && H.shoes == boots) - boots.canremove = 1 - H.drop_from_inventory(boots) + boots.flags &= ~NODROP + H.unEquip(boots) boots.loc = src /* @@ -206,8 +206,8 @@ if(H.wear_suit != src) return if(H.head == helmet) - helmet.canremove = 1 - H.drop_from_inventory(helmet) + helmet.flags &= ~NODROP + H.unEquip(helmet) helmet.loc = src H << "\blue You retract your hardsuit helmet." else @@ -218,7 +218,7 @@ helmet.loc = H helmet.pickup(H) H.equip_to_slot(helmet, slot_head) - helmet.canremove = 0 + helmet.flags |= NODROP H << "\blue You deploy your hardsuit helmet, sealing you off from the world." /obj/item/clothing/suit/space/rig/attackby(obj/item/W as obj, mob/user as mob) diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index 397733ef7de..ee53f0293e4 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -207,7 +207,7 @@ desc = "Forced to live on your shameful acting as a fake Mexican, you and your poncho have grown inseperable. Literally." icon_state = "ponchoshame" item_state = "ponchoshame" - canremove = 0 + flags = NODROP /* * Misc diff --git a/code/modules/clothing/under/accessories/holster.dm b/code/modules/clothing/under/accessories/holster.dm index 12508cc5328..a009c662f4f 100644 --- a/code/modules/clothing/under/accessories/holster.dm +++ b/code/modules/clothing/under/accessories/holster.dm @@ -17,7 +17,7 @@ return 0 else return 1 - + /obj/item/clothing/accessory/holster/attack_self() var/holsteritem = usr.get_active_hand() if(!holstered) @@ -40,7 +40,7 @@ return holstered = W - user.drop_from_inventory(holstered) + user.unEquip(holstered) holstered.loc = src holstered.add_fingerprint(user) user.visible_message("[user] holsters the [holstered].", "You holster the [holstered].") diff --git a/code/modules/clothing/under/color.dm b/code/modules/clothing/under/color.dm index 2a361840b50..b5f276c2539 100644 --- a/code/modules/clothing/under/color.dm +++ b/code/modules/clothing/under/color.dm @@ -32,7 +32,7 @@ flags = ONESIZEFITSALL /obj/item/clothing/under/color/blue/dodgeball - canremove = 0 + flags = ONESIZEFITSALL | NODROP /obj/item/clothing/under/color/green name = "green jumpsuit" @@ -84,7 +84,7 @@ flags = ONESIZEFITSALL /obj/item/clothing/under/color/red/dodgeball - canremove = 0 + flags = ONESIZEFITSALL | NODROP /obj/item/clothing/under/color/white name = "white jumpsuit" diff --git a/code/modules/computer3/computers/HolodeckControl.dm b/code/modules/computer3/computers/HolodeckControl.dm index e650185f855..d53946fa12c 100644 --- a/code/modules/computer3/computers/HolodeckControl.dm +++ b/code/modules/computer3/computers/HolodeckControl.dm @@ -154,7 +154,7 @@ if(isobj(obj)) var/mob/M = obj.loc if(ismob(M)) - M.u_equip(obj) + M.unEquip(obj) M.update_icons() //so their overlays update if(!silent) diff --git a/code/modules/destilery/main.dm b/code/modules/destilery/main.dm index e6944724aaf..ded080d2b12 100644 --- a/code/modules/destilery/main.dm +++ b/code/modules/destilery/main.dm @@ -58,7 +58,7 @@ /obj/machinery/mill/attackby(var/obj/item/weapon/W as obj, mob/user as mob) if(istype(W,/obj/item/weapon/reagent_containers/food)) - user.u_equip(W) + user.unEquip(W) W.loc = src input += W else @@ -128,7 +128,7 @@ /obj/machinery/fermenter/attackby(var/obj/item/weapon/W as obj, mob/user as mob) if(istype(W,/obj/item/weapon/reagent_containers/food)) - user.u_equip(W) + user.unEquip(W) W.loc = src input += W else @@ -189,7 +189,7 @@ /obj/machinery/still/attackby(var/obj/item/weapon/W as obj, mob/user as mob) if(istype(W,/obj/item/weapon/reagent_containers/food)) - user.u_equip(W) + user.unEquip(W) W.loc = src input += W else @@ -274,7 +274,7 @@ /obj/machinery/centrifuge/attackby(var/obj/item/weapon/W as obj, mob/user as mob) if(istype(W,/obj/item/weapon/reagent_containers/food)) - user.u_equip(W) + user.unEquip(W) W.loc = src input += W else diff --git a/code/modules/mining/manufacturing.dm b/code/modules/mining/manufacturing.dm index a59a1071a22..cf8592bf2a4 100644 --- a/code/modules/mining/manufacturing.dm +++ b/code/modules/mining/manufacturing.dm @@ -374,13 +374,13 @@ else ..() if (load == 1) - user.u_equip(W) + user.unEquip(W) W.loc = src if ((user.client && user.s_active != src)) user.client.screen -= W W.dropped() else if (load == 2) - user.u_equip(W) + user.unEquip(W) W.dropped() if ((user.client && user.s_active != src)) user.client.screen -= W diff --git a/code/modules/mining/satchel_ore_boxdm.dm b/code/modules/mining/satchel_ore_boxdm.dm index d3ecc25ec92..fe6f8851b23 100644 --- a/code/modules/mining/satchel_ore_boxdm.dm +++ b/code/modules/mining/satchel_ore_boxdm.dm @@ -20,7 +20,7 @@ /obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob) if (istype(W, /obj/item/weapon/ore)) - user.u_equip(W) + user.unEquip(W) src.contents += W if (istype(W, /obj/item/weapon/storage)) var/obj/item/weapon/storage/S = W diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 71553163b0c..1f0c56d857e 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -80,98 +80,51 @@ return drop_item() return 0 - -/mob/proc/drop_from_inventory(var/obj/item/W) - if(W) - if(client) client.screen -= W - u_equip(W) - if(!W) return 1 // self destroying objects (tk, grabs) - W.layer = initial(W.layer) - W.loc = loc - - var/turf/T = get_turf(loc) - if(isturf(T)) - T.Entered(W) - - W.dropped(src) - update_icons() - return 1 - return 0 - - //Drops the item in our left hand -/mob/proc/drop_l_hand(var/atom/Target) - if(l_hand) - if(client) client.screen -= l_hand - l_hand.layer = initial(l_hand.layer) - - if(Target) l_hand.loc = Target.loc - else l_hand.loc = loc - - var/turf/T = get_turf(loc) - if(isturf(T)) - T.Entered(l_hand) - - l_hand.dropped(src) - l_hand = null - update_inv_l_hand() - return 1 - return 0 +/mob/proc/drop_l_hand() + return unEquip(l_hand) //All needed checks are in unEquip //Drops the item in our right hand -/mob/proc/drop_r_hand(var/atom/Target) - if(r_hand) - if(client) client.screen -= r_hand - r_hand.layer = initial(r_hand.layer) - - if(Target) r_hand.loc = Target.loc - else r_hand.loc = loc - - var/turf/T = get_turf(Target) - if(istype(T)) - T.Entered(r_hand) - - r_hand.dropped(src) - r_hand = null - update_inv_r_hand() - return 1 - return 0 +/mob/proc/drop_r_hand() + return unEquip(r_hand) //Why was this not calling unEquip in the first place jesus fuck. //Drops the item in our active hand. -/mob/proc/drop_item(var/atom/Target) - if(hand) return drop_l_hand(Target) - else return drop_r_hand(Target) +/mob/proc/drop_item() //THIS. DOES. NOT. NEED. AN. ARGUMENT. + if(hand) + return drop_l_hand() + else + return drop_r_hand() -//TODO: phase out this proc -/mob/proc/before_take_item(var/obj/item/W) //TODO: what is this? - W.loc = null - W.layer = initial(W.layer) - u_equip(W) - update_icons() - return +//Here lie unEquip and before_item_take, already forgotten and not missed. -/mob/proc/u_equip(W as obj) - if (W == r_hand) +/mob/proc/unEquip(obj/item/I, force) //Force overrides NODROP for things like wizarditis and admin undress. + if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for NODROP. + return 1 + + if((I.flags & NODROP) && !force) + return 0 + + if(I == r_hand) r_hand = null - update_inv_r_hand(0) - else if (W == l_hand) + update_inv_r_hand() + else if(I == l_hand) l_hand = null - update_inv_l_hand(0) - else if (W == back) - back = null - update_inv_back(0) - else if (W == wear_mask) - wear_mask = null - update_inv_wear_mask(0) - return + update_inv_l_hand() + + if(I) + if(client) + client.screen -= I + I.loc = loc + I.dropped(src) + if(I) + I.layer = initial(I.layer) + + return 1 //Attemps to remove an object on a mob. Will not move it to another area or such, just removes from the mob. /mob/proc/remove_from_mob(var/obj/O) - src.u_equip(O) - if (src.client) - src.client.screen -= O - O.layer = initial(O.layer) + unEquip(O) O.screen_loc = null return 1 diff --git a/code/modules/mob/living/carbon/alien/humanoid/inventory.dm b/code/modules/mob/living/carbon/alien/humanoid/inventory.dm index bf3ca77d02f..138bd24f495 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/inventory.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/inventory.dm @@ -1,23 +1,16 @@ //unequip -/mob/living/carbon/alien/humanoid/u_equip(obj/item/W as obj) - if (W == wear_suit) - wear_suit = null - update_inv_wear_suit(0,0) - else if (W == head) - head = null - update_inv_head(0,0) - else if (W == r_store) +/mob/living/carbon/alien/humanoid/unEquip(obj/item/I as obj) + . = ..() + if(!. || !I) + return + + if(I == r_store) r_store = null update_inv_pockets(0) - else if (W == l_store) + + else if(I == l_store) l_store = null update_inv_pockets(0) - else if (W == r_hand) - r_hand = null - update_inv_r_hand(0) - else if (W == l_hand) - l_hand = null - update_inv_l_hand(0) /mob/living/carbon/alien/humanoid/attack_ui(slot_id) var/obj/item/W = get_active_hand() @@ -31,7 +24,7 @@ return if(W.w_class > 3) return - u_equip(W) + unEquip(W) l_store = W update_inv_pockets() if(slot_r_store) @@ -39,7 +32,7 @@ return if(W.w_class > 3) return - u_equip(W) + unEquip(W) r_store = W update_inv_pockets() else diff --git a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm index d85d377ae00..6990eaa9223 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm @@ -104,7 +104,7 @@ //TODO wear_suit.screen_loc = ui_alien_oclothing if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket)) - drop_from_inventory(handcuffed) + unEquip(handcuffed) drop_r_hand() drop_l_hand() diff --git a/code/modules/mob/living/carbon/alien/larva/inventory.dm b/code/modules/mob/living/carbon/alien/larva/inventory.dm index 076053b2530..99298e50bbe 100644 --- a/code/modules/mob/living/carbon/alien/larva/inventory.dm +++ b/code/modules/mob/living/carbon/alien/larva/inventory.dm @@ -1,3 +1,3 @@ //can't unequip since it can't equip anything -/mob/living/carbon/alien/larva/u_equip(obj/item/W as obj) +/mob/living/carbon/alien/larva/unEquip(obj/item/W as obj) return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index 3f912cb3ce2..e41f5b0b2ae 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -40,7 +40,7 @@ var/const/MAX_ACTIVE_TIME = 400 /obj/item/clothing/mask/facehugger/attack(mob/living/M as mob, mob/user as mob) ..() - user.before_take_item(src) + user.unEquip(src) Attach(M) /obj/item/clothing/mask/facehugger/examine(mob/user) @@ -131,9 +131,12 @@ var/const/MAX_ACTIVE_TIME = 400 if(iscarbon(M)) var/mob/living/carbon/target = L if(target.wear_mask) - if(prob(20)) return 0 + if(prob(20)) + return 0 var/obj/item/clothing/W = target.wear_mask - target.before_take_item(W) + if(W.flags & NODROP) + return 0 + target.unEquip(W) target.visible_message("[src] tears [W] off of [target]'s face!", \ "[src] tears [W] off of [target]'s face!") @@ -162,7 +165,7 @@ var/const/MAX_ACTIVE_TIME = 400 var/mob/living/carbon/C = target if(C.wear_mask != src) return - + if(ishuman(target)) var/mob/living/carbon/human/H = target if((H.species.flags & IS_SYNTHETIC)) @@ -233,7 +236,7 @@ var/const/MAX_ACTIVE_TIME = 400 /proc/CanHug(var/mob/M) if(!M || !ismob(M)) return 0 - + if(M.stat == DEAD) return 0 @@ -255,4 +258,4 @@ var/const/MAX_ACTIVE_TIME = 400 gender = FEMALE /obj/item/clothing/mask/facehugger/lamarr/New()//to prevent deleting it if aliums are disabled - return \ No newline at end of file + return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 3fd186af332..dcfc65efcae 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -378,11 +378,13 @@ throw_mode_off() if(usr.stat || !target) return - if(target.type == /obj/screen) return + if(target.type == /obj/screen) + return var/atom/movable/item = src.get_active_hand() - if(!item) return + if(!item || (item.flags & NODROP)) + return if (istype(item, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = item @@ -404,10 +406,10 @@ else M.LAssailant = usr - if(!item) return //Grab processing has a chance of returning null - - item.layer = initial(item.layer) - u_equip(item) + if(!item) + return //Grab processing has a chance of returning null + if(!ismob(item)) //Honk mobs don't have a dropped() proc honk + unEquip(item) update_icons() if (istype(usr, /mob/living/carbon)) //Check if a carbon mob is throwing. Modify/remove this line as required. @@ -419,6 +421,7 @@ //actually throw it! if (item) + item.layer = initial(item.layer) src.visible_message("\red [src] has thrown [item].") if(!src.lastarea) @@ -453,20 +456,25 @@ return 1 return -/mob/living/carbon/u_equip(obj/item/W as obj) - if(!W) return 0 +/mob/living/carbon/unEquip(obj/item/I) //THIS PROC DID NOT CALL ..() + . = ..() //Sets the default return value to what the parent returns. + if(!. || !I) //We don't want to set anything to null if the parent returned 0. + return - else if (W == handcuffed) + if(I == back) + back = null + update_inv_back(0) + else if(I == wear_mask) + if(istype(src, /mob/living/carbon/human)) //If we don't do this hair won't be properly rebuilt. + return + wear_mask = null + update_inv_wear_mask(0) + else if(I == handcuffed) handcuffed = null - update_inv_handcuffed() - - else if (W == legcuffed) + update_inv_handcuffed(0) + else if(I == legcuffed) legcuffed = null - update_inv_legcuffed() - else - ..() - - return + update_inv_legcuffed(0) /mob/living/carbon/show_inv(mob/living/carbon/user as mob) user.set_machine(src) @@ -579,4 +587,4 @@ return /mob/living/carbon/proc/canBeHandcuffed() - return 0 \ No newline at end of file + return 0 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 0da3bba80fa..2216038aeaa 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -641,6 +641,8 @@ var/obj/item/place_item = usr.get_active_hand() // Item to place in the pocket, if it's empty if(pocket_item && !(pocket_item.flags & ABSTRACT)) + if(pocket_item.flags & NODROP) + usr << "You try to empty [src]'s [pocket_side] pocket, it seems to be stuck!" usr << "You try to empty [src]'s [pocket_side] pocket." else if(place_item && place_item.mob_can_equip(src, pocket_id, 1) && !(place_item.flags & ABSTRACT)) usr << "You try to place [place_item] into [src]'s [pocket_side] pocket." @@ -649,11 +651,11 @@ if(do_mob(usr, src, STRIP_DELAY)) if(pocket_item) - u_equip(pocket_item) + unEquip(pocket_item) usr.put_in_hands(pocket_item) else if(place_item) - usr.u_equip(place_item) + usr.unEquip(place_item) equip_to_slot_if_possible(place_item, pocket_id, 0, 1) // Update strip window @@ -687,11 +689,11 @@ if(do_mob(usr, src, STRIP_DELAY)) if(worn_id) - u_equip(worn_id) + unEquip(worn_id) usr.put_in_hands(worn_id) else if(place_item) - usr.u_equip(place_item) + usr.unEquip(place_item) equip_to_slot_if_possible(place_item, slot_wear_id, 0, 1) // Update strip window diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index ed7c1c9336b..d88d19fe99e 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -176,11 +176,11 @@ if(head) var/obj/item/clothing/head/H = head if(!istype(H) || prob(H.loose)) - drop_from_inventory(H) - if(prob(60)) - step_away(H,M) - visible_message("[M] has knocked [src]'s [H] off!", - "[M] knocked \the [H] clean off your head!") */ + if(unEquip(H)) + if(prob(60)) + step_away(H,M) + visible_message("[M] has knocked [src]'s [H] off!", + "[M] knocked \the [H] clean off your head!") */ var/talked = 0 // BubbleWrap @@ -209,8 +209,8 @@ //End BubbleWrap if(!talked) //BubbleWrap - drop_item() - visible_message("\red [M] has disarmed [src]!") + if(drop_item()) + visible_message("\red [M] has disarmed [src]!") playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) return diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 86c4cc95a26..4db067181cb 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -348,7 +348,7 @@ This function restores all organs. multiplier = 2 var/obj/item/clothing/head/H = head if(!istype(H) || prob(H.loose * multiplier)) - drop_from_inventory(H) + unEquip(H) if(prob(60)) step_rand(H) if(!stat) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 96ea1ab720c..11ef4a1d587 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -72,7 +72,7 @@ emp_act if(c_hand && (stun_amount || agony_amount > 10)) msg_admin_attack("[src.name] ([src.ckey]) was disarmed by a stun effect") - u_equip(c_hand) + unEquip(c_hand) if (affected.status & ORGAN_ROBOT) emote("me", 1, "drops what they were holding, their [affected.display_name] malfunctioning!") else diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 80addc967c6..89dd982e11b 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -104,123 +104,76 @@ if(slot_tie) return 1 -/mob/living/carbon/human/u_equip(obj/item/W as obj) - if(!W) return 0 +/mob/living/carbon/human/unEquip(obj/item/I) + . = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should. + if(!. || !I) + return - var/success - if (W == wear_suit) + if(I == wear_suit) if(s_store) - drop_from_inventory(s_store) - if(W) - success = 1 + unEquip(s_store, 1) //It makes no sense for your suit storage to stay on you if you drop your suit. wear_suit = null - update_inv_wear_suit() - else if (W == w_uniform) - if (r_store) - drop_from_inventory(r_store) - if (l_store) - drop_from_inventory(l_store) - if (wear_id) - drop_from_inventory(wear_id) - if (belt) - drop_from_inventory(belt) + if(I.flags_inv & HIDEJUMPSUIT) + update_inv_w_uniform() + update_inv_wear_suit(0) + else if(I == w_uniform) + if(r_store) + unEquip(r_store, 1) //Again, makes sense for pockets to drop. + if(l_store) + unEquip(l_store, 1) + if(wear_id) + unEquip(wear_id) + if(belt) + unEquip(belt) w_uniform = null - success = 1 - update_inv_w_uniform() - else if (W == gloves) + update_inv_w_uniform(0) + else if(I == gloves) gloves = null - success = 1 - update_inv_gloves() - else if (W == glasses) + update_inv_gloves(0) + else if(I == glasses) glasses = null - success = 1 - update_inv_glasses() - else if (W == head) + update_inv_glasses(0) + else if(I == head) head = null - if((W.flags & BLOCKHAIR) || (W.flags & BLOCKHEADHAIR)) + if(I.flags & BLOCKHAIR) update_hair(0) //rebuild hair - success = 1 - update_inv_head() - else if (W == l_ear) - l_ear = null - success = 1 - update_inv_ears() - else if (W == r_ear) + update_inv_head(0) + else if(I == r_ear) r_ear = null - success = 1 - update_inv_ears() - else if (W == shoes) + update_inv_ears(0) + else if (I == l_ear) + l_ear = null + update_inv_ears(0) + else if(I == shoes) shoes = null - success = 1 - update_inv_shoes() - else if (W == belt) + update_inv_shoes(0) + else if(I == belt) belt = null - success = 1 - update_inv_belt() - else if (W == wear_mask) + update_inv_belt(0) + else if(I == wear_mask) wear_mask = null - success = 1 - if((W.flags & BLOCKHAIR) || (W.flags & BLOCKHEADHAIR)) + if(I.flags & BLOCKHAIR) update_hair(0) //rebuild hair if(internal) if(internals) internals.icon_state = "internal0" internal = null - update_inv_wear_mask() - else if (W == wear_id) + update_inv_wear_mask(0) + else if(I == wear_id) wear_id = null - success = 1 - update_inv_wear_id() - else if (W == wear_pda) - wear_pda = null - success = 1 - update_inv_wear_pda() - else if (W == r_store) + update_inv_wear_id(0) + else if(I == r_store) r_store = null - success = 1 - update_inv_pockets() - else if (W == l_store) + update_inv_pockets(0) + else if(I == l_store) l_store = null - success = 1 - update_inv_pockets() - else if (W == s_store) + update_inv_pockets(0) + else if(I == s_store) s_store = null - success = 1 - update_inv_s_store() - else if (W == back) - back = null - success = 1 - update_inv_back() - else if (W == handcuffed) - handcuffed = null - success = 1 - update_inv_handcuffed() - else if (W == legcuffed) - legcuffed = null - success = 1 - update_inv_legcuffed() - else if (W == r_hand) - r_hand = null - success = 1 - update_inv_r_hand() - else if (W == l_hand) - l_hand = null - success = 1 - update_inv_l_hand() - else - return 0 + update_inv_s_store(0) - if(success) - if (W) - if (client) - client.screen -= W - W.loc = loc - W.dropped(src) - //if(W) - //W.layer = initial(W.layer) update_action_buttons() - return 1 @@ -337,7 +290,7 @@ update_inv_s_store(redraw_mob) if(slot_in_backpack) if(src.get_active_hand() == W) - src.u_equip(W) + src.unEquip(W) W.loc = src.back if(slot_tie) var/obj/item/clothing/under/uniform = src.w_uniform @@ -454,7 +407,7 @@ if("mask") target.attack_log += text("\[[time_stamp()]\] Had their mask removed by [source.name] ([source.ckey])") source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) mask") - if(target.wear_mask && !target.wear_mask.canremove) + if(target.wear_mask && (target.wear_mask.flags & NODROP)) message = "\red [source] fails to take off \a [target.wear_mask] from [target]'s head!" return else if(target.wear_mask) @@ -470,7 +423,7 @@ if("gloves") target.attack_log += text("\[[time_stamp()]\] Has had their gloves ([target.gloves]) removed by [source.name] ([source.ckey])") source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) gloves ([target.gloves])") - if(target.gloves && !target.gloves.canremove) + if(target.gloves && (target.gloves.flags & NODROP)) message = "\red [source] fails to take off \a [target.gloves] from [target]'s hands!" return else if(target.gloves) @@ -478,7 +431,7 @@ if("eyes") target.attack_log += text("\[[time_stamp()]\] Has had their eyewear ([target.glasses]) removed by [source.name] ([source.ckey])") source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) eyewear ([target.glasses])") - if(target.glasses && !target.glasses.canremove) + if(target.glasses && (target.glasses.flags & NODROP)) message = "\red [source] fails to take off \a [target.glasses] from [target]'s eyes!" return else if(target.glasses) @@ -486,7 +439,7 @@ if("l_ear") target.attack_log += text("\[[time_stamp()]\] Has had their left ear item ([target.l_ear]) removed by [source.name] ([source.ckey])") source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) left ear item ([target.l_ear])") - if(target.l_ear && !target.l_ear.canremove) + if(target.l_ear && (target.l_ear.flags & NODROP)) message = "\red [source] fails to take off \a [target.l_ear] from [target]'s left ear!" return else if(target.l_ear) @@ -494,7 +447,7 @@ if("r_ear") target.attack_log += text("\[[time_stamp()]\] Has had their right ear item ([target.r_ear]) removed by [source.name] ([source.ckey])") source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) right ear item ([target.r_ear])") - if(target.r_ear && !target.r_ear.canremove) + if(target.r_ear && (target.r_ear.flags & NODROP)) message = "\red [source] fails to take off \a [target.r_ear] from [target]'s right ear!" return else if(target.r_ear) @@ -502,7 +455,7 @@ if("head") target.attack_log += text("\[[time_stamp()]\] Has had their hat ([target.head]) removed by [source.name] ([source.ckey])") source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) hat ([target.head])") - if(target.head && !target.head.canremove) + if(target.head && (target.head.flags & NODROP)) message = "\red [source] fails to take off \a [target.head] from [target]'s head!" return else if(target.head) @@ -510,7 +463,7 @@ if("shoes") target.attack_log += text("\[[time_stamp()]\] Has had their shoes ([target.shoes]) removed by [source.name] ([source.ckey])") source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) shoes ([target.shoes])") - if(target.shoes && !target.shoes.canremove) + if(target.shoes && (target.shoes.flags & NODROP)) message = "\red [source] fails to take off \a [target.shoes] from [target]'s feet!" return else if(target.shoes) @@ -523,7 +476,7 @@ if("suit") target.attack_log += text("\[[time_stamp()]\] Has had their suit ([target.wear_suit]) removed by [source.name] ([source.ckey])") source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) suit ([target.wear_suit])") - if(target.wear_suit && !target.wear_suit.canremove) + if(target.wear_suit && (target.wear_suit.flags & NODROP)) message = "\red [source] fails to take off \a [target.wear_suit] from [target]'s body!" return else if(target.wear_suit) @@ -550,7 +503,7 @@ for(var/obj/item/I in list(target.l_store, target.r_store)) if(I.on_found(source)) return - if(target.w_uniform && !target.w_uniform.canremove) + if(target.w_uniform && (target.w_uniform.flags & NODROP)) message = "\red [source] fails to take off \a [target.w_uniform] from [target]'s body!" return else @@ -633,7 +586,7 @@ It works in conjuction with the process() above. This proc works for humans only. Aliens stripping humans and the like will all use this proc. Stripping monkeys or somesuch will use their version of this proc. The first if statement for "mask" and such refers to items that are already equipped and un-equipping them. The else statement is for equipping stuff to empty slots. -!canremove refers to variable of /obj/item/clothing which either allows or disallows that item to be removed. +The NODROP flag refers to variable of /obj/item/clothing which either allows or disallows that item to be removed. It can still be worn/put on as normal. */ /obj/effect/equip_e/human/done() //TODO: And rewrite this :< ~Carn @@ -652,11 +605,11 @@ It can still be worn/put on as normal. switch(place) //here we go again... if("mask") slot_to_process = slot_wear_mask - if (target.wear_mask && target.wear_mask.canremove) + if (target.wear_mask && !(target.wear_mask.flags & NODROP)) strip_item = target.wear_mask if("gloves") slot_to_process = slot_gloves - if (target.gloves && target.gloves.canremove) + if (target.gloves && !(target.gloves.flags & NODROP)) strip_item = target.gloves if("eyes") slot_to_process = slot_glasses @@ -672,7 +625,7 @@ It can still be worn/put on as normal. strip_item = target.s_store if("head") slot_to_process = slot_head - if (target.head && target.head.canremove) + if (target.head && !(target.head.flags & NODROP)) strip_item = target.head if("l_ear") slot_to_process = slot_l_ear @@ -684,7 +637,7 @@ It can still be worn/put on as normal. strip_item = target.r_ear if("shoes") slot_to_process = slot_shoes - if (target.shoes && target.shoes.canremove) + if (target.shoes && !(target.shoes.flags & NODROP)) strip_item = target.shoes if("l_hand") if (istype(target, /obj/item/clothing/suit/straight_jacket)) @@ -700,11 +653,11 @@ It can still be worn/put on as normal. strip_item = target.r_hand if("uniform") slot_to_process = slot_w_uniform - if(target.w_uniform && target.w_uniform.canremove) + if(target.w_uniform && !(target.w_uniform.flags & NODROP)) strip_item = target.w_uniform if("suit") slot_to_process = slot_wear_suit - if (target.wear_suit && target.wear_suit.canremove) + if (target.wear_suit && !(target.wear_suit.flags & NODROP)) strip_item = target.wear_suit if("tie") var/obj/item/clothing/under/suit = target.w_uniform @@ -810,7 +763,7 @@ It can still be worn/put on as normal. if(slot_to_process) if(strip_item) //Stripping an item from the mob var/obj/item/W = strip_item - target.u_equip(W) + target.unEquip(W) if (target.client) target.client.screen -= W if (W) @@ -820,11 +773,11 @@ It can still be worn/put on as normal. W.add_fingerprint(source) if(slot_to_process == slot_l_store) //pockets! Needs to process the other one too. Snowflake code, wooo! It's not like anyone will rewrite this anytime soon. If I'm wrong then... CONGRATULATIONS! ;) if(target.r_store) - target.u_equip(target.r_store) //At this stage l_store is already processed by the code above, we only need to process r_store. + target.unEquip(target.r_store) //At this stage l_store is already processed by the code above, we only need to process r_store. else if(item && target.has_organ_for_slot(slot_to_process)) //Placing an item on the mob if(item.mob_can_equip(target, slot_to_process, 0)) - source.u_equip(item) + source.unEquip(item) target.equip_to_slot_if_possible(item, slot_to_process, 0, 1, 1) item.dropped(source) source.update_icons() @@ -843,7 +796,7 @@ It can still be worn/put on as normal. if(slot_r_hand) return r_hand return null - + /mob/living/carbon/get_item_by_slot(slot_id) switch(slot_id) if(slot_back) diff --git a/code/modules/mob/living/carbon/human/plasmaman/species.dm b/code/modules/mob/living/carbon/human/plasmaman/species.dm index d940b638373..a9646cdd886 100644 --- a/code/modules/mob/living/carbon/human/plasmaman/species.dm +++ b/code/modules/mob/living/carbon/human/plasmaman/species.dm @@ -24,10 +24,10 @@ H.fire_sprite = "Plasmaman" // Unequip existing suits and hats. - H.u_equip(H.wear_suit) - H.u_equip(H.head) + H.unEquip(H.wear_suit) + H.unEquip(H.head) if(H.mind.assigned_role!="Clown") - H.u_equip(H.wear_mask) + H.unEquip(H.wear_mask) H.equip_or_collect(new /obj/item/clothing/mask/breath(H), slot_wear_mask) var/suit=/obj/item/clothing/suit/space/plasmaman diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 4b9f4f1e107..200ade3009a 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -598,7 +598,7 @@ proc/get_damage_icon_part(damage_state, body_part) standing.icon = 'icons/mob/uniform_fat.dmi' else src << "\red You burst out of \the [w_uniform]!" - drop_from_inventory(w_uniform) + unEquip(w_uniform) return else standing.icon = 'icons/mob/uniform.dmi' @@ -626,7 +626,7 @@ proc/get_damage_icon_part(damage_state, body_part) // Automatically drop anything in store / id / belt if you're not wearing a uniform. //CHECK IF NECESARRY for( var/obj/item/thing in list(r_store, l_store, wear_id, wear_pda, belt) ) // if(thing) // - u_equip(thing) // + unEquip(thing) // if (client) // client.screen -= thing // // @@ -819,14 +819,14 @@ proc/get_damage_icon_part(damage_state, body_part) standing = image("icon" = 'icons/mob/suit_fat.dmi', "icon_state" = "[wear_suit.icon_state]") else src << "\red You burst out of \the [wear_suit]!" - drop_from_inventory(wear_suit) + unEquip(wear_suit) return else standing = image("icon" = 'icons/mob/suit.dmi', "icon_state" = "[wear_suit.icon_state]") if( istype(wear_suit, /obj/item/clothing/suit/straight_jacket) ) - drop_from_inventory(handcuffed) + unEquip(handcuffed) drop_l_hand() drop_r_hand() diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index 9b597c46e47..dbdeb728fa6 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -230,7 +230,7 @@ return -/mob/living/carbon/slime/u_equip(obj/item/W as obj) +/mob/living/carbon/slime/unEquip(obj/item/W as obj) return /mob/living/carbon/slime/attack_ui(slot) @@ -897,9 +897,8 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75 item_state = "golem" _color = "golem" has_sensor = 0 - flags = ABSTRACT + flags = ABSTRACT | NODROP armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) - canremove = 0 /obj/item/clothing/suit/golem name = "adamantine shell" @@ -912,12 +911,11 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75 body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS|HEAD slowdown = 1.0 flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT - flags = ONESIZEFITSALL | STOPSPRESSUREDMAGE | ABSTRACT + flags = ONESIZEFITSALL | STOPSPRESSUREDMAGE | ABSTRACT | NODROP heat_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS | HEAD max_heat_protection_temperature = FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE cold_protection = UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS | HEAD min_cold_protection_temperature = SPACE_SUIT_MIN_COLD_PROTECTION_TEMPERATURE - canremove = 0 armor = list(melee = 80, bullet = 20, laser = 20, energy = 10, bomb = 0, bio = 0, rad = 0) /obj/item/clothing/shoes/golem @@ -925,8 +923,7 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75 desc = "sturdy adamantine feet" icon_state = "golem" item_state = "golem" - canremove = 0 - flags = NOSLIP | ABSTRACT | MASKINTERNALS | MASKCOVERSMOUTH + flags = NOSLIP | ABSTRACT | MASKINTERNALS | MASKCOVERSMOUTH | NODROP slowdown = SHOES_SLOWDOWN+1 @@ -935,10 +932,9 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75 desc = "the imposing face of an adamantine golem" icon_state = "golem" item_state = "golem" - canremove = 0 siemens_coefficient = 0 unacidable = 1 - flags = ABSTRACT + flags = ABSTRACT | NODROP /obj/item/clothing/gloves/golem @@ -947,8 +943,7 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75 icon_state = "golem" item_state = null siemens_coefficient = 0 - canremove = 0 - flags = ABSTRACT + flags = ABSTRACT | NODROP /obj/item/clothing/head/space/golem @@ -957,9 +952,8 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75 _color = "dermal" name = "golem's head" desc = "a golem's head" - canremove = 0 unacidable = 1 - flags = STOPSPRESSUREDMAGE | ABSTRACT + flags = STOPSPRESSUREDMAGE | ABSTRACT | NODROP heat_protection = HEAD max_heat_protection_temperature = FIRE_HELMET_MAX_HEAT_PROTECTION_TEMPERATURE armor = list(melee = 80, bullet = 20, laser = 20, energy = 10, bomb = 0, bio = 0, rad = 0) diff --git a/code/modules/mob/living/carbon/monkey/diona.dm b/code/modules/mob/living/carbon/monkey/diona.dm index a90868c1c8c..4039156e506 100644 --- a/code/modules/mob/living/carbon/monkey/diona.dm +++ b/code/modules/mob/living/carbon/monkey/diona.dm @@ -193,7 +193,7 @@ adult.rename_self("diona") for (var/obj/item/W in src.contents) - src.drop_from_inventory(W) + src.unEquip(W) del(src) diff --git a/code/modules/mob/living/carbon/monkey/inventory.dm b/code/modules/mob/living/carbon/monkey/inventory.dm index cfb4029609f..2c5934da530 100644 --- a/code/modules/mob/living/carbon/monkey/inventory.dm +++ b/code/modules/mob/living/carbon/monkey/inventory.dm @@ -41,7 +41,7 @@ var/message = null switch(place) if("mask") - if(istype(target.wear_mask, /obj/item/clothing)&&!target.wear_mask:canremove) + if(istype(target.wear_mask, /obj/item/clothing)&&(target.wear_mask:flags & NODROP)) message = text("\red [] fails to take off \a [] from []'s body!", source, target.wear_mask, target) else message = text("\red [] is trying to take off \a [] from []'s head!", source, target.wear_mask, target) @@ -76,10 +76,10 @@ switch(place) if("mask") if (target.wear_mask) - if(istype(target.wear_mask, /obj/item/clothing)&& !target.wear_mask:canremove) + if(istype(target.wear_mask, /obj/item/clothing)&& (target.wear_mask:flags & NODROP)) return var/obj/item/W = target.wear_mask - target.u_equip(W) + target.unEquip(W) if (target.client) target.client.screen -= W if (W) @@ -97,7 +97,7 @@ if("l_hand") if (target.l_hand) var/obj/item/W = target.l_hand - target.u_equip(W) + target.unEquip(W) if (target.client) target.client.screen -= W if (W) @@ -117,7 +117,7 @@ if("r_hand") if (target.r_hand) var/obj/item/W = target.r_hand - target.u_equip(W) + target.unEquip(W) if (target.client) target.client.screen -= W if (W) @@ -137,7 +137,7 @@ if("back") if (target.back) var/obj/item/W = target.back - target.u_equip(W) + target.unEquip(W) if (target.client) target.client.screen -= W if (W) @@ -155,7 +155,7 @@ if("handcuff") if (target.handcuffed) var/obj/item/W = target.handcuffed - target.u_equip(W) + target.unEquip(W) if (target.client) target.client.screen -= W if (W) @@ -199,7 +199,7 @@ if(!istype(W)) return if(W == get_active_hand()) - u_equip(W) + unEquip(W) switch(slot) if(slot_back) diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index c3f4c035292..290f356cb60 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -274,11 +274,11 @@ if ((O.client && !( O.blinded ))) O.show_message(text("\red [] has pushed down [name]!", M), 1) else - drop_item() - playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has disarmed [name]!", M), 1) + if(drop_item()) + playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + for(var/mob/O in viewers(src, null)) + if ((O.client && !( O.blinded ))) + O.show_message(text("\red [] has disarmed [name]!", M), 1) return /mob/living/carbon/monkey/attack_alien(mob/living/carbon/alien/humanoid/M as mob) @@ -344,10 +344,10 @@ if ((O.client && !( O.blinded ))) O.show_message(text("\red [] has tackled down [name]!", M), 1) else - drop_item() - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has disarmed [name]!", M), 1) + if(drop_item()) + for(var/mob/O in viewers(src, null)) + if ((O.client && !( O.blinded ))) + O.show_message(text("\red [] has disarmed [name]!", M), 1) adjustBruteLoss(damage) updatehealth() return diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 737a44342b0..f159a9ca08c 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -286,11 +286,11 @@ var/mob/living/carbon/C = src if (C.handcuffed && !initial(C.handcuffed)) - C.drop_from_inventory(C.handcuffed) + C.unEquip(C.handcuffed) C.handcuffed = initial(C.handcuffed) if (C.legcuffed && !initial(C.legcuffed)) - C.drop_from_inventory(C.legcuffed) + C.unEquip(C.legcuffed) C.legcuffed = initial(C.legcuffed) hud_updateflag |= 1 << HEALTH_HUD hud_updateflag |= 1 << STATUS_HUD @@ -466,7 +466,7 @@ var/mob/M = H.loc //Get our mob holder (if any). if(istype(M)) - M.drop_from_inventory(H) + M.unEquip(H) M << "[H] wriggles out of your grip!" src << "You wriggle out of [M]'s grip!" else if(istype(H.loc,/obj/item)) @@ -674,7 +674,7 @@ for(var/mob/O in viewers(CM))// lags so hard that 40s isn't lenient enough - Quarxink O.show_message("\red [CM] manages to remove the handcuffs!", 1) CM << "\blue You successfully remove \the [CM.handcuffed]." - CM.drop_from_inventory(CM.handcuffed) + CM.unEquip(CM.handcuffed) else if(CM.legcuffed && CM.canmove && (CM.last_special <= world.time)) CM.next_move = world.time + 100 @@ -711,7 +711,7 @@ for(var/mob/O in viewers(CM))// lags so hard that 40s isn't lenient enough - Quarxink O.show_message("\red [CM] manages to remove the legcuffs!", 1) CM << "\blue You successfully remove \the [CM.legcuffed]." - CM.drop_from_inventory(CM.legcuffed) + CM.unEquip(CM.legcuffed) CM.legcuffed = null CM.update_inv_legcuffed() diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 47464bc12e4..1714449cd21 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -63,7 +63,7 @@ var/list/ai_list = list() var/obj/item/borg/sight/hud/sec/sechud = null var/obj/item/borg/sight/hud/med/healthhud = null - + var/arrivalmsg = "$name, $rank, has arrived on the station." /mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/device/mmi/B, var/safety = 0) @@ -842,12 +842,12 @@ var/list/ai_list = list() set desc = "Augment visual feed with internal sensor overlays." set category = "AI Commands" toggle_sensor_mode() - + /mob/living/silicon/ai/proc/change_arrival_message() set name = "Set Arrival Message" set desc = "Change the message that's transmitted when a new crew member arrives on station." set category = "AI Commands" - + var/newmsg = input("What would you like the arrival message to be? Use $name to substitute the crew member's name, and use $rank to substitute the crew member's rank.", "Change Arrival Message", arrivalmsg) as text if(newmsg != arrivalmsg) arrivalmsg = newmsg @@ -921,7 +921,7 @@ var/list/ai_list = list() if(H.wear_id && istype(H.wear_id.GetID(), /obj/item/weapon/card/id/syndicate)) src << "Unable to locate an airlock" return - if(istype(H.head, /obj/item/clothing/head/helmet/space/space_ninja) && !H.head.canremove) + if(istype(H.head, /obj/item/clothing/head/helmet/space/space_ninja) && (H.head.flags & NODROP)) src << "Unable to locate an airlock" return if(H.digitalcamo) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 16ac8d7ec9c..9d8958d62a5 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -334,7 +334,7 @@ //I'm not sure how much of this is necessary, but I would rather avoid issues. if(istype(card.loc,/mob)) var/mob/holder = card.loc - holder.drop_from_inventory(card) + holder.unEquip(card) else if(istype(card.loc,/obj/item/clothing/suit/space/space_ninja)) var/obj/item/clothing/suit/space/space_ninja/holder = card.loc holder.pai = null diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 810f1b0e384..48fd6943658 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -625,7 +625,7 @@ stolen_item = C.r_hand if(stolen_item) - C.u_equip(stolen_item) + C.unEquip(stolen_item) held_item = stolen_item stolen_item.loc = src visible_message("[src] grabs the [held_item] out of [C]'s hand!", "\blue You snag the [held_item] out of [C]'s hand!", "You hear the sounds of wings flapping furiously.") diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 1e73c1ba070..8e5b93a01f0 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -246,7 +246,7 @@ var/list/slot_equipment_priority = list( \ if( !(slot_flags & SLOT_BACK) ) return 0 if(H.back) - if(H.back.canremove) + if(!(H.back.flags & NODROP)) return 2 else return 0 @@ -255,7 +255,7 @@ var/list/slot_equipment_priority = list( \ if( !(slot_flags & SLOT_OCLOTHING) ) return 0 if(H.wear_suit) - if(H.wear_suit.canremove) + if(!(H.wear_suit.flags & NODROP)) return 2 else return 0 @@ -264,7 +264,7 @@ var/list/slot_equipment_priority = list( \ if( !(slot_flags & SLOT_GLOVES) ) return 0 if(H.gloves) - if(H.gloves.canremove) + if(!(H.gloves.flags & NODROP)) return 2 else return 0 @@ -273,7 +273,7 @@ var/list/slot_equipment_priority = list( \ if( !(slot_flags & SLOT_FEET) ) return 0 if(H.shoes) - if(H.shoes.canremove) + if(!(H.shoes.flags & NODROP)) return 2 else return 0 @@ -286,7 +286,7 @@ var/list/slot_equipment_priority = list( \ if( !(slot_flags & SLOT_BELT) ) return 0 if(H.belt) - if(H.belt.canremove) + if(!(H.belt.flags & NODROP)) return 2 else return 0 @@ -295,7 +295,7 @@ var/list/slot_equipment_priority = list( \ if( !(slot_flags & SLOT_EYES) ) return 0 if(H.glasses) - if(H.glasses.canremove) + if(!(H.glasses.flags & NODROP)) return 2 else return 0 @@ -304,7 +304,7 @@ var/list/slot_equipment_priority = list( \ if( !(slot_flags & SLOT_HEAD) ) return 0 if(H.head) - if(H.head.canremove) + if(!(H.head.flags & NODROP)) return 2 else return 0 @@ -313,7 +313,7 @@ var/list/slot_equipment_priority = list( \ if( !(slot_flags & slot_l_ear) ) return 0 if(H.l_ear) - if(H.l_ear.canremove) + if(!(H.l_ear.flags & NODROP)) return 2 else return 0 @@ -322,7 +322,7 @@ var/list/slot_equipment_priority = list( \ if( !(slot_flags & slot_r_ear) ) return 0 if(H.r_ear) - if(H.r_ear.canremove) + if(!(H.r_ear.flags & NODROP)) return 2 else return 0 @@ -333,7 +333,7 @@ var/list/slot_equipment_priority = list( \ if((M_FAT in H.mutations) && !(flags & ONESIZEFITSALL)) return 0 if(H.w_uniform) - if(H.w_uniform.canremove) + if(!(H.w_uniform.flags & NODROP)) return 2 else return 0 @@ -346,7 +346,7 @@ var/list/slot_equipment_priority = list( \ if( !(slot_flags & SLOT_ID) ) return 0 if(H.wear_id) - if(H.wear_id.canremove) + if(!(H.wear_id.flags & NODROP)) return 2 else return 0 @@ -389,7 +389,7 @@ var/list/slot_equipment_priority = list( \ return 0 if( istype(src, /obj/item/device/pda) || istype(src, /obj/item/weapon/pen) || is_type_in_list(src, H.wear_suit.allowed) ) if(H.s_store) - if(H.s_store.canremove) + if(!(H.s_store.flags & NODROP)) return 2 else return 0 diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 29baaab6f11..4910b47817c 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -10,7 +10,7 @@ for(var/obj/item/W in src) if (W==w_uniform) // will be torn continue - drop_from_inventory(W) + unEquip(W) regenerate_icons() monkeyizing = 1 canmove = 0 @@ -73,7 +73,7 @@ if (monkeyizing) return for(var/obj/item/W in src) - drop_from_inventory(W) + unEquip(W) monkeyizing = 1 canmove = 0 icon = null @@ -150,7 +150,7 @@ if(!should_remove_items) for(var/obj/item/W in src) - drop_from_inventory(W) + unEquip(W) var/mob/spirit/mask/new_spirit = new() @@ -193,7 +193,7 @@ if (monkeyizing) return for(var/obj/item/W in src) - drop_from_inventory(W) + unEquip(W) regenerate_icons() monkeyizing = 1 canmove = 0 @@ -249,7 +249,7 @@ if (monkeyizing) return for(var/obj/item/W in src) - drop_from_inventory(W) + unEquip(W) regenerate_icons() monkeyizing = 1 canmove = 0 @@ -280,7 +280,7 @@ if (monkeyizing) return for(var/obj/item/W in src) - drop_from_inventory(W) + unEquip(W) regenerate_icons() monkeyizing = 1 canmove = 0 @@ -315,7 +315,7 @@ if (monkeyizing) return for(var/obj/item/W in src) - drop_from_inventory(W) + unEquip(W) regenerate_icons() monkeyizing = 1 canmove = 0 @@ -345,7 +345,7 @@ if(monkeyizing) return for(var/obj/item/W in src) - drop_from_inventory(W) + unEquip(W) regenerate_icons() monkeyizing = 1 @@ -434,7 +434,7 @@ if(ispath(MP, /mob/living/simple_animal/pony)) return 1 // ZOMG PONIES WHEEE if(ispath(MP, /mob/living/simple_animal/fox)) - return 1 + return 1 //Not in here? Must be untested! return 0 @@ -459,7 +459,7 @@ if(ispath(MP, /mob/living/simple_animal/pony)) return 1 if(ispath(MP, /mob/living/simple_animal/fox)) - return 1 + return 1 //Antag Creatures! /* if(ispath(MP, /mob/living/simple_animal/hostile/carp) && !jobban_isbanned(src, "Syndicate")) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index a039a53edc6..33ce38ba437 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -614,11 +614,11 @@ Note that amputating the affected organ does in fact remove the infection from t else organ= new /obj/item/weapon/organ/head(owner.loc, owner) owner.death() - owner.u_equip(owner.glasses) - owner.u_equip(owner.head) - owner.u_equip(owner.l_ear) - owner.u_equip(owner.r_ear) - owner.u_equip(owner.wear_mask) + owner.unEquip(owner.glasses) + owner.unEquip(owner.head) + owner.unEquip(owner.l_ear) + owner.unEquip(owner.r_ear) + owner.unEquip(owner.wear_mask) if(ARM_RIGHT) if(!spawn_limb) if(status & ORGAN_ROBOT) @@ -658,7 +658,7 @@ Note that amputating the affected organ does in fact remove the infection from t organ = new /obj/item/weapon/skeleton/r_hand(owner.loc) else organ= new /obj/item/weapon/organ/r_hand(owner.loc, owner) - owner.u_equip(owner.gloves) + owner.unEquip(owner.gloves) if(HAND_LEFT) if(!spawn_limb) if(!(status & ORGAN_ROBOT)) @@ -666,7 +666,7 @@ Note that amputating the affected organ does in fact remove the infection from t organ = new /obj/item/weapon/skeleton/l_hand(owner.loc) else organ= new /obj/item/weapon/organ/l_hand(owner.loc, owner) - owner.u_equip(owner.gloves) + owner.unEquip(owner.gloves) if(FOOT_RIGHT) if(!spawn_limb) if(!(status & ORGAN_ROBOT)) @@ -674,7 +674,7 @@ Note that amputating the affected organ does in fact remove the infection from t organ = new /obj/item/weapon/skeleton/r_foot(owner.loc) else organ= new /obj/item/weapon/organ/r_foot/(owner.loc, owner) - owner.u_equip(owner.shoes) + owner.unEquip(owner.shoes) if(FOOT_LEFT) if(!spawn_limb) if(!(status & ORGAN_ROBOT)) @@ -682,7 +682,7 @@ Note that amputating the affected organ does in fact remove the infection from t organ = new /obj/item/weapon/skeleton/l_foot(owner.loc) else organ = new /obj/item/weapon/organ/l_foot(owner.loc, owner) - owner.u_equip(owner.shoes) + owner.unEquip(owner.shoes) destspawn = 1 //Robotic limbs explode if sabotaged. @@ -724,14 +724,14 @@ Note that amputating the affected organ does in fact remove the infection from t "\The [owner.handcuffed.name] falls off of [owner.name].",\ "\The [owner.handcuffed.name] falls off you.") - owner.drop_from_inventory(owner.handcuffed) + owner.unEquip(owner.handcuffed) if (owner.legcuffed && body_part in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT)) owner.visible_message(\ "\The [owner.legcuffed.name] falls off of [owner.name].",\ "\The [owner.legcuffed.name] falls off you.") - owner.drop_from_inventory(owner.legcuffed) + owner.unEquip(owner.legcuffed) /datum/organ/external/proc/bandage() var/rval = 0 @@ -842,11 +842,11 @@ Note that amputating the affected organ does in fact remove the infection from t return if(is_broken()) - owner.u_equip(c_hand) + owner.unEquip(c_hand) var/emote_scream = pick("screams in pain and", "lets out a sharp cry and", "cries out and") owner.emote("me", 1, "[(owner.species && owner.species.flags & NO_PAIN) ? "" : emote_scream ] drops what they were holding in their [hand_name]!") if(is_malfunctioning()) - owner.u_equip(c_hand) + owner.unEquip(c_hand) owner.emote("me", 1, "drops what they were holding, their [hand_name] malfunctioning!") var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() spark_system.set_up(5, 0, owner) diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index c00e8eac5f2..dd311862f2c 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -23,10 +23,10 @@ if(!M.restrained() && !M.stat) switch(over_object.name) if("r_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_r_hand(src) if("l_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_l_hand(src) add_fingerprint(usr) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index edbe96a1cdc..972fec5eddb 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -39,7 +39,7 @@ ..() pixel_y = rand(-8, 8) pixel_x = rand(-9, 9) - + spawn(2) update_icon() updateinfolinks() @@ -293,7 +293,7 @@ "[class]You burn right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap.") if(user.get_inactive_hand() == src) - user.drop_from_inventory(src) + user.unEquip(src) new /obj/effect/decal/cleanable/ash(get_turf(src)) del(src) @@ -366,29 +366,29 @@ B.name = name else if (P.name != "paper" && P.name != "photo") B.name = P.name - user.drop_from_inventory(P) + user.unEquip(P) if (istype(user, /mob/living/carbon/human)) var/mob/living/carbon/human/h_user = user if (h_user.r_hand == src) - h_user.drop_from_inventory(src) + h_user.unEquip(src) h_user.put_in_r_hand(B) else if (h_user.l_hand == src) - h_user.drop_from_inventory(src) + h_user.unEquip(src) h_user.put_in_l_hand(B) else if (h_user.l_store == src) - h_user.drop_from_inventory(src) + h_user.unEquip(src) B.loc = h_user B.layer = 20 h_user.l_store = B h_user.update_inv_pockets() else if (h_user.r_store == src) - h_user.drop_from_inventory(src) + h_user.unEquip(src) B.loc = h_user B.layer = 20 h_user.r_store = B h_user.update_inv_pockets() else if (h_user.head == src) - h_user.u_equip(src) + h_user.unEquip(src) h_user.put_in_hands(B) else if (!istype(src.loc, /turf)) src.loc = get_turf(h_user) diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index c3ddfb3cbbb..e7ccdf2bf90 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -32,7 +32,7 @@ if(screen == 2) screen = 1 user << "You add [(P.name == "paper") ? "the paper" : P.name] to [(src.name == "paper bundle") ? "the paper bundle" : src.name]." - user.drop_from_inventory(P) + user.unEquip(P) P.loc = src if(istype(user,/mob/living/carbon/human)) user:update_inv_l_hand() @@ -42,12 +42,12 @@ if(screen == 2) screen = 1 user << "You add [(W.name == "photo") ? "the photo" : W.name] to [(src.name == "paper bundle") ? "the paper bundle" : src.name]." - user.drop_from_inventory(W) + user.unEquip(W) W.loc = src else if(istype(W, /obj/item/weapon/lighter)) burnpaper(W, user) else if(istype(W, /obj/item/weapon/paper_bundle)) - user.drop_from_inventory(W) + user.unEquip(W) for(var/obj/O in W) O.loc = src O.add_fingerprint(usr) @@ -85,7 +85,7 @@ "[class]You burn right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap.") if(user.get_inactive_hand() == src) - user.drop_from_inventory(src) + user.unEquip(src) new /obj/effect/decal/cleanable/ash(get_turf(src)) del(src) @@ -166,7 +166,7 @@ usr << "You remove the [W.name] from the bundle." if(amount == 1) var/obj/item/weapon/paper/P = src[1] - usr.drop_from_inventory(src) + usr.unEquip(src) usr.put_in_hands(P) del(src) else if(page == amount) @@ -206,7 +206,7 @@ O.loc = usr.loc O.layer = initial(O.layer) O.add_fingerprint(usr) - usr.drop_from_inventory(src) + usr.unEquip(src) del(src) return diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 467da7fdaaa..15e2e844f21 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -61,7 +61,7 @@ "[class]You burn right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap.") if(user.get_inactive_hand() == src) - user.drop_from_inventory(src) + user.unEquip(src) new /obj/effect/decal/cleanable/ash(get_turf(src)) del(src) @@ -118,10 +118,10 @@ if((!( M.restrained() ) && !( M.stat ) && M.back == src)) switch(over_object.name) if("r_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_r_hand(src) if("l_hand") - M.u_equip(src) + M.unEquip(src) M.put_in_l_hand(src) add_fingerprint(usr) return diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm index 806434fb6df..89ba5734241 100644 --- a/code/modules/power/antimatter/control.dm +++ b/code/modules/power/antimatter/control.dm @@ -174,7 +174,7 @@ W.loc = src if(user.client) user.client.screen -= W - user.u_equip(W) + user.unEquip(W) user.update_icons() user.visible_message("[user.name] loads an [W.name] into the [src.name].", \ "You load an [W.name].", \ diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 53ce472cb21..d16e13b8a96 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -313,7 +313,7 @@ //handle mob icon update if(ismob(loc)) var/mob/M = loc - M.u_equip(src) + M.unEquip(src) del(src) else amount -= used diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 8ce267c6d21..d8a4ef3f1bf 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -440,7 +440,7 @@ usr << browse(null, "window=chemmaster") usr.unset_machine() return - + if (href_list["print_p"]) if (!(src.printing)) src.printing = 1 @@ -465,7 +465,7 @@ P.info += "

Notes:
" P.name = "Chemical Analysis - [href_list["name"]]" src.printing = null - + if(beaker) var/datum/reagents/R = beaker:reagents if (href_list["analyze"]) @@ -1069,7 +1069,7 @@ user << "Cannot refine into a reagent." return 1 - user.before_take_item(O) + user.unEquip(O) O.loc = src holdingitems += O src.updateUsrDialog() diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm index fb025cb37da..93841370d75 100644 --- a/code/modules/reagents/reagent_containers/food/snacks.dm +++ b/code/modules/reagents/reagent_containers/food/snacks.dm @@ -22,7 +22,7 @@ if(M == usr) usr << "You finish eating \the [src]." usr.visible_message("[usr] finishes eating \the [src].") - usr.drop_from_inventory(src) //so icons update :[ + usr.unEquip(src) //so icons update :[ if(trash) if(ispath(trash,/obj/item)) @@ -39,7 +39,7 @@ /obj/item/weapon/reagent_containers/food/snacks/attack(mob/M as mob, mob/user as mob, def_zone) if(!reagents.total_volume) //Shouldn't be needed but it checks to see if it has anything left in it. user << "\red None of [src] left, oh no!" - M.drop_from_inventory(src) //so icons update :[ + M.unEquip(src) //so icons update :[ del(src) return 0 @@ -194,7 +194,7 @@ if(!iscarbon(user)) return 1 user << "\red You slip [W] inside [src]." - user.u_equip(W) + user.unEquip(W) if ((user.client && user.s_active != src)) user.client.screen -= W W.dropped(user) diff --git a/code/modules/reagents/reagent_containers/food/snacks/grown.dm b/code/modules/reagents/reagent_containers/food/snacks/grown.dm index 036e19439d9..c2c86c01039 100644 --- a/code/modules/reagents/reagent_containers/food/snacks/grown.dm +++ b/code/modules/reagents/reagent_containers/food/snacks/grown.dm @@ -241,7 +241,7 @@ /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris/attackby(var/obj/item/W as obj, var/mob/user as mob) if(istype(W, /obj/item/weapon/rollingpaper)) - user.u_equip(W) + user.unEquip(W) var/obj/item/clothing/mask/cigarette/joint/J = new /obj/item/clothing/mask/cigarette/joint(user.loc) J.chem_volume = src.reagents.total_volume src.reagents.trans_to(J, J.chem_volume) @@ -264,7 +264,7 @@ /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus/attackby(var/obj/item/W as obj, var/mob/user as mob) if(istype(W, /obj/item/weapon/rollingpaper)) - user.u_equip(W) + user.unEquip(W) var/obj/item/clothing/mask/cigarette/joint/deus/J = new /obj/item/clothing/mask/cigarette/joint/deus(user.loc) J.chem_volume = src.reagents.total_volume src.reagents.trans_to(J, J.chem_volume) diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index db87b378489..4f1b8140531 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -298,7 +298,7 @@ user << "You add [D] to [src]." del(D) user.put_in_hands(new /obj/item/weapon/bucket_sensor) - user.drop_from_inventory(src) + user.unEquip(src) del(src) /obj/item/weapon/reagent_containers/glass/beaker/vial diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm index e7b4ddf987f..5f4bdc09166 100644 --- a/code/modules/reagents/reagent_containers/pill.dm +++ b/code/modules/reagents/reagent_containers/pill.dm @@ -27,7 +27,7 @@ return M << "\blue You swallow [src]." - M.drop_from_inventory(src) //icon update + M.unEquip(src) //icon update if(reagents.total_volume) reagents.reaction(M, INGEST) spawn(5) @@ -49,7 +49,7 @@ if(!do_mob(user, M)) return - user.drop_from_inventory(src) //icon update + user.unEquip(src) //icon update for(var/mob/O in viewers(world.view, user)) O.show_message("\red [user] forces [M] to swallow [src].", 1) @@ -195,7 +195,7 @@ New() ..() reagents.add_reagent("paroxetine", 15) - + /obj/item/weapon/reagent_containers/pill/inaprovaline name = "Inaprovaline pill" desc = "Used to stabilize patients." diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index e24bcb4c90a..7ef798f86e5 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -294,7 +294,7 @@ if (target != user && target.getarmor(target_zone, "melee") > 5 && prob(50)) for(var/mob/O in viewers(world.view, user)) O.show_message(text("\red [user] tries to stab [target] in \the [hit_area] with [src.name], but the attack is deflected by armor!"), 1) - user.u_equip(src) + user.unEquip(src) del(src) return diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 13740067ff2..9de451fd848 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -44,7 +44,7 @@ // attack by item places it in to disposal attackby(var/obj/item/I, var/mob/user) - if(stat & BROKEN || !I || !user) + if(stat & BROKEN || !I || !user || (I.flags & NODROP)) return if(isrobot(user) && !istype(I, /obj/item/weapon/storage/bag/trash)) @@ -102,7 +102,7 @@ T.update_icon() update() return - + if(istype(I, /obj/item/weapon/storage/part_replacer)) var/obj/item/weapon/storage/part_replacer/P = I if(P.contents.len) @@ -111,7 +111,7 @@ P.remove_from_storage(O,src) update() return - + var/obj/item/weapon/grab/G = I if(istype(G)) // handle grabbed mob if(ismob(G.affecting)) diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm index f2e05b18256..c7ba4e304c7 100644 --- a/code/modules/supermatter/supermatter.dm +++ b/code/modules/supermatter/supermatter.dm @@ -283,7 +283,7 @@ "You touch \the [W] to \the [src] when everything suddenly goes silent.\"\n\The [W] flashes into dust as you flinch away from \the [src].",\ "Everything suddenly goes silent.") - user.drop_from_inventory(W) + user.unEquip(W) Consume(W) user.apply_effect(150, IRRADIATE) diff --git a/code/modules/telesci/telesci_computer.dm b/code/modules/telesci/telesci_computer.dm index f37ec393860..a5eb05096fc 100644 --- a/code/modules/telesci/telesci_computer.dm +++ b/code/modules/telesci/telesci_computer.dm @@ -73,7 +73,7 @@ else if(istype(W, /obj/item/device/gps)) if(!inserted_gps) inserted_gps = W - user.before_take_item(W) + user.unEquip(W) W.loc = src user.visible_message("[user] inserts [W] into \the [src]'s GPS device slot.") updateUsrDialog() diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index a929e4499d9..c2250225e05 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -242,7 +242,7 @@ if(!istype(C)) return - H.drop_from_inventory(C) + H.unEquip(C) C.forceMove(src) cell = C powercheck() diff --git a/code/modules/virus2/curer.dm b/code/modules/virus2/curer.dm index 44a0fd348b9..fbc4624438f 100644 --- a/code/modules/virus2/curer.dm +++ b/code/modules/virus2/curer.dm @@ -32,7 +32,7 @@ state("The [src.name] Buzzes", "blue") return ..() - return + return /obj/machinery/computer/curer/attack_ai(var/mob/user as mob) return src.attack_hand(user) diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm index 6669e2c15dc..be4a018bc60 100644 --- a/code/modules/virus2/effect.dm +++ b/code/modules/virus2/effect.dm @@ -382,12 +382,12 @@ /obj/item/clothing/mask/gas/virusclown_hat dropped(mob/user as mob) - canremove = 1 + flags &= ~NODROP ..() equipped(var/mob/user, var/slot) if (slot == slot_l_hand) - canremove = 1 //curses! + flags &= ~NODROP //curses! ..() */ @@ -626,12 +626,12 @@ /obj/item/clothing/glasses/virussunglasses dropped(mob/user as mob) - canremove = 1 + flags &= ~NODROP ..() equipped(var/mob/user, var/slot) if (slot == slot_glasses) - canremove = 0 //curses! + flags |= NODROP //curses! ..() @@ -650,12 +650,12 @@ /obj/item/clothing/mask/gas/virusclown_hat dropped(mob/user as mob) - canremove = 1 + flags &= ~NODROP ..() equipped(var/mob/user, var/slot) if (slot == slot_wear_mask) - canremove = 0 //curses! + flags |= NODROP //curses! ..() @@ -678,12 +678,12 @@ var/list/compatible_mobs = list(/mob/living/carbon/human, /mob/living/carbon/mon voicechange = 1 //NEEEEIIGHH dropped(mob/user as mob) - canremove = 1 + flags &= ~NODROP ..() equipped(var/mob/user, var/slot) if (slot == slot_wear_mask) - canremove = 0 //curses! + flags |= NODROP //curses! ..() diff --git a/code/world.dm b/code/world.dm index 7f85089ea9c..e03344d7f6e 100644 --- a/code/world.dm +++ b/code/world.dm @@ -241,13 +241,13 @@ var/world_topic_spam_protect_time = world.timeofday job_master.FreeRole(C.job) message_admins("[C.name] ([C.ckey]), the [C.job] has been freed due to (Client disconnect for 10 minutes)\n") for(var/obj/item/W in C) - C.drop_from_inventory(W) + C.unEquip(W) del(C) else if(!C.key && C.stat != DEAD && C.brain_op_stage!=4.0) job_master.FreeRole(C.job) message_admins("[C.name] ([C.ckey]), the [C.job] has been freed due to (Client quit BYOND)\n") for(var/obj/item/W in C) - C.drop_from_inventory(W) + C.unEquip(W) del(C) #undef INACTIVITY_KICK */