mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Fixes #3319, you cannot use rpd's when they are far away from you.
Fixes machine frames (but the real way that should have been done originally) Fixes #2701, r-ust topics should no longer be affected by ghost hands
This commit is contained in:
@@ -122,7 +122,7 @@
|
|||||||
user.set_machine(src)
|
user.set_machine(src)
|
||||||
|
|
||||||
/obj/machinery/computer/rust_core_control/Topic(href, href_list)
|
/obj/machinery/computer/rust_core_control/Topic(href, href_list)
|
||||||
..()
|
if(..()) return
|
||||||
|
|
||||||
if( href_list["goto_scanlist"] )
|
if( href_list["goto_scanlist"] )
|
||||||
cur_viewed_device = null
|
cur_viewed_device = null
|
||||||
|
|||||||
@@ -180,6 +180,7 @@ max volume of plasma storeable by the field = the total volume of a number of ti
|
|||||||
user.set_machine(src)
|
user.set_machine(src)
|
||||||
|
|
||||||
/obj/machinery/power/rust_core/Topic(href, href_list)
|
/obj/machinery/power/rust_core/Topic(href, href_list)
|
||||||
|
if(..()) return
|
||||||
if(href_list["str"])
|
if(href_list["str"])
|
||||||
var/dif = text2num(href_list["str"])
|
var/dif = text2num(href_list["str"])
|
||||||
field_strength = min(max(field_strength + dif, MIN_FIELD_STR), MAX_FIELD_STR)
|
field_strength = min(max(field_strength + dif, MIN_FIELD_STR), MAX_FIELD_STR)
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ var/const/max_assembly_amount = 300
|
|||||||
//var/coverlocked
|
//var/coverlocked
|
||||||
|
|
||||||
/obj/machinery/rust_fuel_compressor/Topic(href, href_list)
|
/obj/machinery/rust_fuel_compressor/Topic(href, href_list)
|
||||||
..()
|
if(..()) return
|
||||||
if( href_list["close"] )
|
if( href_list["close"] )
|
||||||
usr << browse(null, "window=fuelcomp")
|
usr << browse(null, "window=fuelcomp")
|
||||||
usr.machine = null
|
usr.machine = null
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
user.set_machine(src)
|
user.set_machine(src)
|
||||||
|
|
||||||
/obj/machinery/computer/rust_fuel_control/Topic(href, href_list)
|
/obj/machinery/computer/rust_fuel_control/Topic(href, href_list)
|
||||||
..()
|
if(..()) return
|
||||||
|
|
||||||
if( href_list["scan"] )
|
if( href_list["scan"] )
|
||||||
connected_injectors = list()
|
connected_injectors = list()
|
||||||
|
|||||||
@@ -137,7 +137,7 @@
|
|||||||
user.set_machine(src)
|
user.set_machine(src)
|
||||||
|
|
||||||
/obj/machinery/power/rust_fuel_injector/Topic(href, href_list)
|
/obj/machinery/power/rust_fuel_injector/Topic(href, href_list)
|
||||||
..()
|
if(..()) return
|
||||||
|
|
||||||
if( href_list["modify_tag"] )
|
if( href_list["modify_tag"] )
|
||||||
id_tag = input("Enter new ID tag", "Modifying ID tag") as text|null
|
id_tag = input("Enter new ID tag", "Modifying ID tag") as text|null
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
//pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
|
//pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
|
||||||
|
|
||||||
Topic(href, href_list)
|
Topic(href, href_list)
|
||||||
..()
|
if(..()) return
|
||||||
if( href_list["close"] )
|
if( href_list["close"] )
|
||||||
usr << browse(null, "window=gyro_monitor")
|
usr << browse(null, "window=gyro_monitor")
|
||||||
usr.machine = null
|
usr.machine = null
|
||||||
|
|||||||
@@ -12,187 +12,187 @@
|
|||||||
var/list/req_components = null
|
var/list/req_components = null
|
||||||
var/list/req_component_names = null
|
var/list/req_component_names = null
|
||||||
var/list/components_in_use = null
|
var/list/components_in_use = null
|
||||||
var/build_state = 2
|
var/build_state = 1
|
||||||
|
|
||||||
// For pods
|
// For pods
|
||||||
var/list/connected_parts = list()
|
var/list/connected_parts = list()
|
||||||
var/pattern_idx=0
|
var/pattern_idx=0
|
||||||
machine_flags = WRENCHMOVE | FIXED2WORK
|
machine_flags = WRENCHMOVE | FIXED2WORK
|
||||||
|
|
||||||
proc/update_desc()
|
/obj/machinery/constructable_frame/proc/update_desc()
|
||||||
var/D
|
var/D
|
||||||
if(req_components)
|
if(req_components)
|
||||||
D = "Requires "
|
D = "Requires "
|
||||||
var/first = 1
|
var/first = 1
|
||||||
for(var/I in req_components)
|
for(var/I in req_components)
|
||||||
if(req_components[I] > 0)
|
if(req_components[I] > 0)
|
||||||
D += "[first?"":", "][num2text(req_components[I])] [req_component_names[I]]"
|
D += "[first?"":", "][num2text(req_components[I])] [req_component_names[I]]"
|
||||||
first = 0
|
first = 0
|
||||||
if(first) // nothing needs to be added, then
|
if(first) // nothing needs to be added, then
|
||||||
D += "nothing"
|
D += "nothing"
|
||||||
D += "."
|
D += "."
|
||||||
desc = D
|
desc = D
|
||||||
|
|
||||||
/obj/machinery/constructable_frame/machine_frame
|
/obj/machinery/constructable_frame/machine_frame
|
||||||
|
|
||||||
attackby(obj/item/P as obj, mob/user as mob)
|
/obj/machinery/constructable_frame/machine_frame/attackby(obj/item/P as obj, mob/user as mob)
|
||||||
if(P.crit_fail)
|
if(P.crit_fail)
|
||||||
user << "<span class='warning'>This part is faulty, you cannot add this to the machine!</span>"
|
user << "<span class='warning'>This part is faulty, you cannot add this to the machine!</span>"
|
||||||
return
|
return
|
||||||
switch(build_state)
|
switch(build_state)
|
||||||
if(1)
|
if(1)
|
||||||
if(istype(P, /obj/item/stack/cable_coil))
|
if(istype(P, /obj/item/stack/cable_coil))
|
||||||
var/obj/item/stack/cable_coil/C = P
|
var/obj/item/stack/cable_coil/C = P
|
||||||
if(C.amount >= 5)
|
if(C.amount >= 5)
|
||||||
playsound(get_turf(src), '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) // Check again
|
|
||||||
C.use(5)
|
|
||||||
user << "<span class='notice'>You add cables to the frame.</span>"
|
|
||||||
build_state = 2
|
|
||||||
icon_state = "box_1"
|
|
||||||
else if(istype(P, /obj/item/stack/sheet/glass/glass))
|
|
||||||
var/obj/item/stack/sheet/glass/glass/G=P
|
|
||||||
if(G.amount<1)
|
|
||||||
user << "<span class='warning'>How...?</span>"
|
|
||||||
return
|
|
||||||
G.use(1)
|
|
||||||
user << "<span class='notice'>You add the glass to the frame.</span>"
|
|
||||||
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
||||||
new /obj/structure/displaycase_frame(src.loc)
|
user << "<span class='notice'>You start to add cables to the frame.</span>"
|
||||||
del(src)
|
if(do_after(user, 20))
|
||||||
|
if(C && C.amount >= 5) // Check again
|
||||||
|
C.use(5)
|
||||||
|
user << "<span class='notice'>You add cables to the frame.</span>"
|
||||||
|
build_state = 2
|
||||||
|
icon_state = "box_1"
|
||||||
|
else if(istype(P, /obj/item/stack/sheet/glass/glass))
|
||||||
|
var/obj/item/stack/sheet/glass/glass/G=P
|
||||||
|
if(G.amount<1)
|
||||||
|
user << "<span class='warning'>How...?</span>"
|
||||||
return
|
return
|
||||||
|
G.use(1)
|
||||||
|
user << "<span class='notice'>You add the glass to the frame.</span>"
|
||||||
|
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
||||||
|
new /obj/structure/displaycase_frame(src.loc)
|
||||||
|
del(src)
|
||||||
|
return
|
||||||
|
else
|
||||||
|
if(istype(P, /obj/item/weapon/wrench))
|
||||||
|
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 75, 1)
|
||||||
|
user << "<span class='notice'>You dismantle the frame.</span>"
|
||||||
|
//new /obj/item/stack/sheet/metal(src.loc, 5)
|
||||||
|
var/obj/item/stack/sheet/metal/M = getFromPool(/obj/item/stack/sheet/metal, src.loc)
|
||||||
|
M.amount = 5
|
||||||
|
del(src)
|
||||||
|
if(2)
|
||||||
|
if(!..())
|
||||||
|
if(istype(P, /obj/item/weapon/circuitboard))
|
||||||
|
var/obj/item/weapon/circuitboard/B = P
|
||||||
|
if(B.board_type == "machine")
|
||||||
|
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
||||||
|
user << "<span class='notice'>You add the circuit board to the frame.</span>"
|
||||||
|
circuit = P
|
||||||
|
user.drop_item()
|
||||||
|
P.loc = src
|
||||||
|
icon_state = "box_2"
|
||||||
|
build_state = 3
|
||||||
|
components = list()
|
||||||
|
req_components = circuit.req_components.Copy()
|
||||||
|
for(var/A in circuit.req_components)
|
||||||
|
req_components[A] = circuit.req_components[A]
|
||||||
|
req_component_names = circuit.req_components.Copy()
|
||||||
|
for(var/A in req_components)
|
||||||
|
var/cp = text2path(A)
|
||||||
|
var/obj/ct = new cp() // have to quickly instantiate it get name
|
||||||
|
req_component_names[A] = ct.name
|
||||||
|
del(ct)
|
||||||
|
if(circuit.frame_desc)
|
||||||
|
desc = circuit.frame_desc
|
||||||
|
else
|
||||||
|
update_desc()
|
||||||
|
user << desc
|
||||||
|
else
|
||||||
|
user << "<span class='warning'>This frame does not accept circuit boards of this type!</span>"
|
||||||
else
|
else
|
||||||
if(istype(P, /obj/item/weapon/wrench))
|
if(istype(P, /obj/item/weapon/wirecutters))
|
||||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 75, 1)
|
playsound(get_turf(src), 'sound/items/Wirecutter.ogg', 50, 1)
|
||||||
user << "<span class='notice'>You dismantle the frame.</span>"
|
user << "<span class='notice'>You remove the cables.</span>"
|
||||||
//new /obj/item/stack/sheet/metal(src.loc, 5)
|
build_state = 1
|
||||||
var/obj/item/stack/sheet/metal/M = getFromPool(/obj/item/stack/sheet/metal, src.loc)
|
icon_state = "box_0"
|
||||||
M.amount = 5
|
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
|
||||||
del(src)
|
A.amount = 5
|
||||||
if(2)
|
|
||||||
if(!..())
|
|
||||||
if(istype(P, /obj/item/weapon/circuitboard))
|
|
||||||
var/obj/item/weapon/circuitboard/B = P
|
|
||||||
if(B.board_type == "machine")
|
|
||||||
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
|
||||||
user << "<span class='notice'>You add the circuit board to the frame.</span>"
|
|
||||||
circuit = P
|
|
||||||
user.drop_item()
|
|
||||||
P.loc = src
|
|
||||||
icon_state = "box_2"
|
|
||||||
build_state = 3
|
|
||||||
components = list()
|
|
||||||
req_components = circuit.req_components.Copy()
|
|
||||||
for(var/A in circuit.req_components)
|
|
||||||
req_components[A] = circuit.req_components[A]
|
|
||||||
req_component_names = circuit.req_components.Copy()
|
|
||||||
for(var/A in req_components)
|
|
||||||
var/cp = text2path(A)
|
|
||||||
var/obj/ct = new cp() // have to quickly instantiate it get name
|
|
||||||
req_component_names[A] = ct.name
|
|
||||||
del(ct)
|
|
||||||
if(circuit.frame_desc)
|
|
||||||
desc = circuit.frame_desc
|
|
||||||
else
|
|
||||||
update_desc()
|
|
||||||
user << desc
|
|
||||||
else
|
|
||||||
user << "<span class='warning'>This frame does not accept circuit boards of this type!</span>"
|
|
||||||
else
|
|
||||||
if(istype(P, /obj/item/weapon/wirecutters))
|
|
||||||
playsound(get_turf(src), 'sound/items/Wirecutter.ogg', 50, 1)
|
|
||||||
user << "<span class='notice'>You remove the cables.</span>"
|
|
||||||
build_state = 1
|
|
||||||
icon_state = "box_0"
|
|
||||||
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
|
|
||||||
A.amount = 5
|
|
||||||
|
|
||||||
if(3)
|
if(3)
|
||||||
if(!..())
|
if(!..())
|
||||||
if(istype(P, /obj/item/weapon/crowbar))
|
if(istype(P, /obj/item/weapon/crowbar))
|
||||||
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
|
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
|
||||||
build_state = 2
|
build_state = 2
|
||||||
circuit.loc = src.loc
|
circuit.loc = src.loc
|
||||||
circuit = null
|
circuit = null
|
||||||
if(components.len == 0)
|
if(components.len == 0)
|
||||||
user << "<span class='notice'>You remove the circuit board.</span>"
|
user << "<span class='notice'>You remove the circuit board.</span>"
|
||||||
else
|
|
||||||
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)
|
|
||||||
req_components = null
|
|
||||||
components = null
|
|
||||||
icon_state = "box_1"
|
|
||||||
else
|
else
|
||||||
if(istype(P, /obj/item/weapon/screwdriver))
|
user << "<span class='notice'>You remove the circuit board and other components.</span>"
|
||||||
var/component_check = 1
|
for(var/obj/item/weapon/W in components)
|
||||||
for(var/R in req_components)
|
W.loc = src.loc
|
||||||
if(req_components[R] > 0)
|
desc = initial(desc)
|
||||||
component_check = 0
|
req_components = null
|
||||||
break
|
components = null
|
||||||
if(component_check)
|
icon_state = "box_1"
|
||||||
playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1)
|
else
|
||||||
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc)
|
if(istype(P, /obj/item/weapon/screwdriver))
|
||||||
for(var/obj/O in new_machine.component_parts)
|
var/component_check = 1
|
||||||
del(O)
|
for(var/R in req_components)
|
||||||
new_machine.component_parts = list()
|
if(req_components[R] > 0)
|
||||||
for(var/obj/O in src)
|
component_check = 0
|
||||||
if(circuit.contain_parts) // things like disposal don't want their parts in them
|
break
|
||||||
O.loc = components_in_use
|
if(component_check)
|
||||||
else
|
playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1)
|
||||||
O.loc = null
|
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc)
|
||||||
new_machine.component_parts += O
|
for(var/obj/O in new_machine.component_parts)
|
||||||
if(circuit.contain_parts)
|
del(O)
|
||||||
circuit.loc = components_in_use
|
new_machine.component_parts = list()
|
||||||
|
for(var/obj/O in src)
|
||||||
|
if(circuit.contain_parts) // things like disposal don't want their parts in them
|
||||||
|
O.loc = components_in_use
|
||||||
else
|
else
|
||||||
circuit.loc = null
|
O.loc = null
|
||||||
new_machine.RefreshParts()
|
new_machine.component_parts += O
|
||||||
del(src)
|
if(circuit.contain_parts)
|
||||||
else
|
circuit.loc = components_in_use
|
||||||
if(istype(P, /obj/item/weapon)||istype(P, /obj/item/stack))
|
else
|
||||||
for(var/I in req_components)
|
circuit.loc = null
|
||||||
if(istype(P, text2path(I)) && (req_components[I] > 0))
|
new_machine.RefreshParts()
|
||||||
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
del(src)
|
||||||
if(istype(P, /obj/item/stack/cable_coil))
|
else
|
||||||
var/obj/item/stack/cable_coil/CP = P
|
if(istype(P, /obj/item/weapon)||istype(P, /obj/item/stack))
|
||||||
if(CP.amount >= req_components[I])
|
for(var/I in req_components)
|
||||||
var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided
|
if(istype(P, text2path(I)) && (req_components[I] > 0))
|
||||||
var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(src)
|
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
||||||
CC.amount = camt
|
if(istype(P, /obj/item/stack/cable_coil))
|
||||||
CC.update_icon()
|
var/obj/item/stack/cable_coil/CP = P
|
||||||
CP.use(camt)
|
if(CP.amount >= req_components[I])
|
||||||
components += CC
|
var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided
|
||||||
req_components[I] -= camt
|
var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(src)
|
||||||
update_desc()
|
CC.amount = camt
|
||||||
break
|
CC.update_icon()
|
||||||
else
|
CP.use(camt)
|
||||||
user << "<span class='warning'>You do not have enough [P]!</span>"
|
components += CC
|
||||||
if(istype(P, /obj/item/stack/rods))
|
req_components[I] -= camt
|
||||||
var/obj/item/stack/rods/R = P
|
update_desc()
|
||||||
if(R.amount >= req_components[I])
|
break
|
||||||
var/camt = min(R.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided
|
else
|
||||||
var/obj/item/stack/rods/RR = new /obj/item/stack/rods(src)
|
user << "<span class='warning'>You do not have enough [P]!</span>"
|
||||||
RR.amount = camt
|
if(istype(P, /obj/item/stack/rods))
|
||||||
RR.update_icon()
|
var/obj/item/stack/rods/R = P
|
||||||
R.use(camt)
|
if(R.amount >= req_components[I])
|
||||||
components += RR
|
var/camt = min(R.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided
|
||||||
req_components[I] -= camt
|
var/obj/item/stack/rods/RR = new /obj/item/stack/rods(src)
|
||||||
update_desc()
|
RR.amount = camt
|
||||||
break
|
RR.update_icon()
|
||||||
else
|
R.use(camt)
|
||||||
user << "<span class='warning'>You do not have enough [P]!</span>"
|
components += RR
|
||||||
user.drop_item()
|
req_components[I] -= camt
|
||||||
P.loc = src
|
update_desc()
|
||||||
components += P
|
break
|
||||||
req_components[I]--
|
else
|
||||||
update_desc()
|
user << "<span class='warning'>You do not have enough [P]!</span>"
|
||||||
break
|
user.drop_item()
|
||||||
user << desc
|
P.loc = src
|
||||||
if(P && P.loc != src && !istype(P, /obj/item/stack/cable_coil))
|
components += P
|
||||||
user << "<span class='warning'>You cannot add that component to the machine!</span>"
|
req_components[I]--
|
||||||
|
update_desc()
|
||||||
|
break
|
||||||
|
user << desc
|
||||||
|
if(P && P.loc != src && !istype(P, /obj/item/stack/cable_coil))
|
||||||
|
user << "<span class='warning'>You cannot add that component to the machine!</span>"
|
||||||
|
|
||||||
|
|
||||||
//Machine Frame Circuit Boards
|
//Machine Frame Circuit Boards
|
||||||
|
|||||||
@@ -415,8 +415,8 @@ Class Procs:
|
|||||||
|
|
||||||
/obj/machinery/proc/dropFrame()
|
/obj/machinery/proc/dropFrame()
|
||||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||||
M.state = 1
|
|
||||||
M.build_state = 2
|
M.build_state = 2
|
||||||
|
M.state = 1
|
||||||
M.icon_state = "box_1"
|
M.icon_state = "box_1"
|
||||||
|
|
||||||
/obj/machinery/proc/crowbarDestroy(mob/user)
|
/obj/machinery/proc/crowbarDestroy(mob/user)
|
||||||
|
|||||||
@@ -407,6 +407,9 @@ var/global/list/RPD_recipes=list(
|
|||||||
return
|
return
|
||||||
usr.set_machine(src)
|
usr.set_machine(src)
|
||||||
src.add_fingerprint(usr)
|
src.add_fingerprint(usr)
|
||||||
|
if(get_dist(usr,src)>=1)
|
||||||
|
usr.unset_machine(usr)
|
||||||
|
return
|
||||||
if(href_list["setdir"])
|
if(href_list["setdir"])
|
||||||
p_dir= text2num(href_list["setdir"])
|
p_dir= text2num(href_list["setdir"])
|
||||||
show_menu(usr)
|
show_menu(usr)
|
||||||
|
|||||||
@@ -221,7 +221,6 @@ var/global/ingredientLimit = 10
|
|||||||
icon_state_on = "mixer_on"
|
icon_state_on = "mixer_on"
|
||||||
cookSound = 'sound/machines/juicer.ogg'
|
cookSound = 'sound/machines/juicer.ogg'
|
||||||
|
|
||||||
v
|
|
||||||
|
|
||||||
/obj/machinery/cooking/candy/validateIngredient(var/obj/item/I)
|
/obj/machinery/cooking/candy/validateIngredient(var/obj/item/I)
|
||||||
. = ..()
|
. = ..()
|
||||||
@@ -241,6 +240,7 @@ var/global/ingredientLimit = 10
|
|||||||
/obj/machinery/cooking/candy/getFoodChoices()
|
/obj/machinery/cooking/candy/getFoodChoices()
|
||||||
return (typesof(/obj/item/weapon/reagent_containers/food/snacks/customizable/candy)-(/obj/item/weapon/reagent_containers/food/snacks/customizable/candy))
|
return (typesof(/obj/item/weapon/reagent_containers/food/snacks/customizable/candy)-(/obj/item/weapon/reagent_containers/food/snacks/customizable/candy))
|
||||||
|
|
||||||
|
|
||||||
// Still ///////////////////////////////////////////////////////
|
// Still ///////////////////////////////////////////////////////
|
||||||
|
|
||||||
/obj/machinery/cooking/still
|
/obj/machinery/cooking/still
|
||||||
|
|||||||
Reference in New Issue
Block a user