From 48088b79d9eea011fc5306b2db3f623d069a509d Mon Sep 17 00:00:00 2001 From: "elly1989@rocketmail.com" Date: Sat, 23 Jun 2012 21:24:45 +0000 Subject: [PATCH] ugh...this was horrible. I'm really sorry if I fucked anything up, I was literally going braindead towards the end. Replaced every l_hand = and r_hand = and all that if(hand) crap to use standardised procs. This means we can use procs like Dropped() reliably as they will always be called when things are dropped. Thorough documentation to come. But generally, if you want a mob's icons to update after deleting something in the inventory...use drop_from_inventory(the_thing_you_wanna_drop) just before deleting it. If you wanna put something in a mob's hands use put_in_hands() (or one of the variants). It'll try putting it in active hand first, then inactive, then the floor. They handle layers, overlays, screenlocs calling various procs such as dropped() etc for you. Easy mob.equipped() is now mob.get_active_hand() because there was another totally unrelated proc named equipped() and stuff was confusing. Weakening was made instantaneous. Minor optimisations for human/handle_regular_status_updates(). I'll port these changes over to the other mobs next. Basically it should stop it constantly incrementing every status effect even after death. umm... bunch of overlays related fixes... I think that's everything. :/ git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3900 316c924e-a436-60f5-8080-3fe189b3f50e --- code/datums/diseases/wizarditis.dm | 12 +- code/datums/mind.dm | 4 +- code/defines/obj.dm | 8 +- code/defines/obj/hydro.dm | 7 +- code/defines/obj/toy.dm | 12 +- code/defines/procs/helpers.dm | 12 +- code/game/area/ai_monitored.dm | 2 +- code/game/atom_procs.dm | 12 +- code/game/chemistry.dm | 6 +- code/game/dna.dm | 4 +- .../gamemodes/changeling/changeling_powers.dm | 8 +- code/game/gamemodes/events/ninja_abilities.dm | 4 +- code/game/gamemodes/events/ninja_equipment.dm | 8 +- code/game/gamemodes/nuclear/nuclearbomb.dm | 2 +- code/game/gamemodes/wizard/soulstone.dm | 2 +- code/game/gamemodes/wizard/spellbook.dm | 17 +- code/game/jobs/access.dm | 4 +- code/game/machinery/OpTable.dm | 2 +- code/game/machinery/alarm.dm | 4 +- code/game/machinery/autolathe.dm | 4 +- code/game/machinery/bots/cleanbot.dm | 4 +- code/game/machinery/bots/ed209bot.dm | 233 +++++++++--------- code/game/machinery/bots/floorbot.dm | 51 ++-- code/game/machinery/bots/medbot.dm | 14 +- code/game/machinery/bots/mulebot.dm | 22 +- code/game/machinery/bots/secbot.dm | 26 +- code/game/machinery/cell_charger.dm | 2 +- .../machinery/computer/HolodeckControl.dm | 11 +- code/game/machinery/computer/card.dm | 8 +- code/game/machinery/computer/cloning.dm | 2 +- .../game/machinery/computer/communications.dm | 4 +- code/game/machinery/computer/medical.dm | 2 +- code/game/machinery/computer/robot.dm | 2 +- code/game/machinery/computer/security.dm | 4 +- code/game/machinery/doors/airlock.dm | 8 +- .../machinery/doors/airlock_electronics.dm | 2 +- code/game/machinery/morgue.dm | 4 +- code/game/machinery/spaceheater.dm | 19 +- .../telecomms/machine_interactions.dm | 12 +- code/game/machinery/turrets.dm | 3 - code/game/machinery/vending.dm | 6 +- code/game/magic/cultist/ritual.dm | 10 +- code/game/magic/library.dm | 2 +- code/game/mecha/equipment/weapons/weapons.dm | 2 +- code/game/mecha/mech_fabricator.dm | 2 +- code/game/mecha/mecha.dm | 8 +- code/game/objects/bodybag.dm | 2 +- code/game/objects/closets/extinguisher.dm | 2 +- code/game/objects/closets/fireaxe.dm | 4 +- code/game/objects/devices/PDA/PDA.dm | 34 ++- code/game/objects/items.dm | 6 +- code/game/objects/items/blueprints.dm | 2 +- code/game/objects/items/candle.dm | 9 +- code/game/objects/items/food.dm | 105 ++------ code/game/objects/items/item.dm | 21 +- code/game/objects/items/tk_grab.dm | 12 +- code/game/objects/items/weapons/cameras.dm | 16 +- code/game/objects/items/weapons/cards_ids.dm | 22 +- .../objects/items/weapons/cigs_lighters.dm | 17 +- code/game/objects/items/weapons/grenades.dm | 8 +- .../items/weapons/implants/implantcase.dm | 2 +- .../items/weapons/implants/implantnanoaug.dm | 2 +- .../items/weapons/implants/implantpad.dm | 13 +- code/game/objects/items/weapons/paint.dm | 2 +- .../objects/items/weapons/table_rack_parts.dm | 9 +- .../objects/items/weapons/teleportation.dm | 2 +- code/game/objects/items/weapons/twohanded.dm | 15 +- .../objects/items/weapons/wrappingpaper.dm | 67 +---- code/game/objects/new_year.dm | 2 +- code/game/objects/radio/electropack.dm | 23 +- code/game/objects/radio/radio.dm | 21 +- code/game/objects/shooting_range.dm | 4 +- code/game/objects/stacks/glass.dm | 2 +- code/game/objects/stacks/metal.dm | 2 +- code/game/objects/stacks/stack.dm | 6 +- code/game/objects/stool.dm | 22 +- code/game/objects/storage/backpack.dm | 16 +- code/game/objects/storage/belt.dm | 16 +- code/game/objects/storage/bible.dm | 16 +- code/game/objects/storage/storage.dm | 23 +- code/game/objects/tables_racks.dm | 4 +- code/game/objects/toys.dm | 16 +- code/game/objects/uplinks.dm | 2 +- code/game/objects/watercloset.dm | 2 +- code/game/throwing.dm | 17 +- code/game/turf.dm | 28 +-- code/modules/admin/verbs/randomverbs.dm | 4 +- code/modules/chemical/Chemistry-Reagents.dm | 2 +- code/modules/chemical/Chemistry-Tools.dm | 48 ++-- code/modules/detectivework/detective_work.dm | 4 +- code/modules/flufftext/Hallucination.dm | 12 +- code/modules/food/food.dm | 8 +- code/modules/mining/mine_turfs.dm | 6 +- code/modules/mob/inventory.dm | 226 ++++++++++------- .../living/carbon/alien/humanoid/humanoid.dm | 10 +- .../living/carbon/alien/humanoid/inventory.dm | 6 +- .../mob/living/carbon/alien/humanoid/life.dm | 31 +-- .../carbon/alien/humanoid/update_icons.dm | 4 +- .../mob/living/carbon/alien/larva/larva.dm | 10 +- .../mob/living/carbon/alien/larva/life.dm | 28 +-- code/modules/mob/living/carbon/brain/life.dm | 16 +- code/modules/mob/living/carbon/carbon.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 4 +- .../living/carbon/human/human_attackalien.dm | 10 +- .../living/carbon/human/human_attackhand.dm | 10 +- .../mob/living/carbon/human/inventory.dm | 8 +- code/modules/mob/living/carbon/human/life.dm | 179 ++++++-------- .../mob/living/carbon/human/update_icons.dm | 11 +- .../mob/living/carbon/metroid/metroid.dm | 20 +- .../mob/living/carbon/monkey/inventory.dm | 2 +- code/modules/mob/living/carbon/monkey/life.dm | 27 +- .../mob/living/carbon/monkey/monkey.dm | 22 +- code/modules/mob/living/living.dm | 17 +- code/modules/mob/living/living_defense.dm | 1 + .../mob/living/silicon/robot/inventory.dm | 79 ++++++ code/modules/mob/living/silicon/robot/life.dm | 17 +- .../modules/mob/living/silicon/robot/robot.dm | 99 +------- .../modules/mob/living/silicon/robot/wires.dm | 4 +- code/modules/mob/mob.dm | 46 +++- code/modules/mob/mob_movement.dm | 11 +- code/modules/mob/simple_animal/life.dm | 9 +- code/modules/mob/transform_procs.dm | 14 +- code/modules/paperwork/clipboard.dm | 24 +- code/modules/paperwork/filingcabinet.dm | 2 +- code/modules/paperwork/folders.dm | 2 +- code/modules/paperwork/paper.dm | 6 +- code/modules/paperwork/paperbin.dm | 16 +- code/modules/paperwork/photocopier.dm | 2 +- code/modules/power/apc.dm | 6 +- code/modules/power/lighting.dm | 19 +- code/modules/power/singularity/collector.dm | 4 +- code/modules/projectiles/projectile/change.dm | 2 +- code/modules/recycling/sortingmachinery.dm | 2 +- code/modules/research/rdmachines.dm | 4 +- html/changelog.html | 10 + tgstation.dme | 197 +-------------- 136 files changed, 972 insertions(+), 1522 deletions(-) create mode 100644 code/modules/mob/living/silicon/robot/inventory.dm diff --git a/code/datums/diseases/wizarditis.dm b/code/datums/diseases/wizarditis.dm index 4b4e15d7dd5..ebba6f645f4 100644 --- a/code/datums/diseases/wizarditis.dm +++ b/code/datums/diseases/wizarditis.dm @@ -60,21 +60,21 @@ STI KALY - blind if(prob(chance)) if(!istype(H.head, /obj/item/clothing/head/wizard)) if(H.head) - H.drop_from_slot(H.head) + H.drop_from_inventory(H.head) H.head = new /obj/item/clothing/head/wizard(H) H.head.layer = 20 return if(prob(chance)) if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe)) if(H.wear_suit) - H.drop_from_slot(H.wear_suit) + H.drop_from_inventory(H.wear_suit) H.wear_suit = new /obj/item/clothing/suit/wizrobe(H) H.wear_suit.layer = 20 return if(prob(chance)) if(!istype(H.shoes, /obj/item/clothing/shoes/sandal)) if(H.shoes) - H.drop_from_slot(H.shoes) + H.drop_from_inventory(H.shoes) H.shoes = new /obj/item/clothing/shoes/sandal(H) H.shoes.layer = 20 return @@ -82,10 +82,8 @@ STI KALY - blind var/mob/living/carbon/H = affected_mob if(prob(chance)) if(!istype(H.r_hand, /obj/item/weapon/staff)) - if(H.r_hand) - H.drop_from_slot(H.r_hand) - H.r_hand = new /obj/item/weapon/staff(H) - H.r_hand.layer = 20 + H.drop_r_hand() + H.put_in_r_hand( new /obj/item/weapon/staff(H) ) return return diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 2ed6110aaa9..be6a57b48f4 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -794,7 +794,7 @@ datum/mind switch(href_list["common"]) if("undress") for(var/obj/item/W in current) - current.drop_from_slot(W) + current.drop_from_inventory(W) if("takeuplink") take_uplink() memory = null//Remove any memory they may have had. @@ -807,7 +807,7 @@ datum/mind crystals = suplink.uses else if (iuplink) crystals = iuplink.uses - crystals = input("Amount of telecrystals for [key]","Sindicate uplink", crystals) as null|num + crystals = input("Amount of telecrystals for [key]","Syndicate uplink", crystals) as null|num if (!isnull(crystals)) if (suplink) suplink.uses = crystals diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 58f010aede5..81eda7d7ae8 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -1348,19 +1348,19 @@ amount-- new/obj/item/stack/sheet/glass(user.loc) if(amount <= 0) - user.u_equip(src) + user.drop_from_inventory(src) 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.u_equip(M) + user.drop_from_inventory(M) del(M) amount-- new/obj/item/stack/tile/light(user.loc) if(amount <= 0) - user.u_equip(src) + user.drop_from_inventory(src) del(src) /obj/item/stack/tile/light @@ -1396,7 +1396,7 @@ amount-- new/obj/item/stack/light_w(user.loc) if(amount <= 0) - user.u_equip(src) + user.drop_from_inventory(src) del(src) /obj/item/stack/sheet/cardboard //BubbleWrap diff --git a/code/defines/obj/hydro.dm b/code/defines/obj/hydro.dm index 6076cbfae49..00dd2ffcc55 100644 --- a/code/defines/obj/hydro.dm +++ b/code/defines/obj/hydro.dm @@ -1065,7 +1065,7 @@ var/mob/M = usr var/obj/item/weapon/corncob/W = new /obj/item/weapon/corncob( M ) M << "You chew on the corn, leaving nothing behind but a cob." - M.put_in_hand(W) + M.put_in_hands(W) W.add_fingerprint(M) New() ..() @@ -1364,7 +1364,7 @@ var/mob/M = usr var/obj/item/weapon/bananapeel/W = new /obj/item/weapon/bananapeel( M ) M << "You peel the banana." - M.put_in_hand(W) + M.put_in_hands(W) W.add_fingerprint(M) New() ..() @@ -1452,7 +1452,6 @@ if(istype(user.loc,/turf/space)) return new /obj/effect/critter/killertomato(user.loc) - del(src) user << "You plant the killer-tomato." @@ -1629,7 +1628,6 @@ if(istype(user.loc,/turf/space)) return new /obj/effect/critter/walkingmushroom(user.loc) - del(src) user << "You plant the walking mushroom." @@ -1673,7 +1671,6 @@ planted.endurance = endurance planted.yield = yield planted.potency = potency - del(src) user << "You plant the glowshroom." diff --git a/code/defines/obj/toy.dm b/code/defines/obj/toy.dm index 9aff2439786..6ca899f8027 100644 --- a/code/defines/obj/toy.dm +++ b/code/defines/obj/toy.dm @@ -366,16 +366,8 @@ add_fingerprint(user) if(user.r_hand == src || user.l_hand == src) - if(amount) - var/obj/item/toy/snappop/M = new /obj/item/toy/snappop(src) - if (user.hand) - user.l_hand = M - user.update_inv_l_hand() - else - user.r_hand = M - user.update_inv_r_hand() - M.loc = user - M.layer = 20 + if(amount>0) + user.put_in_active_hand( new /obj/item/toy/snappop(src) ) user << "You take a snap pop out of the box." amount-- else diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm index 73cbd5aa6db..e391f00ff67 100644 --- a/code/defines/procs/helpers.dm +++ b/code/defines/procs/helpers.dm @@ -1278,10 +1278,10 @@ proc/listclearnulls(list/list) if(!user || !target) return 0 var/user_loc = user.loc var/target_loc = target.loc - var/holding = user.equipped() + var/holding = user.get_active_hand() sleep(time) if(!user || !target) return 0 - if ( user.loc == user_loc && target.loc == target_loc && user.equipped() == holding && !( user.stat ) && ( !user.stunned && !user.weakened && !user.paralysis && !user.lying ) ) + if ( user.loc == user_loc && target.loc == target_loc && user.get_active_hand() == holding && !( user.stat ) && ( !user.stunned && !user.weakened && !user.paralysis && !user.lying ) ) return 1 else return 0 @@ -1290,10 +1290,10 @@ proc/listclearnulls(list/list) if(!M) return 0 var/turf/T = M.loc - var/holding = M.equipped() + var/holding = M.get_active_hand() for(var/i=0, i 30) - user << "You cannot fit the item inside. (Remove larger classed items)" + user << "You cannot fit the item inside. (Remove the larger items first)" return user.u_equip(W) W.loc = src diff --git a/code/game/dna.dm b/code/game/dna.dm index 5b7bf6c5f45..9afec041a9d 100644 --- a/code/game/dna.dm +++ b/code/game/dna.dm @@ -458,7 +458,7 @@ for(var/obj/item/W in (H.contents-implants)) if (W==H.w_uniform) // will be teared continue - H.drop_from_slot(W) + H.drop_from_inventory(W) M.monkeyizing = 1 M.canmove = 0 M.icon = null @@ -527,7 +527,7 @@ W.loc = null if(!connected) for(var/obj/item/W in (Mo.contents-implants)) - Mo.drop_from_slot(W) + Mo.drop_from_inventory(W) M.monkeyizing = 1 M.canmove = 0 M.icon = null diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index 75885d4d6bd..c3a9496cf01 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -89,11 +89,11 @@ usr << "\red Not when we are incapacitated." return - if (!istype(usr.equipped(), /obj/item/weapon/grab)) + if (!istype(usr.get_active_hand(), /obj/item/weapon/grab)) usr << "\red We must be grabbing a creature in our active hand to absorb them." return - var/obj/item/weapon/grab/G = usr.equipped() + var/obj/item/weapon/grab/G = usr.get_active_hand() var/mob/M = G.affecting if (!ishuman(M)) @@ -278,7 +278,7 @@ O.changeling = usr.changeling for(var/obj/item/W in usr) - usr.drop_from_slot(W) + usr.drop_from_inventory(W) for(var/obj/T in usr) @@ -412,7 +412,7 @@ if (usr.monkeyizing) return for(var/obj/item/W in src) - usr.drop_from_slot(W) + usr.drop_from_inventory(W) usr.regenerate_icons() usr.monkeyizing = 1 usr.canmove = 0 diff --git a/code/game/gamemodes/events/ninja_abilities.dm b/code/game/gamemodes/events/ninja_abilities.dm index ec08ae9d6fb..281bb47d610 100644 --- a/code/game/gamemodes/events/ninja_abilities.dm +++ b/code/game/gamemodes/events/ninja_abilities.dm @@ -167,14 +167,14 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo var/obj/item/weapon/melee/energy/blade/W = new() spark_system.start() playsound(U.loc, "sparks", 50, 1) - U.put_in_hand(W) + U.put_in_hands(W) cell.charge-=(C*10) else U << "\red You can only summon one blade. Try dropping an item first." else//Else you can run around with TWO energy blades. I don't know why you'd want to but cool factor remains. if(!U.get_active_hand()) var/obj/item/weapon/melee/energy/blade/W = new() - U.put_in_hand(W) + U.put_in_hands(W) if(!U.get_inactive_hand()) var/obj/item/weapon/melee/energy/blade/W = new() U.put_in_inactive_hand(W) diff --git a/code/game/gamemodes/events/ninja_equipment.dm b/code/game/gamemodes/events/ninja_equipment.dm index 5c483c2c8d0..ddbad486468 100644 --- a/code/game/gamemodes/events/ninja_equipment.dm +++ b/code/game/gamemodes/events/ninja_equipment.dm @@ -612,7 +612,7 @@ ________________________________________________________________________________ if("Eject Disk") var/turf/T = get_turf(loc) if(!U.get_active_hand()) - U.put_in_hand(t_disk) + U.put_in_hands(t_disk) t_disk.add_fingerprint(U) t_disk = null else @@ -633,7 +633,7 @@ ________________________________________________________________________________ if("Eject pAI") var/turf/T = get_turf(loc) if(!U.get_active_hand()) - U.put_in_hand(pai) + U.put_in_hands(pai) pai.add_fingerprint(U) pai = null else @@ -834,7 +834,7 @@ ________________________________________________________________________________ I:charge = min(I:charge+cell.charge, I:maxcharge) var/obj/item/weapon/cell/old_cell = cell old_cell.charge = 0 - U.put_in_hand(old_cell) + U.put_in_hands(old_cell) old_cell.add_fingerprint(U) old_cell.corrupt() old_cell.updateicon() @@ -1355,7 +1355,7 @@ It is possible to destroy the net by the occupant or someone else. if(istype(M,/mob/living/carbon/human)) if(W==M:w_uniform) continue//So all they're left with are shoes and uniform. if(W==M:shoes) continue - M.drop_from_slot(W) + M.drop_from_inventory(W) spawn(0) playsound(M.loc, 'sparks4.ogg', 50, 1) diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 162c8de6f91..fb118b6ad26 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -87,7 +87,7 @@ src.yes_code = 0 src.auth = null else - var/obj/item/I = usr.equipped() + var/obj/item/I = usr.get_active_hand() if (istype(I, /obj/item/weapon/disk/nuclear)) usr.drop_item() I.loc = src diff --git a/code/game/gamemodes/wizard/soulstone.dm b/code/game/gamemodes/wizard/soulstone.dm index 9ab7d518b21..d59a404950c 100644 --- a/code/game/gamemodes/wizard/soulstone.dm +++ b/code/game/gamemodes/wizard/soulstone.dm @@ -113,7 +113,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_slot(W) + T.drop_from_inventory(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 0f4865aa846..bbcc387aaa2 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -348,22 +348,11 @@ usr << browse(null, "window=radio") var/obj/item/device/radio/T = src.origradio var/obj/item/weapon/SWF_uplink/R = src - R.loc = T T.loc = usr - // R.layer = initial(R.layer) - R.layer = 0 - if (usr.client) - usr.client.screen -= R - if (usr.r_hand == R) - usr.u_equip(R) - usr.r_hand = T - usr.update_inv_r_hand() - else - usr.u_equip(R) - usr.l_hand = T - usr.update_inv_l_hand() + + usr.u_equip(R) + usr.put_in_hands(T) R.loc = T - T.layer = 20 T.set_frequency(initial(T.frequency)) T.attack_self(usr) return diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm index a97e0afd257..996ac917b52 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -119,12 +119,12 @@ else if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M //if they are holding or wearing a card that has access, that works - if(src.check_access(H.equipped()) || src.check_access(H.wear_id)) + if(src.check_access(H.get_active_hand()) || src.check_access(H.wear_id)) return 1 else if(istype(M, /mob/living/carbon/monkey) || istype(M, /mob/living/carbon/alien/humanoid)) var/mob/living/carbon/george = M //they can only hold things :( - if(george.equipped() && (istype(george.equipped(), /obj/item/weapon/card/id) || istype(george.equipped(), /obj/item/device/pda)) && src.check_access(george.equipped())) + if(george.get_active_hand() && (istype(george.get_active_hand(), /obj/item/weapon/card/id) || istype(george.get_active_hand(), /obj/item/device/pda)) && src.check_access(george.get_active_hand())) return 1 return 0 diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 36d718867f6..230c5d9a85b 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -87,7 +87,7 @@ /obj/machinery/optable/MouseDrop_T(obj/O as obj, mob/user as mob) - if ((!( istype(O, /obj/item/weapon) ) || user.equipped() != O)) + if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O)) return user.drop_item() if (O.loc != src.loc) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index a45e880138b..a78f6ffc85c 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -375,7 +375,7 @@ if (href_list["AAlarmwires"]) var/t1 = text2num(href_list["AAlarmwires"]) - if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) )) + if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) )) usr << "You need wirecutters!" return if (src.isWireColorCut(t1)) @@ -384,7 +384,7 @@ src.cut(t1) else if (href_list["pulse"]) var/t1 = text2num(href_list["pulse"]) - if (!istype(usr.equipped(), /obj/item/device/multitool)) + if (!istype(usr.get_active_hand(), /obj/item/device/multitool)) usr << "You need a multitool!" return if (src.isWireColorCut(t1)) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 1ae8a046ef0..dddebebb828 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -255,7 +255,7 @@ var/global/list/autolathe_recipes_hidden = list( \ if(href_list["act"]) var/temp_wire = href_list["wire"] if(href_list["act"] == "pulse") - if (!istype(usr.equipped(), /obj/item/device/multitool)) + if (!istype(usr.get_active_hand(), /obj/item/device/multitool)) usr << "You need a multitool!" else if(src.wires[temp_wire]) @@ -273,7 +273,7 @@ var/global/list/autolathe_recipes_hidden = list( \ src.shock(usr,50) spawn(100) src.shocked = !src.shocked if(href_list["act"] == "wire") - if (!istype(usr.equipped(), /obj/item/weapon/wirecutters)) + if (!istype(usr.get_active_hand(), /obj/item/weapon/wirecutters)) usr << "You need wirecutters!" else wires[temp_wire] = !wires[temp_wire] diff --git a/code/game/machinery/bots/cleanbot.dm b/code/game/machinery/bots/cleanbot.dm index 950003b1312..55d4f50c1ec 100644 --- a/code/game/machinery/bots/cleanbot.dm +++ b/code/game/machinery/bots/cleanbot.dm @@ -349,11 +349,13 @@ text("[src.oddbutton ? "Yes" : "No" /obj/item/weapon/bucket_sensor/attackby(var/obj/item/W, mob/user as mob) ..() if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm)) + user.drop_item() + del(W) var/obj/machinery/bot/cleanbot/A = new /obj/machinery/bot/cleanbot A.loc = get_turf(src.loc) A.name = src.created_name user << "You add the robot arm to the bucket and sensor assembly! Beep boop!" - del(W) + user.drop_from_inventory(src) del(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 fe4329dd905..6dc66b7fdee 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -886,122 +886,131 @@ Auto Patrol: []"}, /obj/item/weapon/ed209_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob) ..() - if(((istype(W, /obj/item/robot_parts/l_leg)) || (istype(W, /obj/item/robot_parts/r_leg))) && (src.build_step == 0 || src.build_step == 1)) - src.build_step++ - user << "You add the robot leg to [src]!" - src.name = "legs/frame assembly" - if (src.build_step == 1) - src.item_state = "ed209_leg" - src.icon_state = "ed209_leg" - if (src.build_step == 2) - src.item_state = "ed209_legs" - src.icon_state = "ed209_legs" - del(W) - - else if(istype(W, /obj/item/clothing/suit/armor/vest) && (src.build_step == 2)) - src.build_step++ - user << "You add the armor to [src]!" - src.name = "vest/legs/frame assembly" - src.item_state = "ed209_shell" - src.icon_state = "ed209_shell" - del(W) - else if(istype(W, /obj/item/clothing/suit/bluetag) && (src.build_step == 2)) - src.build_step++ - user << "You add the armor to [src]!" - src.name = "vest/legs/frame assembly" - lasercolor = "b" - src.item_state = "[lasercolor]ed209_shell" - src.icon_state = "[lasercolor]ed209_shell" - del(W) - else if(istype(W, /obj/item/clothing/suit/redtag) && (src.build_step == 2)) - src.build_step++ - user << "You add the armor to [src]!" - src.name = "vest/legs/frame assembly" - lasercolor = "r" - src.item_state = "[lasercolor]ed209_shell" - src.icon_state = "[lasercolor]ed209_shell" - del(W) - else if(istype(W, /obj/item/weapon/weldingtool) && src.build_step == 3) - var/obj/item/weapon/weldingtool/WT = W - if(WT.remove_fuel(0,user)) - src.build_step++ - src.name = "shielded frame assembly" - user << "You welded the vest to [src]!" - else if(istype(W, /obj/item/clothing/head/helmet) && (src.build_step == 4)) - src.build_step++ - user << "You add the helmet to [src]!" - src.name = "covered and shielded frame assembly" - src.item_state = "[lasercolor]ed209_hat" - src.icon_state = "[lasercolor]ed209_hat" - del(W) - else if(isprox(W) && (src.build_step == 5)) - src.build_step++ - user << "You add the prox sensor to [src]!" - src.name = "prox/covered and armed the frame assembly" - src.item_state = "[lasercolor]ed209_prox" - src.icon_state = "[lasercolor]ed209_prox" - del(W) - else if(istype(W, /obj/item/weapon/cable_coil) && (src.build_step == 6) ) - var/obj/item/weapon/cable_coil/coil = W - var/turf/T = get_turf(user) - user.visible_message("[user] wires killbot.", "You start to wire the killbot.") - sleep(40) - if(get_turf(user) == T) - coil.use(1) - src.build_step++ - user << "\blue You wire the ED-209 assembly!" - src.name = "Wired ED-209 Assembly" - else if(istype(W, /obj/item/weapon/gun/energy/taser) && (src.build_step == 7) && (!lasercolor)) - src.build_step++ - user << "You add the taser gun to [src]!" - src.name = "Taser/Wired ED-209 Assembly" - src.item_state = "[lasercolor]ed209_taser" - src.icon_state = "[lasercolor]ed209_taser" - del(W) - else if(istype(W, /obj/item/weapon/gun/energy/laser/bluetag) && (src.build_step == 7) && (lasercolor == "b")) - src.build_step++ - user << "You add the lasertag gun to [src]!" - src.name = "Bluetag ED-209 Assembly" - src.item_state = "[lasercolor]ed209_taser" - src.icon_state = "[lasercolor]ed209_taser" - del(W) - else if(istype(W, /obj/item/weapon/gun/energy/laser/redtag) && (src.build_step == 7) && (lasercolor == "r")) - src.build_step++ - user << "You add the lasertag gun to [src]!" - src.name = "Redtag ED-209 Assembly" - src.item_state = "[lasercolor]ed209_taser" - src.icon_state = "[lasercolor]ed209_taser" - del(W) - else if(istype(W, /obj/item/weapon/screwdriver) && (src.build_step == 8) ) - playsound(src.loc, 'Screwdriver.ogg', 100, 1) - var/turf/T = get_turf(user) - user << "\blue Now attaching the gun to the frame." - sleep(40) - if(get_turf(user) == T) - src.build_step++ - src.name = "Armed ED-209 Assembly" - user << "\blue Taser gun attached!" - else if((istype(W, /obj/item/weapon/cell)) && (src.build_step >= 9)) - src.build_step++ - user << "You complete the ED-209!" - var/obj/machinery/bot/ed209/S = new /obj/machinery/bot/ed209 - S.loc = get_turf(src) - S.name = src.created_name - S.lasercolor = src.lasercolor - S.New() - del(W) - del(src) - - else if(istype(W, /obj/item/weapon/pen)) + if(istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) - if (!t) - return - if (!in_range(src, usr) && src.loc != usr) - return + if(!t) return + if(!in_range(src, usr) && src.loc != usr) return + created_name = t + return + + switch(build_step) + if(0,1) + if( istype(W, /obj/item/robot_parts/l_leg) || istype(W, /obj/item/robot_parts/r_leg) ) + user.drop_item() + del(W) + build_step++ + user << "You add the robot leg to [src]." + name = "legs/frame assembly" + if(build_step == 1) + item_state = "ed209_leg" + icon_state = "ed209_leg" + else + item_state = "ed209_legs" + icon_state = "ed209_legs" + + if(2) + if( istype(W, /obj/item/clothing/suit/redtag) ) + lasercolor = "r" + else if( istype(W, /obj/item/clothing/suit/bluetag) ) + lasercolor = "b" + if( lasercolor || istype(W, /obj/item/clothing/suit/armor/vest) ) + user.drop_item() + del(W) + build_step++ + user << "You add the armor to [src]." + name = "vest/legs/frame assembly" + item_state = "[lasercolor]ed209_shell" + icon_state = "[lasercolor]ed209_shell" + + if(3) + if( istype(W, /obj/item/weapon/weldingtool) ) + var/obj/item/weapon/weldingtool/WT = W + if(WT.remove_fuel(0,user)) + build_step++ + name = "shielded frame assembly" + user << "You welded the vest to [src]." + if(4) + if( istype(W, /obj/item/clothing/head/helmet) ) + user.drop_item() + del(W) + build_step++ + user << "You add the helmet to [src]." + name = "covered and shielded frame assembly" + item_state = "[lasercolor]ed209_hat" + icon_state = "[lasercolor]ed209_hat" + + if(5) + if( isprox(W) ) + user.drop_item() + del(W) + build_step++ + user << "You add the prox sensor to [src]." + name = "prox/covered and armed the frame assembly" + item_state = "[lasercolor]ed209_prox" + icon_state = "[lasercolor]ed209_prox" + + if(6) + if( istype(W, /obj/item/weapon/cable_coil) ) + var/obj/item/weapon/cable_coil/coil = W + var/turf/T = get_turf(user) + user << "You start to wire [src]..." + sleep(40) + if(get_turf(user) == T) + coil.use(1) + build_step++ + user << "You wire the ED-209 assembly." + name = "wired ED-209 assembly" + + if(7) + switch(lasercolor) + if("b") + if( !istype(W, /obj/item/weapon/gun/energy/laser/bluetag) ) + return + name = "bluetag ED-209 assembly" + if("r") + if( !istype(W, /obj/item/weapon/gun/energy/laser/redtag) ) + return + name = "redtag ED-209 assembly" + if("") + if( !istype(W, /obj/item/weapon/gun/energy/taser) ) + return + name = "taser ED-209 assembly" + else + return + build_step++ + user << "You add [W] to [src]." + src.item_state = "[lasercolor]ed209_taser" + src.icon_state = "[lasercolor]ed209_taser" + user.drop_item() + del(W) + + if(8) + if( istype(W, /obj/item/weapon/screwdriver) ) + playsound(src.loc, 'Screwdriver.ogg', 100, 1) + var/turf/T = get_turf(user) + user << "Now attaching the gun to the frame." + sleep(40) + if(get_turf(user) == T) + build_step++ + name = "armed ED-209 assembly" + user << "Taser gun attached." + + if(9) + if( istype(W, /obj/item/weapon/cell) ) + build_step++ + user << "You complete the ED-209." + var/obj/machinery/bot/ed209/S = new /obj/machinery/bot/ed209 + S.loc = get_turf(src) + S.name = created_name + S.lasercolor = lasercolor + S.New() + user.drop_item() + del(W) + user.drop_from_inventory(src) + del(src) - src.created_name = t /obj/machinery/bot/ed209/bullet_act(var/obj/item/projectile/Proj) if((src.lasercolor == "b") && (src.disabled == 0)) diff --git a/code/game/machinery/bots/floorbot.dm b/code/game/machinery/bots/floorbot.dm index e8b7ed1091b..d00f157432b 100644 --- a/code/game/machinery/bots/floorbot.dm +++ b/code/game/machinery/bots/floorbot.dm @@ -369,41 +369,26 @@ if(src.contents.len >= 1) user << "They wont fit in as there is already stuff inside!" return - if (user.s_active) + if(user.s_active) user.s_active.close(user) - var/obj/item/weapon/toolbox_tiles/B = new /obj/item/weapon/toolbox_tiles - B.loc = user - if (user.r_hand == T) - user.u_equip(T) - user.r_hand = B - user.update_inv_r_hand() - else - user.u_equip(T) - user.l_hand = B - user.update_inv_l_hand() - B.layer = 20 - user << "You add the tiles into the empty toolbox. They stick oddly out the top." del(T) + 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 stick protrude from the top." + user.drop_from_inventory(src) del(src) /obj/item/weapon/toolbox_tiles/attackby(var/obj/item/W, mob/user as mob) ..() if(isprox(W)) - var/obj/item/weapon/toolbox_tiles_sensor/B = new /obj/item/weapon/toolbox_tiles_sensor - B.loc = user - if (user.r_hand == W) - user.u_equip(W) - user.r_hand = B - user.update_inv_r_hand() - else - user.u_equip(W) - user.l_hand = B - user.update_inv_l_hand() - B.created_name = src.created_name - B.layer = 20 - user << "You add the sensor to the toolbox and tiles!" del(W) + var/obj/item/weapon/toolbox_tiles_sensor/B = new /obj/item/weapon/toolbox_tiles_sensor() + B.created_name = src.created_name + user.put_in_hands(B) + user << "You add the sensor to the toolbox and tiles!" + user.drop_from_inventory(src) del(src) + else if (istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) @@ -417,16 +402,12 @@ /obj/item/weapon/toolbox_tiles_sensor/attackby(var/obj/item/W, mob/user as mob) ..() if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm)) - var/obj/machinery/bot/floorbot/A = new /obj/machinery/bot/floorbot - if(user.r_hand == src || user.l_hand == src) - A.loc = user.loc - user.update_inv_l_hand(0) - user.update_inv_l_hand(1) - else - A.loc = src.loc - A.name = src.created_name - user << "You add the robot arm to the odd looking toolbox assembly! Boop beep!" del(W) + var/obj/machinery/bot/floorbot/A = new /obj/machinery/bot/floorbot + A.name = src.created_name + user.put_in_hands(A) + user << "You add the robot arm to the odd looking toolbox assembly! Boop beep!" + user.drop_from_inventory(src) del(src) else if (istype(W, /obj/item/weapon/pen)) var/t = input(user, "Enter new robot name", src.name, src.created_name) as text diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index b2fa15b6465..8b5e6ab5d15 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -553,18 +553,10 @@ else if(istype(src,/obj/item/weapon/storage/firstaid/o2)) A.skin = "o2" - A.loc = user - if (user.r_hand == S) - user.u_equip(S) - user.r_hand = A - user.update_inv_r_hand() - else - user.u_equip(S) - user.l_hand = A - user.update_inv_l_hand() - A.layer = 20 - user << "You add the robot arm to the first aid kit" del(S) + user.put_in_hands(A) + user << "You add the robot arm to the first aid kit" + user.drop_from_inventory(src) del(src) diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index d66d077b646..b12a61c9854 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -320,18 +320,10 @@ if("cellremove") - if(open && cell && !usr.equipped()) - cell.loc = usr - cell.layer = 20 - if(usr.hand) - usr.l_hand = cell - usr.update_inv_l_hand() - else - usr.r_hand = cell - usr.update_inv_r_hand() - - cell.add_fingerprint(usr) + if(open && cell && !usr.get_active_hand()) cell.updateicon() + usr.put_in_active_hand(cell) + cell.add_fingerprint(usr) cell = null usr.visible_message("\blue [usr] removes the power cell from [src].", "\blue You remove the power cell from [src].") @@ -339,7 +331,7 @@ if("cellinsert") if(open && !cell) - var/obj/item/weapon/cell/C = usr.equipped() + var/obj/item/weapon/cell/C = usr.get_active_hand() if(istype(C)) usr.drop_item() cell = C @@ -409,20 +401,20 @@ if("wirecut") - if(istype(usr.equipped(), /obj/item/weapon/wirecutters)) + if(istype(usr.get_active_hand(), /obj/item/weapon/wirecutters)) var/wirebit = text2num(href_list["wire"]) wires &= ~wirebit else usr << "\blue You need wirecutters!" if("wiremend") - if(istype(usr.equipped(), /obj/item/weapon/wirecutters)) + if(istype(usr.get_active_hand(), /obj/item/weapon/wirecutters)) var/wirebit = text2num(href_list["wire"]) wires |= wirebit else usr << "\blue You need wirecutters!" if("wirepulse") - if(istype(usr.equipped(), /obj/item/device/multitool)) + if(istype(usr.get_active_hand(), /obj/item/device/multitool)) switch(href_list["wire"]) if("1","2") usr << "\blue \icon[src] The charge light flickers." diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index be223776f7b..258df537a71 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -711,24 +711,15 @@ Auto Patrol: []"}, if(src.type != /obj/item/clothing/head/helmet) //Eh, but we don't want people making secbots out of space helmets. return - if(!S.secured) - return - else - var/obj/item/weapon/secbot_assembly/A = new /obj/item/weapon/secbot_assembly - A.loc = user - if(user.r_hand == S) - user.u_equip(S) - user.r_hand = A - user.update_inv_r_hand() - else - user.u_equip(S) - user.l_hand = A - user.update_inv_l_hand() - A.layer = 20 - user << "You add the signaler to the helmet." + if(S.secured) del(S) + 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.drop_from_inventory(src) del(src) - + else + return /obj/item/weapon/secbot_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob) ..() @@ -740,6 +731,7 @@ Auto Patrol: []"}, user << "You weld a hole in [src]!" else if(isprox(W) && (src.build_step == 1)) + user.drop_item() src.build_step++ user << "You add the prox sensor to [src]!" src.overlays += image('aibots.dmi', "hs_eye") @@ -747,6 +739,7 @@ Auto Patrol: []"}, del(W) else if(((istype(W, /obj/item/robot_parts/l_arm)) || (istype(W, /obj/item/robot_parts/r_arm))) && (src.build_step == 2)) + user.drop_item() src.build_step++ user << "You add the robot arm to [src]!" src.name = "helmet/signaler/prox sensor/robot arm assembly" @@ -754,6 +747,7 @@ Auto Patrol: []"}, del(W) else if((istype(W, /obj/item/weapon/melee/baton)) && (src.build_step >= 3)) + user.drop_item() src.build_step++ user << "You complete the Securitron! Beep boop." var/obj/machinery/bot/secbot/S = new /obj/machinery/bot/secbot diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index a082a54a129..e8970fe72c4 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -70,7 +70,7 @@ attack_hand(mob/user) if(charging) - usr.put_in_hand(charging) + usr.put_in_hands(charging) charging.add_fingerprint(user) charging.updateicon() diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm index 7c4b435af64..cc4da26a543 100644 --- a/code/game/machinery/computer/HolodeckControl.dm +++ b/code/game/machinery/computer/HolodeckControl.dm @@ -212,13 +212,14 @@ -/obj/machinery/computer/HolodeckControl/proc/derez(var/obj , var/silent = 1) +/obj/machinery/computer/HolodeckControl/proc/derez(var/obj/obj , var/silent = 1) holographic_items.Remove(obj) - if(istype(obj , /obj/)) - if(istype(obj:loc , /mob/)) - var/mob/M = obj:loc - M.drop_from_slot(obj) + if(isobj(obj)) + var/mob/M = obj.loc + if(ismob(M)) + M.u_equip(obj) + M.update_icons() //so their overlays update if(!silent) var/obj/oldobj = obj diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 4a02a5e7e78..a1c1c6d1a33 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -176,13 +176,13 @@ if(ishuman(usr)) modify.loc = usr.loc if(!usr.get_active_hand()) - usr.put_in_hand(modify) + usr.put_in_hands(modify) modify = null else modify.loc = loc modify = null else - var/obj/item/I = usr.equipped() + var/obj/item/I = usr.get_active_hand() if (istype(I, /obj/item/weapon/card/id)) usr.drop_item() I.loc = src @@ -194,13 +194,13 @@ if(ishuman(usr)) scan.loc = usr.loc if(!usr.get_active_hand()) - usr.put_in_hand(scan) + usr.put_in_hands(scan) scan = null else scan.loc = src.loc scan = null else - var/obj/item/I = usr.equipped() + var/obj/item/I = usr.get_active_hand() if (istype(I, /obj/item/weapon/card/id)) usr.drop_item() I.loc = src diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index a3f852d2bea..4e34bc34a18 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -301,7 +301,7 @@ src.menu = 4 else if (src.menu == 4) - var/obj/item/weapon/card/id/C = usr.equipped() + var/obj/item/weapon/card/id/C = usr.get_active_hand() if (istype(C)||istype(C, /obj/item/device/pda)) if(src.check_access(C)) src.records.Remove(src.active_record) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 2e8152551d1..aa31b18874e 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -53,7 +53,7 @@ src.state = STATE_DEFAULT if("login") var/mob/M = usr - var/obj/item/weapon/card/id/I = M.equipped() + var/obj/item/weapon/card/id/I = M.get_active_hand() if (istype(I, /obj/item/device/pda)) var/obj/item/device/pda/pda = I I = pda.id @@ -67,7 +67,7 @@ if("swipeidseclevel") var/mob/M = usr - var/obj/item/weapon/card/id/I = M.equipped() + var/obj/item/weapon/card/id/I = M.get_active_hand() if (istype(I, /obj/item/device/pda)) var/obj/item/device/pda/pda = I I = pda.id diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index a58b54b0e5a..2aa4ccbb4ae 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -118,7 +118,7 @@ src.scan.loc = src.loc src.scan = null else - var/obj/item/I = usr.equipped() + var/obj/item/I = usr.get_active_hand() if (istype(I, /obj/item/weapon/card/id)) usr.drop_item() I.loc = src diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index 4db02411f3f..202ff597a54 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -116,7 +116,7 @@ Cancel"} else if (href_list["eject2"]) - var/obj/item/weapon/card/id/I = usr.equipped() + var/obj/item/weapon/card/id/I = usr.get_active_hand() if (istype(I, /obj/item/device/pda)) var/obj/item/device/pda/pda = I I = pda.id diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 3c03e9b176b..5eaa46470d5 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -194,12 +194,12 @@ What a mess.*/ if("Confirm Identity") if (scan) if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand()) - usr.put_in_hand(scan) + usr.put_in_hands(scan) else scan.loc = get_turf(src) scan = null else - var/obj/item/I = usr.equipped() + var/obj/item/I = usr.get_active_hand() if (istype(I, /obj/item/weapon/card/id)) usr.drop_item() I.loc = src diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 60453166256..f15549445e7 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -867,7 +867,7 @@ About the new airlock wires panel: usr.machine = src if(href_list["wires"]) var/t1 = text2num(href_list["wires"]) - if(!( istype(usr.equipped(), /obj/item/weapon/wirecutters) )) + if(!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) )) usr << "You need wirecutters!" return if(src.isWireColorCut(t1)) @@ -876,7 +876,7 @@ About the new airlock wires panel: src.cut(t1) else if(href_list["pulse"]) var/t1 = text2num(href_list["pulse"]) - if(!istype(usr.equipped(), /obj/item/device/multitool)) + if(!istype(usr.get_active_hand(), /obj/item/device/multitool)) usr << "You need a multitool!" return if(src.isWireColorCut(t1)) @@ -886,13 +886,13 @@ About the new airlock wires panel: src.pulse(t1) else if(href_list["signaler"]) var/wirenum = text2num(href_list["signaler"]) - if(!istype(usr.equipped(), /obj/item/device/assembly/signaler)) + if(!istype(usr.get_active_hand(), /obj/item/device/assembly/signaler)) usr << "You need a signaller!" return if(src.isWireColorCut(wirenum)) usr << "You can't attach a signaller to a cut wire." return - var/obj/item/device/assembly/signaler/R = usr.equipped() + var/obj/item/device/assembly/signaler/R = usr.get_active_hand() if(R.secured) usr << "This radio can't be attached!" return diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm index 507f0e9460a..f27892b6a53 100644 --- a/code/game/machinery/doors/airlock_electronics.dm +++ b/code/game/machinery/doors/airlock_electronics.dm @@ -61,7 +61,7 @@ return if (href_list["login"]) - var/obj/item/I = usr.equipped() + var/obj/item/I = usr.get_active_hand() if (istype(I, /obj/item/device/pda)) var/obj/item/device/pda/pda = I I = pda.id diff --git a/code/game/machinery/morgue.dm b/code/game/machinery/morgue.dm index 0e9f9bdc02a..692888dcb36 100644 --- a/code/game/machinery/morgue.dm +++ b/code/game/machinery/morgue.dm @@ -68,7 +68,7 @@ /obj/structure/morgue/attackby(P as obj, mob/user as mob) if (istype(P, /obj/item/weapon/pen)) var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text - if (user.equipped() != P) + if (user.get_active_hand() != P) return if ((!in_range(src, usr) && src.loc != user)) return @@ -212,7 +212,7 @@ /obj/structure/crematorium/attackby(P as obj, mob/user as mob) if (istype(P, /obj/item/weapon/pen)) var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text - if (user.equipped() != P) + if (user.get_active_hand() != P) return if ((!in_range(src, usr) > 1 && src.loc != user)) return diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index d218e769853..9526e8391d7 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -52,7 +52,7 @@ return else // insert cell - var/obj/item/weapon/cell/C = usr.equipped() + var/obj/item/weapon/cell/C = usr.get_active_hand() if(istype(C)) user.drop_item() cell = C @@ -123,26 +123,17 @@ set_temperature = dd_range(20, 90, set_temperature + value) if("cellremove") - if(open && cell && !usr.equipped()) - cell.loc = usr - cell.layer = 20 - if(usr.hand) - usr.l_hand = cell - usr.update_inv_l_hand() - else - usr.r_hand = cell - usr.update_inv_r_hand() - - cell.add_fingerprint(usr) + if(open && cell && !usr.get_active_hand()) cell.updateicon() + usr.put_in_hands(cell) + cell.add_fingerprint(usr) cell = null - usr.visible_message("\blue [usr] removes the power cell from \the [src].", "\blue You remove the power cell from \the [src].") if("cellinstall") if(open && !cell) - var/obj/item/weapon/cell/C = usr.equipped() + var/obj/item/weapon/cell/C = usr.get_active_hand() if(istype(C)) usr.drop_item() cell = C diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index 5f240a2ae4f..eedf5e738a0 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -98,8 +98,8 @@ // You need a multitool to use this, or be silicon if(!issilicon(user)) - if(user.equipped()) - if(!istype(user.equipped(), /obj/item/device/multitool)) + if(user.get_active_hand()) + if(!istype(user.get_active_hand(), /obj/item/device/multitool)) return else return @@ -109,7 +109,7 @@ var/obj/item/device/multitool/P = null if(!issilicon(user)) - P = user.equipped() + P = user.get_active_hand() user.machine = src var/dat @@ -160,8 +160,8 @@ Topic(href, href_list) if(!issilicon(usr)) - if(usr.equipped()) - if(!istype(usr.equipped(), /obj/item/device/multitool)) + if(usr.get_active_hand()) + if(!istype(usr.get_active_hand(), /obj/item/device/multitool)) return else return @@ -171,7 +171,7 @@ var/obj/item/device/multitool/P = null if(!issilicon(usr)) - P = usr.equipped() + P = usr.get_active_hand() if(href_list["input"]) switch(href_list["input"]) diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm index c2257aab2d1..6124474c9a2 100644 --- a/code/game/machinery/turrets.dm +++ b/code/game/machinery/turrets.dm @@ -10,9 +10,6 @@ src.Exited(target) -//TODO: make teleporting to places trigger Entered() ~Carn -// Done. - /area/turret_protected/Entered(O) ..() if( master && master != src ) diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 7a6509c0c13..b43730a311b 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -215,7 +215,7 @@ coin.loc = src.loc if(!usr.get_active_hand()) - usr.put_in_hand(coin) + usr.put_in_hands(coin) usr << "\blue You remove the [coin] from the [src]" coin = null @@ -277,7 +277,7 @@ else if ((href_list["cutwire"]) && (src.panel_open)) var/twire = text2num(href_list["cutwire"]) - if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) )) + if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) )) usr << "You need wirecutters!" return if (src.isWireColorCut(twire)) @@ -287,7 +287,7 @@ else if ((href_list["pulsewire"]) && (src.panel_open)) var/twire = text2num(href_list["pulsewire"]) - if (!istype(usr.equipped(), /obj/item/device/multitool)) + if (!istype(usr.get_active_hand(), /obj/item/device/multitool)) usr << "You need a multitool!" return if (src.isWireColorCut(twire)) diff --git a/code/game/magic/cultist/ritual.dm b/code/game/magic/cultist/ritual.dm index dd1b5c6407a..0b2d2f3c931 100644 --- a/code/game/magic/cultist/ritual.dm +++ b/code/game/magic/cultist/ritual.dm @@ -515,12 +515,12 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", if("Cancel") return if("Read it") - if(usr.equipped() != src) + if(usr.get_active_hand() != src) return user << browse("[tomedat]", "window=Arcane Tome") return if("Notes") - if(usr.equipped() != src) + if(usr.get_active_hand() != src) return notedat = {"
Word translation notes
@@ -538,7 +538,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", // call(/obj/item/weapon/tome/proc/edit_notes)() user << browse("[notedat]", "window=notes") return - if(usr.equipped() != src) + if(usr.get_active_hand() != src) return var/w1 @@ -563,7 +563,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", if (words[w] == w3) w3 = w - if(usr.equipped() != src) + if(usr.get_active_hand() != src) return for (var/mob/V in viewers(src)) @@ -571,7 +571,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", user << "\red You slice open one of your fingers and begin drawing a rune on the floor whilst chanting the ritual that binds your life essence with the dark arcane energies flowing through the surrounding world." user.take_overall_damage(1) if(do_after(user, 50)) - if(usr.equipped() != src) + if(usr.get_active_hand() != src) return var/mob/living/carbon/human/H = user var/obj/effect/rune/R = new /obj/effect/rune(user.loc) diff --git a/code/game/magic/library.dm b/code/game/magic/library.dm index 036d4e54f42..1312136a741 100644 --- a/code/game/magic/library.dm +++ b/code/game/magic/library.dm @@ -101,7 +101,7 @@ return if(ishuman(user)) if(!user.get_active_hand()) - user.put_in_hand(choice) + user.put_in_hands(choice) else choice.loc = get_turf(src) update_icon() diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index c844128f4cc..b05365354e0 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -139,7 +139,7 @@ var/mob/living/carbon/human/H = M if(isobj(H.shoes)) var/thingy = H.shoes - H.drop_from_slot(H.shoes) + H.drop_from_inventory(H.shoes) walk_away(thingy,chassis,15,2) spawn(20) if(thingy) diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index eee2a45de07..95b203da440 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -190,7 +190,7 @@ return 1 else if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M - for(var/ID in list(H.equipped(), H.wear_id, H.belt)) + for(var/ID in list(H.get_active_hand(), H.wear_id, H.belt)) if(src.check_access(ID)) return 1 M << "You don't have required permissions to use [src]" diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index c184b770cb3..4d07c21e774 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -780,7 +780,7 @@ return else if(istype(W, /obj/item/mecha_parts/mecha_tracking)) - user.drop_from_slot(W) + user.drop_from_inventory(W) W.forceMove(src) user.visible_message("[user] attaches [W] to [src].", "You attach [W] to [src]") return @@ -1073,7 +1073,7 @@ else if(mmi_as_oc.brainmob.stat) user << "Beta-rhythm below acceptable level." return 0 - user.drop_from_slot(mmi_as_oc) + user.drop_from_inventory(mmi_as_oc) var/mob/brainmob = mmi_as_oc.brainmob brainmob.reset_view(src) /* @@ -1186,14 +1186,14 @@ ///////////////////////// /obj/mecha/proc/operation_allowed(mob/living/carbon/human/H) - for(var/ID in list(H.equipped(), H.wear_id, H.belt)) + for(var/ID in list(H.get_active_hand(), H.wear_id, H.belt)) if(src.check_access(ID,src.operation_req_access)) return 1 return 0 /obj/mecha/proc/internals_access_allowed(mob/living/carbon/human/H) - for(var/atom/ID in list(H.equipped(), H.wear_id, H.belt)) + for(var/atom/ID in list(H.get_active_hand(), H.wear_id, H.belt)) if(src.check_access(ID,src.internals_req_access)) return 1 return 0 diff --git a/code/game/objects/bodybag.dm b/code/game/objects/bodybag.dm index 07ba22da853..37d4f2af337 100644 --- a/code/game/objects/bodybag.dm +++ b/code/game/objects/bodybag.dm @@ -43,7 +43,7 @@ attackby(W as obj, mob/user as mob) if (istype(W, /obj/item/weapon/pen)) var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text - if (user.equipped() != W) + if (user.get_active_hand() != W) return if (!in_range(src, user) && src.loc != user) return diff --git a/code/game/objects/closets/extinguisher.dm b/code/game/objects/closets/extinguisher.dm index c35b96cc64d..1cb2b214f08 100644 --- a/code/game/objects/closets/extinguisher.dm +++ b/code/game/objects/closets/extinguisher.dm @@ -29,7 +29,7 @@ /obj/structure/extinguisher_cabinet/attack_hand(mob/user as mob) if(has_extinguisher) - user.put_in_hand(has_extinguisher) + user.put_in_hands(has_extinguisher) has_extinguisher = null user << "\blue You take the extinguisher from the [name]." opened = 1 diff --git a/code/game/objects/closets/fireaxe.dm b/code/game/objects/closets/fireaxe.dm index ecb6fee5edd..d7d0b916947 100644 --- a/code/game/objects/closets/fireaxe.dm +++ b/code/game/objects/closets/fireaxe.dm @@ -111,7 +111,7 @@ return if(localopened) if(fireaxe) - user.put_in_hand(fireaxe) + user.put_in_hands(fireaxe) fireaxe = null user << "\blue You take the fire axe from the [name]." src.add_fingerprint(user) @@ -160,7 +160,7 @@ if (localopened) if(fireaxe) - usr.put_in_hand(fireaxe) + usr.put_in_hands(fireaxe) fireaxe = null usr << "\blue You take the Fire axe from the [name]." else diff --git a/code/game/objects/devices/PDA/PDA.dm b/code/game/objects/devices/PDA/PDA.dm index a9c44b25154..0472c4c7db5 100644 --- a/code/game/objects/devices/PDA/PDA.dm +++ b/code/game/objects/devices/PDA/PDA.dm @@ -755,14 +755,12 @@ var/global/list/obj/item/device/pda/PDAs = list() /obj/item/device/pda/proc/remove_id() if (id) - if (istype(loc, /mob)) + if (ismob(loc)) var/mob/M = loc - if(M.equipped() == null) - M.put_in_hand(id) - id = null - usr << "\blue You remove the ID from the [name]." - return - id.loc = get_turf(src) + M.put_in_hands(id) + usr << "You remove the ID from the [name]." + else + id.loc = get_turf(src) id = null /obj/item/device/pda/proc/telecomms_process(var/receipent, var/originator, var/data) @@ -820,8 +818,8 @@ var/global/list/obj/item/device/pda/PDAs = list() if(O) if (istype(loc, /mob)) var/mob/M = loc - if(M.equipped() == null) - M.put_in_hand(O) + if(M.get_active_hand() == null) + M.put_in_hands(O) usr << "You remove \the [O] from \the [src]." return O.loc = get_turf(src) @@ -835,23 +833,19 @@ var/global/list/obj/item/device/pda/PDAs = list() if (id) remove_id() else - var/obj/item/I = user.equipped() + var/obj/item/I = user.get_active_hand() if (istype(I, /obj/item/weapon/card/id)) user.drop_item() I.loc = src id = I else - var/obj/item/weapon/card/I = user.equipped() + var/obj/item/weapon/card/I = user.get_active_hand() if (istype(I, /obj/item/weapon/card/id) && I:registered_name) - if(id)//Get id and replace it. - user.drop_item() - I.loc = src - user.put_in_hand(id) - id = I - else//Insert id. - user.drop_item() - I.loc = src - id = I + var/obj/old_id = id + user.drop_item() + I.loc = src + id = I + user.put_in_hands(old_id) return // access to status display signals diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 8b4da89c38b..27a1f5223ff 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -36,7 +36,7 @@ var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) O.source = user O.target = user - O.item = user.equipped() + O.item = user.get_active_hand() O.s_loc = user.loc O.t_loc = user.loc O.place = "handcuff" @@ -58,7 +58,7 @@ var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) O.source = user O.target = M - O.item = user.equipped() + O.item = user.get_active_hand() O.s_loc = user.loc O.t_loc = M.loc O.place = "handcuff" @@ -77,7 +77,7 @@ var/obj/effect/equip_e/monkey/O = new /obj/effect/equip_e/monkey( ) O.source = user O.target = M - O.item = user.equipped() + O.item = user.get_active_hand() O.s_loc = user.loc O.t_loc = M.loc O.place = "handcuff" diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index bda87b047c2..24d886ca76c 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -23,7 +23,7 @@ /obj/item/blueprints/Topic(href, href_list) ..() - if ((usr.restrained() || usr.stat || usr.equipped() != src)) + if ((usr.restrained() || usr.stat || usr.get_active_hand() != src)) return if (!href_list["action"]) return diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index 86a3835121a..8dd3258b37a 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -119,14 +119,7 @@ return else src.candlecount-- - var/obj/item/candle/W = new /obj/item/candle(user) - if(user.hand) - user.l_hand = W - user.update_inv_l_hand() - else - user.r_hand = W - user.update_inv_r_hand() - W.layer = 20 + user.put_in_hands(new /obj/item/candle(user)) else return ..() src.update_icon() diff --git a/code/game/objects/items/food.dm b/code/game/objects/items/food.dm index b6510892d13..21f9750f2d3 100644 --- a/code/game/objects/items/food.dm +++ b/code/game/objects/items/food.dm @@ -37,16 +37,8 @@ MONKEY CUBE BOX /obj/item/kitchen/donut_box/MouseDrop(mob/user as mob) if ((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr)))))) if(!istype(user, /mob/living/carbon/metroid)) - if (usr.hand) - if (!( usr.l_hand )) - spawn( 0 ) - src.attack_hand(usr, 1, 1) - return - else - if (!( usr.r_hand )) - spawn( 0 ) - src.attack_hand(usr, 0, 1) - return + if( !usr.get_active_hand() ) + src.attack_hand(usr, usr.hand, 1) return /obj/item/kitchen/donut_box/attack_paw(mob/user as mob) @@ -56,36 +48,15 @@ MONKEY CUBE BOX if (flag) return ..() src.add_fingerprint(user) - if (locate(/obj/item/weapon/reagent_containers/food/snacks/donut, src)) - for(var/obj/item/weapon/reagent_containers/food/snacks/donut/P in src) - if (!usr.l_hand) - P.loc = usr - P.layer = 20 - usr.l_hand = P - usr.update_inv_l_hand() - usr << "You take a donut out of the box." - break - else if (!usr.r_hand) - P.loc = usr - P.layer = 20 - usr.r_hand = P - usr.update_inv_r_hand() - usr << "You take a donut out of the box." - break - else - if (src.amount >= 1) - src.amount-- - var/obj/item/weapon/reagent_containers/food/snacks/donut/D = new /obj/item/weapon/reagent_containers/food/snacks/donut - D.loc = usr.loc - if(ishuman(usr)) - if(!usr.get_active_hand()) - usr.put_in_hand(D) - usr << "You take a donut out of the box." - else - D.loc = get_turf_loc(src) - usr << "You take a donut out of the box." - src.update() + var/obj/item/weapon/reagent_containers/food/snacks/donut/P = locate() in src + if(!P && (amount >= 1)) + P = new /obj/item/weapon/reagent_containers/food/snacks/donut( src ) + if(P) + usr.put_in_hands(P) + usr << "You take a donut out of the box." + src.amount-- + src.update() return /obj/item/kitchen/donut_box/examine() @@ -112,16 +83,9 @@ MONKEY CUBE BOX /obj/item/kitchen/egg_box/MouseDrop(mob/user as mob) if ((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr)))))) - if (usr.hand) - if (!( usr.l_hand )) - spawn( 0 ) - src.attack_hand(usr, 1, 1) - return - else - if (!( usr.r_hand )) - spawn( 0 ) - src.attack_hand(usr, 0, 1) - return + if( !usr.get_active_hand() ) + attack_hand(usr, usr.hand, 1) + return return /obj/item/kitchen/egg_box/attack_paw(mob/user as mob) @@ -131,32 +95,17 @@ MONKEY CUBE BOX if (flag) return ..() src.add_fingerprint(user) - if (locate(/obj/item/weapon/reagent_containers/food/snacks/egg, src)) - for(var/obj/item/weapon/reagent_containers/food/snacks/egg/P in src) - if (!usr.l_hand) - P.loc = usr.loc - P.layer = 20 - usr.l_hand = P - P = null - usr.update_inv_l_hand() - usr << "You take an egg out of the box." - break - else if (!usr.r_hand) - P.loc = usr.loc - P.layer = 20 - usr.r_hand = P - P = null - usr.update_inv_r_hand() - usr << "You take an egg out of the box." - break - else - if (src.amount >= 1) - src.amount-- - new /obj/item/weapon/reagent_containers/food/snacks/egg( src.loc ) - usr << "You take an egg out of the box." - src.update() + var/obj/item/weapon/reagent_containers/food/snacks/egg/P = locate() in src + if(!P && (amount >= 1)) + P = new /obj/item/weapon/reagent_containers/food/snacks/egg( src ) + if(P) + usr.put_in_hands(P) + usr << "You take an egg out of the box." + src.amount-- + src.update() return + /obj/item/kitchen/egg_box/examine() set src in oview(1) @@ -186,15 +135,7 @@ MONKEY CUBE BOX if(user.r_hand == src || user.l_hand == src) if(amount) - var/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped/M = new /obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped(src) - if (user.hand) - user.l_hand = M - user.update_inv_l_hand() - else - user.r_hand = M - user.update_inv_r_hand() - M.loc = user - M.layer = 20 + user.put_in_hands(new /obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped(user)) user << "You take a monkey cube out of the box." amount-- else diff --git a/code/game/objects/items/item.dm b/code/game/objects/items/item.dm index 3e3b8787dfe..e9f447ba32d 100644 --- a/code/game/objects/items/item.dm +++ b/code/game/objects/items/item.dm @@ -23,7 +23,7 @@ /obj/item/proc/equipped(var/mob/user, var/slot) return // -// ***TODO: implement unequipped() +// ***TODO: implement unget_active_hand() // /obj/item/proc/afterattack() @@ -119,15 +119,8 @@ src.pickup(user) user.lastDblClick = world.time + 2 user.next_move = world.time + 2 - src.loc = user - src.layer = 20 add_fingerprint(user) - if (user.hand) - user.l_hand = src - user.update_inv_l_hand() - else - user.r_hand = src - user.update_inv_r_hand() + user.put_in_active_hand(src) return @@ -158,14 +151,8 @@ src.pickup(user) user.lastDblClick = world.time + 2 user.next_move = world.time + 2 - src.loc = user - src.layer = 20 - if (user.hand) - user.l_hand = src - user.update_inv_l_hand() - else - user.r_hand = src - user.update_inv_r_hand() + + user.put_in_active_hand(src) return /obj/item/attackby(obj/item/weapon/W as obj, mob/user as mob) diff --git a/code/game/objects/items/tk_grab.dm b/code/game/objects/items/tk_grab.dm index aaeb21e821a..c6e7c680d16 100644 --- a/code/game/objects/items/tk_grab.dm +++ b/code/game/objects/items/tk_grab.dm @@ -20,7 +20,9 @@ return + //stops TK grabs being equipped anywhere but into hands equipped(var/mob/user, var/slot) + if( (slot=="l_hand") || (slot=="r_hand") ) return del(src) return @@ -29,13 +31,7 @@ if(!istype(focus,/obj/item)) return if(!check_path()) return//No clear path - if(user.hand == src) - user.l_hand = focus - else - user.r_hand = focus - - focus.loc = user - focus.layer = 20 + user.put_in_hands(focus) add_fingerprint(user) user.update_inv_l_hand(0) user.update_inv_r_hand() @@ -117,7 +113,7 @@ /* if(istype(user, /mob/living/carbon)) if(user:mutations & TK && get_dist(source, user) <= 7) - if(user:equipped()) return 0 + if(user:get_active_hand()) return 0 var/X = source:x var/Y = source:y var/Z = source:z diff --git a/code/game/objects/items/weapons/cameras.dm b/code/game/objects/items/weapons/cameras.dm index df127565e1a..af8438dd187 100644 --- a/code/game/objects/items/weapons/cameras.dm +++ b/code/game/objects/items/weapons/cameras.dm @@ -13,17 +13,13 @@ return ..() playsound(src.loc, "rustle", 50, 1, -5) if ((!( M.restrained() ) && !( M.stat ) && M.back == src)) - if (over_object.name == "r_hand") - if (!( M.r_hand )) + switch(over_object.name) + if("r_hand") M.u_equip(src) - M.r_hand = src - M.update_inv_r_hand() - else - if (over_object.name == "l_hand") - if (!( M.l_hand )) - M.u_equip(src) - M.l_hand = src - M.update_inv_l_hand() + M.put_in_r_hand(src) + if("l_hand") + M.u_equip(src) + M.put_in_l_hand(src) src.add_fingerprint(usr) return if(over_object == usr && in_range(src, usr) || usr.contents.Find(src)) diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 2b4d7d143d8..c3198d7144d 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -92,17 +92,7 @@ FINGERPRINT CARD if (href_list["remove"]) var/obj/item/P = locate(href_list["remove"]) if ((P && P.loc == src)) - if ((usr.hand && !( usr.l_hand ))) - usr.l_hand = P - P.loc = usr - P.layer = 20 - usr.update_inv_l_hand() - else - if (!( usr.r_hand )) - usr.r_hand = P - P.loc = usr - P.layer = 20 - usr.update_inv_r_hand() + usr.put_in_hands(P) src.add_fingerprint(usr) P.add_fingerprint(usr) src.update() @@ -150,7 +140,7 @@ FINGERPRINT CARD else if (istype(P, /obj/item/weapon/pen)) var/t = input(user, "Holder Label:", text("[]", src.name), null) as text - if (user.equipped() != P) + if (user.get_active_hand() != P) return if ((!in_range(src, usr) && src.loc != user)) return @@ -209,11 +199,7 @@ FINGERPRINT CARD var/obj/item/weapon/f_card/F = new /obj/item/weapon/f_card( user ) F.amount = 1 src.amount-- - if (user.hand) - user.l_hand = F - else - user.r_hand = F - F.layer = 20 + user.put_in_hands(F) F.add_fingerprint(user) if (src.amount < 1) //SN src = null @@ -244,7 +230,7 @@ FINGERPRINT CARD else if (istype(W, /obj/item/weapon/pen)) var/t = input(user, "Card Label:", text("[]", src.name), null) as text - if (user.equipped() != W) + if (user.get_active_hand() != W) return if ((!in_range(src, usr) && src.loc != user)) return diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 48671fe55aa..bf733a282e8 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -71,14 +71,7 @@ ZIPPO return else src.matchcount-- - var/obj/item/weapon/match/W = new /obj/item/weapon/match(user) - if(user.hand) - user.l_hand = W - user.update_inv_l_hand() - else - user.r_hand = W - user.update_inv_r_hand() - W.layer = 20 + user.put_in_active_hand(new /obj/item/weapon/match(user)) else return ..() if(src.matchcount <= 0) @@ -430,13 +423,7 @@ ZIPPO cigcount-- var/obj/item/clothing/mask/cigarette/W = new /obj/item/clothing/mask/cigarette(user) reagents.trans_to(W, reagents.total_volume) - if(user.hand) - user.l_hand = W - user.update_inv_l_hand() - else - user.r_hand = W - user.update_inv_r_hand() - W.layer = 20 + user.put_in_active_hand(W) else return ..() update_icon() diff --git a/code/game/objects/items/weapons/grenades.dm b/code/game/objects/items/weapons/grenades.dm index 6c46cfb7e7f..a90ad927b86 100644 --- a/code/game/objects/items/weapons/grenades.dm +++ b/code/game/objects/items/weapons/grenades.dm @@ -30,7 +30,7 @@ CRITTER GRENADE afterattack(atom/target as mob|obj|turf|area, mob/user as mob) if (istype(target, /obj/item/weapon/storage)) return ..() // Trying to put it in a full container if (istype(target, /obj/item/weapon/gun/grenadelauncher)) return ..() - if((user.equipped() == src)&&(!active)&&(clown_check(user))) + if((user.get_active_hand() == src)&&(!active)&&(clown_check(user))) user << "\red You prime the emp grenade! [det_time/10] seconds!" src.active = 1 src.icon_state = "empar" @@ -130,7 +130,7 @@ CRITTER GRENADE afterattack(atom/target as mob|obj|turf|area, mob/user as mob) if (istype(target, /obj/item/weapon/storage)) return ..() // Trying to put it in a full container if (istype(target, /obj/item/weapon/gun/grenadelauncher)) return ..() - if((user.equipped() == src)&&(!active)&&(clown_check(user))) + if((user.get_active_hand() == src)&&(!active)&&(clown_check(user))) user << "\red You prime the flashbang! [det_time/10] seconds!" src.active = 1 src.icon_state = "flashbang1" @@ -302,7 +302,7 @@ CRITTER GRENADE afterattack(atom/target as mob|obj|turf|area, mob/user as mob) if (istype(target, /obj/item/weapon/storage)) return ..() // Trying to put it in a full container if (istype(target, /obj/item/weapon/gun/grenadelauncher)) return ..() - if((user.equipped() == src)&&(!active)) + if((user.get_active_hand() == src)&&(!active)) //world << "cluster after attack" arm(user) user.dir = get_dir(user, target) @@ -409,7 +409,7 @@ CRITTER GRENADE afterattack(atom/target as mob|obj|turf|area, mob/user as mob) if (istype(target, /obj/item/weapon/storage)) return ..() // Trying to put it in a full container if (istype(target, /obj/item/weapon/gun/grenadelauncher)) return ..() - if((user.equipped() == src)&&(!active)&&(clown_check(user))) + if((user.get_active_hand() == src)&&(!active)&&(clown_check(user))) user << "\red You prime the delivery grenade! [det_time/10] seconds!" src.active = 1 src.icon_state = "delivery1" diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm index 628045c2685..e08ab61e3c8 100644 --- a/code/game/objects/items/weapons/implants/implantcase.dm +++ b/code/game/objects/items/weapons/implants/implantcase.dm @@ -25,7 +25,7 @@ ..() if (istype(I, /obj/item/weapon/pen)) var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text - if (user.equipped() != I) + if (user.get_active_hand() != I) return if((!in_range(src, usr) && src.loc != user)) return diff --git a/code/game/objects/items/weapons/implants/implantnanoaug.dm b/code/game/objects/items/weapons/implants/implantnanoaug.dm index f9350d05c7f..9306f4b4684 100644 --- a/code/game/objects/items/weapons/implants/implantnanoaug.dm +++ b/code/game/objects/items/weapons/implants/implantnanoaug.dm @@ -71,7 +71,7 @@ var/obj/item/weapon/melee/energy/blade/swordspawn = new /obj/item/weapon/melee/energy/blade if(!source.get_active_hand()) - source.put_in_hand(swordspawn) + source.put_in_hands(swordspawn) var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() spark_system.set_up(5, 0, source.loc) diff --git a/code/game/objects/items/weapons/implants/implantpad.dm b/code/game/objects/items/weapons/implants/implantpad.dm index f8cf0ad0d71..43483ac2331 100644 --- a/code/game/objects/items/weapons/implants/implantpad.dm +++ b/code/game/objects/items/weapons/implants/implantpad.dm @@ -26,18 +26,11 @@ attack_hand(mob/user as mob) if ((src.case && (user.l_hand == src || user.r_hand == src))) - if (user.hand) - user.l_hand = src.case - user.update_inv_l_hand() - else - user.r_hand = src.case - user.update_inv_r_hand() - src.case.loc = user - src.case.layer = 20 + user.put_in_active_hand(case) + src.case.add_fingerprint(user) src.case = null - user.update_inv_l_hand(0) - user.update_inv_r_hand() + src.add_fingerprint(user) update() else diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm index 983f8c9276e..bbff36a9401 100644 --- a/code/game/objects/items/weapons/paint.dm +++ b/code/game/objects/items/weapons/paint.dm @@ -53,7 +53,7 @@ var/global/list/cached_icons = list() attack_self(mob/user as mob) var/t1 = input(user, "Please select a color:", "Locking Computer", null) in list( "red", "blue", "green", "yellow", "black", "white") - if ((user.equipped() != src || user.stat || user.restrained())) + if ((user.get_active_hand() != src || user.stat || user.restrained())) return switch(t1) if("red") diff --git a/code/game/objects/items/weapons/table_rack_parts.dm b/code/game/objects/items/weapons/table_rack_parts.dm index faaa26bcbd8..74200b9d880 100644 --- a/code/game/objects/items/weapons/table_rack_parts.dm +++ b/code/game/objects/items/weapons/table_rack_parts.dm @@ -26,8 +26,8 @@ RACK PARTS user << "\red You need at least four rods to do this." /obj/item/weapon/table_parts/attack_self(mob/user as mob) - var/obj/structure/table/T = new /obj/structure/table( user.loc ) - T.add_fingerprint(usr) + new /obj/structure/table( user.loc ) + user.drop_item() del(src) return @@ -35,11 +35,11 @@ RACK PARTS /obj/item/weapon/table_parts/wood/attackby(obj/item/weapon/W as obj, mob/user as mob) if (istype(W, /obj/item/weapon/wrench)) new /obj/item/stack/sheet/wood( src.loc ) - //SN src = null del(src) /obj/item/weapon/table_parts/wood/attack_self(mob/user as mob) new /obj/structure/table/woodentable( user.loc ) + user.drop_item() del(src) return @@ -49,11 +49,11 @@ RACK PARTS if (istype(W, /obj/item/weapon/wrench)) new /obj/item/stack/sheet/metal( src.loc ) new /obj/item/stack/rods( src.loc ) - //SN src = null del(src) /obj/item/weapon/table_parts/reinforced/attack_self(mob/user as mob) new /obj/structure/table/reinforced( user.loc ) + user.drop_item() del(src) return @@ -73,5 +73,6 @@ RACK PARTS /obj/item/weapon/rack_parts/attack_self(mob/user as mob) var/obj/structure/rack/R = new /obj/structure/rack( user.loc ) R.add_fingerprint(user) + user.drop_item() del(src) return \ No newline at end of file diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index d2f37e012b2..007e06cd443 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -122,7 +122,7 @@ Frequency: if(turfs.len) L["None (Dangerous)"] = pick(turfs) var/t1 = input(user, "Please select a teleporter to lock in on.", "Hand Teleporter") in L - if ((user.equipped() != src || user.stat || user.restrained())) + if ((user.get_active_hand() != src || user.stat || user.restrained())) return var/count = 0 //num of portals from this teleport in world for(var/obj/effect/portal/PO in world) diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 14eff5ba0f0..73f5880e073 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -25,14 +25,9 @@ /obj/item/weapon/twohanded/dropped(mob/user as mob) //handles unwielding a twohanded weapon when dropped as well as clearing up the offhand - //bit of a hack but it keeps other code pretty neat and with fewer conditionals - var/obj/item/weapon/twohanded/O if(user) - if(user.l_hand) - O = user.l_hand - else - O = user.r_hand - if(O && istype(O)) + var/obj/item/weapon/twohanded/O = user.get_inactive_hand() + if(istype(O)) O.unwield() return unwield() @@ -67,11 +62,7 @@ var/obj/item/weapon/twohanded/offhand/O = new(user) ////Let's reserve his other hand~ O.name = "[initial(name)] - offhand" O.desc = "Your second grip on the [initial(name)]" - if(user.hand) - user.r_hand = O ///Place dat offhand in the opposite hand - else - user.l_hand = O - O.layer = 20 + user.put_in_inactive_hand(O) return ///////////OFFHAND/////////////// diff --git a/code/game/objects/items/weapons/wrappingpaper.dm b/code/game/objects/items/weapons/wrappingpaper.dm index c38797744f9..01c3e5f19c7 100644 --- a/code/game/objects/items/weapons/wrappingpaper.dm +++ b/code/game/objects/items/weapons/wrappingpaper.dm @@ -32,7 +32,6 @@ PHOTOGRAPHS src.add_fingerprint(user) if (src.amount <= 0) new /obj/item/weapon/c_tube( src.loc ) - //SN src = null del(src) return else @@ -67,7 +66,7 @@ PHOTOGRAPHS log_attack("[user.name] ([user.ckey]) used the [src.name] to wrap [target.name] ([target.ckey])") else - user << "/blue You need more paper." + user << "\blue You need more paper." else user << "Theyre moving around too much. a Straitjacket would help." @@ -78,18 +77,12 @@ PHOTOGRAPHS // GIFTS /obj/item/weapon/gift/attack_self(mob/user as mob) - if(!src.gift) - user << "\blue The gift was empty!" - del(src) - src.gift.loc = user - if (user.hand) - user.l_hand = src.gift - user.update_inv_l_hand() + user.drop_item() + if(src.gift) + user.put_in_active_hand(gift) + src.gift.add_fingerprint(user) else - user.r_hand = src.gift - user.update_inv_r_hand() - src.gift.layer = 20 - src.gift.add_fingerprint(user) + user << "\blue The gift was empty!" del(src) return @@ -107,7 +100,7 @@ PHOTOGRAPHS ..() if (!istype(W, /obj/item/weapon/wirecutters)) - user << "/blue I need wirecutters for that." + user << "\blue I need wirecutters for that." return user << "\blue You cut open the present." @@ -125,67 +118,32 @@ PHOTOGRAPHS switch(pick("flash", "t_gun", "l_gun", "shield", "sword", "axe")) if("flash") var/obj/item/device/flash/W = new /obj/item/device/flash( M ) - if (M.hand) - M.l_hand = W - M.update_inv_l_hand() - else - M.r_hand = W - M.update_inv_r_hand() - W.layer = 20 + M.put_in_active_hand(W) W.add_fingerprint(M) - //SN src = null del(src) return if("l_gun") var/obj/item/weapon/gun/energy/laser/W = new /obj/item/weapon/gun/energy/laser( M ) - if (M.hand) - M.l_hand = W - M.update_inv_l_hand() - else - M.r_hand = W - M.update_inv_r_hand() - W.layer = 20 + M.put_in_active_hand(W) W.add_fingerprint(M) - //SN src = null del(src) return if("t_gun") var/obj/item/weapon/gun/energy/taser/W = new /obj/item/weapon/gun/energy/taser( M ) - if (M.hand) - M.l_hand = W - M.update_inv_l_hand() - else - M.r_hand = W - M.update_inv_r_hand() - W.layer = 20 + M.put_in_active_hand(W) W.add_fingerprint(M) - //SN src = null del(src) return if("sword") var/obj/item/weapon/melee/energy/sword/W = new /obj/item/weapon/melee/energy/sword( M ) - if (M.hand) - M.l_hand = W - M.update_inv_l_hand() - else - M.r_hand = W - M.update_inv_r_hand() - W.layer = 20 + M.put_in_active_hand(W) W.add_fingerprint(M) - //SN src = null del(src) return if("axe") var/obj/item/weapon/melee/energy/axe/W = new /obj/item/weapon/melee/energy/axe( M ) - if (M.hand) - M.l_hand = W - M.update_inv_l_hand() - else - M.r_hand = W - M.update_inv_r_hand() - W.layer = 20 + M.put_in_active_hand(W) W.add_fingerprint(M) - //SN src = null del(src) return else @@ -195,7 +153,6 @@ PHOTOGRAPHS /obj/structure/bedsheetbin/attackby(obj/item/weapon/W as obj, mob/user as mob) if (istype(W, /obj/item/weapon/bedsheet)) - //W = null del(W) src.amount++ return diff --git a/code/game/objects/new_year.dm b/code/game/objects/new_year.dm index 07dbac30bdf..cf386ba4abb 100644 --- a/code/game/objects/new_year.dm +++ b/code/game/objects/new_year.dm @@ -59,7 +59,7 @@ slot_flags = SLOT_BELT /obj/item/weapon/firbang/afterattack(atom/target as mob|obj|turf|area, mob/user as mob) - if (user.equipped() == src) + if (user.get_active_hand() == src) if ((CLUMSY in usr.mutations) && prob(50)) user << "\red Huh? How does this thing work?!" src.state = 1 diff --git a/code/game/objects/radio/electropack.dm b/code/game/objects/radio/electropack.dm index 8a7ea4a4fcf..f0c6b29cc0e 100644 --- a/code/game/objects/radio/electropack.dm +++ b/code/game/objects/radio/electropack.dm @@ -50,28 +50,23 @@ if (istype(W, /obj/item/clothing/head/helmet)) var/obj/item/assembly/shock_kit/A = new /obj/item/assembly/shock_kit( user ) A.icon = 'assemblies.dmi' + user.u_equip(W) W.loc = A A.part1 = W - W.layer = initial(W.layer) - if (user.client) - user.client.screen -= W - if (user.r_hand == W) - user.u_equip(W) - user.r_hand = A - user.update_inv_r_hand() + + if(user.r_hand == W) + user.put_in_r_hand(A) else - user.u_equip(W) - user.l_hand = A - user.update_inv_l_hand() + user.put_in_l_hand(A) + W.master = A src.master = A - src.layer = initial(src.layer) + user.u_equip(src) - if (user.client) - user.client.screen -= src + src.loc = A A.part2 = src - A.layer = 20 + src.add_fingerprint(user) A.add_fingerprint(user) return diff --git a/code/game/objects/radio/radio.dm b/code/game/objects/radio/radio.dm index a11e47f6a2b..62e40809092 100644 --- a/code/game/objects/radio/radio.dm +++ b/code/game/objects/radio/radio.dm @@ -189,21 +189,14 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use // now transform the regular radio, into a (disguised)syndicate uplink! var/obj/item/device/uplink/radio/T = traitorradio var/obj/item/device/radio/R = src + + usr.u_equip(R) R.loc = T - T.loc = usr - R.layer = 0 - if (usr.client) - usr.client.screen -= R - if (usr.r_hand == R) - usr.u_equip(R) - usr.r_hand = T - usr.update_inv_r_hand() + if(usr.r_hand == R) + usr.put_in_r_hand(T) else - usr.u_equip(R) - usr.l_hand = T - usr.update_inv_l_hand() - R.loc = T - T.layer = 20 + usr.put_in_l_hand(T) + T.attack_self(usr) return else if (href_list["talk"]) @@ -219,7 +212,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use channels[chan_name] |= FREQ_LISTENING else if (href_list["wires"]) var/t1 = text2num(href_list["wires"]) - if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) )) + if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) )) return if (wires & t1) wires &= ~t1 diff --git a/code/game/objects/shooting_range.dm b/code/game/objects/shooting_range.dm index 6731b3e9e2c..db493d66d92 100644 --- a/code/game/objects/shooting_range.dm +++ b/code/game/objects/shooting_range.dm @@ -49,7 +49,7 @@ pinned_target.loc = user.loc if(ishuman(user)) if(!user.get_active_hand()) - user.put_in_hand(pinned_target) + user.put_in_hands(pinned_target) user << "You take the target out of the stake." else pinned_target.loc = get_turf_loc(user) @@ -119,7 +119,7 @@ loc = user.loc if(ishuman(user)) if(!user.get_active_hand()) - user.put_in_hand(src) + user.put_in_hands(src) user << "You take the target out of the stake." else src.loc = get_turf_loc(user) diff --git a/code/game/objects/stacks/glass.dm b/code/game/objects/stacks/glass.dm index d850bd8bce0..4e1dc4d136f 100644 --- a/code/game/objects/stacks/glass.dm +++ b/code/game/objects/stacks/glass.dm @@ -38,7 +38,7 @@ SHARDS var/replace = (user.get_inactive_hand()==G) G.use(1) if (!G && !RG && replace) - user.put_in_hand(RG) + user.put_in_hands(RG) else return ..() diff --git a/code/game/objects/stacks/metal.dm b/code/game/objects/stacks/metal.dm index e45650f7a28..ce170b3a4ed 100644 --- a/code/game/objects/stacks/metal.dm +++ b/code/game/objects/stacks/metal.dm @@ -29,7 +29,7 @@ FLOOR TILES var/replace = (user.get_inactive_hand()==R) R.use(2) if (!R && replace) - user.put_in_hand(new_item) + user.put_in_hands(new_item) return ..() diff --git a/code/game/objects/stacks/stack.dm b/code/game/objects/stacks/stack.dm index 1a8ed78d7c0..0db64da3805 100644 --- a/code/game/objects/stacks/stack.dm +++ b/code/game/objects/stacks/stack.dm @@ -52,7 +52,7 @@ if (user.get_inactive_hand() == src) var/obj/item/stack/F = new src.type( user, amount=1) F.copy_evidences(src) - user.put_in_hand(F) + user.put_in_hands(F) src.add_fingerprint(user) F.add_fingerprint(user) use(1) @@ -165,7 +165,7 @@ /obj/item/stack/Topic(href, href_list) ..() - if ((usr.restrained() || usr.stat || usr.equipped() != src)) + if ((usr.restrained() || usr.stat || usr.get_active_hand() != src)) return if (href_list["make"]) if (src.amount < 1) del(src) //Never should happen @@ -204,7 +204,7 @@ usr.before_take_item(oldsrc) del(oldsrc) if (istype(O,/obj/item)) - usr.put_in_hand(O) + usr.put_in_hands(O) O.add_fingerprint(usr) //BubbleWrap - so newly formed boxes are empty if ( istype(O, /obj/item/weapon/storage) ) diff --git a/code/game/objects/stool.dm b/code/game/objects/stool.dm index 937001471ce..686581b41f4 100644 --- a/code/game/objects/stool.dm +++ b/code/game/objects/stool.dm @@ -49,8 +49,8 @@ if(buckled_mob) if(buckled_mob.buckled == src) //this is probably unneccesary, but it doesn't hurt buckled_mob.buckled = null - buckled_mob.anchored = 0 - buckled_mob.lying = 0 + buckled_mob.anchored = initial(buckled_mob.anchored) + buckled_mob.update_canmove() buckled_mob = null return @@ -74,7 +74,7 @@ /obj/structure/stool/bed/proc/buckle_mob(mob/M as mob, mob/user as mob) if (!ticker) user << "You can't buckle anyone in before the game starts." - if ((!( istype(M, /mob) ) || get_dist(src, user) > 1 || M.loc != src.loc || user.restrained() || usr.stat || M.buckled || istype(user, /mob/living/silicon/pai))) + if ( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.restrained() || usr.stat || M.buckled || istype(user, /mob/living/silicon/pai) ) return unbuckle() @@ -89,10 +89,10 @@ "\blue [M.name] is buckled in to [src] by [user.name]!",\ "You are buckled in to [src] by [user.name].",\ "You hear metal clanking") - M.anchored = 1 M.buckled = src M.loc = src.loc M.dir = src.dir + M.update_canmove() src.buckled_mob = M src.add_fingerprint(user) return @@ -100,8 +100,6 @@ /obj/structure/stool/bed/MouseDrop_T(mob/M as mob, mob/user as mob) if(!istype(M)) return buckle_mob(M, user) -// M.lying = 1 -// M.update_icons() //update our icons to reflect our lying/standing status return /obj/structure/stool/bed/attack_paw(mob/user as mob) @@ -137,7 +135,6 @@ /obj/structure/stool/bed/chair/MouseDrop_T(mob/M as mob, mob/user as mob) if(!istype(M)) return buckle_mob(M, user) -// M.update_icons() //update our icons to reflect our lying/standing status return //roller bed @@ -155,7 +152,7 @@ buckled_mob.loc = src.loc /obj/structure/stool/bed/roller/buckle_mob(mob/M as mob, mob/user as mob) - if ((!( istype(M, /mob) ) || get_dist(src, user) > 1 || M.loc != src.loc || user.restrained() || usr.stat || M.buckled || istype(usr, /mob/living/silicon/pai))) + if ( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.restrained() || usr.stat || M.buckled || istype(usr, /mob/living/silicon/pai) ) return M.pixel_y = 6 density = 1 @@ -165,9 +162,12 @@ /obj/structure/stool/bed/roller/manual_unbuckle(mob/user as mob) if(buckled_mob) - buckled_mob.pixel_y = 0 - buckled_mob.anchored = 0 - buckled_mob.buckled = null + if(buckled_mob.buckled == src) //this is probably unneccesary, but it doesn't hurt + buckled_mob.pixel_y = 0 + buckled_mob.anchored = initial(buckled_mob.anchored) + buckled_mob.buckled = null + buckled_mob.update_canmove() + buckled_mob = null density = 0 icon_state = "down" ..() diff --git a/code/game/objects/storage/backpack.dm b/code/game/objects/storage/backpack.dm index 6774c5ef6ef..dbb3266a150 100644 --- a/code/game/objects/storage/backpack.dm +++ b/code/game/objects/storage/backpack.dm @@ -5,17 +5,13 @@ return ..() playsound(src.loc, "rustle", 50, 1, -5) if ((!( M.restrained() ) && !( M.stat ) && M.back == src)) - if (over_object.name == "r_hand") - if (!( M.r_hand )) + switch(over_object.name) + if("r_hand") M.u_equip(src) - M.r_hand = src - M.update_inv_r_hand() - else - if (over_object.name == "l_hand") - if (!( M.l_hand )) - M.u_equip(src) - M.l_hand = src - M.update_inv_l_hand() + M.put_in_r_hand(src) + if("l_hand") + M.u_equip(src) + M.put_in_l_hand(src) src.add_fingerprint(usr) return if(over_object == usr && in_range(src, usr) || usr.contents.Find(src)) diff --git a/code/game/objects/storage/belt.dm b/code/game/objects/storage/belt.dm index 9e40edb46c4..cd9fd76b60c 100644 --- a/code/game/objects/storage/belt.dm +++ b/code/game/objects/storage/belt.dm @@ -23,17 +23,13 @@ return ..() playsound(src.loc, "rustle", 50, 1, -5) if (!M.restrained() && !M.stat && can_use()) - if (over_object.name == "r_hand") - if (!( M.r_hand )) + switch(over_object.name) + if("r_hand") M.u_equip(src) - M.r_hand = src - M.update_inv_r_hand() - else - if (over_object.name == "l_hand") - if (!( M.l_hand )) - M.u_equip(src) - M.l_hand = src - M.update_inv_l_hand() + M.put_in_r_hand(src) + if("l_hand") + M.u_equip(src) + M.put_in_l_hand(src) src.add_fingerprint(usr) return diff --git a/code/game/objects/storage/bible.dm b/code/game/objects/storage/bible.dm index 078b918ed08..20b72dad862 100644 --- a/code/game/objects/storage/bible.dm +++ b/code/game/objects/storage/bible.dm @@ -94,17 +94,13 @@ if (!( istype(over_object, /obj/screen) )) return ..() if ((!( M.restrained() ) && !( M.stat ))) - if (over_object.name == "r_hand") - if (!( M.r_hand )) + switch(over_object.name) + if("r_hand") M.u_equip(src) - M.r_hand = src - M.update_inv_r_hand() - else - if (over_object.name == "l_hand") - if (!( M.l_hand )) - M.u_equip(src) - M.l_hand = src - M.update_inv_l_hand() + M.put_in_r_hand(src) + if("l_hand") + M.u_equip(src) + M.put_in_l_hand(src) src.add_fingerprint(usr) return if(over_object == usr && in_range(src, usr) || usr.contents.Find(src)) diff --git a/code/game/objects/storage/storage.dm b/code/game/objects/storage/storage.dm index f7c8851b964..ca7c7aa9054 100644 --- a/code/game/objects/storage/storage.dm +++ b/code/game/objects/storage/storage.dm @@ -33,9 +33,8 @@ user.show_message(text("\red You reach into the [src.name], but there was a live mousetrap in there!"), 1) else user.show_message(text("\red [user] reaches into the [src.name] and sets off a hidden mousetrap!"), 1) - MT.loc = user.loc + user.drop_from_inventory(MT) MT.triggered(user, user.hand ? "l_hand" : "r_hand") - MT.layer = OBJ_LAYER return user.client.screen -= src.boxes user.client.screen -= src.closer @@ -207,11 +206,11 @@ if(ishuman(user)) var/mob/living/carbon/human/H = user if(H.l_store == src && !H.get_active_hand()) - H.put_in_hand(src) + H.put_in_hands(src) H.l_store = null return if(H.r_store == src && !H.get_active_hand()) - H.put_in_hand(src) + H.put_in_hands(src) H.r_store = null return @@ -370,17 +369,13 @@ if (!( istype(over_object, /obj/screen) )) return ..() if ((!( M.restrained() ) && !( M.stat ) /*&& M.pocket == src*/)) - if (over_object.name == "r_hand") - if (!( M.r_hand )) + switch(over_object.name) + if("r_hand") M.u_equip(src) - M.r_hand = src - M.update_inv_r_hand() - else - if (over_object.name == "l_hand") - if (!( M.l_hand )) - M.u_equip(src) - M.l_hand = src - M.update_inv_l_hand() + M.put_in_r_hand(src) + if("l_hand") + M.u_equip(src) + M.put_in_l_hand(src) src.add_fingerprint(usr) return if(over_object == usr && in_range(src, usr) || usr.contents.Find(src)) diff --git a/code/game/objects/tables_racks.dm b/code/game/objects/tables_racks.dm index 3be189a0534..42141d6ab0e 100644 --- a/code/game/objects/tables_racks.dm +++ b/code/game/objects/tables_racks.dm @@ -125,7 +125,7 @@ TABLE AND RACK OBJECT INTERATIONS /obj/structure/table/MouseDrop_T(obj/O as obj, mob/user as mob) - if ((!( istype(O, /obj/item/weapon) ) || user.equipped() != O)) + if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O)) return if(isrobot(user)) return @@ -323,7 +323,7 @@ TABLE AND RACK OBJECT INTERATIONS return 0 /obj/structure/rack/MouseDrop_T(obj/O as obj, mob/user as mob) - if ((!( istype(O, /obj/item/weapon) ) || user.equipped() != O)) + if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O)) return if(isrobot(user)) return diff --git a/code/game/objects/toys.dm b/code/game/objects/toys.dm index bebb5262fd2..cfe831d482f 100644 --- a/code/game/objects/toys.dm +++ b/code/game/objects/toys.dm @@ -41,17 +41,13 @@ CRAYONS if (!( istype(over_object, /obj/screen) )) return ..() if ((!( M.restrained() ) && !( M.stat ))) - if (over_object.name == "r_hand") - if (!( M.r_hand )) + switch(over_object.name) + if("r_hand") M.u_equip(src) - M.r_hand = src - M.update_inv_r_hand() - else - if (over_object.name == "l_hand") - if (!( M.l_hand )) - M.u_equip(src) - M.l_hand = src - M.update_inv_l_hand() + M.put_in_r_hand(src) + if("l_hand") + M.u_equip(src) + M.put_in_l_hand(src) src.add_fingerprint(usr) return if(over_object == usr && in_range(src, usr) || usr.contents.Find(src)) diff --git a/code/game/objects/uplinks.dm b/code/game/objects/uplinks.dm index 3008f28c605..6deb80a9029 100644 --- a/code/game/objects/uplinks.dm +++ b/code/game/objects/uplinks.dm @@ -528,7 +528,7 @@ A list of items and costs is stored under the datum of every game mode, alongsid var/mob/L = src.loc R.loc = T T.loc = L - // R.layer = initial(R.layer) + // R.layer = initial(R.layer) //TODO: CARN R.layer = 0 if (istype(L)) if (L.client) diff --git a/code/game/objects/watercloset.dm b/code/game/objects/watercloset.dm index 77487322946..2485e6f7c73 100644 --- a/code/game/objects/watercloset.dm +++ b/code/game/objects/watercloset.dm @@ -31,7 +31,7 @@ if(ishuman(user)) if(!user.get_active_hand()) I.loc = user.loc - user.put_in_hand(I) + user.put_in_hands(I) else I.loc = get_turf(src) user << "You find \an [I] in the cistern." diff --git a/code/game/throwing.dm b/code/game/throwing.dm index ad398a47335..b0ffcacb647 100644 --- a/code/game/throwing.dm +++ b/code/game/throwing.dm @@ -1,17 +1,10 @@ /mob/living/carbon/proc/toggle_throw_mode() - var/W = equipped() + var/obj/item/W = get_active_hand() if( !W )//Not holding anything if( client && (TK in mutations) ) - if (hand) - l_hand = new/obj/item/tk_grab(src) - l_hand:host = src - l_hand.screen_loc = ui_lhand - client.screen += l_hand - else - r_hand = new/obj/item/tk_grab(src) - r_hand:host = src - r_hand.screen_loc = ui_rhand - client.screen += r_hand + var/obj/item/tk_grab/O = new(src) + put_in_active_hand(O) + O.host = src return if( istype(W,/obj/item/tk_grab) ) @@ -39,7 +32,7 @@ return if(target.type == /obj/screen) return - var/atom/movable/item = src.equipped() + var/atom/movable/item = src.get_active_hand() if(!item) return diff --git a/code/game/turf.dm b/code/game/turf.dm index e9d3c804fcb..aeb96227243 100644 --- a/code/game/turf.dm +++ b/code/game/turf.dm @@ -567,7 +567,7 @@ sleep(100) if( !istype(src, /turf/simulated/wall) || !user || !WT || !WT.isOn() || !T ) return - if( user.loc == T && user.equipped() == WT ) + if( user.loc == T && user.get_active_hand() == WT ) user << "You remove the outer plating." dismantle_wall() else @@ -584,7 +584,7 @@ sleep(60) if( !istype(src, /turf/simulated/wall) || !user || !W || !T ) return - if( user.loc == T && user.equipped() == W ) + if( user.loc == T && user.get_active_hand() == W ) user << "You remove the outer plating." dismantle_wall() for(var/mob/O in viewers(user, 5)) @@ -601,7 +601,7 @@ sleep(60) if( !istype(src, /turf/simulated/wall) || !user || !W || !T ) return - if( user.loc == T && user.equipped() == W ) + if( user.loc == T && user.get_active_hand() == W ) user << "Your drill tears though the last of the reinforced plating." dismantle_wall() for(var/mob/O in viewers(user, 5)) @@ -620,7 +620,7 @@ sleep(70) if( !istype(src, /turf/simulated/wall) || !user || !EB || !T ) return - if( user.loc == T && user.equipped() == W ) + if( user.loc == T && user.get_active_hand() == W ) EB.spark_system.start() playsound(src.loc, "sparks", 50, 1) playsound(src.loc, 'blade1.ogg', 50, 1) @@ -711,7 +711,7 @@ sleep(40) if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return - if( d_state == 1 && user.loc == T && user.equipped() == W ) + if( d_state == 1 && user.loc == T && user.get_active_hand() == W ) src.d_state = 2 src.icon_state = "r_wall-2" user << "You remove the support lines." @@ -741,7 +741,7 @@ sleep(60) if( !istype(src, /turf/simulated/wall/r_wall) || !user || !WT || !WT.isOn() || !T ) return - if( d_state == 2 && user.loc == T && user.equipped() == WT ) + if( d_state == 2 && user.loc == T && user.get_active_hand() == WT ) src.d_state = 3 src.icon_state = "r_wall-3" user << "You press firmly on the cover, dislodging it." @@ -757,7 +757,7 @@ sleep(40) if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return - if( d_state == 2 && user.loc == T && user.equipped() == W ) + if( d_state == 2 && user.loc == T && user.get_active_hand() == W ) src.d_state = 3 src.icon_state = "r_wall-3" user << "You press firmly on the cover, dislodging it." @@ -772,7 +772,7 @@ sleep(100) if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return - if( d_state == 3 && user.loc == T && user.equipped() == W ) + if( d_state == 3 && user.loc == T && user.get_active_hand() == W ) src.d_state = 4 src.icon_state = "r_wall-4" user << "You pry off the cover." @@ -787,7 +787,7 @@ sleep(40) if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return - if( d_state == 4 && user.loc == T && user.equipped() == W ) + if( d_state == 4 && user.loc == T && user.get_active_hand() == W ) src.d_state = 5 src.icon_state = "r_wall-5" user << "You remove the bolts anchoring the support rods." @@ -804,7 +804,7 @@ sleep(100) if( !istype(src, /turf/simulated/wall/r_wall) || !user || !WT || !WT.isOn() || !T ) return - if( d_state == 5 && user.loc == T && user.equipped() == WT ) + if( d_state == 5 && user.loc == T && user.get_active_hand() == WT ) src.d_state = 6 src.icon_state = "r_wall-6" new /obj/item/stack/rods( src ) @@ -821,7 +821,7 @@ sleep(70) if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return - if( d_state == 5 && user.loc == T && user.equipped() == W ) + if( d_state == 5 && user.loc == T && user.get_active_hand() == W ) src.d_state = 6 src.icon_state = "r_wall-6" new /obj/item/stack/rods( src ) @@ -837,7 +837,7 @@ sleep(100) if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return - if( user.loc == T && user.equipped() == W ) + if( user.loc == T && user.get_active_hand() == W ) user << "You pry off the outer sheath." dismantle_wall() return @@ -852,7 +852,7 @@ sleep(200) if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return - if( user.loc == T && user.equipped() == W ) + if( user.loc == T && user.get_active_hand() == W ) user << "Your drill tears though the last of the reinforced plating." dismantle_wall() @@ -865,7 +865,7 @@ sleep( max(20*d_state,100) ) //time taken to repair is proportional to the damage! (max 10 seconds) if( !istype(src, /turf/simulated/wall/r_wall) || !user || !MS || !T ) return - if( user.loc == T && user.equipped() == MS && d_state ) + if( user.loc == T && user.get_active_hand() == MS && d_state ) src.d_state = 0 src.icon_state = "r_wall" relativewall_neighbours() //call smoothwall stuff diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index dff13da6bc8..e6b65e2f3a4 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_slot(W) + M.drop_from_inventory(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_slot(W) + M.drop_from_inventory(W) //teleport person to cell M.Paralyse(5) sleep(5) //so they black out before warping diff --git a/code/modules/chemical/Chemistry-Reagents.dm b/code/modules/chemical/Chemistry-Reagents.dm index 739f75189ec..cb81ecf7c60 100644 --- a/code/modules/chemical/Chemistry-Reagents.dm +++ b/code/modules/chemical/Chemistry-Reagents.dm @@ -989,7 +989,7 @@ datum for(var/mob/living/carbon/metroid/M in T) M.adjustToxLoss(rand(5,10)) - reaction_mob(var/mob/M, var/method=TOUCH, var/volume) + reaction_mob(var/mob/M, var/method=TOUCH, var/volume) //TODO: CARN M.clean_blood() if(istype(M, /mob/living/carbon)) var/mob/living/carbon/C = M diff --git a/code/modules/chemical/Chemistry-Tools.dm b/code/modules/chemical/Chemistry-Tools.dm index c45e346dcb7..75e2287c74a 100644 --- a/code/modules/chemical/Chemistry-Tools.dm +++ b/code/modules/chemical/Chemistry-Tools.dm @@ -1384,43 +1384,43 @@ switch(trash) if ("raisins") var/obj/item/trash/raisins/T = new /obj/item/trash/raisins/( M ) - M.put_in_hand(T) + M.put_in_hands(T) if ("candy") var/obj/item/trash/candy/T = new /obj/item/trash/candy/( M ) - M.put_in_hand(T) + M.put_in_hands(T) if ("cheesie") var/obj/item/trash/cheesie/T = new /obj/item/trash/cheesie/( M ) - M.put_in_hand(T) + M.put_in_hands(T) if ("chips") var/obj/item/trash/chips/T = new /obj/item/trash/chips/( M ) - M.put_in_hand(T) + M.put_in_hands(T) if ("popcorn") var/obj/item/trash/popcorn/T = new /obj/item/trash/popcorn/( M ) - M.put_in_hand(T) + M.put_in_hands(T) if ("sosjerky") var/obj/item/trash/sosjerky/T = new /obj/item/trash/sosjerky/( M ) - M.put_in_hand(T) + M.put_in_hands(T) if ("syndi_cakes") var/obj/item/trash/syndi_cakes/T = new /obj/item/trash/syndi_cakes/( M ) - M.put_in_hand(T) + M.put_in_hands(T) if ("waffles") var/obj/item/trash/waffles/T = new /obj/item/trash/waffles/( M ) - M.put_in_hand(T) + M.put_in_hands(T) if ("plate") var/obj/item/trash/plate/T = new /obj/item/trash/plate/( M ) - M.put_in_hand(T) + M.put_in_hands(T) if ("snack_bowl") var/obj/item/trash/snack_bowl/T = new /obj/item/trash/snack_bowl/( M ) - M.put_in_hand(T) + M.put_in_hands(T) if ("pistachios") var/obj/item/trash/pistachios/T = new /obj/item/trash/pistachios/( M ) - M.put_in_hand(T) + M.put_in_hands(T) if ("semki") var/obj/item/trash/semki/T = new /obj/item/trash/semki/( M ) - M.put_in_hand(T) + M.put_in_hands(T) if ("tray") var/obj/item/trash/tray/T = new /obj/item/trash/tray/( M ) - M.put_in_hand(T) + M.put_in_hands(T) return attackby(obj/item/weapon/W as obj, mob/user as mob) @@ -1431,6 +1431,7 @@ 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 :[ del(src) return 0 if(istype(M, /mob/living/carbon)) @@ -1491,6 +1492,7 @@ if(!reagents.total_volume) if(M == user) user << "\red You finish eating [src]." else user << "\red [M] finishes eating [src]." + M.drop_from_inventory(src) //so icons update :[ del(src) playsound(M.loc,'eatfood.ogg', rand(10,50), 1) return 1 @@ -1833,22 +1835,14 @@ attackby(var/obj/D, mob/user as mob) if(isprox(D)) - var/obj/item/weapon/bucket_sensor/B = new /obj/item/weapon/bucket_sensor - B.loc = user - if (user.r_hand == D) - user.u_equip(D) - user.r_hand = B - user.update_inv_r_hand() - else - user.u_equip(D) - user.l_hand = B - user.update_inv_l_hand() - B.layer = 20 - user << "You add the sensor to the bucket" + user << "You add [D] to [src]." del(D) + user.put_in_hands(new /obj/item/weapon/bucket_sensor) + user.drop_from_inventory(src) del(src) -/obj/item/weapon/reagent_containers/glass/cantister +/* +/obj/item/weapon/reagent_containers/glass/canister //not used apparantly desc = "It's a canister. Mainly used for transporting fuel." name = "canister" icon = 'tank.dmi' @@ -1862,7 +1856,7 @@ possible_transfer_amounts = list(10,20,30,60) volume = 120 flags = FPRINT - +*/ /obj/item/weapon/reagent_containers/glass/dispenser name = "reagent glass" diff --git a/code/modules/detectivework/detective_work.dm b/code/modules/detectivework/detective_work.dm index 7b0eda82d87..dc6cb9293a8 100644 --- a/code/modules/detectivework/detective_work.dm +++ b/code/modules/detectivework/detective_work.dm @@ -148,7 +148,7 @@ obj/machinery/computer/forensic_scanning temp = "Eject Failed: No Object" if("insert") var/mob/M = usr - var/obj/item/I = M.equipped() + var/obj/item/I = M.get_active_hand() if(I && istype(I)) if(istype(I, /obj/item/weapon/evidencebag)) scanning = I.contents[1] @@ -163,7 +163,7 @@ obj/machinery/computer/forensic_scanning usr << "Invalid Object Rejected." if("card") //Processing a fingerprint card. var/mob/M = usr - var/obj/item/I = M.equipped() + var/obj/item/I = M.get_active_hand() if(!(I && istype(I,/obj/item/weapon/f_card))) I = card if(I && istype(I,/obj/item/weapon/f_card)) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index c96f1d86e3d..9e458887ce3 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -347,16 +347,20 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/ite /obj/item/clothing/suit/space/nasavoid, /obj/item/weapon/tank) /proc/fake_attack(var/mob/target) - var/list/possible_clones = new/list() +// var/list/possible_clones = new/list() var/mob/living/carbon/human/clone = null var/clone_weapon = null for(var/mob/living/carbon/human/H in world) if(H.stat || H.lying) continue - possible_clones += H +// possible_clones += H + clone = H + break //changed the code a bit. Less randomised, but less work to do. Should be ok, world.contents aren't stored in any particular order. + +// if(!possible_clones.len) return +// clone = pick(possible_clones) + if(!clone) return - if(!possible_clones.len) return - clone = pick(possible_clones) //var/obj/effect/fake_attacker/F = new/obj/effect/fake_attacker(outside_range(target)) var/obj/effect/fake_attacker/F = new/obj/effect/fake_attacker(target.loc) if(clone.l_hand) diff --git a/code/modules/food/food.dm b/code/modules/food/food.dm index ca1570fd00a..857e28da164 100644 --- a/code/modules/food/food.dm +++ b/code/modules/food/food.dm @@ -636,7 +636,7 @@ var/mob/M = usr var/obj/item/stack/rods/W = new /obj/item/stack/rods( M ) M << "\blue You lick clean the rod." - M.put_in_hand(W) + M.put_in_hands(W) /obj/item/weapon/reagent_containers/food/snacks/monkeykabob name = "Meat-kabob" @@ -651,7 +651,7 @@ var/mob/M = usr var/obj/item/stack/rods/W = new /obj/item/stack/rods( M ) M << "\blue You lick clean the rod." - M.put_in_hand(W) + M.put_in_hands(W) /obj/item/weapon/reagent_containers/food/snacks/tofukabob name = "Tofu-kabob" @@ -666,7 +666,7 @@ var/mob/M = usr var/obj/item/stack/rods/W = new /obj/item/stack/rods( M ) M << "\blue You lick clean the rod." - M.put_in_hand(W) + M.put_in_hands(W) /obj/item/weapon/reagent_containers/food/snacks/cubancarp name = "Cuban Carp" @@ -813,7 +813,7 @@ "\blue [M] takes a piece of paper from the cookie!", \ "\blue You take a piece of paper from the cookie! Read it!" \ ) - M.put_in_hand(paper) + M.put_in_hands(paper) paper.add_fingerprint(M) /obj/item/weapon/reagent_containers/food/snacks/badrecipe diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 48a52ef2ddd..accd65a20c4 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -342,7 +342,7 @@ playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better sleep(40) - if ((user.loc == T && user.equipped() == W)) + if ((user.loc == T && user.get_active_hand() == W)) user << "\blue You dug a hole." gets_dug() @@ -359,7 +359,7 @@ playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better sleep(30) - if ((user.loc == T && user.equipped() == W)) + if ((user.loc == T && user.get_active_hand() == W)) user << "\blue You dug a hole." gets_dug() @@ -376,7 +376,7 @@ playsound(src.loc, 'rustle1.ogg', 50, 1) //russle sounds sounded better sleep(0) - if ((user.loc == T && user.equipped() == W)) + if ((user.loc == T && user.get_active_hand() == W)) user << "\blue You dug a hole." gets_dug() diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index f62afc296c1..e256238e8b0 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -1,116 +1,152 @@ +//These procs handle putting s tuff in your hand. It's probably best to use these rather than setting l_hand = ...etc +//as they handle all relevant stuff like adding it to the player's screen and updating their overlays. + +//Returns the thing in our active hand /mob/proc/get_active_hand() - if (hand) - return l_hand - else - return r_hand + if(hand) return l_hand + else return r_hand +//Returns the thing in our inactive hand /mob/proc/get_inactive_hand() - if (!hand) - return l_hand - else - return r_hand + if(hand) return r_hand + else return l_hand -/mob/proc/put_in_hand(var/obj/item/I) - if(!I) return - I.loc = src - if (hand) - l_hand = I + +//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success. +/mob/proc/put_in_l_hand(var/obj/item/W) + if(!W) return 0 + if(lying) return 0 + if(!l_hand) + W.loc = src //TODO: move to equipped? + l_hand = W + W.layer = 20 //TODO: move to equipped? +// l_hand.screen_loc = ui_lhand + W.equipped(src,"l_hand") + if(client) client.screen |= W update_inv_l_hand() - else - r_hand = I - update_inv_r_hand() - I.layer = 20 + return 1 + return 0 -/mob/proc/put_in_hands(var/obj/item/I) //A suprisingly useful proc. Allows a simple way to place an object in a mob's hands, or, if they are full, on the ground below them. +//Puts the item into your r_hand if possible and calls all necessary triggers/updates. returns 1 on success. +/mob/proc/put_in_r_hand(var/obj/item/W) + if(!W) return 0 + if(lying) return 0 if(!r_hand) - I.loc = src - r_hand = I + W.loc = src + r_hand = W + W.layer = 20 +// r_hand.screen_loc = ui_rhand + W.equipped(src,"r_hand") + if(client) client.screen |= W update_inv_r_hand() - I.layer = 20 - else if(!l_hand) - I.loc = src - l_hand = I - update_inv_l_hand() - I.layer = 20 + return 1 + return 0 + +//Puts the item into our active hand if possible. returns 1 on success. +/mob/proc/put_in_active_hand(var/obj/item/W) + if(hand) return put_in_l_hand(W) + else return put_in_r_hand(W) + +//Puts the item into our inactive hand if possible. returns 1 on success. +/mob/proc/put_in_inactive_hand(var/obj/item/W) + if(hand) return put_in_r_hand(W) + else return put_in_l_hand(W) + +//Puts the item our active hand if possible. Failing that it tries our inactive hand. Returns 1 on success. +//If both fail it drops it on the floor and returns 0. +//This is probably the main one you need to know :) +/mob/proc/put_in_hands(var/obj/item/W) + if(!W) return 0 + if(put_in_active_hand(W)) return 1 + else if(put_in_inactive_hand(W)) return 1 else - I.loc = get_turf(src) + W.loc = get_turf(src) + return 0 -/mob/proc/drop_item_v() - if (stat == 0) - drop_item() - return -/mob/proc/drop_from_slot(var/obj/item/item) - if(!item) - return - if(!(item in contents)) - return - u_equip(item) - if (client) - client.screen -= item - if (item) - item.loc = loc - item.dropped(src) - if (item) - item.layer = initial(item.layer) - var/turf/T = get_turf(loc) - if (istype(T)) - T.Entered(item) - return -/mob/proc/drop_item(var/atom/target) - var/obj/item/W = equipped() +/mob/proc/drop_item_v() //this is dumb. + if(stat == CONSCIOUS) + return drop_item() + return 0 - if (W) + +/mob/proc/drop_from_inventory(var/obj/item/W) + if(W) + if(client) client.screen -= W u_equip(W) - update_icons() - if (client) - client.screen -= W - if (W) - W.layer = initial(W.layer) - if(target) - W.loc = target.loc - else - W.loc = loc - W.dropped(src) - var/turf/T = get_turf(loc) - if (istype(T)) - T.Entered(W) - return + W.layer = initial(W.layer) + W.loc = loc -/mob/proc/before_take_item(var/obj/item/item) - item.loc = null - item.layer = initial(item.layer) - u_equip(item) - //if (client) - // client.screen -= item + 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 + +//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 + +//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) + + + + + + + + + +//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 -/mob/proc/put_in_inactive_hand(var/obj/item/I) - I.loc = src - if (!hand) - l_hand = I - update_inv_l_hand() - else - r_hand = I - update_inv_r_hand() - I.layer = 20 - - -/mob/proc/equipped() - if(issilicon(src)) - if(isrobot(src)) - if(src:module_active) - return src:module_active - else - if (hand) - return l_hand - else - return r_hand - - - /mob/proc/u_equip(W as obj) if (W == r_hand) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 104d9a03c9e..5bf2e3847d7 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -401,14 +401,10 @@ return var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) G.assailant = M - if (M.hand) - M.l_hand = G - M.update_inv_l_hand() - else - M.r_hand = G - M.update_inv_r_hand() - G.layer = 20 G.affecting = src + + M.put_in_active_hand(G) + grabbed_by += G G.synch() diff --git a/code/modules/mob/living/carbon/alien/humanoid/inventory.dm b/code/modules/mob/living/carbon/alien/humanoid/inventory.dm index 300ccb08220..8da6f554592 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/inventory.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/inventory.dm @@ -20,7 +20,7 @@ update_inv_l_hand(0) /mob/living/carbon/alien/humanoid/db_click(text, t1) - var/obj/item/W = equipped() + var/obj/item/W = get_active_hand() var/emptyHand = (W == null) if ((!emptyHand) && (!istype(W, /obj/item))) return @@ -42,7 +42,7 @@ return u_equip(W) wear_suit = W - W.equipped(src, text) + W.get_active_hand(src, text) */ if("head") if (head) @@ -57,7 +57,7 @@ return u_equip(W) head = W - W.equipped(src, text) + W.get_active_hand(src, text) */ if("storage1") if (l_store) diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index 962d57edf65..9556f42bf75 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -17,9 +17,7 @@ ..() - if (src.stat != 2) //still breathing - - + if (src.stat != DEAD) //still breathing //First, resolve location and get a breath @@ -62,36 +60,25 @@ //Status updates, death etc. handle_regular_status_updates() - //Being buckled to a chair or bed - check_if_buckled() - - //Temporary, whilst I finish the regenerate_icons changes ~Carn - if( update_icon ) //forces a full overlay update - update_icon = 0 - regenerate_icons() - else if( lying != lying_prev ) - update_icons() - - if(client) - handle_regular_hud_updates() - // Yup. update_canmove() - clamp_values() - // Grabbing for(var/obj/item/weapon/grab/G in src) G.process() + if(client) + handle_regular_hud_updates() + + clamp_values() /mob/living/carbon/alien/humanoid proc clamp_values() - SetStunned(min(stunned, 20)) +// SetStunned(min(stunned, 20)) SetParalysis(min(paralysis, 20)) - SetWeakened(min(weakened, 20)) +// SetWeakened(min(weakened, 20)) sleeping = max(min(sleeping, 20), 0) adjustBruteLoss(0) adjustToxLoss(0) @@ -256,10 +243,6 @@ src.internals.icon_state = "internal0" return null - update_canmove() - if(paralysis || stunned || weakened || buckled) canmove = 0 - else canmove = 1 - handle_breath(datum/gas_mixture/breath) if(src.nodamage) return 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 14bef583094..3064b06ae6d 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm @@ -115,7 +115,7 @@ if(r_hand) var/t_state = r_hand.item_state if(!t_state) t_state = r_hand.icon_state - r_hand.screen_loc = ui_rhand +// r_hand.screen_loc = ui_rhand overlays_standing[X_R_HAND_LAYER] = image("icon" = 'items_righthand.dmi', "icon_state" = t_state) else overlays_standing[X_R_HAND_LAYER] = null @@ -125,7 +125,7 @@ if(l_hand) var/t_state = l_hand.item_state if(!t_state) t_state = l_hand.icon_state - l_hand.screen_loc = ui_lhand +// l_hand.screen_loc = ui_lhand overlays_standing[X_L_HAND_LAYER] = image("icon" = 'items_lefthand.dmi', "icon_state" = t_state) else overlays_standing[X_L_HAND_LAYER] = null diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index 6f15b4e504b..9e0234daaee 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -368,14 +368,10 @@ return var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) G.assailant = M - if (M.hand) - M.l_hand = G - M.update_inv_l_hand() - else - M.r_hand = G - M.update_inv_r_hand() - G.layer = 20 G.affecting = src + + M.put_in_active_hand(G) + grabbed_by += G G.synch() diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 098c28ebc20..f6a82d35c01 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -58,32 +58,26 @@ //Status updates, death etc. handle_regular_status_updates() - // Update clothing -// regenerate_icons() - - if(client) - handle_regular_hud_updates() - - //Being buckled to a chair or bed - check_if_buckled() - - // Yup. + //Handles updating canmove. update_canmove() - clamp_values() - // Grabbing for(var/obj/item/weapon/grab/G in src) G.process() + if(client) + handle_regular_hud_updates() + + clamp_values() + /mob/living/carbon/alien/larva proc clamp_values() - SetStunned(min(stunned, 20)) + // SetStunned(min(stunned, 20)) SetParalysis(min(paralysis, 20)) - SetWeakened(min(weakened, 20)) + // SetWeakened(min(weakened, 20)) sleeping = max(min(sleeping, 20), 0) handle_mutations_and_radiation() @@ -227,10 +221,6 @@ internals.icon_state = "internal0" return null - update_canmove() - if(paralysis || stunned || weakened || buckled) canmove = 0 - else canmove = 1 - handle_breath(datum/gas_mixture/breath) if(nodamage) return @@ -506,4 +496,4 @@ if(air_master.current_cycle%3==1) if(!M.nodamage) M.adjustBruteLoss(5) - nutrition += 10 + nutrition += 10 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index 0503eebb507..ce5beed7410 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -40,15 +40,13 @@ clamp_values() - - proc clamp_values() AdjustParalysis(0) - AdjustStunned(0) - AdjustWeakened(0) +// AdjustStunned(0) +// AdjustWeakened(0) adjustBruteLoss(0) adjustFireLoss(0) adjustOxyLoss(0) @@ -89,12 +87,6 @@ emote("gasp") updatehealth() - update_canmove() - if(in_contents_of(/obj/mecha)) - canmove = 1 - else - canmove = 0 - return handle_environment(datum/gas_mixture/environment) if(!environment) @@ -315,3 +307,7 @@ D.cure() return + update_canmove() + if(in_contents_of(/obj/mecha)) canmove = 1 + else canmove = 0 + return canmove \ 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 961b6270183..20bf80980ad 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -14,7 +14,7 @@ for(var/mob/M in hearers(4, src)) if(M.client) M.show_message(text("\red You hear something rumbling inside [src]'s stomach..."), 2) - var/obj/item/I = user.equipped() + var/obj/item/I = user.get_active_hand() if(I && I.force) var/d = rand(round(I.force / 4), I.force) if(istype(src, /mob/living/carbon/human)) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 8fb7f877341..2dc1f02ee0e 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -622,7 +622,7 @@ var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) O.source = usr O.target = src - O.item = usr.equipped() + O.item = usr.get_active_hand() O.s_loc = usr.loc O.t_loc = loc O.place = href_list["item"] @@ -692,7 +692,7 @@ if(full_body && ((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )) || (src.back || src.wear_mask || src.head || src.shoes || src.w_uniform || src.wear_suit || src.glasses || src.ears || src.gloves))) return 1 - if((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract ))) + if( (src.l_hand && !src.l_hand.abstract) || (src.r_hand && !src.r_hand.abstract) ) return 1 return 0 diff --git a/code/modules/mob/living/carbon/human/human_attackalien.dm b/code/modules/mob/living/carbon/human/human_attackalien.dm index 02192f29836..a3ae7879768 100644 --- a/code/modules/mob/living/carbon/human/human_attackalien.dm +++ b/code/modules/mob/living/carbon/human/human_attackalien.dm @@ -14,14 +14,10 @@ w_uniform.add_fingerprint(M) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) G.assailant = M - if (M.hand) - M.l_hand = G - M.update_inv_l_hand() - else - M.r_hand = G - M.update_inv_r_hand() - G.layer = 20 G.affecting = src + + M.put_in_active_hand(G) + grabbed_by += G G.synch() LAssailant = M diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 1d19b20a9a8..de1b510c88b 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -87,14 +87,10 @@ if(w_uniform) w_uniform.add_fingerprint(M) var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M) G.assailant = M - if (M.hand) - M.l_hand = G - M.update_inv_l_hand() - else - M.r_hand = G - M.update_inv_r_hand() - G.layer = 20 G.affecting = src + + M.put_in_active_hand(G) + grabbed_by += G G.synch() LAssailant = M diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 96d805ccede..e5ac5844946 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -559,7 +559,7 @@ It can still be worn/put on as normal. if(source.loc != s_loc) return if(target.loc != t_loc) return if(LinkBlocked(s_loc,t_loc)) return - if(item && source.equipped() != item) return + if(item && source.get_active_hand() != item) return if ((source.restrained() || source.stat)) return switch(place) if("mask") @@ -920,8 +920,8 @@ It can still be worn/put on as normal. W.add_fingerprint(source) else if (istype(item, /obj/item/weapon/handcuffs)) - target.drop_from_slot(target.r_hand) - target.drop_from_slot(target.l_hand) + target.drop_from_inventory(target.r_hand) + target.drop_from_inventory(target.l_hand) source.drop_item() target.handcuffed = item item.loc = target @@ -1012,7 +1012,7 @@ It can still be worn/put on as normal. return /mob/living/carbon/human/db_click(text, t1) - var/obj/item/W = equipped() + var/obj/item/W = get_active_hand() var/emptyHand = (W == null) if(emptyHand) usr.next_move = usr.prev_move diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index cbe9c6adb1d..7f4a194b409 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -68,16 +68,7 @@ //Status updates, death etc. UpdateLuminosity() handle_regular_status_updates() //TODO: optimise ~Carn - - //Being buckled to chairs/beds/etc - check_if_buckled() - - //Temporary, whilst I finish the regenerate_icons changes ~Carn - if( update_icon ) //forces a full overlay update - update_icon = 0 - regenerate_icons() - else if( lying != lying_prev ) - update_icons() + update_canmove() //TODO: remove from life() if viable ~Carn (read as: if it won't cause massive problems) //Update our name based on whether our face is obscured/disfigured name = get_visible_name() //TODO: this was broken by the dismemberment revert ~Carn @@ -85,10 +76,6 @@ if(client) handle_regular_hud_updates() - update_canmove() //TODO: check ~Carn - - clamp_values() //TODO: check that dmage procs aren't outputing bad values outside clamp ranges ~Carn - // Grabbing for(var/obj/item/weapon/grab/G in src) G.process() @@ -99,6 +86,9 @@ if(!currentTurf.sd_lumcount) playsound_local(src,pick(scarySounds),50, 1, -1) + clamp_values() //TODO: finish removing this ~Carn + + /mob/living/carbon/human/calculate_affecting_pressure(var/pressure) ..() var/pressure_difference = abs( pressure - ONE_ATMOSPHERE ) @@ -121,9 +111,9 @@ //This can probably be removed like Rockdtben suggested, but I'd like to go over the damage procs first just to be safe. //Perhaps code view-vars to be unable to directly edit the damagevariables without using procs proc/clamp_values() - stunned = max( min(stunned,20), 0 ) // positive and under 20 +// stunned = max( min(stunned,20), 0 ) // positive and under 20 paralysis = max( min(paralysis,20), 0 ) // positive and under 20 - weakened = max( min(weakened,20), 0 ) // positive and under 20 +// weakened = max( min(weakened,20), 0 ) // positive and under 20 sleeping = max( min(sleeping, 20), 0 ) // positive and under 20 oxyloss = max(oxyloss,0) // positive toxloss = max(toxloss,0) // positive @@ -376,14 +366,6 @@ internals.icon_state = "internal0" return null - proc/update_canmove() - if(stat || sleeping || paralysis || stunned || weakened || resting || buckled || (changeling && changeling.changeling_fakedeath)) - canmove = 0 - - else - lying = 0 - canmove = 1 - proc/handle_breath(datum/gas_mixture/breath) if(nodamage || REBREATHER in augmentations) @@ -754,100 +736,87 @@ return //TODO: DEFERRED proc/handle_regular_status_updates() - - // health = 100 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss()) - - if(getOxyLoss() > 50) Paralyse(3) - - if(health < config.health_threshold_dead || brain_op_stage == 4.0) - death() - else if(health < config.health_threshold_crit) - if(health <= 20 && prob(1)) spawn(0) emote("gasp") - - //if(!rejuv) oxyloss++ - if(!reagents.has_reagent("inaprovaline")) adjustOxyLoss(1) - - if(stat != DEAD) stat = UNCONSCIOUS - Paralyse(5) - - if (stat != DEAD) //Alive. - if (silent) - silent-- - - if (resting || sleeping || paralysis || stunned || weakened || (changeling && changeling.changeling_fakedeath)) //Stunned etc. - if (stunned > 0) - AdjustStunned(-1) - stat = CONSCIOUS - if (weakened > 0) - AdjustWeakened(-1) - lying = 1 - stat = CONSCIOUS - if (paralysis > 0) - AdjustParalysis(-1) - blinded = 1 - lying = 1 - stat = UNCONSCIOUS - - if (sleeping > 0) - handle_dreams() - adjustHalLoss(-5) - blinded = 1 - lying = 1 - stat = UNCONSCIOUS - if (prob(10) && health && !hal_crit) - spawn(0) - emote("snore") - sleeping-- - - if(resting) - lying = 1 - stat = CONSCIOUS - - var/h = hand - hand = 0 - drop_item() - hand = 1 - drop_item() - hand = h - - else //Not stunned. - lying = 0 - stat = CONSCIOUS - - else //Dead. - lying = 1 + if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP blinded = 1 stat = DEAD silent = 0 + else //ALIVE. LIGHTS ARE ON + if(health < config.health_threshold_dead || brain_op_stage == 4.0) + death() + blinded = 1 + stat = DEAD + silent = 0 + return 1 - if (stuttering) stuttering-- + stat = CONSCIOUS + if(getOxyLoss() > 50) + Paralyse(3) - if (eye_blind) - eye_blind-- - blinded = 1 + if(health < config.health_threshold_crit) //UNCONSCIOUS. NO-ONE IS HOME + if( health <= 20 && prob(1) ) + spawn(0) + emote("gasp") - if (ear_deaf > 0) ear_deaf-- - if (ear_damage < 25) - ear_damage -= 0.05 - ear_damage = max(ear_damage, 0) + if(!reagents.has_reagent("inaprovaline")) + adjustOxyLoss(1) - density = !( lying ) + stat = UNCONSCIOUS + Paralyse(5) - if ((sdisabilities & 1 || istype(glasses, /obj/item/clothing/glasses/blindfold))) - blinded = 1 - if ((sdisabilities & 4 || istype(ears, /obj/item/clothing/ears/earmuffs))) - ear_deaf = 1 + if(silent) + silent = max(silent-1, 0) - if (eye_blurry > 0) - eye_blurry-- - eye_blurry = max(0, eye_blurry) + if(stunned > 0) + AdjustStunned(-1) + if(weakened > 0) + AdjustWeakened(-1) - if (druggy > 0) - druggy-- - druggy = max(0, druggy) + //Incapacitated + if(paralysis > 0) + AdjustParalysis(-1) + blinded = 1 + stat = UNCONSCIOUS + if(sleeping > 0) + handle_dreams() + adjustHalLoss(-5) + blinded = 1 + stat = UNCONSCIOUS + if( prob(10) && health && !hal_crit ) + spawn(0) + emote("snore") + sleeping = max(sleeping-1, 0) + + if(stuttering) + stuttering = max(stuttering-1, 0) + + //Eyes & Ears + if(sdisabilities & 1) //disabled-blind, doesn't get better on its own + blinded = 1 + else if(eye_blind) //blindness, heals slowly over time + eye_blind = max(eye_blind-1,0) + blinded = 1 + else if(istype(glasses, /obj/item/clothing/glasses/blindfold)) //resting your eyes with a blindfold heals blurry eyes faster + eye_blurry = max(eye_blurry-3, 0) + blinded = 1 + else if(eye_blurry) //blurry eyes heal slowly + eye_blurry = max(eye_blurry-1, 0) + + if(sdisabilities & 4) //disabled-deaf, doesn't get better on its own + ear_deaf = max(ear_deaf, 1) + else if(ear_deaf) //deafness, heals slowly over time + ear_deaf = max(ear_deaf-1, 0) + else if(istype(ears, /obj/item/clothing/ears/earmuffs)) //resting your ears with earmuffs heals ear damage faster + ear_damage = max(ear_damage-0.15, 0) + ear_deaf = max(ear_deaf, 1) + else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs + ear_damage = max(ear_damage-0.05, 0) + + if(druggy) + druggy = max(druggy-1, 0) return 1 + proc/handle_regular_hud_updates() if(!client) return 0 diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 348a79faa1b..e18bef82358 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -127,6 +127,8 @@ Please contact me on #coderbus IRC. ~Carn x //this proc is messy as I was forced to include some old laggy cloaking code to it so that I don't break cloakers //I'll work on removing that stuff by rewriting some of the cloaking stuff at a later date. /mob/living/carbon/human/update_icons() + if(Debug2) world << "human/update_icons()" + lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again update_hud() //TODO: remove the need for this overlays = null @@ -354,19 +356,14 @@ Please contact me on #coderbus IRC. ~Carn x if(!t_color) t_color = icon_state var/image/lying = image("icon_state" = "[t_color]_l") var/image/standing = image("icon_state" = "[t_color]_s") + if( (FAT in mutations) ) if(w_uniform.flags&ONESIZEFITSALL) lying.icon = 'uniform_fat.dmi' standing.icon = 'uniform_fat.dmi' else src << "\red You burst out of \the [w_uniform]!" - var/obj/item/clothing/c = w_uniform - w_uniform = null - if(client) - client.screen -= c - c.loc = loc - c.dropped(src) - c.layer = initial(c.layer) + drop_from_inventory(w_uniform) lying = null standing = null else diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index 89bedffd23e..4ad92a47e17 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -451,14 +451,10 @@ return var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) G.assailant = M - if (M.hand) - M.l_hand = G - M.update_inv_l_hand() - else - M.r_hand = G - M.update_inv_r_hand() - G.layer = 20 G.affecting = src + + M.put_in_active_hand(G) + grabbed_by += G G.synch() @@ -557,14 +553,10 @@ return var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) G.assailant = M - if (M.hand) - M.l_hand = G - M.update_inv_l_hand() - else - M.r_hand = G - M.update_inv_r_hand() - G.layer = 20 G.affecting = src + + M.put_in_active_hand(G) + grabbed_by += G G.synch() diff --git a/code/modules/mob/living/carbon/monkey/inventory.dm b/code/modules/mob/living/carbon/monkey/inventory.dm index dfb461e054e..57f993a4747 100644 --- a/code/modules/mob/living/carbon/monkey/inventory.dm +++ b/code/modules/mob/living/carbon/monkey/inventory.dm @@ -66,7 +66,7 @@ if(source.loc != s_loc) return if(target.loc != t_loc) return if(LinkBlocked(s_loc,t_loc)) return - if(item && source.equipped() != item) return + if(item && source.get_active_hand() != item) return if ((source.restrained() || source.stat)) return switch(place) if("mask") diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index b82e45846ed..47f3f3c54c4 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -56,25 +56,13 @@ //Status updates, death etc. UpdateLuminosity() handle_regular_status_updates() + update_canmove() + clamp_values() + if(client) handle_regular_hud_updates() - //Being buckled to a chair or bed - check_if_buckled() - - //Temporary, whilst I finish the regenerate_icons changes ~Carn - if( update_icon ) //forces a full overlay update - update_icon = 0 - regenerate_icons() - else if( lying != lying_prev ) - update_icons() - - // Yup. - update_canmove() - - clamp_values() - // Grabbing for(var/obj/item/weapon/grab/G in src) G.process() @@ -93,10 +81,9 @@ proc/clamp_values() - - AdjustStunned(0) +// AdjustStunned(0) AdjustParalysis(0) - AdjustWeakened(0) +// AdjustWeakened(0) proc/handle_disabilities() @@ -250,10 +237,6 @@ src.internals.icon_state = "internal0" return null - proc/update_canmove() - if(paralysis || stunned || weakened || buckled || (changeling && changeling.changeling_fakedeath)) canmove = 0 - else canmove = 1 - proc/handle_breath(datum/gas_mixture/breath) if(src.nodamage) return diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index b3cb49b7130..a801fb81c43 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -85,7 +85,7 @@ var/obj/effect/equip_e/monkey/O = new /obj/effect/equip_e/monkey( ) O.source = usr O.target = src - O.item = usr.equipped() + O.item = usr.get_active_hand() O.s_loc = usr.loc O.t_loc = loc O.place = href_list["item"] @@ -211,14 +211,10 @@ var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) G.assailant = M - if (M.hand) - M.l_hand = G - M.update_inv_l_hand() - else - M.r_hand = G - M.update_inv_r_hand() - G.layer = 20 G.affecting = src + + M.put_in_active_hand(G) + grabbed_by += G G.synch() @@ -286,14 +282,10 @@ return var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) G.assailant = M - if (M.hand) - M.l_hand = G - M.update_inv_l_hand() - else - M.r_hand = G - M.update_inv_r_hand() - G.layer = 20 G.affecting = src + + M.put_in_active_hand(G) + grabbed_by += G G.synch() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 5e192c29963..b1dc87d48b5 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -173,22 +173,9 @@ /mob/living/proc/UpdateDamageIcon() return +/*CARN: Deprecated. Please use update_canmove() /mob/living/proc/check_if_buckled() - if (buckled) - density = 1 - if( istype(buckled, /obj/structure/stool/bed/chair) ) - lying = 0 - else - lying = 1 - else - density = !lying - if(lying) - var/h = hand - hand = 0 - drop_item() - hand = 1 - drop_item() - hand = h +*/ /mob/living/proc/Examine_OOC() set name = "Examine Meta-Info (OOC)" diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index bdc39671f4f..c0af35f8ca7 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -40,6 +40,7 @@ var/obj/item/weapon/cloaking_device/C = locate((/obj/item/weapon/cloaking_device) in src) if(C && C.active) C.attack_self(src)//Should shut it off + update_icons() src << "\blue Your [C.name] was disrupted!" Stun(2) diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm new file mode 100644 index 00000000000..534d22f5754 --- /dev/null +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -0,0 +1,79 @@ +//These procs handle putting s tuff in your hand. It's probably best to use these rather than setting stuff manually +//as they handle all relevant stuff like adding it to the player's screen and such + +//Returns the thing in our active hand (whatever is in our active module-slot, in this case) +/mob/living/silicon/robot/get_active_hand() + return module_active + + + +/*-------TODOOOOOOOOOO--------*/ +/mob/living/silicon/robot/proc/uneq_active() + if(isnull(module_active)) + return + if(module_state_1 == module_active) + if(istype(module_state_1,/obj/item/borg/sight)) + sight_mode &= ~module_state_1:sight_mode + if (client) + client.screen -= module_state_1 + contents -= module_state_1 + module_active = null + module_state_1 = null + inv1.icon_state = "inv1" + else if(module_state_2 == module_active) + if(istype(module_state_2,/obj/item/borg/sight)) + sight_mode &= ~module_state_2:sight_mode + if (client) + client.screen -= module_state_2 + contents -= module_state_2 + module_active = null + module_state_2 = null + inv2.icon_state = "inv2" + else if(module_state_3 == module_active) + if(istype(module_state_3,/obj/item/borg/sight)) + sight_mode &= ~module_state_3:sight_mode + if (client) + client.screen -= module_state_3 + contents -= module_state_3 + module_active = null + module_state_3 = null + inv3.icon_state = "inv3" + +/mob/living/silicon/robot/proc/uneq_all() + module_active = null + + if(module_state_1) + if(istype(module_state_1,/obj/item/borg/sight)) + sight_mode &= ~module_state_1:sight_mode + if (client) + client.screen -= module_state_1 + contents -= module_state_1 + module_state_1 = null + inv1.icon_state = "inv1" + if(module_state_2) + if(istype(module_state_2,/obj/item/borg/sight)) + sight_mode &= ~module_state_2:sight_mode + if (client) + client.screen -= module_state_2 + contents -= module_state_2 + module_state_2 = null + inv2.icon_state = "inv2" + if(module_state_3) + if(istype(module_state_3,/obj/item/borg/sight)) + sight_mode &= ~module_state_3:sight_mode + if (client) + client.screen -= module_state_3 + contents -= module_state_3 + module_state_3 = null + inv3.icon_state = "inv3" + + +/mob/living/silicon/robot/proc/activated(obj/item/O) + if(module_state_1 == O) + return 1 + else if(module_state_2 == O) + return 1 + else if(module_state_3 == O) + return 1 + else + return 0 \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 741f1a2edf7..14033fa6df9 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -16,7 +16,7 @@ UpdateLuminosity() handle_regular_hud_updates() update_items() - if (src.stat != 2) //still using power + if (src.stat != DEAD) //still using power use_power() process_killswitch() process_locks() @@ -30,9 +30,9 @@ proc clamp_values() - SetStunned(min(stunned, 30)) +// SetStunned(min(stunned, 30)) SetParalysis(min(paralysis, 30)) - SetWeakened(min(weakened, 20)) +// SetWeakened(min(weakened, 20)) sleeping = 0 adjustBruteLoss(0) adjustToxLoss(0) @@ -66,12 +66,6 @@ uneq_all() src.stat = 1 - - update_canmove() - if(paralysis || stunned || weakened || buckled || lockcharge) canmove = 0 - else canmove = 1 - - update_mind() if(!mind && client) mind = new @@ -315,3 +309,8 @@ src << "\red Weapon Lock Timed Out!" weapon_lock = 0 weaponlock_time = 120 + + update_canmove() + if(paralysis || stunned || weakened || buckled || lockcharge) canmove = 0 + else canmove = 1 + return canmove \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 077a6619833..40ebb954b5e 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -540,14 +540,10 @@ return var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) G.assailant = M - if (M.hand) - M.l_hand = G - M.update_inv_l_hand() - else - M.r_hand = G - M.update_inv_r_hand() - G.layer = 20 G.affecting = src + + M.put_in_active_hand(G) + grabbed_by += G G.synch() playsound(loc, 'thudswoosh.ogg', 50, 1, -1) @@ -673,20 +669,11 @@ if(opened && !wiresexposed && (!istype(user, /mob/living/silicon))) if(cell) - cell.loc = usr - cell.layer = 20 - if (user.hand ) - user.l_hand = cell - user.update_inv_l_hand() - else - user.r_hand = cell - user.update_inv_r_hand() - - cell.add_fingerprint(user) cell.updateicon() - + cell.add_fingerprint(user) + user.put_in_active_hand(cell) + user << "You remove \the [cell]." cell = null - user << "You remove the power cell." updateicon() if(ishuman(user)) @@ -701,12 +688,12 @@ if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M //if they are holding or wearing a card that has access, that works - if(check_access(H.equipped()) || check_access(H.wear_id)) + if(check_access(H.get_active_hand()) || check_access(H.wear_id)) return 1 else if(istype(M, /mob/living/carbon/monkey)) var/mob/living/carbon/monkey/george = M //they can only hold things :( - if(george.equipped() && istype(george.equipped(), /obj/item/weapon/card/id) && check_access(george.equipped())) + if(george.get_active_hand() && istype(george.get_active_hand(), /obj/item/weapon/card/id) && check_access(george.get_active_hand())) return 1 return 0 @@ -855,76 +842,6 @@ installed_modules() return -/mob/living/silicon/robot/proc/uneq_active() - if(isnull(module_active)) - return - if(module_state_1 == module_active) - if(istype(module_state_1,/obj/item/borg/sight)) - sight_mode &= ~module_state_1:sight_mode - if (client) - client.screen -= module_state_1 - contents -= module_state_1 - module_active = null - module_state_1 = null - inv1.icon_state = "inv1" - else if(module_state_2 == module_active) - if(istype(module_state_2,/obj/item/borg/sight)) - sight_mode &= ~module_state_2:sight_mode - if (client) - client.screen -= module_state_2 - contents -= module_state_2 - module_active = null - module_state_2 = null - inv2.icon_state = "inv2" - else if(module_state_3 == module_active) - if(istype(module_state_3,/obj/item/borg/sight)) - sight_mode &= ~module_state_3:sight_mode - if (client) - client.screen -= module_state_3 - contents -= module_state_3 - module_active = null - module_state_3 = null - inv3.icon_state = "inv3" - -/mob/living/silicon/robot/proc/uneq_all() - module_active = null - - if(module_state_1) - if(istype(module_state_1,/obj/item/borg/sight)) - sight_mode &= ~module_state_1:sight_mode - if (client) - client.screen -= module_state_1 - contents -= module_state_1 - module_state_1 = null - inv1.icon_state = "inv1" - if(module_state_2) - if(istype(module_state_2,/obj/item/borg/sight)) - sight_mode &= ~module_state_2:sight_mode - if (client) - client.screen -= module_state_2 - contents -= module_state_2 - module_state_2 = null - inv2.icon_state = "inv2" - if(module_state_3) - if(istype(module_state_3,/obj/item/borg/sight)) - sight_mode &= ~module_state_3:sight_mode - if (client) - client.screen -= module_state_3 - contents -= module_state_3 - module_state_3 = null - inv3.icon_state = "inv3" - - -/mob/living/silicon/robot/proc/activated(obj/item/O) - if(module_state_1 == O) - return 1 - else if(module_state_2 == O) - return 1 - else if(module_state_3 == O) - return 1 - else - return 0 - /mob/living/silicon/robot/proc/radio_menu() var/dat = {" diff --git a/code/modules/mob/living/silicon/robot/wires.dm b/code/modules/mob/living/silicon/robot/wires.dm index acf3c0dfcbb..e3d72409a5e 100644 --- a/code/modules/mob/living/silicon/robot/wires.dm +++ b/code/modules/mob/living/silicon/robot/wires.dm @@ -98,7 +98,7 @@ usr.machine = src if (href_list["borgwires"]) var/t1 = text2num(href_list["borgwires"]) - if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) )) + if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) )) usr << "You need wirecutters!" return if (src.isWireColorCut(t1)) @@ -107,7 +107,7 @@ src.cut(t1) else if (href_list["pulse"]) var/t1 = text2num(href_list["pulse"]) - if (!istype(usr.equipped(), /obj/item/device/multitool)) + if (!istype(usr.get_active_hand(), /obj/item/device/multitool)) usr << "You need a multitool!" return if (src.isWireColorCut(t1)) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 9f4d58e30fc..9fa31856fda 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -108,7 +108,7 @@ //Used by monkeys, *chimpers* //TODO: eliminate this convoluted proc it's incredibly shitty. ~Carn /mob/proc/db_click(text, t1) - var/obj/item/weapon/W = equipped() + var/obj/item/weapon/W = get_active_hand() switch(text) if("mask") if (wear_mask) @@ -666,6 +666,43 @@ note dizziness decrements automatically in the mob's Life() proc. if(restrained()) return 0 return 1 +//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it. +/mob/proc/update_canmove() + if( stat || weakened || paralysis || resting || sleeping || (changeling && changeling.changeling_fakedeath) ) + lying = 1 + canmove = 0 + else if( stunned ) +// lying = 0 + canmove = 0 + else + lying = 0 + canmove = 1 + + if(buckled) + anchored = 1 + if( istype(buckled,/obj/structure/stool/bed/chair) ) + lying = 0 + else + lying = 1 + + if(lying) + density = 0 + drop_l_hand() + drop_r_hand() + else + density = 1 + + //Temporarily moved here from the various life() procs + //I'm fixing stuff incrementally so this will likely find a better home. + //It just makes sense for now. ~Carn + if( update_icon ) //forces a full overlay update + update_icon = 0 + regenerate_icons() + else if( lying != lying_prev ) + update_icons() + + return canmove + /mob/verb/eastface() set hidden = 1 @@ -706,8 +743,6 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/Stun(amount) if(canstun) stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun - - else if(istype(src, /mob/living/carbon/alien)) // add some movement delay var/mob/living/carbon/alien/Alien = src @@ -717,8 +752,6 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned" if(canstun) stunned = max(amount,0) - - return /mob/proc/AdjustStunned(amount) @@ -729,16 +762,19 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/Weaken(amount) if(canweaken) weakened = max(max(weakened,amount),0) + update_canmove() //updates lying, canmove and icons return /mob/proc/SetWeakened(amount) if(canweaken) weakened = max(amount,0) + update_canmove() //updates lying, canmove and icons return /mob/proc/AdjustWeakened(amount) if(canweaken) weakened = max(weakened + amount,0) + update_canmove() //updates lying, canmove and icons return /mob/proc/Paralyse(amount) diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index de04906ed14..d91425347b0 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -172,9 +172,14 @@ /client/verb/attack_self() set hidden = 1 - var/obj/item/weapon/W = mob.equipped() - if (W) - W.attack_self(mob) + if(mob.hand) + if(mob.l_hand) + mob.l_hand.attack_self(mob) + mob.update_inv_l_hand() + else + if(mob.r_hand) + mob.r_hand.attack_self(mob) + mob.update_inv_r_hand() return diff --git a/code/modules/mob/simple_animal/life.dm b/code/modules/mob/simple_animal/life.dm index 81ccecf574b..9f7de01ec11 100644 --- a/code/modules/mob/simple_animal/life.dm +++ b/code/modules/mob/simple_animal/life.dm @@ -277,14 +277,9 @@ return var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) G.assailant = M - if (M.hand) - M.l_hand = G - M.update_inv_l_hand() - else - M.r_hand = G - M.update_inv_r_hand() - G.layer = 20 G.affecting = src + M.put_in_active_hand(G) + grabbed_by += G G.synch() diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 8cc86460659..52ba006dada 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -2,9 +2,9 @@ if (monkeyizing) return for(var/obj/item/W in src) - if (W==w_uniform) // will be teared + if (W==w_uniform) // will be torn continue - drop_from_slot(W) + drop_from_inventory(W) regenerate_icons() monkeyizing = 1 canmove = 0 @@ -63,7 +63,7 @@ if (monkeyizing) return for(var/obj/item/W in src) - drop_from_slot(W) + drop_from_inventory(W) regenerate_icons() monkeyizing = 1 canmove = 0 @@ -155,7 +155,7 @@ if (monkeyizing) return for(var/obj/item/W in src) - drop_from_slot(W) + drop_from_inventory(W) regenerate_icons() monkeyizing = 1 canmove = 0 @@ -222,7 +222,7 @@ if (monkeyizing) return for(var/obj/item/W in src) - drop_from_slot(W) + drop_from_inventory(W) regenerate_icons() monkeyizing = 1 canmove = 0 @@ -262,7 +262,7 @@ if (monkeyizing) return for(var/obj/item/W in src) - drop_from_slot(W) + drop_from_inventory(W) regenerate_icons() monkeyizing = 1 canmove = 0 @@ -313,7 +313,7 @@ if (monkeyizing) return for(var/obj/item/W in src) - drop_from_slot(W) + drop_from_inventory(W) regenerate_icons() monkeyizing = 1 canmove = 0 diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index 9809ecc4fe3..146ec35ef22 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -21,18 +21,16 @@ var/mob/M = usr if (!(istype(over_object, /obj/screen) )) return ..() - if((!(M.restrained()) && !(M.stat))) - if(over_object.name == "r_hand") - if(!(M.r_hand)) + + if(!M.restrained() && !M.stat) + switch(over_object.name) + if("r_hand") M.u_equip(src) - M.r_hand = src - M.update_inv_r_hand() - else - if(over_object.name == "l_hand") - if(!(M.l_hand)) - M.u_equip(src) - M.l_hand = src - M.update_inv_l_hand() + M.put_in_r_hand(src) + if("l_hand") + M.u_equip(src) + M.put_in_l_hand(src) + src.add_fingerprint(usr) return @@ -91,7 +89,7 @@ haspen.loc = usr.loc if(ishuman(usr)) if(!usr.get_active_hand()) - usr.put_in_hand(haspen) + usr.put_in_hands(haspen) haspen = null if(href_list["addpen"]) @@ -115,7 +113,7 @@ P.loc = usr.loc if(ishuman(usr)) if(!usr.get_active_hand()) - usr.put_in_hand(P) + usr.put_in_hands(P) else P.loc = get_turf(usr) if(P == toppaper) diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index e9b257bb6d3..a87acd00e46 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -46,7 +46,7 @@ var/obj/item/P = locate(href_list["retrieve"])//contents[retrieveindex] if(!isnull(P) && in_range(src,usr)) if(!usr.get_active_hand()) - usr.put_in_hand(P) + usr.put_in_hands(P) else P.loc = get_turf_loc(src) diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index a29d418424e..a375904320a 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -65,7 +65,7 @@ P.loc = usr.loc if(ishuman(usr)) if(!usr.get_active_hand()) - usr.put_in_hand(P) + usr.put_in_hands(P) else P.loc = get_turf(usr) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 91b5f5bca47..76d8eae96fb 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -228,7 +228,7 @@ var/id = href_list["write"] //var/t = strip_html_simple(input(usr, "What text do you wish to add to " + (id=="end" ? "the end of the paper" : "field "+id) + "?", "[name]", null),8192) as message var/t = strip_html_simple(input("Enter what you want to write:", "Write", null, null) as message, MAX_MESSAGE_LEN) - var/obj/item/i = usr.equipped() // Check to see if he still got that darn pen, also check if he's using a crayon or pen. + var/obj/item/i = usr.get_active_hand() // Check to see if he still got that darn pen, also check if he's using a crayon or pen. var/iscrayon = 0 if(!istype(i, /obj/item/weapon/pen)) if(!istype(i, /obj/item/toy/crayon)) @@ -236,7 +236,7 @@ iscrayon = 1 - if ((!in_range(src, usr) && src.loc != usr && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != usr && usr.equipped() != i)) // Some check to see if he's allowed to write + if ((!in_range(src, usr) && src.loc != usr && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != usr && usr.get_active_hand() != i)) // Some check to see if he's allowed to write return t = parsepencode(t, i, usr, iscrayon) // Encode everything from pencode to html @@ -263,7 +263,7 @@ //openhelp(user) return else if(istype(P, /obj/item/weapon/stamp)) - if ((!in_range(src, usr) && src.loc != user && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != user && user.equipped() != P)) + if ((!in_range(src, usr) && src.loc != user && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != user && user.get_active_hand() != P)) return stamps += (stamps=="" ? "
" : "
") + "This paper has been stamped with the [P.name]." diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index 7118d8547e9..b4cf6e72815 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -16,16 +16,10 @@ MouseDrop(mob/user as mob) if ((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr)))))) - if (usr.hand) - if (!( usr.l_hand )) - spawn( 0 ) - src.attack_hand(usr, 1, 1) - return - else - if (!( usr.r_hand )) - spawn( 0 ) - src.attack_hand(usr, 0, 1) - return + + if( !usr.get_active_hand() ) //if active hand is empty + attack_hand(usr, 1, 1) + return @@ -53,7 +47,7 @@ P.loc = user.loc if(ishuman(user)) if(!user.get_active_hand()) - user.put_in_hand(P) + user.put_in_hands(P) user << "You take a paper out of the bin." else P.loc = get_turf_loc(src) diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index c94d279edbf..11e680314e3 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -69,7 +69,7 @@ if(ishuman(usr)) if(!usr.get_active_hand()) copy.loc = usr.loc - usr.put_in_hand(copy) + usr.put_in_hands(copy) usr << "You take the paper out of the photocopier." copy = null updateUsrDialog() diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 0b5b9abb48e..877d58b0eaf 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -442,7 +442,7 @@ src.add_fingerprint(user) if(opened && (!istype(user, /mob/living/silicon))) if(cell) - usr.put_in_hand(cell) + usr.put_in_hands(cell) cell.add_fingerprint(user) cell.updateicon() @@ -763,7 +763,7 @@ usr.machine = src if (href_list["apcwires"]) var/t1 = text2num(href_list["apcwires"]) - if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) )) + if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) )) usr << "You need wirecutters!" return if (src.isWireColorCut(t1)) @@ -772,7 +772,7 @@ src.cut(t1) else if (href_list["pulse"]) var/t1 = text2num(href_list["pulse"]) - if (!istype(usr.equipped(), /obj/item/device/multitool)) + if (!istype(usr.get_active_hand(), /obj/item/device/multitool)) usr << "You need a multitool!" return if (src.isWireColorCut(t1)) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 86006f28fbd..3d5cabb0e86 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -366,12 +366,12 @@ switchcount = L.switchcount rigged = L.rigged brightness = L.brightness - del(L) - on = has_power() update() - user.update_inv_l_hand(0) - user.update_inv_r_hand() + + user.drop_item() //drop the item to update overlays and such + del(L) + if(on && rigged) explode() else @@ -497,23 +497,16 @@ L.status = status L.rigged = rigged L.brightness = src.brightness - L.loc = usr - L.layer = 20 - if(user.hand) - user.l_hand = L - user.update_inv_l_hand() - else - user.r_hand = L - user.update_inv_r_hand() // light item inherits the switchcount, then zero it L.switchcount = switchcount switchcount = 0 - L.update() L.add_fingerprint(user) + user.put_in_active_hand(L) //puts it in our active hand + status = LIGHT_EMPTY update() diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index 84755edda04..c98f0b458f4 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -53,11 +53,9 @@ if(src.P) user << "\red There's already a plasma tank loaded." return 1 + user.drop_item() src.P = W W.loc = src - if (user.client) - user.client.screen -= W - user.u_equip(W) updateicon() else if(istype(W, /obj/item/weapon/crowbar)) if(P && !src.locked) diff --git a/code/modules/projectiles/projectile/change.dm b/code/modules/projectiles/projectile/change.dm index 7c86838fefc..44529ff3ee9 100644 --- a/code/modules/projectiles/projectile/change.dm +++ b/code/modules/projectiles/projectile/change.dm @@ -23,7 +23,7 @@ for(var/obj/item/W in M) if (istype(M, /mob/living/silicon/robot)||istype(W, /obj/item/weapon/implant)) del (W) - M.drop_from_slot(W) + M.drop_from_inventory(W) var/randomize = pick("monkey","robot","metroid","alien","human") switch(randomize) if("monkey") diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 08a4cd16a1d..8a10c3bf6f8 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -47,7 +47,7 @@ if (src.wrapped) //sometimes items can disappear. For example, bombs. --rastaf0 wrapped.loc = user.loc if(ishuman(user)) - user.put_in_hand(wrapped) + user.put_in_hands(wrapped) else wrapped.loc = get_turf_loc(src) diff --git a/code/modules/research/rdmachines.dm b/code/modules/research/rdmachines.dm index df3a33bce84..5736103903a 100644 --- a/code/modules/research/rdmachines.dm +++ b/code/modules/research/rdmachines.dm @@ -73,7 +73,7 @@ src.add_fingerprint(usr) if(href_list["pulse"]) var/temp_wire = href_list["wire"] - if (!istype(usr.equipped(), /obj/item/device/multitool)) + if (!istype(usr.get_active_hand(), /obj/item/device/multitool)) usr << "You need a multitool!" else if(src.wires[temp_wire]) @@ -91,7 +91,7 @@ src.shock(usr,50) spawn(100) src.shocked = !src.shocked if(href_list["cut"]) - if (!istype(usr.equipped(), /obj/item/weapon/wirecutters)) + if (!istype(usr.get_active_hand(), /obj/item/weapon/wirecutters)) usr << "You need wirecutters!" else var/temp_wire = href_list["wire"] diff --git a/html/changelog.html b/html/changelog.html index c870b61019a..250d616c2e7 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -46,6 +46,16 @@ Stuff which is in development and not yet visible to players or just code relate should be listed in the changelog upon commit tho. Thanks. --> +
+

Sat 23rd June 2012

+

Carn updated:

+
    +
  • Putting a blindfold on a human with lightly damaged eyes will speed up the healing process. Similar with earmuffs.
  • +
  • More overlay bug fixes. Most of it to do with little robots and construction stuff. Bugs go here if you have 2 minutes http://nanotrasen.com/phpBB3/viewtopic.php?f=15&t=9077
  • +
  • Weakening is instant! That means if you stunbaton somebody they're gonna fall-down immediately.
  • +
+
+

Saturday, June 23rd

Donkie updated:

diff --git a/tgstation.dme b/tgstation.dme index 87a88beb38d..740c77c7497 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -5,199 +5,6 @@ // END_INTERNALS // BEGIN_FILE_DIR #define FILE_DIR . -#define FILE_DIR "code" -#define FILE_DIR "code/ATMOSPHERICS" -#define FILE_DIR "code/ATMOSPHERICS/components" -#define FILE_DIR "code/ATMOSPHERICS/components/binary_devices" -#define FILE_DIR "code/ATMOSPHERICS/components/trinary_devices" -#define FILE_DIR "code/ATMOSPHERICS/components/unary" -#define FILE_DIR "code/datums" -#define FILE_DIR "code/datums/diseases" -#define FILE_DIR "code/datums/helper_datums" -#define FILE_DIR "code/datums/spells" -#define FILE_DIR "code/defines" -#define FILE_DIR "code/defines/area" -#define FILE_DIR "code/defines/mob" -#define FILE_DIR "code/defines/mob/dead" -#define FILE_DIR "code/defines/mob/living" -#define FILE_DIR "code/defines/mob/living/carbon" -#define FILE_DIR "code/defines/mob/living/silicon" -#define FILE_DIR "code/defines/obj" -#define FILE_DIR "code/defines/procs" -#define FILE_DIR "code/defines/tanning" -#define FILE_DIR "code/FEA" -#define FILE_DIR "code/game" -#define FILE_DIR "code/game/area" -#define FILE_DIR "code/game/asteroid" -#define FILE_DIR "code/game/gamemodes" -#define FILE_DIR "code/game/gamemodes/blob" -#define FILE_DIR "code/game/gamemodes/changeling" -#define FILE_DIR "code/game/gamemodes/cult" -#define FILE_DIR "code/game/gamemodes/events" -#define FILE_DIR "code/game/gamemodes/events/holidays" -#define FILE_DIR "code/game/gamemodes/extended" -#define FILE_DIR "code/game/gamemodes/malfunction" -#define FILE_DIR "code/game/gamemodes/meteor" -#define FILE_DIR "code/game/gamemodes/nuclear" -#define FILE_DIR "code/game/gamemodes/revolution" -#define FILE_DIR "code/game/gamemodes/sandbox" -#define FILE_DIR "code/game/gamemodes/traitor" -#define FILE_DIR "code/game/gamemodes/wizard" -#define FILE_DIR "code/game/jobs" -#define FILE_DIR "code/game/jobs/job" -#define FILE_DIR "code/game/machinery" -#define FILE_DIR "code/game/machinery/atmoalter" -#define FILE_DIR "code/game/machinery/bots" -#define FILE_DIR "code/game/machinery/computer" -#define FILE_DIR "code/game/machinery/doors" -#define FILE_DIR "code/game/machinery/embedded_controller" -#define FILE_DIR "code/game/machinery/kitchen" -#define FILE_DIR "code/game/machinery/pipe" -#define FILE_DIR "code/game/machinery/telecomms" -#define FILE_DIR "code/game/magic" -#define FILE_DIR "code/game/magic/cultist" -#define FILE_DIR "code/game/mecha" -#define FILE_DIR "code/game/mecha/combat" -#define FILE_DIR "code/game/mecha/equipment" -#define FILE_DIR "code/game/mecha/equipment/tools" -#define FILE_DIR "code/game/mecha/equipment/weapons" -#define FILE_DIR "code/game/mecha/medical" -#define FILE_DIR "code/game/mecha/working" -#define FILE_DIR "code/game/objects" -#define FILE_DIR "code/game/objects/alien" -#define FILE_DIR "code/game/objects/closets" -#define FILE_DIR "code/game/objects/closets/secure" -#define FILE_DIR "code/game/objects/devices" -#define FILE_DIR "code/game/objects/devices/PDA" -#define FILE_DIR "code/game/objects/items" -#define FILE_DIR "code/game/objects/items/weapons" -#define FILE_DIR "code/game/objects/items/weapons/implants" -#define FILE_DIR "code/game/objects/radio" -#define FILE_DIR "code/game/objects/secstorage" -#define FILE_DIR "code/game/objects/stacks" -#define FILE_DIR "code/game/objects/storage" -#define FILE_DIR "code/game/objects/tanks" -#define FILE_DIR "code/game/vehicles" -#define FILE_DIR "code/game/vehicles/airtight" -#define FILE_DIR "code/game/verbs" -#define FILE_DIR "code/js" -#define FILE_DIR "code/modules" -#define FILE_DIR "code/modules/admin" -#define FILE_DIR "code/modules/admin/verbs" -#define FILE_DIR "code/modules/assembly" -#define FILE_DIR "code/modules/chemical" -#define FILE_DIR "code/modules/client" -#define FILE_DIR "code/modules/clothing" -#define FILE_DIR "code/modules/clothing/glasses" -#define FILE_DIR "code/modules/clothing/gloves" -#define FILE_DIR "code/modules/clothing/head" -#define FILE_DIR "code/modules/clothing/masks" -#define FILE_DIR "code/modules/clothing/shoes" -#define FILE_DIR "code/modules/clothing/spacesuits" -#define FILE_DIR "code/modules/clothing/suits" -#define FILE_DIR "code/modules/clothing/under" -#define FILE_DIR "code/modules/clothing/uniforms" -#define FILE_DIR "code/modules/critters" -#define FILE_DIR "code/modules/critters/hivebots" -#define FILE_DIR "code/modules/detectivework" -#define FILE_DIR "code/modules/flufftext" -#define FILE_DIR "code/modules/food" -#define FILE_DIR "code/modules/maps" -#define FILE_DIR "code/modules/mining" -#define FILE_DIR "code/modules/mob" -#define FILE_DIR "code/modules/mob/dead" -#define FILE_DIR "code/modules/mob/dead/observer" -#define FILE_DIR "code/modules/mob/living" -#define FILE_DIR "code/modules/mob/living/blob" -#define FILE_DIR "code/modules/mob/living/carbon" -#define FILE_DIR "code/modules/mob/living/carbon/alien" -#define FILE_DIR "code/modules/mob/living/carbon/alien/humanoid" -#define FILE_DIR "code/modules/mob/living/carbon/alien/humanoid/caste" -#define FILE_DIR "code/modules/mob/living/carbon/alien/larva" -#define FILE_DIR "code/modules/mob/living/carbon/brain" -#define FILE_DIR "code/modules/mob/living/carbon/human" -#define FILE_DIR "code/modules/mob/living/carbon/metroid" -#define FILE_DIR "code/modules/mob/living/carbon/monkey" -#define FILE_DIR "code/modules/mob/living/silicon" -#define FILE_DIR "code/modules/mob/living/silicon/ai" -#define FILE_DIR "code/modules/mob/living/silicon/decoy" -#define FILE_DIR "code/modules/mob/living/silicon/pai" -#define FILE_DIR "code/modules/mob/living/silicon/robot" -#define FILE_DIR "code/modules/mob/new_player" -#define FILE_DIR "code/modules/mob/organ" -#define FILE_DIR "code/modules/mob/simple_animal" -#define FILE_DIR "code/modules/paperwork" -#define FILE_DIR "code/modules/power" -#define FILE_DIR "code/modules/power/antimatter" -#define FILE_DIR "code/modules/power/singularity" -#define FILE_DIR "code/modules/power/singularity/particle_accelerator" -#define FILE_DIR "code/modules/projectiles" -#define FILE_DIR "code/modules/projectiles/ammunition" -#define FILE_DIR "code/modules/projectiles/guns" -#define FILE_DIR "code/modules/projectiles/guns/energy" -#define FILE_DIR "code/modules/projectiles/guns/projectile" -#define FILE_DIR "code/modules/projectiles/projectile" -#define FILE_DIR "code/modules/recycling" -#define FILE_DIR "code/modules/research" -#define FILE_DIR "code/modules/scripting" -#define FILE_DIR "code/modules/scripting/AST" -#define FILE_DIR "code/modules/scripting/AST/Operators" -#define FILE_DIR "code/modules/scripting/Implementations" -#define FILE_DIR "code/modules/scripting/Interpreter" -#define FILE_DIR "code/modules/scripting/Parser" -#define FILE_DIR "code/modules/scripting/Scanner" -#define FILE_DIR "code/modules/security levels" -#define FILE_DIR "code/unused" -#define FILE_DIR "code/unused/beast" -#define FILE_DIR "code/unused/computer2" -#define FILE_DIR "code/unused/disease2" -#define FILE_DIR "code/unused/gamemodes" -#define FILE_DIR "code/unused/hivebot" -#define FILE_DIR "code/unused/mining" -#define FILE_DIR "code/unused/optics" -#define FILE_DIR "code/unused/pda2" -#define FILE_DIR "code/unused/powerarmor" -#define FILE_DIR "code/unused/spacecraft" -#define FILE_DIR "code/WorkInProgress" -#define FILE_DIR "code/WorkInProgress/mapload" -#define FILE_DIR "code/WorkInProgress/organs" -#define FILE_DIR "code/WorkInProgress/virus2" -#define FILE_DIR "html" -#define FILE_DIR "icons" -#define FILE_DIR "icons/48x48" -#define FILE_DIR "icons/effects" -#define FILE_DIR "icons/mecha" -#define FILE_DIR "icons/misc" -#define FILE_DIR "icons/mob" -#define FILE_DIR "icons/obj" -#define FILE_DIR "icons/obj/assemblies" -#define FILE_DIR "icons/obj/atmospherics" -#define FILE_DIR "icons/obj/clothing" -#define FILE_DIR "icons/obj/doors" -#define FILE_DIR "icons/obj/machines" -#define FILE_DIR "icons/obj/pipes" -#define FILE_DIR "icons/pda_icons" -#define FILE_DIR "icons/spideros_icons" -#define FILE_DIR "icons/Testing" -#define FILE_DIR "icons/turf" -#define FILE_DIR "icons/unused" -#define FILE_DIR "icons/vehicles" -#define FILE_DIR "icons/vending_icons" -#define FILE_DIR "interface" -#define FILE_DIR "maps" -#define FILE_DIR "maps/RandomZLevels" -#define FILE_DIR "sound" -#define FILE_DIR "sound/AI" -#define FILE_DIR "sound/ambience" -#define FILE_DIR "sound/effects" -#define FILE_DIR "sound/hallucinations" -#define FILE_DIR "sound/items" -#define FILE_DIR "sound/machines" -#define FILE_DIR "sound/mecha" -#define FILE_DIR "sound/misc" -#define FILE_DIR "sound/piano" -#define FILE_DIR "sound/voice" -#define FILE_DIR "sound/weapons" // END_FILE_DIR // BEGIN_PREFERENCES @@ -1014,6 +821,7 @@ #include "code\modules\mob\living\silicon\robot\emote.dm" #include "code\modules\mob\living\silicon\robot\examine.dm" #include "code\modules\mob\living\silicon\robot\hud.dm" +#include "code\modules\mob\living\silicon\robot\inventory.dm" #include "code\modules\mob\living\silicon\robot\laws.dm" #include "code\modules\mob\living\silicon\robot\life.dm" #include "code\modules\mob\living\silicon\robot\login.dm" @@ -1068,9 +876,6 @@ #include "code\modules\power\terminal.dm" #include "code\modules\power\tracker.dm" #include "code\modules\power\turbine.dm" -#include "code\modules\power\antimatter\containment_jar.dm" -#include "code\modules\power\antimatter\control.dm" -#include "code\modules\power\antimatter\shielding.dm" #include "code\modules\power\singularity\collector.dm" #include "code\modules\power\singularity\containment_field.dm" #include "code\modules\power\singularity\emitter.dm"