From 0328f437ff52bde44595e7b06afd406c03272f5f Mon Sep 17 00:00:00 2001 From: Miauw Date: Sat, 15 Feb 2014 16:22:25 +0100 Subject: [PATCH] finishes up nodrop as far as i can be arsed to --- code/game/machinery/bots/cleanbot.dm | 4 +-- code/game/machinery/bots/ed209bot.dm | 32 +++++++++---------- code/game/machinery/bots/floorbot.dm | 6 ++-- code/game/machinery/bots/medbot.dm | 4 +-- code/game/machinery/bots/secbot.dm | 2 +- code/game/machinery/portable_turret.dm | 10 +++--- code/game/machinery/recycler.dm | 4 +-- code/game/machinery/teleporter.dm | 4 ++- code/game/mecha/mecha.dm | 8 +++-- code/game/objects/items/candle.dm | 2 +- .../items/devices/radio/electropack.dm | 6 +++- .../game/objects/items/stacks/sheets/light.dm | 6 ++-- code/game/objects/items/stacks/stack.dm | 4 +-- code/game/objects/items/stacks/tiles/light.dm | 2 +- code/game/objects/items/toys.dm | 6 +++- 15 files changed, 57 insertions(+), 43 deletions(-) diff --git a/code/game/machinery/bots/cleanbot.dm b/code/game/machinery/bots/cleanbot.dm index 28701bf2f29..fcb93c1aa22 100644 --- a/code/game/machinery/bots/cleanbot.dm +++ b/code/game/machinery/bots/cleanbot.dm @@ -336,8 +336,8 @@ text("[src.oddbutton ? "Yes" : "No" var/obj/machinery/bot/cleanbot/A = new /obj/machinery/bot/cleanbot(T) A.name = src.created_name user << "You add the robot arm to the bucket and sensor assembly. Beep boop!" - user.unEquip(src) - del(src) + user.unEquip(src, 1) + del src else if (istype(W, /obj/item/weapon/pen)) var/t = copytext(stripped_input(user, "Enter new robot name", src.name, src.created_name),1,MAX_NAME_LEN) diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index 16d493a0738..bfe50c3cc33 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -895,7 +895,7 @@ Auto Patrol: []"}, switch(build_step) if(0,1) - if( istype(W, /obj/item/robot_parts/l_leg) || istype(W, /obj/item/robot_parts/r_leg) ) + if(istype(W, /obj/item/robot_parts/l_leg) || istype(W, /obj/item/robot_parts/r_leg)) user.drop_item() del(W) build_step++ @@ -909,11 +909,11 @@ Auto Patrol: []"}, icon_state = "ed209_legs" if(2) - if( istype(W, /obj/item/clothing/suit/redtag) ) + if(istype(W, /obj/item/clothing/suit/redtag)) lasercolor = "r" - else if( istype(W, /obj/item/clothing/suit/bluetag) ) + else if(istype(W, /obj/item/clothing/suit/bluetag)) lasercolor = "b" - if( lasercolor || istype(W, /obj/item/clothing/suit/armor/vest) ) + if(lasercolor || istype(W, /obj/item/clothing/suit/armor/vest)) user.drop_item() del(W) build_step++ @@ -923,7 +923,7 @@ Auto Patrol: []"}, icon_state = "[lasercolor]ed209_shell" if(3) - if( istype(W, /obj/item/weapon/weldingtool) ) + if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if(WT.remove_fuel(0,user)) build_step++ @@ -932,15 +932,15 @@ Auto Patrol: []"}, if(4) switch(lasercolor) if("b") - if( !istype(W, /obj/item/clothing/head/helmet/bluetaghelm) ) + if(!istype(W, /obj/item/clothing/head/helmet/bluetaghelm)) return if("r") - if( !istype(W, /obj/item/clothing/head/helmet/redtaghelm) ) + if(!istype(W, /obj/item/clothing/head/helmet/redtaghelm)) return if("") - if( !istype(W, /obj/item/clothing/head/helmet) ) + if(!istype(W, /obj/item/clothing/head/helmet)) return user.drop_item() @@ -952,7 +952,7 @@ Auto Patrol: []"}, icon_state = "[lasercolor]ed209_hat" if(5) - if( isprox(W) ) + if(isprox(W)) user.drop_item() del(W) build_step++ @@ -962,7 +962,7 @@ Auto Patrol: []"}, icon_state = "[lasercolor]ed209_prox" if(6) - if( istype(W, /obj/item/stack/cable_coil) ) + if(istype(W, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/coil = W var/turf/T = get_turf(user) user << "You start to wire [src]..." @@ -976,15 +976,15 @@ Auto Patrol: []"}, if(7) switch(lasercolor) if("b") - if( !istype(W, /obj/item/weapon/gun/energy/laser/bluetag) ) + 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) ) + 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) ) + if(!istype(W, /obj/item/weapon/gun/energy/taser)) return name = "taser ED-209 assembly" else @@ -997,7 +997,7 @@ Auto Patrol: []"}, del(W) if(8) - if( istype(W, /obj/item/weapon/screwdriver) ) + if(istype(W, /obj/item/weapon/screwdriver)) playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) var/turf/T = get_turf(user) user << "Now attaching the gun to the frame..." @@ -1008,14 +1008,14 @@ Auto Patrol: []"}, user << "Taser gun attached." if(9) - if( istype(W, /obj/item/weapon/cell) ) + if(istype(W, /obj/item/weapon/cell)) build_step++ user << "You complete the ED-209." var/turf/T = get_turf(src) new /obj/machinery/bot/ed209(T,created_name,lasercolor) user.drop_item() del(W) - user.unEquip(src) + user.unEquip(src, 1) del(src) diff --git a/code/game/machinery/bots/floorbot.dm b/code/game/machinery/bots/floorbot.dm index d444c935c75..6eeb40f8276 100644 --- a/code/game/machinery/bots/floorbot.dm +++ b/code/game/machinery/bots/floorbot.dm @@ -404,7 +404,7 @@ var/obj/item/weapon/toolbox_tiles/B = new /obj/item/weapon/toolbox_tiles user.put_in_hands(B) user << "You add the tiles into the empty toolbox. They protrude from the top." - user.unEquip(src) + user.unEquip(src, 1) del(src) /obj/item/weapon/toolbox_tiles/attackby(var/obj/item/W, mob/user as mob) @@ -415,7 +415,7 @@ B.created_name = src.created_name user.put_in_hands(B) user << "You add the sensor to the toolbox and tiles!" - user.unEquip(src) + user.unEquip(src, 1) del(src) else if (istype(W, /obj/item/weapon/pen)) @@ -435,7 +435,7 @@ var/obj/machinery/bot/floorbot/A = new /obj/machinery/bot/floorbot(T) A.name = src.created_name user << "You add the robot arm to the odd looking toolbox assembly! Boop beep!" - user.unEquip(src) + user.unEquip(src, 1) del(src) else if (istype(W, /obj/item/weapon/pen)) var/t = stripped_input(user, "Enter new robot name", src.name, src.created_name) diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index edad537fb88..97699e949fe 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -554,7 +554,7 @@ del(S) user.put_in_hands(A) user << "You add the robot arm to the first aid kit." - user.unEquip(src) + user.unEquip(src, 1) del(src) @@ -588,6 +588,6 @@ var/obj/machinery/bot/medbot/S = new /obj/machinery/bot/medbot(T) S.skin = src.skin S.name = src.created_name - user.unEquip(src) + user.unEquip(src, 1) del(src) diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index 4e51474db1b..6a225362183 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -706,7 +706,7 @@ Auto Patrol: []"}, var/obj/item/weapon/secbot_assembly/A = new /obj/item/weapon/secbot_assembly user.put_in_hands(A) user << "You add the signaler to the helmet." - user.unEquip(src) + user.unEquip(src, 1) del(src) else return diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 60f45f09553..39279217e9f 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -701,13 +701,13 @@ if(isrobot(user)) return var/obj/item/weapon/gun/energy/E = I //typecasts the item to an energy gun + if(!user.unEquip(I)) + user << "\the [I] is stuck to your hand, you cannot put it in \the [src]" + return installation = I.type //installation becomes I.type gun_charge = E.power_supply.charge //the gun's charge is stored in gun_charge user << "You add [I] to the turret." build_step = 4 - if(!user.unEquip(I)) - user << "\the [I] is stuck to your hand, you cannot put it in \the [src]" - return del(I) //delete the gun :( return @@ -720,10 +720,10 @@ if(4) if(isprox(I)) build_step = 5 - user << "You add the prox sensor to the turret." if(!user.unEquip(I)) user << "\the [I] is stuck to your hand, you cannot put it in \the [src]" return + user << "You add the prox sensor to the turret." del(I) return @@ -746,7 +746,7 @@ build_step = 7 M.amount -= 2 if(M.amount <= 0) - user.unEquip(M) + user.unEquip(M, 1) //If we don't force-unequip, bugs happen because the item was deleted without updating the neccesary stuffs. del(M) else user << "You need two sheets of metal for that." diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index e20f4641efb..d92af0da8c0 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -138,8 +138,8 @@ var/const/SAFETY_COOLDOWN = 100 // Remove and recycle the equipped items. for(var/obj/item/I in L.get_equipped_items()) - L.unEquip(I) - recycle(I, 0) + if(L.unEquip(I)) + recycle(I, 0) // Instantly lie down, also go unconscious from the pain, before you die. L.Paralyse(5) diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index cf2bb2cfb18..5d82ebfbacb 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -28,7 +28,9 @@ if(istype(I, /obj/item/device/gps)) var/obj/item/device/gps/L = I if(L.locked_location && !(stat & (NOPOWER|BROKEN))) - user.unEquip(L) + if(!user.unEquip(L)) + user << "\the [I] is stuck to your hand, you cannot put it in \the [src]" + return L.loc = src locked = L user << "You insert the GPS device into the [name]'s slot." diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index d5cf6410c43..4b971b3a6ca 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -755,7 +755,9 @@ return else if(istype(W, /obj/item/mecha_parts/mecha_tracking)) - user.unEquip(W) + if(!user.unEquip(W)) + user << "\the [W] is stuck to your hand, you cannot put it in \the [src]" + return W.forceMove(src) user.visible_message("[user] attaches [W] to [src].", "You attach [W] to [src]") return @@ -1038,7 +1040,9 @@ else if(mmi_as_oc.brainmob.stat) user << "Beta-rhythm below acceptable level." return 0 - user.unEquip(mmi_as_oc) + if(!user.unEquip(mmi_as_oc)) + user << "\the [mmi_as_oc] is stuck to your hand, you cannot put it in \the [src]" + return var/mob/brainmob = mmi_as_oc.brainmob brainmob.reset_view(src) /* diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index 66d9bbb03f6..7047a708465 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -65,7 +65,7 @@ new/obj/item/trash/candle(src.loc) if(istype(src.loc, /mob)) var/mob/M = src.loc - M.unEquip(src) + M.unEquip(src, 1) //src is being deleted anyway del(src) update_icon() if(istype(loc, /turf)) //start a fire if possible diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index ba51811a6c4..7a8e100ceb0 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -28,7 +28,9 @@ var/obj/item/assembly/shock_kit/A = new /obj/item/assembly/shock_kit( user ) A.icon = 'icons/obj/assemblies.dmi' - user.unEquip(W) + if(!user.unEquip(W)) + user << "\the [W] is stuck to your hand, you cannot attach it to \the [src]!" + return W.loc = A W.master = A A.part1 = W @@ -40,6 +42,8 @@ user.put_in_hands(A) A.add_fingerprint(user) + if(src.flags & NODROP) + A.flags |= NODROP /obj/item/device/radio/electropack/Topic(href, href_list) //..() diff --git a/code/game/objects/items/stacks/sheets/light.dm b/code/game/objects/items/stacks/sheets/light.dm index ca76833dfc9..a0fdc179a0b 100644 --- a/code/game/objects/items/stacks/sheets/light.dm +++ b/code/game/objects/items/stacks/sheets/light.dm @@ -21,18 +21,18 @@ var/obj/item/stack/sheet/glass/G = new (user.loc) G.add_fingerprint(user) if(amount <= 0) - user.unEquip(src) + user.unEquip(src, 1) del(src) if(istype(O,/obj/item/stack/sheet/metal)) var/obj/item/stack/sheet/metal/M = O M.amount-- if(M.amount <= 0) - user.unEquip(M) + user.unEquip(M, 1) del(M) amount-- var/obj/item/stack/tile/light/L = new (user.loc) L.add_fingerprint(user) if(amount <= 0) - user.unEquip(src) + user.unEquip(src, 1) del(src) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 3681b701915..acd5e631671 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -122,7 +122,7 @@ if (src.amount<=0) var/oldsrc = src src = null //dont kill proc after del() - usr.unEquip(oldsrc) + usr.unEquip(oldsrc, 1) del(oldsrc) if (istype(O,/obj/item)) usr.put_in_hands(O) @@ -144,7 +144,7 @@ var/oldsrc = src src = null //dont kill proc after del() if(usr) - usr.unEquip(oldsrc) + usr.unEquip(oldsrc, 1) del(oldsrc) return diff --git a/code/game/objects/items/stacks/tiles/light.dm b/code/game/objects/items/stacks/tiles/light.dm index d9b413a2309..c9aa012f2b3 100644 --- a/code/game/objects/items/stacks/tiles/light.dm +++ b/code/game/objects/items/stacks/tiles/light.dm @@ -32,5 +32,5 @@ amount-- new/obj/item/stack/light_w(user.loc) if(amount <= 0) - user.unEquip(src) + user.unEquip(src, 1) del(src) \ No newline at end of file diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index fa258c95d69..6c3b914c77d 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -339,6 +339,8 @@ user << "You try to attach the end of the plastic sword to... itself. You're not very smart, are you?" if(ishuman(user)) user.adjustBrainLoss(10) + else if((W.flags & NODROP) || (flags & NODROP)) + user << "\the [flags & NODROP ? src : W] is stuck to your hand, you can't attach it to \the [flags & NODROP ? W : src]!" else user << "You attach the ends of the two plastic swords, making a single double-bladed toy! You're fake-cool." var/obj/item/weapon/twohanded/dualsaber/toy/newSaber = new /obj/item/weapon/twohanded/dualsaber/toy(user.loc) @@ -653,8 +655,10 @@ obj/item/toy/cards/deck/attackby(obj/item/toy/cards/singlecard/C, mob/living/use ..() if(istype(C)) if(C.parentdeck == src) + if(!user.unEquip(C)) + user << "The card is stuck to your hand, you can't add it to the deck!" + return src.cards += C.cardname - user.unEquip(C) user.visible_message("[user] adds a card to the bottom of the deck.","You add the card to the bottom of the deck.") del(C) else