mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-15 17:13:46 +01:00
Fixes a Bunch of RCL Bugs (#31698)
* RCL cable migration * e * Pain and death * merge master fixes * e * aaaaaa * Update RCL.dm * AaaaAAAAA * Update cable_coil.dm * Update cable_coil.dm * returns throwforce * removes color feature --------- Signed-off-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
This commit is contained in:
@@ -9138,12 +9138,12 @@
|
||||
/turf/simulated/floor/mineral/plastitanium/red,
|
||||
/area/shuttle/administration)
|
||||
"GV" = (
|
||||
/obj/item/rcl,
|
||||
/obj/item/rcl,
|
||||
/obj/item/rcl,
|
||||
/obj/item/rcl,
|
||||
/obj/item/rcl,
|
||||
/obj/item/rcl,
|
||||
/obj/item/stack/cable_coil/rcl,
|
||||
/obj/item/stack/cable_coil/rcl,
|
||||
/obj/item/stack/cable_coil/rcl,
|
||||
/obj/item/stack/cable_coil/rcl,
|
||||
/obj/item/stack/cable_coil/rcl,
|
||||
/obj/item/stack/cable_coil/rcl,
|
||||
/obj/structure/shelf/engineering,
|
||||
/turf/simulated/floor/plasteel/dark,
|
||||
/area/centcom/specops)
|
||||
|
||||
@@ -38331,7 +38331,7 @@
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{
|
||||
dir = 4
|
||||
},
|
||||
/obj/item/rcl,
|
||||
/obj/item/stack/cable_coil/rcl,
|
||||
/turf/simulated/floor/plasteel,
|
||||
/area/station/engineering/equipmentstorage)
|
||||
"cRR" = (
|
||||
|
||||
@@ -20046,7 +20046,7 @@
|
||||
/obj/effect/turf_decal/tiles/department/engineering/side{
|
||||
dir = 8
|
||||
},
|
||||
/obj/item/rcl,
|
||||
/obj/item/stack/cable_coil/rcl,
|
||||
/turf/simulated/floor/plasteel,
|
||||
/area/station/engineering/break_room)
|
||||
"dfG" = (
|
||||
@@ -40927,7 +40927,7 @@
|
||||
/obj/structure/cable/yellow{
|
||||
icon_state = "4-8"
|
||||
},
|
||||
/obj/item/rcl,
|
||||
/obj/item/stack/cable_coil/rcl,
|
||||
/turf/simulated/floor/plasteel,
|
||||
/area/station/engineering/break_room)
|
||||
"hMA" = (
|
||||
|
||||
@@ -52499,7 +52499,7 @@
|
||||
"foI" = (
|
||||
/obj/structure/table/reinforced,
|
||||
/obj/effect/turf_decal/tiles/neutral,
|
||||
/obj/item/rcl,
|
||||
/obj/item/stack/cable_coil/rcl,
|
||||
/turf/simulated/floor/plasteel,
|
||||
/area/station/engineering/break_room)
|
||||
"foU" = (
|
||||
|
||||
@@ -40262,7 +40262,7 @@
|
||||
pixel_x = -3;
|
||||
pixel_y = 3
|
||||
},
|
||||
/obj/item/rcl,
|
||||
/obj/item/stack/cable_coil/rcl,
|
||||
/turf/simulated/floor/plasteel,
|
||||
/area/station/engineering/equipmentstorage)
|
||||
"idP" = (
|
||||
|
||||
@@ -71546,7 +71546,7 @@
|
||||
/obj/effect/turf_decal/tiles/department/engineering/side{
|
||||
dir = 8
|
||||
},
|
||||
/obj/item/rcl,
|
||||
/obj/item/stack/cable_coil/rcl,
|
||||
/turf/simulated/floor/plasteel/dark,
|
||||
/area/station/engineering/equipmentstorage)
|
||||
"rye" = (
|
||||
|
||||
+164
-131
@@ -1,148 +1,170 @@
|
||||
/obj/item/rcl
|
||||
/obj/item/stack/cable_coil/rcl
|
||||
name = "rapid cable layer (RCL)"
|
||||
desc = "An electrician's best friend, this plastic spool can hold a large amount of cable and rapidly lay it down."
|
||||
icon = 'icons/obj/rcl.dmi'
|
||||
icon_state = "rcl"
|
||||
inhand_icon_state = "rcl"
|
||||
throwforce = 5
|
||||
belt_icon = null
|
||||
origin_tech = "engineering=4;materials=2"
|
||||
materials = list(MAT_METAL = 5000)
|
||||
destroy_upon_empty = FALSE
|
||||
max_amount = RCL_MAX_SPOOL_SIZE
|
||||
amount = RCL_MAX_SPOOL_SIZE
|
||||
color = null
|
||||
/// Are we rapidly laying cable?
|
||||
var/active = FALSE
|
||||
var/spool_color
|
||||
/// Remembers the last cable structure that got laid down to aid in further cable laying.
|
||||
var/obj/structure/cable/last
|
||||
var/obj/item/stack/cable_coil/random/rcl_spool/loaded
|
||||
new_attack_chain = TRUE
|
||||
|
||||
/obj/item/rcl/Initialize(mapload)
|
||||
/obj/item/stack/cable_coil/rcl/examine(mob/user)
|
||||
. = ..()
|
||||
loaded = new()
|
||||
AddComponent(/datum/component/two_handed)
|
||||
update_icon(UPDATE_ICON_STATE|UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/rcl/examine(mob/user)
|
||||
. = ..()
|
||||
if(loaded.amount)
|
||||
. += SPAN_NOTICE("It contains <b>[loaded.amount]/[RCL_MAX_SPOOL_SIZE]</b> cables.")
|
||||
else
|
||||
. += SPAN_WARNING("It's empty!")
|
||||
. += SPAN_NOTICE("It can stack <b>[RCL_MAX_SPOOL_SIZE]</b> lengths of cable around its spool.")
|
||||
. += SPAN_NOTICE("Use in-hand to swap to [active ? "standard" : "Rapid Cable Laying"] mode.")
|
||||
|
||||
/obj/item/rcl/item_interaction(mob/living/user, obj/item/used, list/modifiers)
|
||||
if(!istype(used, /obj/item/stack/cable_coil))
|
||||
return ..()
|
||||
/obj/item/stack/cable_coil/rcl/Initialize(mapload)
|
||||
. = ..()
|
||||
// Do not craft from an RCL.
|
||||
recipes = null
|
||||
color_rainbow()
|
||||
AddComponent(/datum/component/two_handed)
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
refresh_icon()
|
||||
|
||||
var/obj/item/stack/cable_coil/coil = used
|
||||
if(loaded.amount >= RCL_MAX_SPOOL_SIZE)
|
||||
to_chat(user, SPAN_WARNING("You cannot fit any more cable on [src]!"))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
// When loading an empty cable spool, turn it into either standard or heavy based on what we're loading.
|
||||
if(!loaded.amount)
|
||||
loaded.color = coil.color
|
||||
loaded.cable_type = coil.cable_type
|
||||
loaded.cable_merge_id = coil.cable_merge_id
|
||||
else if(loaded.cable_merge_id != coil.cable_merge_id)
|
||||
to_chat(user, SPAN_WARNING("These coils are of different types!"))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
var/amount = min(loaded.amount + coil.get_amount(), RCL_MAX_SPOOL_SIZE)
|
||||
coil.use(amount - loaded.amount)
|
||||
loaded.amount = amount
|
||||
refresh_icon(user)
|
||||
to_chat(user, SPAN_NOTICE("You add the cables to [src]. It now contains [loaded.amount]."))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/rcl/interact_with_atom(atom/target, mob/living/user, list/modifiers)
|
||||
if(istype(target, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = target
|
||||
C.melee_attack_chain(user, src, list2params(modifiers))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(isstorage(target) || istable(target))
|
||||
return ..()
|
||||
|
||||
loaded.melee_attack_chain(user, target, list2params(modifiers))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/rcl/proc/refresh_icon(mob/user)
|
||||
update_icon(UPDATE_ICON_STATE|UPDATE_OVERLAYS)
|
||||
user.update_inv_l_hand()
|
||||
user.update_inv_r_hand()
|
||||
|
||||
/obj/item/rcl/screwdriver_act(mob/user, obj/item/I)
|
||||
if(!loaded)
|
||||
to_chat(user, SPAN_WARNING("There's no cable to remove!"))
|
||||
return
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, FALSE, volume = I.tool_volume))
|
||||
return
|
||||
to_chat(user, SPAN_NOTICE("You loosen the securing screws on the side, allowing you to lower the guiding edge and retrieve the wires."))
|
||||
while(loaded.amount)
|
||||
var/diff = 30
|
||||
if(loaded.amount < 30)
|
||||
diff = loaded.amount
|
||||
if(loaded.cable_merge_id == CABLE_LOW_POWER)
|
||||
var/obj/item/stack/cable_coil/dropped_coil = new /obj/item/stack/cable_coil(user.loc, diff)
|
||||
dropped_coil.color = loaded.color
|
||||
loaded.use(diff)
|
||||
else
|
||||
new /obj/item/stack/cable_coil/extra_insulated(user.loc, diff)
|
||||
loaded.use(diff)
|
||||
refresh_icon(user)
|
||||
|
||||
/obj/item/rcl/Destroy()
|
||||
QDEL_NULL(loaded)
|
||||
/obj/item/stack/cable_coil/rcl/Destroy()
|
||||
last = null
|
||||
active = FALSE
|
||||
return ..()
|
||||
|
||||
/obj/item/rcl/update_overlays()
|
||||
/obj/item/stack/cable_coil/rcl/screwdriver_act(mob/user, obj/item/I)
|
||||
if(!amount)
|
||||
to_chat(user, SPAN_WARNING("There's no cable to remove!"))
|
||||
return
|
||||
|
||||
if(!I.use_tool(src, user, FALSE, volume = I.tool_volume))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
to_chat(user, SPAN_NOTICE("You loosen the securing screws on the side, allowing you to lower the guiding edge and retrieve the wires."))
|
||||
while(amount)
|
||||
var/delta = 30
|
||||
if(amount < 30)
|
||||
delta = amount
|
||||
if(cable_merge_id == CABLE_LOW_POWER)
|
||||
var/obj/item/stack/cable_coil/dropped_coil = new /obj/item/stack/cable_coil(user.loc, delta)
|
||||
dropped_coil.color = get_cable_color()
|
||||
use(delta, FALSE)
|
||||
else
|
||||
new /obj/item/stack/cable_coil/extra_insulated(user.loc, delta)
|
||||
use(delta, FALSE)
|
||||
refresh_icon(user)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/stack/cable_coil/rcl/item_interaction(mob/living/user, obj/item/used, list/modifiers)
|
||||
if(!istype(used, /obj/item/stack/cable_coil))
|
||||
return ..()
|
||||
|
||||
// Another RCL is stealing cable from us, let its `interact_with_atom()` fire.
|
||||
if(istype(used, /obj/item/stack/cable_coil/rcl))
|
||||
return NONE
|
||||
|
||||
load_cable(user, used)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/stack/cable_coil/rcl/interact_with_atom(atom/target, mob/living/user, list/modifiers)
|
||||
if(!istype(target, /obj/item/stack/cable_coil))
|
||||
..()
|
||||
is_empty(user)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
load_cable(user, target)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/stack/cable_coil/rcl/proc/load_cable(mob/living/user, obj/item/used)
|
||||
var/obj/item/stack/cable_coil/used_coil = used
|
||||
if(get_amount() >= RCL_MAX_SPOOL_SIZE)
|
||||
to_chat(user, SPAN_WARNING("You cannot fit any more cable on [src]!"))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
// When loading an empty cable spool, turn it into either standard or heavy based on what we're loading.
|
||||
if(!get_amount())
|
||||
spool_color = used_coil.get_cable_color()
|
||||
cable_type = used_coil.cable_type
|
||||
cable_merge_id = used_coil.cable_merge_id
|
||||
// Robot RCL can freely swap between cable types anyway, allow them to eat the cable.
|
||||
else if((cable_merge_id != used_coil.cable_merge_id) && !is_robot_module())
|
||||
to_chat(user, SPAN_WARNING("These coils are of different types!"))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
var/delta = (RCL_MAX_SPOOL_SIZE - get_amount())
|
||||
add(min(used_coil.get_amount(), delta))
|
||||
used_coil.use(min(used_coil.get_amount(), delta), used_coil.destroy_upon_empty)
|
||||
refresh_icon(user)
|
||||
to_chat(user, SPAN_NOTICE("You add the cables to [src]. It now contains [get_amount()]."))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/stack/cable_coil/rcl/get_cable_color()
|
||||
return spool_color
|
||||
|
||||
/obj/item/stack/cable_coil/rcl/proc/refresh_icon(mob/user)
|
||||
if(color)
|
||||
spool_color = color
|
||||
color = null
|
||||
update_icon(UPDATE_ICON_STATE|UPDATE_OVERLAYS)
|
||||
if(user)
|
||||
user.update_inv_l_hand()
|
||||
user.update_inv_r_hand()
|
||||
|
||||
/obj/item/stack/cable_coil/rcl/update_overlays()
|
||||
. = ..()
|
||||
overlays.Cut()
|
||||
if(!loaded.amount)
|
||||
if(!get_amount())
|
||||
return
|
||||
|
||||
var/coil_size
|
||||
switch(loaded.amount)
|
||||
switch(get_amount())
|
||||
if(61 to INFINITY)
|
||||
coil_size = "full"
|
||||
if(31 to 60)
|
||||
coil_size = "mid"
|
||||
if(1 to 30)
|
||||
coil_size = "low"
|
||||
|
||||
if(loaded.cable_merge_id == CABLE_LOW_POWER)
|
||||
if(cable_merge_id == CABLE_LOW_POWER)
|
||||
var/image/cable_overlay = image('icons/obj/rcl.dmi', icon_state = "rcl_[coil_size]")
|
||||
cable_overlay.color = loaded.color
|
||||
cable_overlay.color = get_cable_color()
|
||||
overlays += cable_overlay
|
||||
else if(loaded.cable_type == /obj/structure/cable/extra_insulated)
|
||||
else if(cable_type == /obj/structure/cable/extra_insulated)
|
||||
overlays += "rcl_[coil_size]_hd"
|
||||
else
|
||||
overlays += "rcl_[coil_size]_hd_connected"
|
||||
|
||||
|
||||
/obj/item/rcl/update_icon_state()
|
||||
. = ..()
|
||||
if(loaded.cable_merge_id == CABLE_LOW_POWER)
|
||||
inhand_icon_state = "rcl[loaded.amount ? "_[loaded.color]" : null]"
|
||||
else if(loaded.cable_type == /obj/structure/cable/extra_insulated)
|
||||
inhand_icon_state = "rcl[loaded.amount ? "_hd" : null]"
|
||||
/obj/item/stack/cable_coil/rcl/update_icon_state()
|
||||
icon_state = "rcl"
|
||||
if(cable_merge_id == CABLE_LOW_POWER)
|
||||
inhand_icon_state = "rcl[amount ? "_[get_cable_color()]" : null]"
|
||||
else if(cable_type == /obj/structure/cable/extra_insulated)
|
||||
inhand_icon_state = "rcl[amount ? "_hd" : null]"
|
||||
else
|
||||
inhand_icon_state = "rcl[loaded.amount ? "_hd_connected" : null]"
|
||||
inhand_icon_state = "rcl[amount ? "_hd_connected" : null]"
|
||||
|
||||
/obj/item/rcl/proc/is_empty(mob/user, loud = 1)
|
||||
/obj/item/stack/cable_coil/rcl/update_name()
|
||||
. = ..()
|
||||
name = initial(name)
|
||||
|
||||
/obj/item/stack/cable_coil/rcl/proc/is_empty(mob/user, loud = 1)
|
||||
refresh_icon(user)
|
||||
if(!loaded.amount)
|
||||
if(!get_amount())
|
||||
if(loud)
|
||||
to_chat(user, SPAN_WARNING("The last of the cables unreel from [src]!"))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/rcl/dropped(mob/wearer)
|
||||
/obj/item/stack/cable_coil/rcl/dropped(mob/wearer)
|
||||
..()
|
||||
active = FALSE
|
||||
last = null
|
||||
|
||||
/obj/item/rcl/activate_self(mob/user)
|
||||
/obj/item/stack/cable_coil/rcl/activate_self(mob/user)
|
||||
if(..())
|
||||
return FINISH_ATTACK
|
||||
|
||||
@@ -157,93 +179,104 @@
|
||||
if(C.d1 == 0 || C.d2 == 0)
|
||||
last = C
|
||||
break
|
||||
|
||||
to_chat(user, SPAN_NOTICE("You [active ? "prepare to rapidly lay cable" : "stop rapidly laying cable"]."))
|
||||
|
||||
/obj/item/rcl/on_mob_move(direct, mob/user)
|
||||
/obj/item/stack/cable_coil/rcl/on_mob_move(direct, mob/user)
|
||||
if(active && isturf(user.loc))
|
||||
trigger(user)
|
||||
|
||||
/obj/item/rcl/proc/trigger(mob/user)
|
||||
/obj/item/stack/cable_coil/rcl/proc/trigger(mob/user)
|
||||
if(is_empty(user, 0))
|
||||
to_chat(user, SPAN_WARNING("[src] is empty!"))
|
||||
return
|
||||
|
||||
if(last)
|
||||
if(get_dist(last, user) == 1) //hacky, but it works
|
||||
var/turf/T = get_turf(user)
|
||||
if(!isturf(T) || T.intact || !T.can_have_cabling())
|
||||
last = null
|
||||
return
|
||||
|
||||
if(get_dir(last, user) == last.d2)
|
||||
//Did we just walk backwards? Well, that's the one direction we CAN'T complete a stub.
|
||||
last = null
|
||||
return
|
||||
loaded.cable_join(last, user)
|
||||
|
||||
cable_join(last, user)
|
||||
if(is_empty(user))
|
||||
return //If we've run out, display message and exit
|
||||
|
||||
else
|
||||
last = null
|
||||
last = loaded.place_turf(get_turf(loc), user, turn(user.dir, 180))
|
||||
last = place_turf(get_turf(loc), user, turn(user.dir, 180))
|
||||
is_empty(user) //If we've run out, display message
|
||||
|
||||
/obj/item/rcl/empty/Initialize(mapload)
|
||||
/obj/item/stack/cable_coil/rcl/empty/Initialize(mapload)
|
||||
..()
|
||||
loaded.use(RCL_MAX_SPOOL_SIZE, FALSE)
|
||||
update_icon(UPDATE_ICON_STATE|UPDATE_OVERLAYS)
|
||||
use(RCL_MAX_SPOOL_SIZE, FALSE)
|
||||
refresh_icon()
|
||||
|
||||
/obj/item/rcl/robot
|
||||
/obj/item/stack/cable_coil/rcl/AltClick(mob/living/user)
|
||||
return
|
||||
|
||||
/obj/item/stack/cable_coil/rcl/update_wclass()
|
||||
return
|
||||
|
||||
/obj/item/stack/cable_coil/rcl/robot
|
||||
name = "robotic rapid cable layer (RRCL)"
|
||||
desc = "A Rapid Cable Layer used to hold a spool of cable for engineering and construction robots."
|
||||
energy_type = /datum/robot_storage/material/cable
|
||||
is_cyborg = TRUE
|
||||
/// Tells us if we're laying basic or insulated cable.
|
||||
var/heavy_mode = FALSE
|
||||
|
||||
/obj/item/rcl/robot/examine(mob/user)
|
||||
// update_icon() refuses to add the cable overlay on Initialize(), I'm convinced it's an issue with energy stacks.
|
||||
// Energy stacks cannot be avoided because the icon of a stack refuses to render otherwise for reasons beyond my comprehension.
|
||||
/obj/item/stack/cable_coil/rcl/robot/Initialize(mapload)
|
||||
..()
|
||||
var/image/cable_overlay = image('icons/obj/rcl.dmi', icon_state = "rcl_full")
|
||||
cable_overlay.color = spool_color
|
||||
overlays += cable_overlay
|
||||
|
||||
/obj/item/stack/cable_coil/rcl/robot/examine(mob/user)
|
||||
. = ..()
|
||||
. += SPAN_NOTICE("[src] is currently dispensing [heavy_mode ? "<b>heavy duty cable</b>" : "<b>standard cable</b>"].")
|
||||
. += SPAN_NOTICE("<b>Alt-Click</b> to swap between laying <b>standard</b> and <b>heavy duty</b> cable.")
|
||||
. += SPAN_NOTICE("<b>Ctrl-Click</b> to [heavy_mode ? "toggle cable connectivity" : "select cable color"].")
|
||||
|
||||
/obj/item/rcl/robot/screwdriver_act(mob/user, obj/item/I)
|
||||
/obj/item/stack/cable_coil/rcl/robot/screwdriver_act(mob/user, obj/item/I)
|
||||
return
|
||||
|
||||
/obj/item/rcl/robot/AltClick(mob/user, modifiers)
|
||||
/obj/item/stack/cable_coil/rcl/robot/AltClick(mob/user, modifiers)
|
||||
if(..())
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(heavy_mode)
|
||||
loaded.cable_type = /obj/structure/cable
|
||||
loaded.cable_merge_id = CABLE_LOW_POWER
|
||||
loaded.color = "red"
|
||||
cable_type = /obj/structure/cable
|
||||
cable_merge_id = CABLE_LOW_POWER
|
||||
spool_color = "red"
|
||||
else
|
||||
loaded.cable_type = /obj/structure/cable/extra_insulated
|
||||
loaded.cable_merge_id = CABLE_HIGH_POWER
|
||||
loaded.color = null
|
||||
cable_type = /obj/structure/cable/extra_insulated
|
||||
cable_merge_id = CABLE_HIGH_POWER
|
||||
spool_color = null
|
||||
heavy_mode = !heavy_mode
|
||||
to_chat(user, SPAN_NOTICE("You start dispensing [heavy_mode ? "heavy-duty cable" : "standard cable"]."))
|
||||
update_icon(UPDATE_ICON_STATE|UPDATE_OVERLAYS)
|
||||
refresh_icon()
|
||||
|
||||
/obj/item/rcl/robot/CtrlClick(mob/user, modifiers)
|
||||
/obj/item/stack/cable_coil/rcl/robot/CtrlClick(mob/user, modifiers)
|
||||
if(!heavy_mode)
|
||||
var/new_cable_color = tgui_input_list(user, "Pick a cable color.", "Cable Color", list("white","red","orange","yellow","green","blue","cyan","pink"))
|
||||
var/new_cable_color = tgui_input_list(user, "Pick a cable color.", "Cable Color", list("pink","red","orange","yellow","green","blue","cyan","white"))
|
||||
if(!new_cable_color)
|
||||
return
|
||||
|
||||
to_chat(user, SPAN_NOTICE("[src] is now dispensing [new_cable_color] cable."))
|
||||
// For reasons beyond my comprehension, BYOND cannot comprehend the fact that green is equal to itself unless you explicitly tell it so.
|
||||
if(new_cable_color == "green")
|
||||
new_cable_color = COLOR_GREEN
|
||||
loaded.cable_color(new_cable_color)
|
||||
cable_color(new_cable_color)
|
||||
else
|
||||
if(loaded.cable_type == /obj/structure/cable/extra_insulated/pre_connect)
|
||||
loaded.cable_type = /obj/structure/cable/extra_insulated
|
||||
if(cable_type == /obj/structure/cable/extra_insulated/pre_connect)
|
||||
cable_type = /obj/structure/cable/extra_insulated
|
||||
to_chat(user, SPAN_NOTICE("[src] is now dispensing closed-connection heavy duty cable"))
|
||||
else
|
||||
loaded.cable_type = /obj/structure/cable/extra_insulated/pre_connect
|
||||
cable_type = /obj/structure/cable/extra_insulated/pre_connect
|
||||
to_chat(user, SPAN_NOTICE("[src] is now dispensing open-connection heavy duty cable"))
|
||||
|
||||
update_icon(UPDATE_ICON_STATE|UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/stack/cable_coil/random/rcl_spool
|
||||
destroy_upon_empty = FALSE
|
||||
max_amount = RCL_MAX_SPOOL_SIZE
|
||||
amount = RCL_MAX_SPOOL_SIZE
|
||||
refresh_icon()
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
/obj/item/robotanalyzer,
|
||||
/obj/item/rpd/bluespace,
|
||||
/obj/item/hammer,
|
||||
/obj/item/rcl,
|
||||
/obj/item/stack/cable_coil/rcl,
|
||||
/obj/item/melee/sickly_blade/lock,
|
||||
)
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
new /obj/item/crowbar/power(src)
|
||||
new /obj/item/weldingtool/experimental(src)//This can be changed if this is too much
|
||||
new /obj/item/multitool(src)
|
||||
new /obj/item/rcl(src)
|
||||
new /obj/item/stack/cable_coil/rcl(src)
|
||||
new /obj/item/extinguisher/mini(src)
|
||||
new /obj/item/analyzer(src)
|
||||
update_icon()
|
||||
|
||||
@@ -569,14 +569,14 @@ GLOBAL_LIST_EMPTY(station_turfs)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
C.place_turf(src, user)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
else if(istype(used, /obj/item/rcl))
|
||||
var/obj/item/rcl/R = used
|
||||
if(R.loaded)
|
||||
else if(istype(used, /obj/item/stack/cable_coil/rcl))
|
||||
var/obj/item/stack/cable_coil/rcl/R = used
|
||||
if(R.get_amount())
|
||||
for(var/obj/structure/cable/LC in src)
|
||||
if(LC.d1 == 0 || LC.d2 == 0)
|
||||
LC.item_interaction(user, R)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
R.loaded.place_turf(src, user)
|
||||
R.place_turf(src, user)
|
||||
R.is_empty(user)
|
||||
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
@@ -470,7 +470,7 @@
|
||||
/obj/item/stack/rods/cyborg,
|
||||
/obj/item/stack/tile/plasteel/cyborg,
|
||||
/obj/item/stack/tile/catwalk/cyborg,
|
||||
/obj/item/rcl/robot,
|
||||
/obj/item/stack/cable_coil/rcl/robot,
|
||||
/obj/item/stack/sheet/glass/cyborg,
|
||||
/obj/item/stack/sheet/rglass/cyborg,
|
||||
/obj/item/inflatable/cyborg,
|
||||
@@ -766,7 +766,7 @@
|
||||
/obj/item/stack/rods/cyborg,
|
||||
/obj/item/stack/tile/plasteel/cyborg,
|
||||
/obj/item/stack/tile/catwalk/cyborg,
|
||||
/obj/item/rcl/robot,
|
||||
/obj/item/stack/cable_coil/rcl/robot,
|
||||
/obj/item/stack/sheet/glass/cyborg/drone,
|
||||
/obj/item/stack/sheet/rglass/cyborg/drone,
|
||||
/obj/item/stack/sheet/wood/cyborg,
|
||||
@@ -876,7 +876,7 @@
|
||||
/obj/item/stack/sheet/metal/cyborg,
|
||||
/obj/item/stack/rods/cyborg,
|
||||
/obj/item/stack/tile/plasteel/cyborg,
|
||||
/obj/item/rcl/robot,
|
||||
/obj/item/stack/cable_coil/rcl/robot,
|
||||
/obj/item/stack/sheet/glass/cyborg,
|
||||
/obj/item/stack/sheet/rglass/cyborg
|
||||
)
|
||||
@@ -1121,3 +1121,9 @@
|
||||
statpanel_name = "Metal"
|
||||
stack = /obj/item/stack/sheet/metal
|
||||
add_to_storage = TRUE
|
||||
|
||||
/datum/robot_storage/material/cable
|
||||
name = "Cable Storage"
|
||||
statpanel_name = "Cable"
|
||||
max_amount = 90
|
||||
stack = /obj/item/stack/cable_coil/rcl
|
||||
|
||||
@@ -105,10 +105,10 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
return
|
||||
coil.cable_join(src, user)
|
||||
|
||||
else if(istype(W, /obj/item/rcl))
|
||||
var/obj/item/rcl/R = W
|
||||
if(R.loaded)
|
||||
R.loaded.cable_join(src, user)
|
||||
else if(istype(W, /obj/item/stack/cable_coil/rcl))
|
||||
var/obj/item/stack/cable_coil/rcl/R = W
|
||||
if(R.amount)
|
||||
R.cable_join(src, user)
|
||||
R.is_empty(user)
|
||||
|
||||
else if(istype(W, /obj/item/toy/crayon))
|
||||
|
||||
@@ -8,6 +8,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
|
||||
|
||||
/obj/item/stack/cable_coil
|
||||
name = "cable coil"
|
||||
desc = "A low-cost superconducting cable."
|
||||
singular_name = "cable"
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "coil"
|
||||
@@ -46,6 +47,10 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
|
||||
new_stack.color = color
|
||||
return new_stack
|
||||
|
||||
/// Used to decouple the physical color of the cable from the logical color. Used by RCL to stop its spool holder from being colored in.
|
||||
/obj/item/stack/cable_coil/proc/get_cable_color()
|
||||
return color
|
||||
|
||||
/obj/item/stack/cable_coil/update_name()
|
||||
. = ..()
|
||||
if(amount > 2)
|
||||
@@ -67,17 +72,6 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
|
||||
else
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
|
||||
/obj/item/stack/cable_coil/examine(mob/user)
|
||||
. = ..()
|
||||
if(!in_range(user, src))
|
||||
return
|
||||
if(get_amount() == 1)
|
||||
. += "A short piece of power cable."
|
||||
else if(get_amount() == 2)
|
||||
. += "A piece of power cable."
|
||||
else
|
||||
. += "A coil of power cables."
|
||||
|
||||
/obj/item/stack/cable_coil/can_merge(obj/item/stack/check, inhand = FALSE)
|
||||
. = FALSE
|
||||
if(istype(check, merge_type))
|
||||
@@ -145,27 +139,24 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
|
||||
C.color = color
|
||||
return C
|
||||
|
||||
// Items usable on a cable coil :
|
||||
// - Wirecutters : cut them duh !
|
||||
// - Cable coil : merge cables
|
||||
/obj/item/stack/cable_coil/item_interaction(mob/living/user, obj/item/used, list/modifiers)
|
||||
if(istype(used, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = used
|
||||
// Cable merging is handled by parent proc
|
||||
if(C.cable_merge_id != cable_merge_id)
|
||||
to_chat(user, "These coils are of different types.")
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(C.get_amount() >= MAXCOIL)
|
||||
if(C.get_amount() >= C.max_amount)
|
||||
to_chat(user, "The coil is as long as it will get.")
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if((C.get_amount() + get_amount() <= MAXCOIL))
|
||||
// Cable merging is handled by parent proc.
|
||||
if((C.get_amount() + get_amount() <= C.max_amount))
|
||||
to_chat(user, "You join the cable coils together.")
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
return ..()
|
||||
|
||||
to_chat(user, "You transfer [get_amount_transferred()] length\s of cable from one coil to the other.")
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
return ..()
|
||||
|
||||
if(istype(used, /obj/item/toy/crayon))
|
||||
var/obj/item/toy/crayon/C = used
|
||||
@@ -180,8 +171,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
|
||||
|
||||
/obj/item/stack/cable_coil/proc/get_new_cable(location)
|
||||
var/obj/structure/cable/C = new cable_type(location)
|
||||
C.cable_color(color)
|
||||
|
||||
C.cable_color(get_cable_color())
|
||||
return C
|
||||
|
||||
/// called when cable_coil is clicked on a turf/simulated/floor
|
||||
@@ -319,9 +309,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
|
||||
to_chat(user, SPAN_WARNING("There's already a cable at that position!"))
|
||||
return
|
||||
|
||||
|
||||
C.cable_color(color)
|
||||
|
||||
C.cable_color(get_cable_color())
|
||||
C.d1 = nd1
|
||||
C.d2 = nd2
|
||||
|
||||
@@ -382,30 +370,30 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
|
||||
/obj/item/stack/cable_coil/ten
|
||||
amount = 10
|
||||
|
||||
/obj/item/stack/cable_coil/yellow
|
||||
color = COLOR_YELLOW
|
||||
|
||||
/obj/item/stack/cable_coil/blue
|
||||
color = COLOR_BLUE
|
||||
|
||||
/obj/item/stack/cable_coil/green
|
||||
color = COLOR_GREEN
|
||||
|
||||
/obj/item/stack/cable_coil/pink
|
||||
color = COLOR_PINK
|
||||
|
||||
/obj/item/stack/cable_coil/yellow
|
||||
color = COLOR_YELLOW
|
||||
|
||||
/obj/item/stack/cable_coil/orange
|
||||
color = COLOR_ORANGE
|
||||
|
||||
/obj/item/stack/cable_coil/green
|
||||
color = COLOR_GREEN
|
||||
|
||||
/obj/item/stack/cable_coil/cyan
|
||||
color = COLOR_CYAN
|
||||
|
||||
/obj/item/stack/cable_coil/blue
|
||||
color = COLOR_BLUE
|
||||
|
||||
/obj/item/stack/cable_coil/white
|
||||
color = COLOR_WHITE
|
||||
|
||||
/obj/item/stack/cable_coil/random/Initialize(mapload)
|
||||
. = ..()
|
||||
color = pick(COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN, COLOR_ORANGE)
|
||||
color = pick(COLOR_RED, COLOR_PINK, COLOR_ORANGE, COLOR_YELLOW, COLOR_GREEN, COLOR_CYAN, COLOR_BLUE, COLOR_WHITE)
|
||||
|
||||
/obj/item/stack/cable_coil/extra_insulated
|
||||
name = "heavy duty cable coil"
|
||||
|
||||
@@ -830,7 +830,7 @@
|
||||
id = "rcl"
|
||||
build_type = AUTOLATHE
|
||||
materials = list(MAT_METAL = 5000)
|
||||
build_path = /obj/item/rcl/empty
|
||||
build_path = /obj/item/stack/cable_coil/rcl/empty
|
||||
category = list("initial", "Construction")
|
||||
|
||||
//hacked autolathe recipes
|
||||
|
||||
@@ -280,10 +280,10 @@
|
||||
if(C.get_amount() < 3)
|
||||
to_chat(user, SPAN_WARNING("You need three or more cable pieces to repair this damage."))
|
||||
return SURGERY_BEGINSTEP_SKIP
|
||||
C.use(3)
|
||||
C.use(3, C.destroy_upon_empty)
|
||||
user.visible_message(
|
||||
"[user] begins to splice new cabling into [target]'s [affected.name].",
|
||||
"You begin to splice new cabling into [target]'s [affected.name].",
|
||||
SPAN_NOTICE("[user] begins to splice new cabling into [target]'s [affected.name]."),
|
||||
SPAN_NOTICE("You begin to splice new cabling into [target]'s [affected.name]."),
|
||||
chat_message_type = MESSAGE_TYPE_COMBAT
|
||||
)
|
||||
return ..()
|
||||
@@ -294,7 +294,7 @@
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message(
|
||||
SPAN_NOTICE("[user] finishes splicing cable into [target]'s [affected.name]."),
|
||||
SPAN_NOTICE("You finishes splicing new cable into [target]'s [affected.name]."),
|
||||
SPAN_NOTICE("You finish splicing new cable into [target]'s [affected.name]."),
|
||||
chat_message_type = MESSAGE_TYPE_COMBAT
|
||||
)
|
||||
affected.heal_damage(0, rand(30, 50), 1, 1)
|
||||
|
||||
Reference in New Issue
Block a user