mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
<span> and cable use()
- Added more span tags - using cable now uses use() - fixed use() to correctly return 1 when it succeeds - checked that there were no checks that would’ve been previously borked. For testing purposes I renamed use to use_cable (‘use’ is kinda bad for a proc name, but use_cable is hardly better), but left that out of the commit because it would’ve inflated the pr.
This commit is contained in:
+3
-3
@@ -447,13 +447,13 @@
|
||||
panel_open = !panel_open
|
||||
if(panel_open)
|
||||
icon_state = "[icon_state]_maintenance"
|
||||
user << "You open the maintenance panel of [src]."
|
||||
user << "<span class='notice'>You open the maintenance panel of [src].</span>"
|
||||
else
|
||||
if(open)
|
||||
icon_state = "[initial(icon_state)]_open"
|
||||
else
|
||||
icon_state = "[initial(icon_state)]"
|
||||
user << "You close the maintenance panel of [src]."
|
||||
user << "<span class='notice'>You close the maintenance panel of [src].</span>"
|
||||
return
|
||||
|
||||
if(istype(G, /obj/item/weapon/crowbar))
|
||||
@@ -542,7 +542,7 @@
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
src.diskette = I
|
||||
user << "You insert [I]."
|
||||
user << "<span class='notice'>You insert [I].</span>"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
else
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
/obj/machinery/constructable_frame/machine_frame/attackby(obj/item/P as obj, mob/user as mob)
|
||||
if(P.crit_fail)
|
||||
user << "\red This part is faulty, you cannot add this to the machine!"
|
||||
user << "<span class='danger'>This part is faulty, you cannot add this to the machine!</span>"
|
||||
return
|
||||
switch(state)
|
||||
if(1)
|
||||
@@ -57,17 +57,17 @@
|
||||
var/obj/item/weapon/cable_coil/C = P
|
||||
if(C.amount >= 5)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "\blue You start to add cables to the frame."
|
||||
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) del(C)
|
||||
user << "\blue You add cables to the frame."
|
||||
user << "<span class='notice'>You add cables to the frame.</span>"
|
||||
state = 2
|
||||
icon_state = "box_1"
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user << "\blue You dismantle the frame"
|
||||
user << "<span class='notice'>You dismantle the frame.</span>"
|
||||
new /obj/item/stack/sheet/metal(src.loc, 5)
|
||||
del(src)
|
||||
if(2)
|
||||
@@ -75,7 +75,7 @@
|
||||
var/obj/item/weapon/circuitboard/B = P
|
||||
if(B.board_type == "machine")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "\blue You add the circuit board to the frame."
|
||||
user << "<span class='notice'>You add the circuit board to the frame.</span>"
|
||||
circuit = P
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
@@ -86,10 +86,10 @@
|
||||
update_namelist()
|
||||
update_req_desc()
|
||||
else
|
||||
user << "\red This frame does not accept circuit boards of this type!"
|
||||
user << "<span class='danger'>This frame does not accept circuit boards of this type!</span>"
|
||||
if(istype(P, /obj/item/weapon/wirecutters))
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
user << "\blue You remove the cables."
|
||||
user << "<span class='notice'>You remove the cables.</span>"
|
||||
state = 1
|
||||
icon_state = "box_0"
|
||||
var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( src.loc )
|
||||
@@ -102,9 +102,9 @@
|
||||
circuit.loc = src.loc
|
||||
circuit = null
|
||||
if(components.len == 0)
|
||||
user << "\blue You remove the circuit board."
|
||||
user << "<span class='notice'>You remove the circuit board.</span>"
|
||||
else
|
||||
user << "\blue You remove the circuit board and other components."
|
||||
user << "<span class='notice'>You remove the circuit board and other components.</span>"
|
||||
for(var/obj/item/weapon/W in components)
|
||||
W.loc = src.loc
|
||||
desc = initial(desc)
|
||||
@@ -132,27 +132,26 @@
|
||||
del(src)
|
||||
|
||||
if(istype(P, /obj/item/weapon))
|
||||
var/success
|
||||
for(var/I in req_components)
|
||||
if(istype(P, text2path(I)) && (req_components[I] > 0))
|
||||
success=1
|
||||
if(istype(P, /obj/item/weapon/cable_coil))
|
||||
var/obj/item/weapon/cable_coil/CP = P
|
||||
if(CP.amount > 1)
|
||||
var/obj/item/weapon/cable_coil/CC = new /obj/item/weapon/cable_coil(src, 1)
|
||||
CP.amount--
|
||||
if(!CP.amount) del(CP)
|
||||
else CP.update_icon()
|
||||
var/obj/item/weapon/cable_coil/CC = new /obj/item/weapon/cable_coil(src, 1, CP.item_color)
|
||||
if(CP.use(1))
|
||||
components += CC
|
||||
req_components[I]--
|
||||
update_req_desc()
|
||||
break
|
||||
break
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
components += P
|
||||
req_components[I]--
|
||||
update_req_desc()
|
||||
break
|
||||
if(P.loc != src && !istype(P, /obj/item/weapon/cable_coil))
|
||||
user << "\red You cannot add that component to the machine!"
|
||||
if(!success)
|
||||
user << "<span class='danger'>You cannot add that to the machine!</span>"
|
||||
|
||||
|
||||
//Machine Frame Circuit Boards
|
||||
|
||||
@@ -212,7 +212,7 @@ Class Procs:
|
||||
if ( ! (istype(usr, /mob/living/carbon/human) || \
|
||||
istype(usr, /mob/living/silicon) || \
|
||||
istype(usr, /mob/living/carbon/monkey) && ticker && ticker.mode.name == "monkey") )
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
usr << "<span class='danger'>You don't have the dexterity to do this!</span>"
|
||||
return 1
|
||||
/*
|
||||
//distance checks are made by atom/proc/DblClick
|
||||
@@ -225,7 +225,7 @@ Class Procs:
|
||||
visible_message("\red [H] stares cluelessly at [src] and drools.")
|
||||
return 1
|
||||
else if(prob(H.getBrainLoss()))
|
||||
user << "\red You momentarily forget how to use [src]."
|
||||
user << "<span class='danger'>You momentarily forget how to use [src].</span>"
|
||||
return 1
|
||||
|
||||
src.add_fingerprint(user)
|
||||
@@ -254,8 +254,8 @@ Class Procs:
|
||||
if (!panel_open)
|
||||
panel_open = 1
|
||||
icon_state = icon_state_open
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
user << "<span class='notice'>You open the maintenance hatch of [src].</span>"
|
||||
else
|
||||
panel_open = 0
|
||||
icon_state = icon_state_closed
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
user << "<span class='notice'>You close the maintenance hatch of [src].</span>"
|
||||
|
||||
@@ -24,26 +24,26 @@
|
||||
switch(construct_op)
|
||||
if(0)
|
||||
if(istype(P, /obj/item/weapon/screwdriver))
|
||||
user << "You unfasten the bolts."
|
||||
user << "<span class='notice'>You unfasten the bolts.</span>"
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
construct_op ++
|
||||
if(1)
|
||||
if(istype(P, /obj/item/weapon/screwdriver))
|
||||
user << "You fasten the bolts."
|
||||
user << "<span class='notice'>You fasten the bolts.</span>"
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
construct_op --
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
user << "You dislodge the external plating."
|
||||
user << "<span class='notice'>You dislodge the external plating.</span>"
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
construct_op ++
|
||||
if(2)
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
user << "You secure the external plating."
|
||||
user << "<span class='notice'>You secure the external plating.</span>"
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
construct_op --
|
||||
if(istype(P, /obj/item/weapon/wirecutters))
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
user << "You remove the cables."
|
||||
user << "<span class='notice'>You remove the cables.</span>"
|
||||
construct_op ++
|
||||
var/obj/item/weapon/cable_coil/A = new /obj/item/weapon/cable_coil( user.loc )
|
||||
A.amount = 5
|
||||
@@ -51,21 +51,17 @@
|
||||
if(3)
|
||||
if(istype(P, /obj/item/weapon/cable_coil))
|
||||
var/obj/item/weapon/cable_coil/A = P
|
||||
if(A.amount >= 5)
|
||||
user << "You insert the cables."
|
||||
A.amount -= 5
|
||||
if(A.amount <= 0)
|
||||
user.drop_item()
|
||||
del(A)
|
||||
if(A.use(5))
|
||||
user << "<span class='notice'>You insert the cables.</span>"
|
||||
construct_op --
|
||||
stat &= ~BROKEN // the machine's not borked anymore!
|
||||
else
|
||||
user << "You need more cable"
|
||||
user << "<span class='danger'>You need more cable to do that.</span>"
|
||||
if(istype(P, /obj/item/weapon/crowbar))
|
||||
user << "You begin prying out the circuit board and components..."
|
||||
user << "<span class='notice'>You begin prying out the circuit board and components...</span>"
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
if(do_after(user,60))
|
||||
user << "You finish prying out the components."
|
||||
user << "<span class='notice'>You finish prying out the components.</span>"
|
||||
|
||||
// Drop all the component stuff
|
||||
if(component_parts)
|
||||
|
||||
@@ -302,8 +302,8 @@
|
||||
if(src.amount < used)
|
||||
return 0
|
||||
else if (src.amount == used)
|
||||
//handle mob icon update
|
||||
if(ismob(loc))
|
||||
.=1 //Because del(src) stops the proc, set the default return value to 1
|
||||
if(ismob(loc)) //handle mob icon update
|
||||
var/mob/M = loc
|
||||
M.u_equip(src)
|
||||
del(src)
|
||||
|
||||
Reference in New Issue
Block a user