From 3908160998e27decf43de275040ca9e2655a4bd5 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Tue, 10 Jun 2014 20:36:08 +0400 Subject: [PATCH] One big update for stacks. --- code/game/machinery/alarm.dm | 29 ++--- code/game/machinery/bots/ed209bot.dm | 16 +-- code/game/machinery/bots/floorbot.dm | 30 +++-- code/game/machinery/camera/camera_assembly.dm | 5 +- code/game/machinery/computer/ai_core.dm | 27 ++-- .../game/machinery/computer/buildandrepair.dm | 39 +++--- code/game/machinery/constructable_frame.dm | 13 +- code/game/machinery/portable_turret.dm | 16 +-- code/game/machinery/rechargestation.dm | 13 +- code/game/machinery/shieldgen.dm | 11 +- .../telecomms/machine_interactions.dm | 2 +- code/game/mecha/mecha.dm | 7 +- code/game/mecha/mecha_construction_paths.dm | 14 +-- .../objects/items/devices/lightreplacer.dm | 19 ++- code/game/objects/items/robot/robot_parts.dm | 31 +++-- code/game/objects/items/stacks/rods.dm | 6 +- .../game/objects/items/stacks/sheets/glass.dm | 75 +++++++---- .../game/objects/items/stacks/sheets/light.dm | 20 ++- .../items/stacks/sheets/sheet_types.dm | 2 + code/game/objects/items/stacks/stack.dm | 119 +++++++++++------- .../objects/items/stacks/tiles/plasteel.dm | 5 +- .../items/weapons/grenades/chem_grenade.dm | 11 +- .../items/weapons/grenades/ghettobomb.dm | 19 +-- code/game/objects/items/weapons/handcuffs.dm | 18 +-- .../objects/items/weapons/table_rack_parts.dm | 14 +-- code/game/objects/items/weapons/tools.dm | 18 +-- .../structures/crates_lockers/crates.dm | 10 +- code/game/objects/structures/door_assembly.dm | 11 +- code/game/objects/structures/girders.dm | 26 ++-- code/game/objects/structures/grille.dm | 9 +- code/game/turfs/simulated/floor.dm | 34 ++--- code/game/turfs/simulated/walls_reinforced.dm | 30 +++-- code/game/turfs/space/space.dm | 28 +++-- code/modules/hydroponics/grown.dm | 8 +- code/modules/mining/mint.dm | 16 +-- code/modules/mining/ores_coins.dm | 17 ++- .../modules/mob/living/silicon/robot/robot.dm | 14 ++- .../mob/living/silicon/robot/robot_modules.dm | 79 ++++++++---- code/modules/power/apc.dm | 35 +++--- code/modules/power/cable.dm | 43 +++++-- code/modules/power/lighting.dm | 20 +-- .../particle_accelerator.dm | 6 +- code/modules/power/solar.dm | 6 +- code/modules/research/circuitprinter.dm | 20 +-- 44 files changed, 584 insertions(+), 407 deletions(-) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 4f0df133f3b..4bc346319f4 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -807,20 +807,17 @@ table tr:first-child th:first-child { border: none;} if(istype(W, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/cable = W - if(cable.amount < 5) - user << "You need more cable!" + if(cable.get_amount() < 5) + user << "You need five lengths of cable to wire fire alarm." return - - user << "You start wiring the air alarm!" - spawn(20) - cable.amount -= 5 - if(!cable.amount) - qdel(cable) - - user << "You wire the air alarm!" - wires.wires_status = 0 - buildstage = 2 - update_icon() + user << "You start wiring the air alarm." + if (do_after(user, 20)) + if (cable.get_amount() >= 5 && buildstage == 1) + cable.use(5) + user << "You wire the air alarm." + wires.wires_status = 0 + buildstage = 2 + update_icon() return if(0) if(istype(W, /obj/item/weapon/airalarm_electronics)) @@ -999,13 +996,11 @@ FIRE ALARM if(1) if(istype(W, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/coil = W - if(coil.amount < 5) + if(coil.get_amount() < 5) user << "You need more cable for this!" return - coil.amount -= 5 - if(!coil.amount) - qdel(coil) + coil.use(5) buildstage = 2 user << "You wire \the [src]!" diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index 5cb9d67a849..09106fcee3b 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -967,14 +967,16 @@ Auto Patrol: []"}, if(6) if(istype(W, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/coil = W - var/turf/T = get_turf(user) + if (coil.get_amount() < 1) + user << "You need one length of cable to wire ED-209." + return 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 (do_after(user, 40)) + if (coil.get_amount() >= 1 && build_step == 6) + coil.use(1) + build_step = 7 + user << "You wire the ED-209 assembly." + name = "wired ED-209 assembly" if(7) switch(lasercolor) diff --git a/code/game/machinery/bots/floorbot.dm b/code/game/machinery/bots/floorbot.dm index 642dcfe2ff9..c5d6d7de5a5 100644 --- a/code/game/machinery/bots/floorbot.dm +++ b/code/game/machinery/bots/floorbot.dm @@ -102,11 +102,14 @@ var/obj/item/stack/tile/plasteel/T = W if(src.amount >= 50) return - var/loaded = min(50-src.amount, T.amount) + var/loaded = min(50 - src.amount, T.get_amount()) T.use(loaded) src.amount += loaded - user << "You load [loaded] tiles into the floorbot. He now contains [src.amount] tiles." - src.updateicon() + if (loaded > 0) + user << "You load [loaded] tiles into the floorbot. He now contains [src.amount] tiles." + src.updateicon() + else + user << "You need at least one floor tile to put it into floorbot." else if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) if(src.allowed(usr) && !open && !emagged) src.locked = !src.locked @@ -409,16 +412,19 @@ ..() return if(src.contents.len >= 1) - user << "They wont fit in as there is already stuff inside." + user << "They won't fit in, as there is already stuff inside." + return + if(T.use(10)) + if(user.s_active) + user.s_active.close(user) + 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, 1) + qdel(src) + else + user << "You need 10 floor tiles to start building a floorbot." return - if(user.s_active) - user.s_active.close(user) - qdel(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 protrude from the top." - user.unEquip(src, 1) - qdel(src) /obj/item/weapon/toolbox_tiles/attackby(var/obj/item/W, mob/user as mob) ..() diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 32efc75734d..cc44b26c0c3 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -59,8 +59,11 @@ if(istype(W, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/C = W if(C.use(2)) - user << "You add wires to the assembly." + user << "You add wires to the assembly." state = 3 + else + user << "You need two lengths of cable to wire a camera." + return return else if(istype(W, /obj/item/weapon/weldingtool)) diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 5f0e35b08ec..5665d6997b8 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -63,14 +63,18 @@ state = 1 icon_state = "1" if(istype(P, /obj/item/stack/cable_coil)) - if(P:amount >= 5) + var/obj/item/stack/cable_coil/C = P + if(C.get_amount() >= 5) playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) if(do_after(user, 20)) - P:amount -= 5 - if(!P:amount) qdel(P) - user << "You add cables to the frame." - state = 3 - icon_state = "3" + if (C.get_amount() >= 5 && state == 3) + C.use(5) + user << "You add cables to the frame." + state = 3 + icon_state = "3" + else + user << "You need five lengths of cable to wire the AI core." + return if(3) if(istype(P, /obj/item/weapon/wirecutters)) if (brain) @@ -84,15 +88,18 @@ A.amount = 5 if(istype(P, /obj/item/stack/sheet/rglass)) - if(P:amount >= 2) + var/obj/item/stack/sheet/rglass/G = P + if(G.get_amount() >= 2) playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) if(do_after(user, 20)) - if (P) - P:amount -= 2 - if(!P:amount) qdel(P) + if (G.get_amount() >= 2 && state == 3) + G.use(2) user << "You put in the glass panel." state = 4 icon_state = "4" + else + user << "You need two sheets of reinforced glass to insert them into AI core." + return if(istype(P, /obj/item/weapon/aiModule/core/full)) //Allows any full core boards to be applied to AI cores. var/obj/item/weapon/aiModule/core/M = P diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 012ed538d50..0b6c713d2fd 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -326,50 +326,51 @@ if(istype(P, /obj/item/weapon/screwdriver) && circuit) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) user << "You unfasten the circuit board." - src.state = 1 - src.icon_state = "1" + state = 1 + icon_state = "1" if(istype(P, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/C = P - if(C.amount >= 5) + if(C.get_amount() >= 5) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) user << "You start adding cables to the frame." if(do_after(user, 20)) - if(C && C.amount >= 5) - C.amount -= 5 - if(C.amount <= 0) qdel(C) + if(C.get_amount() >= 5 && state == 2) + C.use(5) user << "You've added cables to the frame." - src.state = 3 - src.icon_state = "3" + state = 3 + icon_state = "3" else - user << "You need more cable to do that." + user << "You need five lengths of cable to wire the frame." if(3) if(istype(P, /obj/item/weapon/wirecutters)) playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) user << "You remove the cables." - src.state = 2 - src.icon_state = "2" + state = 2 + icon_state = "2" var/obj/item/stack/cable_coil/A = new (loc) A.amount = 5 A.add_fingerprint(user) if(istype(P, /obj/item/stack/sheet/glass)) - if(P:amount >= 2) + var/obj/item/stack/sheet/glass/G = P + if(G.get_amount() < 2) + user << "You need two glass sheets to continue construction." + return + else playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) user << "You start to put in the glass panel." if(do_after(user, 20)) - if(P) - P:use(2) + if(G.get_amount() >= 2 && state == 3) + G.use(2) user << "You've put in the glass panel." - src.state = 4 + state = 4 src.icon_state = "4" - else - user << "You need more glass to do that." if(4) if(istype(P, /obj/item/weapon/crowbar)) playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) user << "You remove the glass panel." - src.state = 3 - src.icon_state = "3" + state = 3 + icon_state = "3" var/obj/item/stack/sheet/glass/G = new (loc, 2) G.add_fingerprint(user) if(istype(P, /obj/item/weapon/screwdriver)) diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index f33beedab30..f5a285e8290 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -55,16 +55,18 @@ if(1) if(istype(P, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/C = P - if(C.amount >= 5) + if(C.get_amount() >= 5) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) user << "You start to add cables to the frame." if(do_after(user, 20)) - if(C) - C.amount -= 5 - if(!C.amount) qdel(C) + if(C.get_amount() >= 5 && state == 1) + C.use(5) user << "You add cables to the frame." state = 2 icon_state = "box_1" + else + user << "You need five length of cable to wire the frame." + return if(istype(P, /obj/item/weapon/wrench)) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) user << "You dismantle the frame." @@ -138,6 +140,9 @@ success=1 if(istype(P, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/CP = P + if (CP.get_amount() < 1) + user << "You need more cable!" + return var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(src, 1, CP.item_color) if(CP.use(1)) components += CC diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 7747da62bc7..e52421b06be 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -653,16 +653,12 @@ if(1) if(istype(I, /obj/item/stack/sheet/metal)) var/obj/item/stack/sheet/metal/M = I - if(M.amount>=2) //requires 2 metal sheets + if(M.use(2)) user << "You add some metal armor to the interior frame." build_step = 2 - M.amount -= 2 icon_state = "turret_frame2" - if(M.amount <= 0) - user.unEquip(M, 1) //We're deleting it anyway, so no point in having NODROP fuck shit up. - qdel(M) else - user << "You need two sheets of metal for that." + user << "You need two sheets of metal to continue construction." return else if(istype(I, /obj/item/weapon/wrench)) @@ -743,15 +739,11 @@ if(6) if(istype(I, /obj/item/stack/sheet/metal)) var/obj/item/stack/sheet/metal/M = I - if(M.amount>=2) + if(M.use(2)) user << "You add some metal armor to the exterior frame." build_step = 7 - M.amount -= 2 - if(M.amount <= 0) - user.unEquip(M, 1) //If we don't force-unequip, bugs happen because the item was deleted without updating the neccesary stuffs. - qdel(M) else - user << "You need two sheets of metal for that." + user << "You need two sheets of metal to continue construction." return else if(istype(I, /obj/item/weapon/screwdriver)) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index f3c06c9424d..522483a63be 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -155,20 +155,19 @@ /obj/machinery/recharge_station/proc/restock_modules() if(occupier) if(occupier.module && occupier.module.modules) - var/list/um = occupier.contents|occupier.module.modules - // ^ makes sinle list of active (occupier.contents) and inactive modules (occupier.module.modules) + var/list/um = occupier.contents|occupier.module.modules // Makes single list of active (occupier.contents) and inactive (occupier.module.modules) modules var/coeff = recharge_speed / 200 + for (var/datum/robot_energy_storage/st in occupier.module.storages) + st.energy = min(st.max_energy, st.energy + coeff * st.recharge_rate) for(var/obj/O in um) - // Engineering - if(istype(O,/obj/item/stack/sheet/metal) || istype(O,/obj/item/stack/sheet/rglass) || istype(O,/obj/item/stack/rods) || istype(O,/obj/item/stack/cable_coil)|| istype(O,/obj/item/stack/tile/plasteel)) - if(O:amount < 50) - O:amount += coeff - // Security + //General if(istype(O,/obj/item/device/flash)) if(O:broken) O:broken = 0 O:times_used = 0 O:icon_state = "flash" + // Engineering + // Security if(istype(O,/obj/item/weapon/gun/energy/taser/cyborg)) if(O:power_supply.charge < O:power_supply.maxcharge) var/obj/item/weapon/gun/energy/G = O diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index d3e32c02081..796f8dcc729 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -247,14 +247,17 @@ else if(istype(W, /obj/item/stack/cable_coil) && malfunction && is_open) var/obj/item/stack/cable_coil/coil = W - user << "\blue You begin to replace the wires." - //if(do_after(user, min(60, round( ((maxhealth/health)*10)+(malfunction*10) ))) //Take longer to repair heavier damage + if (coil.get_amount() < 1) + user << "You need one length of cable to repair [src]." + return + user << "You begin to replace the wires." if(do_after(user, 30)) - if(!src || !coil) return + if(coil.get_amount() < 1) + return coil.use(1) health = max_health malfunction = 0 - user << "\blue You repair the [src]!" + user << "You repair the [src]!" update_icon() else if(istype(W, /obj/item/weapon/wrench)) diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index 4098ed938c8..f3d1796d3a2 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -56,7 +56,7 @@ construct_op -- stat &= ~BROKEN // the machine's not borked anymore! else - user << "You need more cable to do that." + user << "You need five lengths of cable for this machine." if(istype(P, /obj/item/weapon/crowbar)) user << "You begin prying out the circuit board and components..." playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index df02cb26e81..b6524eee6bc 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -703,12 +703,11 @@ else if(istype(W, /obj/item/stack/cable_coil)) if(state == 3 && hasInternalDamage(MECHA_INT_SHORT_CIRCUIT)) var/obj/item/stack/cable_coil/CC = W - if(CC.amount > 1) - CC.use(2) + if(CC.use(2)) clearInternalDamage(MECHA_INT_SHORT_CIRCUIT) - user << "You replace the fused wires." + user << "You replace the fused wires." else - user << "There's not enough wire to finish the task." + user << "You need two lengths of cable to fix this mecha." return else if(istype(W, /obj/item/weapon/screwdriver)) if(hasInternalDamage(MECHA_INT_TEMP_CONTROL)) diff --git a/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm index 24a42e5f774..96f233152ef 100644 --- a/code/game/mecha/mecha_construction_paths.dm +++ b/code/game/mecha/mecha_construction_paths.dm @@ -20,12 +20,11 @@ else if(istype(used_atom, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/C = used_atom - if(C.amount<4) + if(C.use(4)) + playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1) + else user << ("There's not enough cable to finish the task.") return 0 - else - C.use(4) - playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1) else if(istype(used_atom, /obj/item/stack)) var/obj/item/stack/S = used_atom if(S.amount < 5) @@ -53,12 +52,11 @@ else if(istype(used_atom, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/C = used_atom - if(C.amount<4) + if (C.use(4)) + playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1) + else user << ("There's not enough cable to finish the task.") return 0 - else - C.use(4) - playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1) else if(istype(used_atom, /obj/item/stack)) var/obj/item/stack/S = used_atom if(S.amount < 5) diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm index 9c6dbbdb37c..2b844aaa029 100644 --- a/code/game/objects/items/devices/lightreplacer.dm +++ b/code/game/objects/items/devices/lightreplacer.dm @@ -78,18 +78,15 @@ if(istype(W, /obj/item/stack/sheet/glass)) var/obj/item/stack/sheet/glass/G = W - if(G.amount - decrement >= 0 && uses < max_uses) - var/remaining = max(G.amount - decrement, 0) - if(!remaining && !(G.amount - decrement) == 0) - user << "There isn't enough glass." - return - G.amount = remaining - if(!G.amount) - user.drop_item() - qdel(G) - AddUses(increment) - user << "You insert a piece of glass into the [src.name]. You have [uses] lights remaining." + if(uses >= max_uses) + user << "span class='warning'>[src.name] is full." return + else if(G.use(decrement)) + AddUses(increment) + user << "You insert a piece of glass into the [src.name]. You have [uses] lights remaining." + return + else + user << "You need one sheet of glass to replace lights." if(istype(W, /obj/item/weapon/light)) var/obj/item/weapon/light/L = W diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 5173e9842e3..f88936e66d9 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -104,14 +104,18 @@ /obj/item/robot_parts/robot_suit/attackby(obj/item/W as obj, mob/user as mob) ..() if(istype(W, /obj/item/stack/sheet/metal) && !l_arm && !r_arm && !l_leg && !r_leg && !chest && !head) - var/obj/item/weapon/ed209_assembly/B = new /obj/item/weapon/ed209_assembly - B.loc = get_turf(src) - user << "You armed the robot frame" - W:use(1) - if (user.get_inactive_hand()==src) - user.unEquip(src) - user.put_in_inactive_hand(B) - qdel(src) + var/obj/item/stack/sheet/metal/M = W + if (M.use(1)) + var/obj/item/weapon/ed209_assembly/B = new /obj/item/weapon/ed209_assembly + B.loc = get_turf(src) + user << "You armed the robot frame." + if (user.get_inactive_hand()==src) + user.unEquip(src) + user.put_in_inactive_hand(B) + qdel(src) + else + user << "You need one sheet of metal to start building ED-209." + return if(istype(W, /obj/item/robot_parts/l_leg)) if(src.l_leg) return user.drop_item() @@ -313,13 +317,14 @@ user << "\blue You insert the cell!" if(istype(W, /obj/item/stack/cable_coil)) if(src.wires) - user << "\blue You have already inserted wire!" + user << "You have already inserted wire." return - else - var/obj/item/stack/cable_coil/coil = W - coil.use(1) + var/obj/item/stack/cable_coil/coil = W + if (coil.use(1)) src.wires = 1.0 - user << "\blue You insert the wire!" + user << "You insert the wire." + else + user << "You need one length of coil to wire it." return /obj/item/robot_parts/head/attackby(obj/item/W as obj, mob/user as mob) diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 47d017a5c22..ac5c1cbca99 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -19,7 +19,7 @@ if (istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W - if(amount < 2) + if(get_amount() < 2) user << "\red You need at least two rods to do this." return @@ -54,7 +54,7 @@ else return 1 else - if(amount < 2) + if(get_amount() < 2) user << "\blue You need at least two rods to do this." return usr << "\blue Assembling grille..." @@ -68,3 +68,5 @@ /obj/item/stack/rods/cyborg/ m_amt = 0 + is_cyborg = 1 + cost = 250 \ No newline at end of file diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index 299677c2a17..c19167e2fee 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -16,6 +16,10 @@ g_amt = MINERAL_MATERIAL_AMOUNT origin_tech = "materials=1" +/obj/item/stack/sheet/glass/cyborg + g_amt = 0 + is_cyborg = 1 + cost = 500 /obj/item/stack/sheet/glass/attack_self(mob/user as mob) construct_window(user) @@ -23,28 +27,32 @@ /obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user) ..() add_fingerprint(user) - if(istype(W,/obj/item/stack/cable_coil)) + if(istype(W, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/CC = W - if(CC.amount < 5) - user << "\b There is not enough wire in this coil. You need 5 lengths." + if (get_amount() < 1 || CC.get_amount() < 5) + user << "You attach wire to the [name]." var/obj/item/stack/light_w/new_tile = new(user.loc) new_tile.add_fingerprint(user) - src.use(1) - else if( istype(W, /obj/item/stack/rods) ) - var/obj/item/stack/rods/V = W - var/obj/item/stack/sheet/rglass/RG = new (user.loc) - RG.add_fingerprint(user) - RG.add_to_stacks(user) - V.use(1) - var/obj/item/stack/sheet/glass/G = src - src = null - var/replace = (user.get_inactive_hand()==G) - G.use(1) - if (!G && !RG && replace) - user.put_in_hands(RG) + else if(istype(W, /obj/item/stack/rods)) + var/obj/item/stack/rods/V = W + if (V.get_amount() > 1 && src.get_amount() > 1) + var/obj/item/stack/sheet/rglass/RG = new (user.loc) + RG.add_fingerprint(user) + RG.add_to_stacks(user) + var/obj/item/stack/sheet/glass/G = src + src = null + var/replace = (user.get_inactive_hand()==G) + V.use(1) + G.use(1) + if (!G && replace) + user.put_in_hands(RG) + else + user << "You need one rod and one sheet of glass to make reinforced glass." + return else return ..() @@ -55,7 +63,7 @@ user << "\red You don't have the dexterity to do this!" return 0 var/title = "Sheet-Glass" - title += " ([src.amount] sheet\s left)" + title += " ([src.get_amount()] sheet\s left)" switch(alert(title, "Would you like full tile glass or one direction?", "One Direction", "Full Window", "Cancel", null)) if("One Direction") if(!src) return 1 @@ -95,7 +103,7 @@ if("Full Window") if(!src) return 1 if(src.loc != user) return 1 - if(src.amount < 2) + if(src.get_amount() < 2) user << "\red You need more glass to do that." return 1 if(locate(/obj/structure/window) in user.loc) @@ -121,16 +129,29 @@ singular_name = "reinforced glass sheet" icon_state = "sheet-rglass" g_amt = MINERAL_MATERIAL_AMOUNT - m_amt = 1000 + m_amt = MINERAL_MATERIAL_AMOUNT / 2 origin_tech = "materials=2" /obj/item/stack/sheet/rglass/cyborg - name = "reinforced glass" - desc = "Glass which seems to have rods or something stuck in them." - singular_name = "reinforced glass sheet" - icon_state = "sheet-rglass" g_amt = 0 m_amt = 0 + var/datum/robot_energy_storage/metsource + var/datum/robot_energy_storage/glasource + var/metcost = 250 + var/glacost = 500 + +/obj/item/stack/sheet/rglass/cyborg/get_amount() + return min(round(metsource.energy / metcost), round(glasource.energy / glacost)) + +/obj/item/stack/sheet/rglass/cyborg/use(var/amount) // Requires special checks, because it uses two storages + metsource.use_charge(amount * metcost) + glasource.use_charge(amount * glacost) + return + +/obj/item/stack/sheet/rglass/cyborg/add(var/amount) + metsource.add_charge(amount * metcost) + glasource.add_charge(amount * glacost) + return /obj/item/stack/sheet/rglass/attack_self(mob/user as mob) construct_window(user) @@ -142,7 +163,7 @@ user << "\red You don't have the dexterity to do this!" return 0 var/title = "Sheet Reinf. Glass" - title += " ([src.amount] sheet\s left)" + title += " ([src.get_amount()] sheet\s left)" switch(input(title, "Would you like full tile glass a one direction glass pane or a windoor?") in list("One Direction", "Full Window", "Windoor", "Cancel")) if("One Direction") if(!src) return 1 @@ -182,7 +203,7 @@ if("Full Window") if(!src) return 1 if(src.loc != user) return 1 - if(src.amount < 2) + if(src.get_amount() < 2) user << "You need more glass to do that." return 1 if(locate(/obj/structure/window) in user.loc) @@ -208,7 +229,7 @@ user << "There is already a windoor in that location." return 1 - if(src.amount < 5) + if(src.get_amount() < 5) user << "You need more glass to do that." return 1 diff --git a/code/game/objects/items/stacks/sheets/light.dm b/code/game/objects/items/stacks/sheets/light.dm index e00fe5da5e5..00bc8110c1c 100644 --- a/code/game/objects/items/stacks/sheets/light.dm +++ b/code/game/objects/items/stacks/sheets/light.dm @@ -24,15 +24,13 @@ user.unEquip(src, 1) qdel(src) - if(istype(O,/obj/item/stack/sheet/metal)) + 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, 1) - qdel(M) - amount-- - var/obj/item/stack/tile/light/L = new (user.loc) - L.add_fingerprint(user) - if(amount <= 0) - user.unEquip(src, 1) - qdel(src) + if (M.use(1)) + use(1) + var/obj/item/stack/tile/light/L = new (user.loc) + user << "You make a light tile." + L.add_fingerprint(user) + else + user << "You need one metal sheet to finish the light tile." + return diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 774f723db8f..8951c278576 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -55,6 +55,8 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \ /obj/item/stack/sheet/metal/cyborg m_amt = 0 + is_cyborg = 1 + cost = 500 /obj/item/stack/sheet/metal/New(var/loc, var/amount=null) recipes = metal_recipes diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index f622413ce9c..568898f5802 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -14,14 +14,19 @@ var/singular_name var/amount = 1 var/max_amount //also see stack recipes initialisation, param "max_res_amount" must be equal to this max_amount + var/is_cyborg = 0 // It's 1 if module is used by a cyborg, and uses its storage + var/datum/robot_energy_storage/source + var/cost = 1 // How much energy from storage it costs /obj/item/stack/New(var/loc, var/amount=null) ..() if (amount) - src.amount=amount + src.amount = amount return /obj/item/stack/Destroy() + if (is_cyborg) + return // Not supposed to be destroyed if (usr && usr.machine==src) usr << browse(null, "window=stack") ..() @@ -29,27 +34,39 @@ /obj/item/stack/examine() set src in view(1) ..() - if(src.singular_name) - if(src.amount>1) - usr << "There are [src.amount] [src.singular_name]\s in the stack." + if (is_cyborg) + if(src.singular_name) + usr << "There is enough energy for [src.get_amount()] [src.singular_name]\s." else - usr << "There is [src.amount] [src.singular_name] in the stack." - else if(src.amount>1) - usr << "There are [src.amount] in the stack." + usr << "There is enough energy for [src.get_amount()]." + return + if(src.singular_name) + if(src.get_amount()>1) + usr << "There are [src.get_amount()] [src.singular_name]\s in the stack." + else + usr << "There is [src.get_amount()] [src.singular_name] in the stack." + else if(src.get_amount()>1) + usr << "There are [src.get_amount()] in the stack." else - usr << "There is [src.amount] in the stack." + usr << "There is [src.get_amount()] in the stack." return +/obj/item/stack/proc/get_amount() + if (is_cyborg) + return round(source.energy / cost) + else + return (amount) + /obj/item/stack/attack_self(mob/user as mob) interact(user) /obj/item/stack/interact(mob/user as mob) if (!recipes) return - if (!src || amount<=0) + if (!src || get_amount() <= 0) user << browse(null, "window=stack") user.set_machine(src) //for correct work of onclose - var/t1 = text("Constructions from []Amount Left: []
", src, src.amount) + var/t1 = text("Constructions from []Amount Left: []
", src, src.get_amount()) for(var/i=1;i<=recipes.len,i++) var/datum/stack_recipe/R = recipes[i] if (isnull(R)) @@ -57,7 +74,7 @@ continue if (i>1 && !isnull(recipes[i-1])) t1+="
" - var/max_multiplier = round(src.amount / R.req_amount) + var/max_multiplier = round(src.get_amount() / R.req_amount) var/title as text var/can_build = 1 can_build = can_build && (max_multiplier>0) @@ -97,12 +114,12 @@ if ((usr.restrained() || usr.stat || usr.get_active_hand() != src)) return if (href_list["make"]) - if (src.amount < 1) qdel(src) //Never should happen + if (src.get_amount() < 1) qdel(src) //Never should happen var/datum/stack_recipe/R = recipes[text2num(href_list["make"])] var/multiplier = text2num(href_list["multiplier"]) if (!multiplier) multiplier = 1 - if (src.amount < R.req_amount*multiplier) + if (src.get_amount() < R.req_amount*multiplier) if (R.req_amount*multiplier>1) usr << "\red You haven't got enough [src] to build \the [R.req_amount*multiplier] [R.title]\s!" else @@ -118,24 +135,19 @@ usr << "\blue Building [R.title] ..." if (!do_after(usr, R.time)) return - if (src.amount < R.req_amount*multiplier) + if (src.get_amount() < R.req_amount*multiplier) return var/atom/O = new R.result_type( usr.loc ) O.dir = usr.dir - if (R.max_res_amount>1) + if (R.max_res_amount > 1) var/obj/item/stack/new_item = O new_item.amount = R.res_amount*multiplier - //new_item.add_to_stacks(usr) - src.amount-=R.req_amount*multiplier - if (src.amount<=0) - var/oldsrc = src - src = null //dont kill proc after del() - usr.unEquip(oldsrc, 1) - qdel(oldsrc) - if (istype(O,/obj/item)) - usr.put_in_hands(O) + new_item.add_to_stacks(usr) + use(R.req_amount * multiplier) + if (istype(O,/obj/item)) + usr.put_in_hands(O) O.add_fingerprint(usr) - //BubbleWrap - so newly formed boxes are empty + //BubbleWrap - so newly formed boxes are empty // This is so insanely bad I don't even if ( istype(O, /obj/item/weapon/storage) ) for (var/obj/item/I in O) qdel(I) @@ -146,15 +158,23 @@ return return -/obj/item/stack/proc/use(var/amount) - src.amount-=amount - if (src.amount<=0) - var/oldsrc = src - src = null //dont kill proc after del() +/obj/item/stack/proc/use(var/used) // return 0 = borked; return 1 = had enough + if (is_cyborg) + return source.use_charge(used * cost) + if (amount < used) + return 0 + amount -= used + if (amount <= 0) if(usr) - usr.unEquip(oldsrc, 1) - qdel(oldsrc) - return + usr.unEquip(src, 1) + qdel(src) + return 1 + +/obj/item/stack/proc/add(var/amount) + if (is_cyborg) + source.add_charge(amount * cost) + else + src.amount += amount /obj/item/stack/proc/add_to_stacks(mob/usr as mob) var/obj/item/stack/oldsrc = src @@ -189,19 +209,28 @@ ..() if (istype(W, src.type)) var/obj/item/stack/S = W - if (S.amount >= max_amount) - return 1 - var/to_transfer as num - if (user.get_inactive_hand()==src) - to_transfer = 1 + if (S.is_cyborg) + var/to_transfer = min(src.amount, round((S.source.max_energy - S.source.energy) / S.cost)) + S.add(to_transfer) + if (S && usr.machine==S) + spawn(0) S.interact(usr) + src.use(to_transfer) + if (src && usr.machine==src) + spawn(0) src.interact(usr) else - to_transfer = min(src.amount, S.max_amount-S.amount) - S.amount+=to_transfer - if (S && usr.machine==S) - spawn(0) S.interact(usr) - src.use(to_transfer) - if (src && usr.machine==src) - spawn(0) src.interact(usr) + if (S.amount >= max_amount) + return 1 + var/to_transfer as num + if (user.get_inactive_hand()==src) + to_transfer = 1 + else + to_transfer = min(src.amount, S.max_amount-S.amount) + S.amount+=to_transfer + if (S && usr.machine==S) + spawn(0) S.interact(usr) + src.use(to_transfer) + if (src && usr.machine==src) + spawn(0) src.interact(usr) else return ..() /obj/item/stack/proc/copy_evidences(obj/item/stack/from as obj) diff --git a/code/game/objects/items/stacks/tiles/plasteel.dm b/code/game/objects/items/stacks/tiles/plasteel.dm index fce3db65f83..adf2e4f7257 100644 --- a/code/game/objects/items/stacks/tiles/plasteel.dm +++ b/code/game/objects/items/stacks/tiles/plasteel.dm @@ -15,7 +15,8 @@ /obj/item/stack/tile/plasteel/cyborg desc = "The ground you walk on" //Not the usual floor tile desc as that refers to throwing, Cyborgs can't do that - RR m_amt = 0 // All other Borg versions of items have no Metal or Glass - RR - max_amount = 50 + is_cyborg = 1 + cost = 125 /obj/item/stack/tile/plasteel/New(var/loc, var/amount=null) ..() @@ -28,7 +29,7 @@ if (istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W - if(amount < 4) + if(get_amount() < 4) user << "\red You need at least four tiles to do this." return diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index 8f6eab792de..99173ffb58b 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -93,10 +93,13 @@ else if(stage == EMPTY && istype(I, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/C = I - C.use(1) - det_time = 50 // In case the cable_coil was removed and readded. - stage_change(WIRED) - user << "You rig the [initial(name)] assembly." + if (C.use(1)) + det_time = 50 // In case the cable_coil was removed and readded. + stage_change(WIRED) + user << "You rig the [initial(name)] assembly." + else + user << "You need one length of coil to wire the assembly." + return else if(stage == READY && istype(I, /obj/item/weapon/wirecutters)) stage_change(WIRED) diff --git a/code/game/objects/items/weapons/grenades/ghettobomb.dm b/code/game/objects/items/weapons/grenades/ghettobomb.dm index df3e801863f..3bdb2c6cc6e 100644 --- a/code/game/objects/items/weapons/grenades/ghettobomb.dm +++ b/code/game/objects/items/weapons/grenades/ghettobomb.dm @@ -52,14 +52,17 @@ if(istype(I, /obj/item/stack/cable_coil)) if(assembled == 1) var/obj/item/stack/cable_coil/C = I - C.use(1) - assembled = 2 - user << "You wire the igniter to detonate the fuel." - desc = "A weak, improvised explosive." - overlays += image('icons/obj/grenade.dmi', icon_state = "improvised_grenade_wired") - name = "improvised explosive" - active = 0 - det_time = rand(30,80) + if (C.use(1)) + assembled = 2 + user << "You wire the igniter to detonate the fuel." + desc = "A weak, improvised explosive." + overlays += image('icons/obj/grenade.dmi', icon_state = "improvised_grenade_wired") + name = "improvised explosive" + active = 0 + det_time = rand(30,80) + else + user <<"span class='warning'>You need one length of cable to add an igniter." + return /obj/item/weapon/grenade/iedcasing/attack_self(mob/user as mob) // if(!active) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 799b5e57d52..4506afb18a6 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -91,15 +91,15 @@ ..() if(istype(I, /obj/item/stack/rods)) var/obj/item/stack/rods/R = I - var/obj/item/weapon/wirerod/W = new /obj/item/weapon/wirerod - R.use(1) - - user.unEquip(src) - - user.put_in_hands(W) - user << "You wrap the cable restraint around the top of the rod." - - qdel(src) + if (R.use(1)) + var/obj/item/weapon/wirerod/W = new /obj/item/weapon/wirerod + user.unEquip(src) + user.put_in_hands(W) + user << "You wrap the cable restraint around the top of the rod." + qdel(src) + else + user << "You need one rod to make a wired rod." + return /obj/item/weapon/handcuffs/cyborg/attack(mob/living/carbon/C, mob/user) if(isrobot(user)) diff --git a/code/game/objects/items/weapons/table_rack_parts.dm b/code/game/objects/items/weapons/table_rack_parts.dm index 8adcedd4ff9..d8cbe11c631 100644 --- a/code/game/objects/items/weapons/table_rack_parts.dm +++ b/code/game/objects/items/weapons/table_rack_parts.dm @@ -17,15 +17,15 @@ new /obj/item/stack/sheet/metal( user.loc ) //SN src = null qdel(src) - if (istype(W, /obj/item/stack/rods)) - var/obj/item/stack/rods/R = W - if (R.amount >= 4) + if (istype(W, /obj/item/stack/rods)) + var/obj/item/stack/rods/V = W + if (V.use(4)) new /obj/item/weapon/table_parts/reinforced( user.loc ) user << "You reinforce the [name]." - R.use(4) qdel(src) - else if (R.amount < 4) - user << "You need at least 4 rods to do that." + else + user << "You need four rods to reinforce table parts." + return /obj/item/weapon/table_parts/attack_self(mob/user as mob) user << "Constructing table.." @@ -93,4 +93,4 @@ R.add_fingerprint(user) user.drop_item() qdel(src) - return \ No newline at end of file + return diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index 385115c97a8..617fe7a030a 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -361,13 +361,17 @@ /obj/item/weapon/weldingtool/proc/flamethrower_rods(obj/item/I, mob/user) if(!status) var/obj/item/stack/rods/R = I - R.use(1) - var/obj/item/weapon/flamethrower/F = new /obj/item/weapon/flamethrower(user.loc) - user.unEquip(src) - loc = F - F.weldtool = src - add_fingerprint(user) - user.put_in_hands(F) + if (R.use(1)) + var/obj/item/weapon/flamethrower/F = new /obj/item/weapon/flamethrower(user.loc) + user.unEquip(src) + loc = F + F.weldtool = src + add_fingerprint(user) + user << "You add a rod to a welder, starting to build a flamethrower." + user.put_in_hands(F) + else + user << "You need one rod to start building a flamethrower." + return /obj/item/weapon/weldingtool/largetank name = "industrial welding tool" diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 358c961abc2..790f7f188e1 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -335,10 +335,12 @@ if(rigged) user << "[src] is already rigged!" return - user << "You rig [src]." - user.drop_item() - qdel(W) - rigged = 1 + var/obj/item/stack/cable_coil/C = W + if (C.use(5)) + user << "You rig [src]." + rigged = 1 + else + user << "You need 5 lengths of cable to rig [src]." return else if(istype(W, /obj/item/device/radio/electropack)) if(rigged) diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 553122c43fb..09193785f88 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -458,13 +458,16 @@ obj/structure/door_assembly src.anchored = 0 else if(istype(W, /obj/item/stack/cable_coil) && state == 0 && anchored ) - var/obj/item/stack/cable_coil/coil = W + var/obj/item/stack/cable_coil/C = W + if (C.get_amount() < 1) + user << "You need one length of cable to wire the airlock assembly." + return user.visible_message("[user] wires the airlock assembly.", "You start to wire the airlock assembly.") if(do_after(user, 40)) - if(!src) return - coil.use(1) + if(C.get_amount() < 1 || state != 0) return + C.use(1) src.state = 1 - user << "\blue You've wired the airlock assembly." + user << "You've wired the airlock assembly." src.name = "wired airlock assembly" else if(istype(W, /obj/item/weapon/wirecutters) && state == 1 ) diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 1311dbea0b8..d0875271714 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -73,25 +73,29 @@ if(/obj/item/stack/sheet/metal, /obj/item/stack/sheet/metal/cyborg) if(!anchored) - if(S.amount < 2) - user << "You need at least two sheets to create a false wall." + if (S.use(2)) + user << "You create a false wall! Push on it to open or close the passage." + var/obj/structure/falsewall/F = new (loc) + transfer_fingerprints_to(F) + qdel(src) + else + user << "You need two sheets of metal to create a false wall." return - S.use(2) - user << "You create a false wall! Push on it to open or close the passage." - var/obj/structure/falsewall/F = new (loc) - transfer_fingerprints_to(F) - qdel(src) else - if(S.amount < 2) return ..() + if(S.get_amount() < 2) + user << "You need two sheets of metal to finish a wall." + return user << "Now adding plating..." - if (do_after(user,40)) - if(!src || !S || S.amount < 2) return + if (do_after(user, 40)) + if(loc == null || S.get_amount() < 2) + return S.use(2) user << "You added the plating!" var/turf/Tsrc = get_turf(src) Tsrc.ChangeTurf(/turf/simulated/wall) for(var/turf/simulated/wall/X in Tsrc.loc) - if(X) transfer_fingerprints_to(X) + if(X) + transfer_fingerprints_to(X) qdel(src) return diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index ff59707bbed..fbdc264dcf3 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -119,7 +119,11 @@ return //window placing begin - else if( istype(W,/obj/item/stack/sheet/rglass) || istype(W,/obj/item/stack/sheet/glass) ) + else if(istype(W, /obj/item/stack/sheet/rglass) || istype(W, /obj/item/stack/sheet/glass)) + var/obj/item/stack/ST = W + if (ST.get_amount() < 1) + user << "You need at least one sheet of glass for that." + return var/dir_to_set = 1 if(loc == user.loc) dir_to_set = user.dir @@ -150,7 +154,7 @@ user << "There is already a window facing this way there." return var/obj/structure/window/WD - if(istype(W,/obj/item/stack/sheet/rglass)) + if(istype(W, /obj/item/stack/sheet/rglass)) WD = new/obj/structure/window(loc,1) //reinforced window else WD = new/obj/structure/window(loc,0) //normal window @@ -158,7 +162,6 @@ WD.ini_dir = dir_to_set WD.anchored = 0 WD.state = 0 - var/obj/item/stack/ST = W ST.use(1) user << "You place the [WD] on [src]." return diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 7c02b232b65..be5e7807136 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -199,13 +199,13 @@ turf/simulated/floor/proc/update_icon() break_tile() /turf/simulated/floor/is_plasteel_floor() - if(istype(floor_tile,/obj/item/stack/tile/plasteel)) + if(istype(floor_tile, /obj/item/stack/tile/plasteel)) return 1 else return 0 /turf/simulated/floor/is_light_floor() - if(istype(floor_tile,/obj/item/stack/tile/light)) + if(istype(floor_tile, /obj/item/stack/tile/light)) return 1 else return 0 @@ -324,7 +324,7 @@ turf/simulated/floor/proc/update_icon() intact = 1 SetLuminosity(0) if(T) - if(istype(T,/obj/item/stack/tile/plasteel)) + if(istype(T, /obj/item/stack/tile/plasteel)) floor_tile = T if (icon_regular_floor) icon_state = icon_regular_floor @@ -463,24 +463,30 @@ turf/simulated/floor/proc/update_icon() if(istype(C, /obj/item/stack/rods)) var/obj/item/stack/rods/R = C if (is_plating()) - if (R.amount >= 2) - user << "\blue Reinforcing the floor..." - if(do_after(user, 30) && R && R.amount >= 2 && is_plating()) - ChangeTurf(/turf/simulated/floor/engine) - playsound(src, 'sound/items/Deconstruct.ogg', 80, 1) - R.use(2) - return + if (R.get_amount() < 2) + user << "You need two rods to make a reinforced floor." + return else - user << "\red You need more rods." + user << "Reinforcing the floor..." + if(do_after(user, 30)) + if (R.get_amount() >= 2 && is_plating()) + ChangeTurf(/turf/simulated/floor/engine) + playsound(src, 'sound/items/Deconstruct.ogg', 80, 1) + R.use(2) + user << "You have reinforced the floor." + return else - user << "\red You must remove the plating first." + user << "You must remove the plating first." return if(istype(C, /obj/item/stack/tile)) if(is_plating()) if(!broken && !burnt) var/obj/item/stack/tile/T = C - floor_tile = new T.type + if(istype(T, /obj/item/stack/tile/plasteel/cyborg)) + floor_tile = new /obj/item/stack/tile/plasteel + else + floor_tile = new T.type intact = 1 if(istype(T,/obj/item/stack/tile/light)) var/obj/item/stack/tile/light/L = T @@ -514,7 +520,7 @@ turf/simulated/floor/proc/update_icon() return coil.turf_place(src, user) else - user << "\red You must remove the plating first." + user << "You must remove the plating first." if(istype(C, /obj/item/weapon/shovel)) if(is_grass_floor()) diff --git a/code/game/turfs/simulated/walls_reinforced.dm b/code/game/turfs/simulated/walls_reinforced.dm index 1dfbc9d1bb3..8126029fc18 100644 --- a/code/game/turfs/simulated/walls_reinforced.dm +++ b/code/game/turfs/simulated/walls_reinforced.dm @@ -75,13 +75,16 @@ return //REPAIRING (replacing the outer grille for cosmetic damage) - else if( istype(W, /obj/item/stack/rods) ) + else if(istype(W, /obj/item/stack/rods)) var/obj/item/stack/rods/O = W - src.d_state = 0 - src.icon_state = "r_wall" - relativewall_neighbours() //call smoothwall stuff - user << "You replace the outer grille." - O.use(1) + if (O.use(1)) + src.d_state = 0 + src.icon_state = "r_wall" + relativewall_neighbours() //call smoothwall stuff + user << "You replace the outer grille." + else + user << "You need one rod to repair the wall." + return return if(2) @@ -211,20 +214,23 @@ dismantle_wall() //REPAIRING - else if( istype(W, /obj/item/stack/sheet/metal) && d_state ) + else if(istype(W, /obj/item/stack/sheet/metal) && d_state) var/obj/item/stack/sheet/metal/MS = W + if (MS.get_amount() < 1) + user << "You need one sheet of metal to repair the wall." + return + user << "You begin patching-up the wall with \a [MS]." - 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.get_active_hand() == MS && d_state ) + if (do_after(user, max(20*d_state,100)))//time taken to repair is proportional to the damage! (max 10 seconds) + if(loc == null || MS.get_amount() < 1) + return + MS.use(1) src.d_state = 0 src.icon_state = "r_wall" relativewall_neighbours() //call smoothwall stuff user << "You repair the last of the damage." - MS.use(1) //APC diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index d5f53c2942a..b4bf950331f 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -18,27 +18,35 @@ /turf/space/attackby(obj/item/C as obj, mob/user as mob) if (istype(C, /obj/item/stack/rods)) + var/obj/item/stack/rods/R = C var/obj/structure/lattice/L = locate(/obj/structure/lattice, src) if(L) + user << "There is already a lattice." + return + if (R.use(1)) + user << "Constructing support lattice..." + playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) + ReplaceWithLattice() + else + user << "You need one rod to build lattice." return - var/obj/item/stack/rods/R = C - user << "\blue Constructing support lattice ..." - playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) - ReplaceWithLattice() - R.use(1) return if (istype(C, /obj/item/stack/tile/plasteel)) var/obj/structure/lattice/L = locate(/obj/structure/lattice, src) if(L) var/obj/item/stack/tile/plasteel/S = C - qdel(L) - playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) - S.build(src) - S.use(1) + if (S.use(1)) + qdel(L) + playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) + user << "You build a floor." + S.build(src) + else + user << "You need one floor tile to build a floor." + return return else - user << "\red The plating is going to need some support." + user << "The plating is going to need some support. Place metal rods first." return diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 53b7210d99f..1832f971b2d 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -144,15 +144,17 @@ /obj/item/weapon/reagent_containers/food/snacks/grown/potato/attackby(obj/item/weapon/W as obj, mob/user as mob) ..() if(istype(W, /obj/item/stack/cable_coil)) - if(W:amount >= 5) - W:amount -= 5 - if(!W:amount) qdel(W) + var/obj/item/stack/cable_coil/C + if (C.use(5)) user << "You add some cable to the potato and slide it inside the battery encasing." var/obj/item/weapon/stock_parts/cell/potato/pocell = new /obj/item/weapon/stock_parts/cell/potato(user.loc) pocell.maxcharge = src.potency * 10 pocell.charge = pocell.maxcharge qdel(src) return + else + user << "You need five lengths of cable to make a potato battery." + return /obj/item/weapon/reagent_containers/food/snacks/grown/grapes seed = "/obj/item/seeds/grapeseed" diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm index 44cbb1da3cf..2f130f34d6e 100644 --- a/code/modules/mining/mint.dm +++ b/code/modules/mining/mint.dm @@ -25,28 +25,28 @@ var/turf/T = get_step(src,input_dir) if(T) for(var/obj/item/stack/sheet/O in T) - if (istype(O,/obj/item/stack/sheet/mineral/gold)) + if (istype(O, /obj/item/stack/sheet/mineral/gold)) amt_gold += 100 * O.amount O.loc = null - if (istype(O,/obj/item/stack/sheet/mineral/silver)) + if (istype(O, /obj/item/stack/sheet/mineral/silver)) amt_silver += 100 * O.amount O.loc = null - if (istype(O,/obj/item/stack/sheet/mineral/diamond)) + if (istype(O, /obj/item/stack/sheet/mineral/diamond)) amt_diamond += 100 * O.amount O.loc = null - if (istype(O,/obj/item/stack/sheet/mineral/plasma)) + if (istype(O, /obj/item/stack/sheet/mineral/plasma)) amt_plasma += 100 * O.amount O.loc = null - if (istype(O,/obj/item/stack/sheet/mineral/uranium)) + if (istype(O, /obj/item/stack/sheet/mineral/uranium)) amt_uranium += 100 * O.amount O.loc = null - if (istype(O,/obj/item/stack/sheet/metal)) + if (istype(O, /obj/item/stack/sheet/metal)) amt_iron += 100 * O.amount O.loc = null - if (istype(O,/obj/item/stack/sheet/mineral/clown)) + if (istype(O, /obj/item/stack/sheet/mineral/clown)) amt_clown += 100 * O.amount O.loc = null - if (istype(O,/obj/item/stack/sheet/mineral/adamantine)) + if (istype(O, /obj/item/stack/sheet/mineral/adamantine)) amt_adamantine += 100 * O.amount O.loc = null //Commented out for now. -Durandan return diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm index 48c101d41be..88a115e20fb 100644 --- a/code/modules/mining/ores_coins.dm +++ b/code/modules/mining/ores_coins.dm @@ -224,21 +224,20 @@ /obj/item/weapon/coin/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W,/obj/item/stack/cable_coil) ) + if(istype(W, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/CC = W if(string_attached) - user << "\blue There already is a string attached to this coin." + user << "There already is a string attached to this coin." return - if(CC.amount <= 0) - user << "\blue This cable coil appears to be empty." - qdel(CC) + if (CC.use(1)) + overlays += image('icons/obj/economy.dmi',"coin_string_overlay") + string_attached = 1 + user << "You attach a string to the coin." + else + user << "You need one length of cable to attach a string to the coin." return - overlays += image('icons/obj/economy.dmi',"coin_string_overlay") - string_attached = 1 - user << "\blue You attach a string to the coin." - CC.use(1) else if(istype(W,/obj/item/weapon/wirecutters)) if(!string_attached) ..() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 9354918ac99..23019c83f9e 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -317,6 +317,8 @@ if(internal) stat("Internal Atmosphere Info", internal.name) stat("Tank Pressure", internal.air_contents.return_pressure()) + for (var/datum/robot_energy_storage/st in module.storages) + stat("[st.name]: [st.energy]/[st.max_energy]") /mob/living/silicon/robot/restrained() return 0 @@ -413,11 +415,13 @@ else if(istype(W, /obj/item/stack/cable_coil) && wiresexposed) var/obj/item/stack/cable_coil/coil = W - adjustFireLoss(-30) - updatehealth() - for(var/mob/O in viewers(user, null)) - O.show_message(text("\red [user] has fixed some of the burnt wires on [src]!"), 1) - coil.use(1) + if (coil.use(1)) + adjustFireLoss(-30) + updatehealth() + for(var/mob/O in viewers(user, null)) + O.show_message(text("\red [user] has fixed some of the burnt wires on [src]!"), 1) + else + user << "You need one length of cable to repair [src]." else if (istype(W, /obj/item/weapon/crowbar)) // crowbar means open or close the cover if(opened) diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 277bacfe30b..3fedce48ffb 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -9,7 +9,7 @@ var/list/modules = list() var/obj/item/emag = null var/obj/item/borg/upgrade/jetpack = null - + var/list/storages = list() /obj/item/weapon/robot_module/emp_act(severity) if(modules) @@ -108,42 +108,38 @@ modules += new /obj/item/device/t_scanner(src) modules += new /obj/item/device/analyzer(src) + var/datum/robot_energy_storage/metal/metstore = new /datum/robot_energy_storage/metal(src) + var/datum/robot_energy_storage/glass/glastore = new /datum/robot_energy_storage/glass(src) + var/datum/robot_energy_storage/wire/wirestore = new /datum/robot_energy_storage/wire(src) + var/obj/item/stack/sheet/metal/cyborg/M = new /obj/item/stack/sheet/metal/cyborg(src) - M.amount = 50 + M.source = metstore modules += M + var/obj/item/stack/sheet/glass/cyborg/Q = new /obj/item/stack/sheet/glass/cyborg(src) + Q.source = glastore + modules += Q + var/obj/item/stack/sheet/rglass/cyborg/G = new /obj/item/stack/sheet/rglass/cyborg(src) - G.amount = 50 + G.metsource = metstore + G.glasource = glastore modules += G var/obj/item/stack/rods/cyborg/R = new /obj/item/stack/rods/cyborg(src) - R.amount = 50 + R.source = metstore modules += R - var/obj/item/stack/cable_coil/W = new /obj/item/stack/cable_coil(src) - W.amount = 50 + var/obj/item/stack/cable_coil/cyborg/W = new /obj/item/stack/cable_coil/cyborg(src) + W.source = wirestore modules += W var/obj/item/stack/tile/plasteel/cyborg/F = new /obj/item/stack/tile/plasteel/cyborg(src) //"Plasteel" is the normal metal floor tile, Don't be confused - RR - F.amount = 50 - modules += F //'F' for floor tile - RR - - - respawn_consumable(var/mob/living/silicon/robot/R) - var/list/what = list ( - /obj/item/stack/sheet/metal, - /obj/item/stack/sheet/rglass, - /obj/item/stack/rods, - /obj/item/stack/cable_coil, - /obj/item/stack/tile/plasteel/cyborg, - ) - for(var/T in what) - if(!(locate(T) in modules)) - modules -= null - var/O = new T(src) - modules += O - O:amount = 1 + F.source = metstore + modules += F //'F' for floor tile - RR(src) + storages += metstore + storages += glastore + storages += wirestore /obj/item/weapon/robot_module/security name = "security robot module" @@ -239,4 +235,37 @@ modules += new /obj/item/weapon/gun/energy/laser/cyborg(src) modules += new /obj/item/weapon/tank/jetpack/carbondioxide(src) modules += new /obj/item/weapon/crowbar(src) - emag = null \ No newline at end of file + emag = null + +/datum/robot_energy_storage + var/name = "Generic energy storage" + var/max_energy = 30000 + var/recharge_rate = 1000 + var/energy + +/datum/robot_energy_storage/New() + energy = max_energy + return + +/datum/robot_energy_storage/proc/use_charge(var/amount) + if (energy >= amount) + energy -= amount + if (energy == 0) + return 1 + return 2 + else + return 0 + +/datum/robot_energy_storage/proc/add_charge(var/amount) + energy = min(energy + amount, max_energy) + +/datum/robot_energy_storage/metal + name = "Metal Synthesizer" + +/datum/robot_energy_storage/glass + name = "Glass Synthesizer" + +/datum/robot_energy_storage/wire + max_energy = 50 + recharge_rate = 2 + name = "Wire Synthesizer" diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index e296c3123fd..dd23b2ed520 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -488,28 +488,29 @@ user << "You fail to [ locked ? "unlock" : "lock"] the APC interface." else if (istype(W, /obj/item/stack/cable_coil) && !terminal && opened && has_electronics!=2) if (src.loc:intact) - user << "\red You must remove the floor plating in front of the APC first." + user << "You must remove the floor plating in front of the APC first." return var/obj/item/stack/cable_coil/C = W - if(C.amount < 10) - user << "\red You need more wires." + if(C.get_amount() < 10) + user << "You need ten lengths of cable for APC." return user << "You start adding cables to the APC frame..." playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) - if(do_after(user, 20) && C.amount >= 10) - var/turf/T = get_turf(src) - var/obj/structure/cable/N = T.get_cable_node() - if (prob(50) && electrocute_mob(usr, N, N)) - var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread - s.set_up(5, 1, src) - s.start() - return - C.use(10) - user.visible_message(\ - "\red [user.name] has added cables to the APC frame!",\ - "You add cables to the APC frame.") - make_terminal() - terminal.connect_to_network() + if(do_after(user, 20)) + if (C.amount >= 10 && !terminal && opened && has_electronics != 2) + var/turf/T = get_turf(src) + var/obj/structure/cable/N = T.get_cable_node() + if (prob(50) && electrocute_mob(usr, N, N)) + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, src) + s.start() + return + C.use(10) + user.visible_message(\ + "\red [user.name] has added cables to the APC frame!",\ + "You add cables to the APC frame.") + make_terminal() + terminal.connect_to_network() else if (istype(W, /obj/item/weapon/wirecutters) && terminal && opened && has_electronics!=2) if (src.loc:intact) user << "\red You must remove the floor plating in front of the APC first." diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 5dc3e03aef9..94acb6797ee 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -146,6 +146,9 @@ By design, d1 is the smallest direction and d2 is the highest else if(istype(W, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/coil = W + if (coil.get_amount() < 1) + user << "Not enough cable" + return coil.cable_join(src, user) else if(istype(W, /obj/item/device/multitool)) @@ -464,6 +467,12 @@ obj/structure/cable/proc/avail() slot_flags = SLOT_BELT attack_verb = list("whipped", "lashed", "disciplined", "flogged") +/obj/item/stack/cable_coil/cyborg + is_cyborg = 1 + m_amt = 0 + g_amt = 0 + cost = 1 + /obj/item/stack/cable_coil/suicide_act(mob/user) if(locate(/obj/structure/stool) in user.loc) user.visible_message("[user] is making a noose with the [src.name]! It looks like \he's trying to commit suicide.") @@ -515,12 +524,15 @@ obj/structure/cable/proc/avail() /obj/item/stack/cable_coil/examine() set src in view(1) - if(amount == 1) - usr << "A short piece of power cable." - else if(amount == 2) - usr << "A piece of power cable." + if (is_cyborg) + usr << "A cable synthesizer. Currently has energy for [get_amount()] lengths of cable." else - usr << "A coil of power cable. There are [amount] lengths of cable in the coil." + if(get_amount() == 1) + usr << "A short piece of power cable." + else if(get_amount() == 2) + usr << "A piece of power cable." + else + usr << "A coil of power cable. There are [get_amount()] lengths of cable in the coil." /obj/item/stack/cable_coil/verb/make_restraint() @@ -553,7 +565,12 @@ obj/structure/cable/proc/avail() src.update_icon() return - else if( istype(W, /obj/item/stack/cable_coil) ) + else if(istype(W, /obj/item/stack/cable_coil/cyborg)) + var/obj/item/stack/cable_coil/cyborg/C = W + var/to_transfer = min(src.amount, round((C.source.max_energy - C.source.energy) / C.cost)) + C.add(to_transfer) + src.use(to_transfer) + else if(istype(W, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/C = W if(C.amount >= MAXCOIL) user << "The coil is too long, you cannot add any more cable to it." @@ -573,6 +590,7 @@ obj/structure/cable/proc/avail() return //remove cables from the stack +/* This is probably reduntant /obj/item/stack/cable_coil/use(var/used) if(src.amount < used) return 0 @@ -586,6 +604,11 @@ obj/structure/cable/proc/avail() amount -= used update_icon() return 1 +*/ +/obj/item/stack/cable_coil/use(var/used) + . = ..() + update_icon() + return //add cables to the stack /obj/item/stack/cable_coil/proc/give(var/extra) @@ -604,11 +627,15 @@ obj/structure/cable/proc/avail() if(!isturf(user.loc)) return - if(get_dist(F,user) > 1) //too far + if(get_amount() < 1) // Out of cable + user << "There is no cable left." + return + + if(get_dist(F,user) > 1) // Too far user << "You can't lay cable at a place that far away." return - if(F.intact) // if floor is intact, complain + if(F.intact) // Ff floor is intact, complain user << "You can't lay cable there unless the floor tiles are removed." return diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 7158a28f907..8261e9fc7dc 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -137,15 +137,17 @@ if(istype(W, /obj/item/stack/cable_coil)) if (src.stage != 1) return var/obj/item/stack/cable_coil/coil = W - coil.use(1) - switch(fixture_type) - if ("tube") - src.icon_state = "tube-construct-stage2" - if("bulb") - src.icon_state = "bulb-construct-stage2" - src.stage = 2 - user.visible_message("[user.name] adds wires to [src].", \ - "You add wires to [src].") + if (coil.use(1)) + switch(fixture_type) + if ("tube") + src.icon_state = "tube-construct-stage2" + if("bulb") + src.icon_state = "bulb-construct-stage2" + src.stage = 2 + user.visible_message("[user.name] adds wires to [src].", \ + "You add wires to [src].") + else + user << "You need one length of cable to wire [src]." return if(istype(W, /obj/item/weapon/screwdriver)) diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm index f4751450a1d..85684c8e756 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm @@ -226,10 +226,14 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin "You remove the external bolts.") temp_state-- else if(istype(O, /obj/item/stack/cable_coil)) - if(O:use(1,user)) + var/obj/item/stack/cable_coil/C = O + if(C.use(1)) user.visible_message("[user.name] adds wires to the [src.name].", \ "You add some wires.") temp_state++ + else + user << "You need one length of cable to wire the [src.name]." + return if(2) if(istype(O, /obj/item/weapon/wirecutters))//TODO:Shock user if its on? user.visible_message("[user.name] removes some wires from the [src.name].", \ diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 7c3e16ed5a4..8b394c28d73 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -219,15 +219,17 @@ var/list/solars_list = list() if(istype(W, /obj/item/stack/sheet/glass) || istype(W, /obj/item/stack/sheet/rglass)) var/obj/item/stack/sheet/S = W - if(S.amount >= 2) + if(S.use(2)) glass_type = W.type - S.use(2) playsound(src.loc, 'sound/machines/click.ogg', 50, 1) user.visible_message("[user] places the glass on the solar assembly.") if(tracker) new /obj/machinery/power/tracker(get_turf(src), src) else new /obj/machinery/power/solar(get_turf(src), src) + else + user << "You need two sheets of glass to put them into a solar panel." + return return 1 if(!tracker) diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index e5588ca946f..6c960e0d5c8 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -75,15 +75,15 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis). if(istype(O, /obj/item/weapon/crowbar)) for(var/obj/item/weapon/reagent_containers/glass/G in component_parts) reagents.trans_to(G, G.reagents.maximum_volume) - if(g_amount >= 3750) + if(g_amount >= MINERAL_MATERIAL_AMOUNT) var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc) - G.amount = round(g_amount / 3750) - if(gold_amount >= 2000) + G.amount = round(g_amount / MINERAL_MATERIAL_AMOUNT) + if(gold_amount >= MINERAL_MATERIAL_AMOUNT) var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold(src.loc) - G.amount = round(gold_amount / 2000) - if(diamond_amount >= 2000) + G.amount = round(gold_amount / MINERAL_MATERIAL_AMOUNT) + if(diamond_amount >= MINERAL_MATERIAL_AMOUNT) var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(src.loc) - G.amount = round(diamond_amount / 2000) + G.amount = round(diamond_amount / MINERAL_MATERIAL_AMOUNT) default_deconstruction_crowbar(O) return else @@ -116,14 +116,14 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis). amount = min(stack.amount, round((max_material_amount-TotalMaterials())/stack.perunit)) busy = 1 - use_power(max(1000, (3750*amount/10))) + use_power(max(1000, (MINERAL_MATERIAL_AMOUNT*amount/10))) user << "You add [amount] sheets to the [src.name]." if(istype(stack, /obj/item/stack/sheet/glass)) - g_amount += amount * 3750 + g_amount += amount * MINERAL_MATERIAL_AMOUNT else if(istype(stack, /obj/item/stack/sheet/mineral/gold)) - gold_amount += amount * 2000 + gold_amount += amount * MINERAL_MATERIAL_AMOUNT else if(istype(stack, /obj/item/stack/sheet/mineral/diamond)) - diamond_amount += amount * 2000 + diamond_amount += amount * MINERAL_MATERIAL_AMOUNT stack.use(amount) busy = 0 src.updateUsrDialog()