Rapid Cable Layer rewrite & Cable Coilours (#35241)

* RCL Revolution

* Polishing

* fixing conflicts

* aight

* SpaceRCL

* Fixing Conflict & macro name

* fixing conflicts
This commit is contained in:
DeityLink
2023-10-30 03:55:15 +01:00
committed by GitHub
parent 79d631e03e
commit d6d7317222
25 changed files with 366 additions and 171 deletions

View File

@@ -196,6 +196,8 @@
#define istable(A) (istype(A, /obj/structure/table))
#define isshelf(A) (istype(A, /obj/structure/table) || istype(A, /obj/structure/rack) || istype(A, /obj/structure/closet) || istype(A, /obj/item/weapon/storage))
#define issilicatesprayer(A) (istype(A, /obj/item/device/silicate_sprayer))
#define iswindow(A) (istype(A, /obj/structure/window))

View File

@@ -7,7 +7,8 @@
// Use in chem.flags.
#define CHEMFLAG_DISHONORABLE 1
#define CHEMFLAG_OBSCURING 2
#define CHEMFLAG_OBSCURING 2
#define CHEMFLAG_PIGMENT 4
#define EXPLICITLY_INVALID_REAGENT_ID "Use this ID if the reagent is not supposed to be used, like for the base type of other reagents."

View File

@@ -154,10 +154,21 @@
)
)
alt_title_items_to_collect = list(
"Electrician" = list(
/obj/item/weapon/rcl/pre_loaded/yellow,
)
)
pda_type = /obj/item/device/pda/engineering
pda_slot = slot_l_store
id_type = /obj/item/weapon/card/id/engineering
/datum/outfit/engineer/post_equip(var/mob/living/carbon/human/H)
..()
if(H.mind.role_alt_title == "Electrician")//So they get some extra cables
H.put_in_hands(new /obj/item/weapon/storage/toolbox/electrical(H))
/datum/outfit/engineer/pre_equip_priority(var/mob/living/carbon/human/H, var/species)
items_to_collect[/obj/item/device/multitool/omnitool] = SURVIVAL_BOX
items_to_collect[/obj/item/weapon/reagent_containers/food/drinks/soda_cans/engicoffee_shard] = SURVIVAL_BOX

View File

@@ -2437,6 +2437,7 @@ var/global/num_vending_terminals = 1
)
premium = list(
/obj/item/clothing/gloves/yellow = 1,
/obj/item/weapon/rcl = 2,
)
pack = /obj/structure/vendomatpack/tool
@@ -2467,6 +2468,7 @@ var/global/num_vending_terminals = 1
/obj/item/blueprints/construction_permit = 4, // permits
/obj/item/taperoll/engineering = 5,
/obj/item/taperoll/atmos = 5,
/obj/item/weapon/rcl = 3,
)
contraband = list(
/obj/item/weapon/cell/potato = 3,

View File

@@ -374,7 +374,7 @@
if(!use_cable(1))
return reset()
var/obj/structure/cable/NC = new /obj/structure/cable(new_turf)
NC.cableColor("red")
NC.color = "#FF0000"
NC.d1 = 0
NC.d2 = fdirn
NC.update_icon()

View File

@@ -6,8 +6,7 @@
// Definitions
////////////////////////////////
/datum/stack_recipe/cable_cuffs/finish_building(var/mob/usr, var/obj/item/stack/cable_coil/S, var/obj/item/weapon/handcuffs/cable/C)
C._color = S._color
C.update_icon()
C.color = S.color
var/global/list/datum/stack_recipe/cable_recipes = list ( \
new/datum/stack_recipe/cable_cuffs("cable cuffs", /obj/item/weapon/handcuffs/cable, 15, time = 3, one_per_turf = 0, on_floor = 0))
@@ -17,13 +16,14 @@ var/global/list/datum/stack_recipe/cable_recipes = list ( \
/obj/item/stack/cable_coil
name = "cable coil"
icon = 'icons/obj/power.dmi'
icon_state = "coil_red"
icon_state = "coil"
item_state = "coil"
gender = NEUTER
amount = MAXCOIL
restock_amount = 2
singular_name = "cable piece"
max_amount = MAXCOIL
_color = "red"
color = "#FF0000"
desc = "A coil of power cable."
throwforce = 10
w_class = W_CLASS_SMALL
@@ -35,7 +35,6 @@ var/global/list/datum/stack_recipe/cable_recipes = list ( \
autoignition_temperature = AUTOIGNITION_PLASTIC
siemens_coefficient = 1.5 //Extra conducting
slot_flags = SLOT_BELT
item_state = "coil_red"
attack_verb = list("whips", "lashes", "disciplines", "flogs")
toolsounds = list('sound/weapons/cablecuff.ogg')
surgerysound = 'sound/items/fixovein.ogg'
@@ -53,7 +52,7 @@ var/global/list/datum/stack_recipe/cable_recipes = list ( \
recipes = cable_recipes
if(param_color)
_color = param_color
color = param_color
pixel_x = rand(-2,2) * PIXEL_MULTIPLIER
pixel_y = rand(-2,2) * PIXEL_MULTIPLIER
@@ -63,6 +62,11 @@ var/global/list/datum/stack_recipe/cable_recipes = list ( \
// General procedures
///////////////////////////////////
/obj/item/stack/cable_coil/copy_evidences(var/obj/item/stack/from)
..(from)
color = from.color
update_icon()
/obj/item/stack/cable_coil/preattack(atom/target, mob/user, proximity_flag, params)
var/turf/target_turf
@@ -104,6 +108,27 @@ var/global/list/datum/stack_recipe/cable_recipes = list ( \
else
return ..()
/obj/item/stack/cable_coil/afterattack(obj/target, mob/user, proximity_flag, click_parameters)
if(proximity_flag == 0) // not adjacent
return
if(target.is_open_container() && target.reagents && !target.reagents.is_empty())
// Figure out how much water or cleaner there is
var/cleaner_percent = get_reagent_paint_cleaning_percent(target)
if (cleaner_percent >= 0.7)
// Clean up that cable
color = "#D0D0D0"
to_chat(user, "<span class='notice'>You clean \the [name] in \the [target.name].</span>")
else
// Take the reagent mix's color
var/list/paint_color_rgb = rgb2num(mix_color_from_reagents(target.reagents.reagent_list, TRUE))//only pigments
color = rgb(paint_color_rgb[1], paint_color_rgb[2], paint_color_rgb[3])
to_chat(user, "<span class='notice'>You dip \the [name] in \the [target.name].</span>")
user.update_inv_hands()
/obj/item/stack/cable_coil/use(var/amount)
. = ..()
update_icon()
@@ -116,18 +141,17 @@ var/global/list/datum/stack_recipe/cable_recipes = list ( \
return istype(other_stack, /obj/item/stack/cable_coil) && !istype(other_stack, /obj/item/stack/cable_coil/heavyduty) //It can be any cable, except the fat stuff
/obj/item/stack/cable_coil/update_icon()
if(!_color)
_color = pick("red", "yellow", "blue", "green")
if(amount == 1)
icon_state = "coil_[_color]1"
icon_state = "coil_1"
name = "cable piece"
else if(amount == 2)
icon_state = "coil_[_color]2"
icon_state = "coil_2"
name = "cable piece"
else
icon_state = "coil_[_color]"
icon_state = "coil"
name = "cable coil"
item_state = "coil"
/obj/item/stack/cable_coil/examine()
set src in view(1)
@@ -145,7 +169,7 @@ var/global/list/datum/stack_recipe/cable_recipes = list ( \
/obj/item/stack/cable_coil/attackby(obj/item/weapon/W, mob/user)
if(W.is_wirecutter(user) && (amount > 1))
use(1)
new /obj/item/stack/cable_coil(user.loc, 1, _color)
new /obj/item/stack/cable_coil(user.loc, 1, color)
to_chat(user, "<span class='notice'>You cut a piece off the cable coil.</span>")
update_icon()
return
@@ -185,7 +209,7 @@ var/global/list/datum/stack_recipe/cable_recipes = list ( \
return
var/obj/structure/cable/C = new /obj/structure/cable(F)
C.cableColor(_color)
C.color = color
//Set up the new cable
if(isopenspace(F))
@@ -197,7 +221,7 @@ var/global/list/datum/stack_recipe/cable_recipes = list ( \
if(!current_turf)
break
var/obj/structure/cable/C2 = new /obj/structure/cable(current_turf)
C2.cableColor(_color)
C2.color = color
var/turf/to_check = GetBelow(current_turf)
if(to_check && (to_check.intact || !to_check.can_place_cables())) // Can the turf below have cables on it? Important to know if the cable should hang here.
to_check = null
@@ -309,7 +333,7 @@ var/global/list/datum/stack_recipe/cable_recipes = list ( \
to_chat(user, "<span class='warning'>There's already a cable at that position.</span>")
return
C.cableColor(_color)
C.color = color
C.d1 = nd1
C.d2 = nd2
@@ -352,37 +376,33 @@ var/global/list/datum/stack_recipe/cable_recipes = list ( \
update_icon()
/obj/item/stack/cable_coil/yellow
_color = "yellow"
icon_state = "coil_yellow"
color = "#FFED00"
/obj/item/stack/cable_coil/blue
_color = "blue"
icon_state = "coil_blue"
color = "#005C84"
/obj/item/stack/cable_coil/green
_color = "green"
icon_state = "coil_green"
color = "#0B8400"
/obj/item/stack/cable_coil/pink
_color = "pink"
icon_state = "coil_pink"
color = "#CA00B6"
/obj/item/stack/cable_coil/orange
_color = "orange"
icon_state = "coil_orange"
color = "#CA6900"
/obj/item/stack/cable_coil/cyan
_color = "cyan"
icon_state = "coil_cyan"
color = "#00B5CA"
/obj/item/stack/cable_coil/white
_color = "white"
icon_state = "coil_white"
color = "#D0D0D0"
/obj/item/stack/cable_coil/random/New(loc, amount, var/param_color = null)
..()
_color = pick("red","yellow","green","blue","pink")
icon_state = "coil_[_color]"
color = pick("#FF0000","#FFED00","#0B8400","#005C84","#CA00B6")
update_icon()
if (ismob(loc))
var/mob/M = loc
M.update_inv_hands()
/obj/item/stack/cable_coil/persistent/turf_place(turf/simulated/floor/F, mob/user, var/dirnew) //for cable coil that needs to not be capable of being used up entirely
if(amount > 1)

View File

@@ -1,11 +1,10 @@
/obj/item/weapon/rcl
name = "rapid cable layer (RCL)"
desc = "A device used to rapidly deploy cables. It has screws on the side which can be removed to slide off the cables."
icon = 'icons/obj/items.dmi'
icon_state = "rcl-0"
icon = 'icons/obj/power.dmi'
icon_state = "rcl"
item_state = "rcl-0"
inhand_states = list("left_hand" = 'icons/mob/in-hand/left/electronics.dmi', "right_hand" = 'icons/mob/in-hand/right/electronics.dmi')
opacity = 0
flags = FPRINT
siemens_coefficient = 1 //Not quite as conductive as working with cables themselves
force = 5.0 //Plastic is soft
@@ -17,10 +16,27 @@
melt_temperature = MELTPOINT_PLASTIC
autoignition_temperature = AUTOIGNITION_PLASTIC
origin_tech = Tc_ENGINEERING + "=2;" + Tc_MATERIALS + "=4"
var/max_amount = 90
var/active = 0
var/obj/structure/cable/last = null
var/active = FALSE
var/obj/item/stack/cable_coil/loaded = null
var/placed_stub = FALSE
var/turf/before
var/turf/after
/obj/item/weapon/rcl/examine(mob/user)
..()
if(loaded)
to_chat(user, "<span class='info'>It contains [loaded.amount]/[max_amount] cables.</span>")
/obj/item/weapon/rcl/Destroy()
QDEL_NULL(loaded)
active = FALSE
set_move_event()
..()
/obj/item/weapon/rcl/attackby(obj/item/weapon/W, mob/user)
if(istype(W,/obj/item/stack/cable_coil))
@@ -31,11 +47,14 @@
else
loaded.preattack(W,user,1)
update_icon()
playsound(loc, 'sound/items/zip.ogg', 20, 1)
to_chat(user, "<span class='notice'>You add the cables to the [src]. It now contains [loaded.amount].</span>")
else if(W.is_screwdriver(user))
if(!loaded)
to_chat(user, "<span class='warning'>There are no wires to remove.</span>")
return
to_chat(user, "<span class='notice'>You loosen the securing screws on the side, allowing you to lower the guiding edge and retrieve the wires.</span>")
W.playtoolsound(src, 50)
while(loaded.amount>30) //There are only two kinds of situations: "nodiff" (60,90), or "diff" (31-59, 61-89)
var/diff = loaded.amount % 30
if(diff)
@@ -52,91 +71,243 @@
else
..()
/obj/item/weapon/rcl/examine(mob/user)
..()
if(loaded)
to_chat(user, "<span class='info'>It contains [loaded.amount]/90 cables.</span>")
/obj/item/weapon/rcl/Destroy()
QDEL_NULL(loaded)
last = null
active = 0
set_move_event()
..()
/obj/item/weapon/rcl/update_icon()
overlays.len = 0
if(!loaded)
icon_state = "rcl-0"
item_state = "rcl-0"
color = null
if (ismob(loc))
var/mob/M = loc
M.update_inv_hands()
return
switch(loaded.amount)
if(61 to INFINITY)
icon_state = "rcl-30"
item_state = "rcl"
if(31 to 60)
icon_state = "rcl-20"
item_state = "rcl"
if(1 to 30)
icon_state = "rcl-10"
item_state = "rcl"
else
icon_state = "rcl-0"
item_state = "rcl-0"
color = loaded.color
var/amount = clamp(round(loaded.amount / (max_amount/12)) + 1, 1, 12)
overlays += "rcl-[amount]"
var/image/I = image(icon,src,"rcl-lights")
I.appearance_flags = RESET_COLOR
overlays += I
if (active)
overlays += "rcl-wire"
item_state = "rcl-1"
else
item_state = "rcl"
var/image/M = image(icon,src, "rcl-cover")
M.appearance_flags = RESET_COLOR
overlays += M
if (ismob(loc))
var/mob/O = loc
O.update_inv_hands()
/obj/item/weapon/rcl/afterattack(obj/target, mob/user, proximity_flag, click_parameters)
if(proximity_flag == 0) // not adjacent
return
if (isshelf(target))//placing on table, rack, closet, or in a backpack etc
return
if(!loaded || !loaded.amount)
to_chat(user, "<span class='warning'>There isn't any cable left inside.</span>")
return
var/turf/T = get_turf(src)
var/turf/U = get_turf(target)
placed_stub = FALSE
if (connect_two_floors(user, T, U, TRUE))
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
active = TRUE
set_move_event(user)
update_icon()
/obj/item/weapon/rcl/proc/connect_two_floors(var/mob/user, var/turf/first_floor, var/turf/second_floor, var/clicked = FALSE)
if (!first_floor || !second_floor)
return
if(!first_floor.can_place_cables(TRUE) || !second_floor.can_place_cables(TRUE))
if (user)
to_chat(user, "<span class='warning'>You can't place cables between here and there.</span>")
if (active)
playsound(loc, 'sound/machines/click.ogg', 50, 1)
active = FALSE
set_move_event(user)
update_icon()
return
var/used = max(connect_toward(user, second_floor, first_floor, clicked), connect_toward(user, first_floor, second_floor, clicked))
/obj/item/weapon/rcl/proc/is_empty(mob/user)
update_icon()
if(loaded && !loaded.amount)
to_chat(user, "<span class='notice'>The last of the cables unreel from \the [src].</span>")
to_chat(user, "<span class='warning'>The last of the cables unreel from \the [src].</span>")
QDEL_NULL(loaded)
active = 0
return 1
return 0
active = FALSE
/obj/item/weapon/rcl/dropped(mob/wearer as mob)
if (used)
playsound(loc, 'sound/items/crank.ogg', 10, 1)
update_icon()
return used
/obj/item/weapon/rcl/proc/connect_toward(var/mob/user, var/turf/start_floor, var/turf/target_floor, var/new_stubs = FALSE)
if(!loaded || !loaded.amount)
return FALSE
//first we search for a node on that tile
var/target_dir = get_dir(start_floor, target_floor)
var/obj/structure/cable/valid_node
var/obj/structure/cable/wire_stub
var/allow_stubs_unclicked = TRUE
var/list/possible_nodes = list()
var/list/full_wires = list()
for (var/obj/structure/cable/C in start_floor)
if (!C.d1)
if (C.d2 == target_dir)
//that node goes toward our target tile already.
wire_stub = C
else
possible_nodes += C
else
full_wires += C
if ((C.d1 == target_dir) || (C.d2 == target_dir))
allow_stubs_unclicked = FALSE
if (possible_nodes.len > 0)
for (var/obj/structure/cable/C in possible_nodes)
var/valid = TRUE
for (var/obj/structure/cable/A in full_wires)
if (((C.d2 == A.d1) && (target_dir == A.d2)) || ((C.d2 == A.d2) && (target_dir == A.d1)))
//there's already a full wire that covers that path
valid = FALSE
break
if (valid)
//alright we got our valid node
valid_node = C
break
if (valid_node)
//we found a node that could come toward the other tile, let's do that and call it a day
var/nd1 = valid_node.d2
var/nd2 = target_dir
if(nd1 > nd2)
nd1 = target_dir
nd2 = valid_node.d2
valid_node.color = color
valid_node.d1 = nd1
valid_node.d2 = nd2
valid_node.update_icon()
valid_node.mergeConnectedNetworks(valid_node.d1) //Merge the powernets
valid_node.mergeConnectedNetworks(valid_node.d2) //In the two new cable directions
valid_node.mergeConnectedNetworksOnTurf()
if(valid_node.d1 & (valid_node.d1 - 1)) //If the cable is layed diagonally, check the others 2 possible directions
valid_node.mergeDiagonalsNetworks(valid_node.d1)
if(valid_node.d2 & (valid_node.d2 - 1)) //If the cable is layed diagonally, check the others 2 possible directions
valid_node.mergeDiagonalsNetworks(valid_node.d2)
loaded.use(1)
return TRUE
else if (!wire_stub && (allow_stubs_unclicked || new_stubs))
//else let's add a new stub if we clicked (but only one per click, not two, and in priority on the tile we clicked at)
if (placed_stub && !allow_stubs_unclicked)
return FALSE
placed_stub = TRUE
var/obj/structure/cable/C = new /obj/structure/cable(start_floor)
C.color = color
C.d1 = 0 //It's a O-X node cable
C.d2 = target_dir
C.update_icon()
var/datum/powernet/PN = new /datum/powernet
PN.add_cable(C)
C.mergeConnectedNetworks(C.d2) //Merge the powernet with adjacents powernets
C.mergeConnectedNetworksOnTurf() //Merge the powernet with on turf powernets
if(C.d2 & (C.d2 - 1)) //If the cable is layed diagonally, check the others 2 possible directions
C.mergeDiagonalsNetworks(C.d2)
loaded.use(1)
return TRUE
return FALSE
/obj/item/weapon/rcl/attack_self(var/mob/user)
active = !active
if (active)
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
else
playsound(loc, 'sound/machines/click.ogg', 50, 1)
to_chat(user, "<span class='notice'>You turn \the [src] [active ? "on" : "off"].<span>")
set_move_event(user)
update_icon()
/obj/item/weapon/rcl/pickup(var/mob/user)
..()
active = 0
set_move_event(wearer)
if(active)
user.register_event(/event/before_move, src, /obj/item/weapon/rcl/proc/turf_before)
user.register_event(/event/after_move, src, /obj/item/weapon/rcl/proc/turf_after)
/obj/item/weapon/rcl/dropped(var/mob/user)
..()
user.unregister_event(/event/before_move, src, /obj/item/weapon/rcl/proc/turf_before)
user.unregister_event(/event/after_move, src, /obj/item/weapon/rcl/proc/turf_after)
/obj/item/weapon/rcl/proc/set_move_event(mob/user)
if(user)
if(active)
trigger(user)
user.register_event(/event/moved, src, nameof(src::holder_moved()))
user.register_event(/event/before_move, src, /obj/item/weapon/rcl/proc/turf_before)
user.register_event(/event/after_move, src, /obj/item/weapon/rcl/proc/turf_after)
return
user.unregister_event(/event/moved, src, nameof(src::holder_moved()))
user.unregister_event(/event/before_move, src, /obj/item/weapon/rcl/proc/turf_before)
user.unregister_event(/event/after_move, src, /obj/item/weapon/rcl/proc/turf_after)
/obj/item/weapon/rcl/attack_self(mob/user as mob)
active = !active
to_chat(user, "<span class='notice'>You turn \the [src] [active ? "on" : "off"].<span>")
set_move_event(user)
/obj/item/weapon/rcl/proc/turf_before()
before = get_turf(src)
/obj/item/weapon/rcl/proc/holder_moved(atom/movable/mover)
if(active)
trigger(mover)
/obj/item/weapon/rcl/proc/turf_after()
after = get_turf(src)
if (before && (before != after))
if (before.Adjacent(after))
var/mob/M = null
if (ismob(loc))
M = loc
connect_two_floors(M, before, after)
before = null
after = null
/obj/item/weapon/rcl/proc/trigger(mob/user as mob)
if(!loaded)
to_chat(user, "<span class='warning'>\The [src] is empty!</span>")
return
if(last)
if(get_dist(last, user) == 0) //hacky, but it works
last = null
else if(get_dist(last, user) == 1)
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)
if(is_empty(user))
return //If we've run out, display message and exit
else
last = null
last = loaded.turf_place(get_turf(src.loc),user,turn(user.dir,180))
is_empty(user) //If we've run out, display message
//-----------------------------------------------------------------------------------------
/obj/item/weapon/rcl/pre_loaded
var/cable_type = /obj/item/stack/cable_coil
/obj/item/weapon/rcl/pre_loaded/New() //Comes preloaded with cable, for testing stuff
..()
loaded = new()
loaded = new cable_type()
loaded.max_amount = max_amount
loaded.amount = max_amount
update_icon()
/obj/item/weapon/rcl/pre_loaded/yellow
cable_type = /obj/item/stack/cable_coil/yellow
/obj/item/weapon/rcl/pre_loaded/blue
cable_type = /obj/item/stack/cable_coil/blue
/obj/item/weapon/rcl/pre_loaded/green
cable_type = /obj/item/stack/cable_coil/green
/obj/item/weapon/rcl/pre_loaded/pink
cable_type = /obj/item/stack/cable_coil/pink
/obj/item/weapon/rcl/pre_loaded/orange
cable_type = /obj/item/stack/cable_coil/orange
/obj/item/weapon/rcl/pre_loaded/cyan
cable_type = /obj/item/stack/cable_coil/cyan
/obj/item/weapon/rcl/pre_loaded/white
cable_type = /obj/item/stack/cable_coil/white
/obj/item/weapon/rcl/pre_loaded/random
cable_type = /obj/item/stack/cable_coil/random

View File

@@ -109,45 +109,33 @@
/obj/item/weapon/handcuffs/cable
name = "cable restraints"
desc = "Looks like some cables tied together. Could be used to tie something up."
icon_state = "cuff_red"
_color = "red"
icon_state = "cablecuff"
restraint_resist_time = 30 SECONDS
toolsounds = list('sound/weapons/cablecuff.ogg')
/obj/item/weapon/handcuffs/cable/red
icon_state = "cuff_red"
color = "#FF0000"
/obj/item/weapon/handcuffs/cable/yellow
icon_state = "cuff_yellow"
_color = "yellow"
color = "#FFED00"
/obj/item/weapon/handcuffs/cable/blue
icon_state = "cuff_blue"
_color = "blue"
color = "#005C84"
/obj/item/weapon/handcuffs/cable/green
icon_state = "cuff_green"
_color = "green"
color = "#0B8400"
/obj/item/weapon/handcuffs/cable/pink
icon_state = "cuff_pink"
_color = "pink"
color = "#CA00B6"
/obj/item/weapon/handcuffs/cable/orange
icon_state = "cuff_orange"
_color = "orange"
color = "#CA6900"
/obj/item/weapon/handcuffs/cable/cyan
icon_state = "cuff_cyan"
_color = "cyan"
color = "#00B5CA"
/obj/item/weapon/handcuffs/cable/white
icon_state = "cuff_white"
_color = "white"
/obj/item/weapon/handcuffs/cable/update_icon()
if(_color)
icon_state = "cuff_[_color]"
color = "#D0D0D0"
/obj/item/weapon/handcuffs/cable/attackby(var/obj/item/I, mob/user as mob)
..()
@@ -162,3 +150,22 @@
to_chat(user, "<span class='notice'>You wrap the cable restraint around the top of the rod.</span>")
qdel(src)
/obj/item/weapon/handcuffs/cable/afterattack(obj/target, mob/user, proximity_flag, click_parameters)
if(proximity_flag == 0) // not adjacent
return
if(target.is_open_container() && target.reagents && !target.reagents.is_empty())
// Figure out how much water or cleaner there is
var/cleaner_percent = get_reagent_paint_cleaning_percent(target)
if (cleaner_percent >= 0.7)
// Clean up that cable
color = "#D0D0D0"
to_chat(user, "<span class='notice'>You clean \the [name] in \the [target.name].</span>")
else
// Take the reagent mix's color
var/list/paint_color_rgb = rgb2num(mix_color_from_reagents(target.reagents.reagent_list, TRUE))//only pigments
color = rgb(paint_color_rgb[1], paint_color_rgb[2], paint_color_rgb[3])
to_chat(user, "<span class='notice'>You dip \the [name] in \the [target.name].</span>")
user.update_inv_hands()

View File

@@ -104,7 +104,7 @@
/obj/item/weapon/storage/toolbox/electrical/New()
..()
var/color = pick("red","yellow","green","blue","pink","orange","cyan","white")
var/color = pick("#FF0000","#FFED00","#0B8400","#005C84","#CA00B6","#CA6900","#00B5CA","#D0D0D0")
new /obj/item/stack/cable_coil(src,30,color)
new /obj/item/stack/cable_coil(src,30,color)
if(prob(5))

View File

@@ -206,7 +206,9 @@
for(var/obj/effect/beam/B in src)
B.Crossed(A)
/turf/space/can_place_cables()
/turf/space/can_place_cables(var/override_space = FALSE)
if (override_space)
return TRUE
var/obj/structure/catwalk/support = locate() in src
return !isnull(support)

View File

@@ -247,7 +247,7 @@
/turf/proc/is_plating()
return 0
/turf/proc/can_place_cables()
/turf/proc/can_place_cables(var/override_space = FALSE)
return is_plating()
/turf/proc/is_asteroid_floor()
return 0

View File

@@ -1351,6 +1351,7 @@ var/global/list/damage_icon_parts = list()
var/obj/abstract/Overlays/O = obj_overlays[HANDCUFF_LAYER]
O.icon = 'icons/obj/cuffs.dmi'
O.icon_state = handcuffed.icon_state
O.color = handcuffed.color
O.pixel_x = species.inventory_offsets["[slot_handcuffed]"]["pixel_x"] * PIXEL_MULTIPLIER
O.pixel_y = species.inventory_offsets["[slot_handcuffed]"]["pixel_y"] * PIXEL_MULTIPLIER
obj_to_plane_overlay(O,HANDCUFF_LAYER)

View File

@@ -187,6 +187,7 @@ var/global/list/paint_types = subtypesof(/datum/reagent/paint)
color = "#808080"
density = 1.808
specheatcap = 0.85
flags = CHEMFLAG_PIGMENT
/datum/reagent/paint/reaction_turf(var/turf/T, var/volume)
if(!istype(T) || istype(T, /turf/space))

View File

@@ -38,8 +38,7 @@ By design, d1 is the smallest direction and d2 is the highest
var/d2 = 1 // cable direction 2 (see above)
plane = ABOVE_TURF_PLANE //Set above turf for mapping preview only, supposed to be ABOVE_PLATING_PLANE, handled in New()
layer = WIRE_LAYER
var/_color = "red"
color = "red"
color = "#FF0000"
//For rebuilding powernets from scratch
var/build_status = 0 //1 means it needs rebuilding during the next tick or on usage
@@ -51,39 +50,31 @@ By design, d1 is the smallest direction and d2 is the highest
return TRUE
/obj/structure/cable/yellow
_color = "yellow"
color = "yellow"
color = "#FFED00"
/obj/structure/cable/green
_color = "green"
color = "green"
color = "#0B8400"
/obj/structure/cable/blue
_color = "blue"
color = "blue"
color = "#005C84"
/obj/structure/cable/pink
_color = "pink"
color = CABLE_PINK
color = "#CA00B6"
/obj/structure/cable/orange
_color = "orange"
color = CABLE_ORANGE
color = "#CA6900"
/obj/structure/cable/cyan
_color = "cyan"
color = "cyan"
color = "#00B5CA"
/obj/structure/cable/white
_color = "white"
color = "white"
color = "#D0D0D0"
// the power cable object
/obj/structure/cable/New(loc)
..(loc)
reset_plane()
cableColor(_color)
// ensure d1 & d2 reflect the icon_state for entering and exiting cable
var/dash = findtext(icon_state, "-")
@@ -205,11 +196,6 @@ By design, d1 is the smallest direction and d2 is the highest
else
to_chat(user, "<span class='warning'>You can't place cables there.</span>")
return
else if(istype(W, /obj/item/weapon/rcl))
var/obj/item/weapon/rcl/R = W
if(R.loaded)
R.loaded.cable_join(src, user)
R.is_empty()
else if(W.is_multitool(user))
report_load(user)
shock(user, 5, 0.2)
@@ -244,9 +230,9 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/structure/cable/proc/cut(mob/user, var/turf/T)
if(src.d1) // 0-X cables are 1 unit, X-X cables are 2 units long
new /obj/item/stack/cable_coil(T, 2, light_color)
new /obj/item/stack/cable_coil(T, 2, color)
else
new /obj/item/stack/cable_coil(T, 1, light_color)
new /obj/item/stack/cable_coil(T, 1, color)
user.visible_message("<span class='warning'>[user] cuts the cable.</span>", "<span class='info'>You cut the cable.</span>")
@@ -293,25 +279,15 @@ By design, d1 is the smallest direction and d2 is the highest
qdel(src)
if(2.0)
if(prob(50))
new /obj/item/stack/cable_coil(src.loc, src.d1 ? 2 : 1, light_color)
new /obj/item/stack/cable_coil(src.loc, src.d1 ? 2 : 1, color)
qdel(src)
if(3.0)
if(prob(25))
new /obj/item/stack/cable_coil(src.loc, src.d1 ? 2 : 1, light_color)
new /obj/item/stack/cable_coil(src.loc, src.d1 ? 2 : 1, color)
qdel(src)
return
/obj/structure/cable/proc/cableColor(var/colorC = "red")
light_color = colorC
switch(colorC)
if("pink")
color = CABLE_PINK
if("orange")
color = CABLE_ORANGE
else
color = colorC
////////////////////////////////////////////
// Power related
///////////////////////////////////////////

View File

@@ -23,8 +23,3 @@
return
else
..()
/obj/structure/cable/heavyduty/cableColor(var/colorC)
_color = "red"
light_color = LIGHT_COLOR_RED
return

View File

@@ -2,7 +2,7 @@
* Returns:
* #RRGGBB(AA) on success, null on failure
*/
/proc/mix_color_from_reagents(const/list/reagent_list)
/proc/mix_color_from_reagents(const/list/reagent_list, var/pigments_only = FALSE)
if(!istype(reagent_list))
return
@@ -12,6 +12,8 @@
var/vol_temp
// see libs/IconProcs/IconProcs.dm
for(var/datum/reagent/reagent in reagent_list)
if (pigments_only && !(reagent.flags & CHEMFLAG_PIGMENT))
continue
if(reagent.id == BLOOD && reagent.data["blood_colour"])
reagent_color = reagent.data["blood_colour"]
else

View File

@@ -471,6 +471,7 @@
description = "Tomatoes made into juice. Probably. What a waste of big, juicy tomatoes, huh?"
id = BLOOD
reagent_state = REAGENT_STATE_LIQUID
flags = CHEMFLAG_PIGMENT
color = DEFAULT_BLOOD //rgb: 161, 8, 8
density = 1.05
specheatcap = 3.49
@@ -4719,6 +4720,7 @@ var/procizine_tolerance = 0
reagent_state = REAGENT_STATE_LIQUID
nutriment_factor = 5 * REAGENTS_METABOLISM
color = "#731008" //rgb: 115, 16, 8
flags = CHEMFLAG_PIGMENT
/datum/reagent/mustard
name = "Mustard"
@@ -4727,6 +4729,7 @@ var/procizine_tolerance = 0
reagent_state = REAGENT_STATE_LIQUID
nutriment_factor = 3 * REAGENTS_METABOLISM
color = "#cccc33" //rgb: 204, 204, 51
flags = CHEMFLAG_PIGMENT
/datum/reagent/relish
name = "Relish"
@@ -5075,7 +5078,7 @@ var/procizine_tolerance = 0
id = BLACKCOLOR
description = "A black coloring used to dye food and drinks."
reagent_state = REAGENT_STATE_LIQUID
flags = CHEMFLAG_OBSCURING
flags = CHEMFLAG_OBSCURING|CHEMFLAG_PIGMENT
color = "#000000" //rgb: 0, 0, 0
/datum/reagent/frostoil
@@ -9378,6 +9381,7 @@ var/global/list/tonio_doesnt_remove=list("tonio", "blood")
id = ZEAXANTHIN
description = "Zeaxanthin is a natural pigment which purportedly supports eye health."
color = "#CC4303" //rgb: 204, 67, 3
flags = CHEMFLAG_PIGMENT
/datum/reagent/stoxin/valerenic_acid
name = "Valerenic Acid"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 KiB

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 KiB

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB