mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 08:37:43 +01:00
Merge pull request #3889 from Kelenius/OfCyborgsAndModules
Of cyborgs and modules
This commit is contained in:
@@ -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 << "<span class='warning'>You need five lengths of cable to wire the fire alarm.</span>"
|
||||
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 << "<span class='notice'>You start wiring the air alarm.</span>"
|
||||
if (do_after(user, 20))
|
||||
if (cable.get_amount() >= 5 && buildstage == 1)
|
||||
cable.use(5)
|
||||
user << "<span class='notice'>You wire the air alarm.</span>"
|
||||
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 << "<span class='warning'>You need more cable for this!</span>"
|
||||
return
|
||||
|
||||
coil.amount -= 5
|
||||
if(!coil.amount)
|
||||
qdel(coil)
|
||||
coil.use(5)
|
||||
|
||||
buildstage = 2
|
||||
user << "<span class='notice'>You wire \the [src]!</span>"
|
||||
|
||||
@@ -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 << "<span class='warning'>You need one length of cable to wire the ED-209.</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start to wire [src]...</span>"
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
coil.use(1)
|
||||
build_step++
|
||||
user << "<span class='notice'>You wire the ED-209 assembly.</span>"
|
||||
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 << "<span class='notice'>You wire the ED-209 assembly.</span>"
|
||||
name = "wired ED-209 assembly"
|
||||
|
||||
if(7)
|
||||
switch(lasercolor)
|
||||
|
||||
@@ -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 << "<span class='notice'>You load [loaded] tiles into the floorbot. He now contains [src.amount] tiles.</span>"
|
||||
src.updateicon()
|
||||
if (loaded > 0)
|
||||
user << "<span class='notice'>You load [loaded] tiles into the floorbot. He now contains [src.amount] tiles.</span>"
|
||||
src.updateicon()
|
||||
else
|
||||
user << "<span class='warning'>You need at least one floor tile to put into the floorbot.</span>"
|
||||
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 << "<span class='notice'>They wont fit in as there is already stuff inside.</span>"
|
||||
user << "<span class='alert'>They won't fit in, as there is already stuff inside.</span>"
|
||||
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 << "<span class='notice'>You add the tiles into the empty toolbox. They protrude from the top.</span>"
|
||||
user.unEquip(src, 1)
|
||||
qdel(src)
|
||||
else
|
||||
user << "<span class='alert'>You need 10 floor tiles to start building a floorbot.</span>"
|
||||
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 << "<span class='notice'>You add the tiles into the empty toolbox. They protrude from the top.</span>"
|
||||
user.unEquip(src, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/toolbox_tiles/attackby(var/obj/item/W, mob/user as mob)
|
||||
..()
|
||||
|
||||
@@ -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 << "<span class='notice'>You add wires to the assembly.</span>"
|
||||
state = 3
|
||||
else
|
||||
user << "<span class='warning'>You need two lengths of cable to wire a camera.</span>"
|
||||
return
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/weapon/weldingtool))
|
||||
|
||||
@@ -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 << "<span class='notice'>You add cables to the frame.</span>"
|
||||
state = 3
|
||||
icon_state = "3"
|
||||
if (C.get_amount() >= 5 && state == 3)
|
||||
C.use(5)
|
||||
user << "<span class='notice'>You add cables to the frame.</span>"
|
||||
state = 3
|
||||
icon_state = "3"
|
||||
else
|
||||
user << "<span class='warning'>You need five lengths of cable to wire the AI core.</span>"
|
||||
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 << "<span class='notice'>You put in the glass panel.</span>"
|
||||
state = 4
|
||||
icon_state = "4"
|
||||
else
|
||||
user << "<span class='warning'>You need two sheets of reinforced glass to insert them into AI core.</span>"
|
||||
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
|
||||
|
||||
@@ -326,50 +326,51 @@
|
||||
if(istype(P, /obj/item/weapon/screwdriver) && circuit)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "<span class='notice'>You unfasten the circuit board.</span>"
|
||||
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 << "<span class='notice'>You start adding cables to the frame.</span>"
|
||||
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 << "<span class='notice'>You've added cables to the frame.</span>"
|
||||
src.state = 3
|
||||
src.icon_state = "3"
|
||||
state = 3
|
||||
icon_state = "3"
|
||||
else
|
||||
user << "<span class='warning'>You need more cable to do that.</span>"
|
||||
user << "<span class='warning'>You need five lengths of cable to wire the frame.</span>"
|
||||
if(3)
|
||||
if(istype(P, /obj/item/weapon/wirecutters))
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
user << "<span class='notice'>You remove the cables.</span>"
|
||||
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 << "<span class='warning'>You need two glass sheets to continue construction.</span>"
|
||||
return
|
||||
else
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "<span class='notice'>You start to put in the glass panel.</span>"
|
||||
if(do_after(user, 20))
|
||||
if(P)
|
||||
P:use(2)
|
||||
if(G.get_amount() >= 2 && state == 3)
|
||||
G.use(2)
|
||||
user << "<span class='notice'>You've put in the glass panel.</span>"
|
||||
src.state = 4
|
||||
state = 4
|
||||
src.icon_state = "4"
|
||||
else
|
||||
user << "<span class='warning'>You need more glass to do that.</span>"
|
||||
if(4)
|
||||
if(istype(P, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "<span class='notice'>You remove the glass panel.</span>"
|
||||
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))
|
||||
|
||||
@@ -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 << "<span class='notice'>You start to add cables to the frame.</span>"
|
||||
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 << "<span class='notice'>You add cables to the frame.</span>"
|
||||
state = 2
|
||||
icon_state = "box_1"
|
||||
else
|
||||
user << "<span class='warning'>You need five length of cable to wire the frame.</span>"
|
||||
return
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user << "<span class='notice'>You dismantle the frame.</span>"
|
||||
@@ -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
|
||||
|
||||
@@ -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 << "<span class='notice'>You add some metal armor to the interior frame.</span>"
|
||||
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 << "<span class='warning'>You need two sheets of metal for that.</span>"
|
||||
user << "<span class='warning'>You need two sheets of metal to continue construction.</span>"
|
||||
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 << "<span class='notice'>You add some metal armor to the exterior frame.</span>"
|
||||
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 << "<span class='warning'>You need two sheets of metal for that.</span>"
|
||||
user << "<span class='warning'>You need two sheets of metal to continue construction.</span>"
|
||||
return
|
||||
|
||||
else if(istype(I, /obj/item/weapon/screwdriver))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 << "<span class='notice'>You begin to replace the wires.</span>"
|
||||
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 << "<span class='notice'>You repair the [src]!</span>"
|
||||
update_icon()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
construct_op --
|
||||
stat &= ~BROKEN // the machine's not borked anymore!
|
||||
else
|
||||
user << "<span class='danger'>You need more cable to do that.</span>"
|
||||
user << "<span class='danger'>You need five lengths of cable for this machine.</span>"
|
||||
if(istype(P, /obj/item/weapon/crowbar))
|
||||
user << "<span class='notice'>You begin prying out the circuit board and components...</span>"
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
|
||||
@@ -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 << "<span class='notice'>You replace the fused wires.</span>"
|
||||
else
|
||||
user << "There's not enough wire to finish the task."
|
||||
user << "<span class='warning'>You need two lengths of cable to fix this mecha.</span>"
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(hasInternalDamage(MECHA_INT_TEMP_CONTROL))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 << "<span class='notice'>You insert a piece of glass into the [src.name]. You have [uses] lights remaining.</span>"
|
||||
return
|
||||
else
|
||||
user << "<span class='warning'>You need one sheet of glass to replace lights.</span>"
|
||||
|
||||
if(istype(W, /obj/item/weapon/light))
|
||||
var/obj/item/weapon/light/L = W
|
||||
|
||||
@@ -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 << "<span class='notice'>You armed the robot frame.</span>"
|
||||
if (user.get_inactive_hand()==src)
|
||||
user.unEquip(src)
|
||||
user.put_in_inactive_hand(B)
|
||||
qdel(src)
|
||||
else
|
||||
user << "<span class='warning'>You need one sheet of metal to start building ED-209.</span>"
|
||||
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 << "<span class='warning'>You have already inserted wire.</span>"
|
||||
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 << "<span class='notice'>You insert the wire.</span>"
|
||||
else
|
||||
user << "<span class='warning'>You need one length of coil to wire it.</span>"
|
||||
return
|
||||
|
||||
/obj/item/robot_parts/head/attackby(obj/item/W as obj, mob/user as mob)
|
||||
|
||||
@@ -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
|
||||
@@ -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 << "<span class='warning>You need five lengths of coil and one sheet of glass to make wired glass.</span>"
|
||||
return
|
||||
CC.use(5)
|
||||
user << "\blue You attach wire to the [name]."
|
||||
use(1)
|
||||
user << "<span class='notice'>You attach wire to the [name].</span>"
|
||||
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 << "<span class='warning'>You need one rod and one sheet of glass to make reinforced glass.</span>"
|
||||
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 << "<span class='warning'>You need more glass to do that.</span>"
|
||||
return 1
|
||||
if(locate(/obj/structure/window) in user.loc)
|
||||
@@ -208,7 +229,7 @@
|
||||
user << "<span class='warning'>There is already a windoor in that location.</span>"
|
||||
return 1
|
||||
|
||||
if(src.amount < 5)
|
||||
if(src.get_amount() < 5)
|
||||
user << "<span class='warning'>You need more glass to do that.</span>"
|
||||
return 1
|
||||
|
||||
|
||||
@@ -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 << "<span class='notice'>You make a light tile.</span>"
|
||||
L.add_fingerprint(user)
|
||||
else
|
||||
user << "<span class='warning'>You need one metal sheet to finish the light tile.</span>"
|
||||
return
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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("<HTML><HEAD><title>Constructions from []</title></HEAD><body><TT>Amount Left: []<br>", src, src.amount)
|
||||
var/t1 = text("<HTML><HEAD><title>Constructions from []</title></HEAD><body><TT>Amount Left: []<br>", 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+="<br>"
|
||||
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,22 +135,17 @@
|
||||
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
|
||||
if ( istype(O, /obj/item/weapon/storage) )
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 << "<span class='notice'>You rig the [initial(name)] assembly.</span>"
|
||||
if (C.use(1))
|
||||
det_time = 50 // In case the cable_coil was removed and readded.
|
||||
stage_change(WIRED)
|
||||
user << "<span class='notice'>You rig the [initial(name)] assembly.</span>"
|
||||
else
|
||||
user << "<span class='warning'>You need one length of coil to wire the assembly.</span>"
|
||||
return
|
||||
|
||||
else if(stage == READY && istype(I, /obj/item/weapon/wirecutters))
|
||||
stage_change(WIRED)
|
||||
|
||||
@@ -54,20 +54,23 @@
|
||||
if(istype(I, /obj/item/stack/cable_coil))
|
||||
if(assembled == 1)
|
||||
var/obj/item/stack/cable_coil/C = I
|
||||
times = list("5" = 10, "-1" = 20, "[rand(30,80)]" = 50, "[rand(65,180)]" = 20) // "Premature, Dud, Short Fuse, Long Fuse"=[weighting value]
|
||||
C.use(1)
|
||||
assembled = 2
|
||||
user << "<span class='notice'>You wire the igniter to detonate the fuel.</span>"
|
||||
desc = "A weak, improvised incendiary device."
|
||||
overlays += image('icons/obj/grenade.dmi', icon_state = "improvised_grenade_wired")
|
||||
name = "improvised firebomb"
|
||||
active = 0
|
||||
det_time = text2num(pickweight(times))
|
||||
if(det_time < 0) //checking for 'duds'
|
||||
range = 1
|
||||
det_time = rand(30,80)
|
||||
if (C.use(1))
|
||||
times = list("5" = 10, "-1" = 20, "[rand(30,80)]" = 50, "[rand(65,180)]" = 20) // "Premature, Dud, Short Fuse, Long Fuse"=[weighting value]
|
||||
assembled = 2
|
||||
user << "<span class='notice'>You wire the igniter to detonate the fuel.</span>"
|
||||
desc = "A weak, improvised incendiary device."
|
||||
overlays += image('icons/obj/grenade.dmi', icon_state = "improvised_grenade_wired")
|
||||
name = "improvised firebomb"
|
||||
active = 0
|
||||
det_time = text2num(pickweight(times))
|
||||
if(det_time < 0) //checking for 'duds'
|
||||
range = 1
|
||||
det_time = rand(30,80)
|
||||
else
|
||||
range = pick(2,2,2,3,3,3,4)
|
||||
else
|
||||
range = pick(2,2,2,3,3,3,4)
|
||||
user <<"span class='warning'>You need one length of cable to add an igniter.</span>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/grenade/iedcasing/attack_self(mob/user as mob) //
|
||||
if(!active)
|
||||
|
||||
@@ -88,15 +88,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 << "<span class='notice'>You wrap the cable restraint around the top of the rod.</span>"
|
||||
|
||||
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 << "<span class='notice'>You wrap the cable restraint around the top of the rod.</span>"
|
||||
qdel(src)
|
||||
else
|
||||
user << "<span class='warning'>You need one rod to make a wired rod.</span>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/handcuffs/cyborg/attack(mob/living/carbon/C, mob/user)
|
||||
if(isrobot(user))
|
||||
|
||||
@@ -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 << "<span class='notice'>You reinforce the [name].</span>"
|
||||
R.use(4)
|
||||
qdel(src)
|
||||
else if (R.amount < 4)
|
||||
user << "<span class='notice'>You need at least 4 rods to do that.</span>"
|
||||
else
|
||||
user << "<span class='warning'>You need four rods to reinforce table parts.</span>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/table_parts/attack_self(mob/user as mob)
|
||||
user << "<span class='notice'>Constructing table..</span>"
|
||||
@@ -93,4 +93,4 @@
|
||||
R.add_fingerprint(user)
|
||||
user.drop_item()
|
||||
qdel(src)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -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 << "<span class='notice'>You add a rod to a welder, starting to build a flamethrower.</span>"
|
||||
user.put_in_hands(F)
|
||||
else
|
||||
user << "<span class='warning'>You need one rod to start building a flamethrower.</span>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/weldingtool/largetank
|
||||
name = "industrial welding tool"
|
||||
|
||||
@@ -338,10 +338,12 @@
|
||||
if(rigged)
|
||||
user << "<span class='notice'>[src] is already rigged!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You rig [src].</span>"
|
||||
user.drop_item()
|
||||
qdel(W)
|
||||
rigged = 1
|
||||
var/obj/item/stack/cable_coil/C = W
|
||||
if (C.use(5))
|
||||
user << "<span class='notice'>You rig [src].</span>"
|
||||
rigged = 1
|
||||
else
|
||||
user << "<span class='warning'>You need 5 lengths of cable to rig [src].</span>"
|
||||
return
|
||||
else if(istype(W, /obj/item/device/radio/electropack))
|
||||
if(rigged)
|
||||
|
||||
@@ -464,12 +464,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 << "<span class='warning'>You need one length of cable to wire the airlock assembly.</span>"
|
||||
return
|
||||
user.visible_message("[user] wires the airlock assembly.", "You start to wire the airlock assembly.")
|
||||
if(do_after(user, 40))
|
||||
coil.use(1)
|
||||
if(do_after(user, 40))
|
||||
if(C.get_amount() < 1 || state != 0) return
|
||||
C.use(1)
|
||||
src.state = 1
|
||||
user << "<span class='notice'> You've wired the airlock assembly.</span>"
|
||||
user << "<span class='notice'>You've wired the airlock assembly.</span>"
|
||||
src.name = "wired airlock assembly"
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wirecutters) && state == 1 )
|
||||
@@ -522,12 +526,13 @@ obj/structure/door_assembly
|
||||
else if(istype(W, /obj/item/stack/sheet) && !mineral)
|
||||
var/obj/item/stack/sheet/G = W
|
||||
if(G)
|
||||
if(G.amount>=1)
|
||||
if(G.get_amount() >= 1)
|
||||
if(G.type == /obj/item/stack/sheet/rglass)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
|
||||
user.visible_message("[user] adds [G.name] to the airlock assembly.", "You start to install [G.name] into the airlock assembly.")
|
||||
if(do_after(user, 40))
|
||||
user << "<span class='notice'> You've installed reinforced glass windows into the airlock assembly.</span>"
|
||||
if(do_after(user, 40))
|
||||
if(G.get_amount() < 1 || mineral) return
|
||||
user << "<span class='notice'>You've installed reinforced glass windows into the airlock assembly.</span>"
|
||||
G.use(1)
|
||||
mineral = "glass"
|
||||
name = "near finished window airlock assembly"
|
||||
@@ -545,11 +550,12 @@ obj/structure/door_assembly
|
||||
glass_base_icon_state = "door_as_g[icontext]"
|
||||
else if(istype(G, /obj/item/stack/sheet/mineral))
|
||||
var/M = G.sheettype
|
||||
if(G.amount>=2)
|
||||
if(G.get_amount() >= 2)
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
|
||||
user.visible_message("[user] adds [G.name] to the airlock assembly.", "You start to install [G.name] into the airlock assembly.")
|
||||
if(do_after(user, 40))
|
||||
user << "<span class='notice'> You've installed [M] plating into the airlock assembly.</span>"
|
||||
if(do_after(user, 40))
|
||||
if(G.get_amount() < 2 || mineral) return
|
||||
user << "<span class='notice'>You've installed [M] plating into the airlock assembly.</span>"
|
||||
G.use(2)
|
||||
mineral = "[M]"
|
||||
name = "near finished [M] airlock assembly"
|
||||
|
||||
@@ -73,25 +73,29 @@
|
||||
|
||||
if(/obj/item/stack/sheet/metal, /obj/item/stack/sheet/metal/cyborg)
|
||||
if(!anchored)
|
||||
if(S.amount < 2)
|
||||
user << "<span class='warning'>You need at least two sheets to create a false wall.</span>"
|
||||
if (S.use(2))
|
||||
user << "<span class='notice'>You create a false wall! Push on it to open or close the passage.</span>"
|
||||
var/obj/structure/falsewall/F = new (loc)
|
||||
transfer_fingerprints_to(F)
|
||||
qdel(src)
|
||||
else
|
||||
user << "<span class='warning'>You need two sheets of metal to create a false wall.</span>"
|
||||
return
|
||||
S.use(2)
|
||||
user << "<span class='notice'>You create a false wall! Push on it to open or close the passage.</span>"
|
||||
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 << "<span class='warning'>You need two sheets of metal to finish a wall.</span>"
|
||||
return
|
||||
user << "<span class='notice'>Now adding plating...</span>"
|
||||
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 << "<span class='notice'>You added the plating!</span>"
|
||||
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
|
||||
|
||||
|
||||
@@ -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 << "<span class='warning'>You need at least one sheet of glass for that.</span>"
|
||||
return
|
||||
var/dir_to_set = 1
|
||||
if(loc == user.loc)
|
||||
dir_to_set = user.dir
|
||||
@@ -150,7 +154,7 @@
|
||||
user << "<span class='notice'>There is already a window facing this way there.</span>"
|
||||
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 << "<span class='notice'>You place the [WD] on [src].</span>"
|
||||
return
|
||||
|
||||
@@ -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 << "<span class='warning'>You need two rods to make a reinforced floor.</span>"
|
||||
return
|
||||
else
|
||||
user << "\red You need more rods."
|
||||
user << "<span class='notice'>Reinforcing the floor...</span>"
|
||||
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 << "<span class='notice'>You have reinforced the floor.</span>"
|
||||
return
|
||||
else
|
||||
user << "\red You must remove the plating first."
|
||||
user << "<span class='warning'>You must remove the plating first.</span>"
|
||||
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 << "<span class='warning'>You must remove the plating first.</span>"
|
||||
|
||||
if(istype(C, /obj/item/weapon/shovel))
|
||||
if(is_grass_floor())
|
||||
|
||||
@@ -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 << "<span class='notice'>You replace the outer grille.</span>"
|
||||
O.use(1)
|
||||
if (O.use(1))
|
||||
src.d_state = 0
|
||||
src.icon_state = "r_wall"
|
||||
relativewall_neighbours() //call smoothwall stuff
|
||||
user << "<span class='notice'>You replace the outer grille.</span>"
|
||||
else
|
||||
user << "<span class='warning'>You need one rod to repair the wall.</span>"
|
||||
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 << "<span class='warning'>You need one sheet of metal to repair the wall.</span>"
|
||||
return
|
||||
|
||||
user << "<span class='notice'>You begin patching-up the wall with \a [MS].</span>"
|
||||
|
||||
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 << "<span class='notice'>You repair the last of the damage.</span>"
|
||||
MS.use(1)
|
||||
|
||||
|
||||
//APC
|
||||
|
||||
@@ -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 << "<span class='warning'>There is already a lattice.</span>"
|
||||
return
|
||||
if (R.use(1))
|
||||
user << "<span class='notice'>Constructing support lattice...</span>"
|
||||
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
|
||||
ReplaceWithLattice()
|
||||
else
|
||||
user << "<span class='warning'>You need one rod to build lattice.</span>"
|
||||
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 << "<span class='notice'>You build a floor.</span>"
|
||||
S.build(src)
|
||||
else
|
||||
user << "<span class='warning'>You need one floor tile to build a floor.</span>"
|
||||
return
|
||||
return
|
||||
else
|
||||
user << "\red The plating is going to need some support."
|
||||
user << "<span class='danger'>The plating is going to need some support. Place metal rods first.</span>"
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -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 << "<span class='notice'>You add some cable to the potato and slide it inside the battery encasing.</span>"
|
||||
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 << "<span class='warning'>You need five lengths of cable to make a potato battery.</span>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/grapes
|
||||
seed = "/obj/item/seeds/grapeseed"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 << "<span class='notice'>There already is a string attached to this coin.</span>"
|
||||
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 << "<span class='notice'>You attach a string to the coin.</span>"
|
||||
else
|
||||
user << "<span class='warning'>You need one length of cable to attach a string to the coin.</span>"
|
||||
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)
|
||||
..()
|
||||
|
||||
@@ -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 << "<span class='warning'>You need one length of cable to repair [src].</span>"
|
||||
|
||||
else if (istype(W, /obj/item/weapon/crowbar)) // crowbar means open or close the cover
|
||||
if(opened)
|
||||
|
||||
@@ -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
|
||||
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"
|
||||
|
||||
+18
-17
@@ -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 << "<span class='warning'>You must remove the floor plating in front of the APC first.</span>"
|
||||
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 << "<span class='warning'>You need ten lengths of cable for APC.</span>"
|
||||
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."
|
||||
|
||||
@@ -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("<span class='suicide'>[user] is making a noose with the [src.name]! It looks like \he's trying to commit suicide.</span>")
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 << "<span class='warning'>You need one length of cable to wire [src]."
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
|
||||
@@ -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 << "<span class='warning'>You need one length of cable to wire the [src.name].</span>"
|
||||
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].", \
|
||||
|
||||
@@ -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("<span class='notice'>[user] places the glass on the solar assembly.</span>")
|
||||
if(tracker)
|
||||
new /obj/machinery/power/tracker(get_turf(src), src)
|
||||
else
|
||||
new /obj/machinery/power/solar(get_turf(src), src)
|
||||
else
|
||||
user << "<span class='warning'>You need two sheets of glass to put them into a solar panel.</span>"
|
||||
return
|
||||
return 1
|
||||
|
||||
if(!tracker)
|
||||
|
||||
@@ -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 << "<span class='notice'>You add [amount] sheets to the [src.name].</span>"
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user