Merge pull request #3606 from Citadel-Station-13/upstream-merge-31972

[MIRROR] Greyscale cables
This commit is contained in:
LetterJay
2017-10-26 16:53:08 -04:00
committed by GitHub
14 changed files with 79 additions and 100 deletions
@@ -491,7 +491,7 @@ Congratulations! You are now trained for invasive xenobiology research!"}
/obj/item/restraints/handcuffs/energy /obj/item/restraints/handcuffs/energy
name = "hard-light energy field" name = "hard-light energy field"
desc = "A hard-light field restraining the hands." desc = "A hard-light field restraining the hands."
icon_state = "cuff_white" // Needs sprite icon_state = "cuff" // Needs sprite
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi' lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi' righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
breakouttime = 450 breakouttime = 450
@@ -408,8 +408,7 @@
return reset() return reset()
if(!use_cable(1)) if(!use_cable(1))
return reset() return reset()
var/obj/structure/cable/NC = new(new_turf) var/obj/structure/cable/NC = new(new_turf, "red")
NC.cableColor("red")
NC.d1 = 0 NC.d1 = 0
NC.d2 = fdirn NC.d2 = fdirn
NC.update_icon() NC.update_icon()
+27 -21
View File
@@ -88,8 +88,9 @@
/obj/item/restraints/handcuffs/cable /obj/item/restraints/handcuffs/cable
name = "cable restraints" name = "cable restraints"
desc = "Looks like some cables tied together. Could be used to tie something up." desc = "Looks like some cables tied together. Could be used to tie something up."
icon_state = "cuff_red" icon_state = "cuff"
item_state = "coil_red" item_state = "coil"
item_color = "red"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
materials = list(MAT_METAL=150, MAT_GLASS=75) materials = list(MAT_METAL=150, MAT_GLASS=75)
@@ -98,6 +99,18 @@
cuffsound = 'sound/weapons/cablecuff.ogg' cuffsound = 'sound/weapons/cablecuff.ogg'
var/datum/robot_energy_storage/wirestorage = null var/datum/robot_energy_storage/wirestorage = null
/obj/item/restraints/handcuffs/cable/Initialize(mapload, param_color)
. = ..()
var/list/cable_colors = GLOB.cable_colors
item_color = param_color || item_color || pick(cable_colors)
if(cable_colors[item_color])
item_color = cable_colors[item_color]
update_icon()
/obj/item/restraints/handcuffs/cable/update_icon()
add_atom_colour(item_color, FIXED_COLOUR_PRIORITY)
/obj/item/restraints/handcuffs/cable/attack(mob/living/carbon/C, mob/living/carbon/human/user) /obj/item/restraints/handcuffs/cable/attack(mob/living/carbon/C, mob/living/carbon/human/user)
if(!istype(C)) if(!istype(C))
return return
@@ -116,36 +129,28 @@
return ..() return ..()
/obj/item/restraints/handcuffs/cable/red /obj/item/restraints/handcuffs/cable/red
icon_state = "cuff_red" item_color = "red"
item_state = "coil_red"
/obj/item/restraints/handcuffs/cable/yellow /obj/item/restraints/handcuffs/cable/yellow
icon_state = "cuff_yellow" item_color = "yellow"
item_state = "coil_yellow"
/obj/item/restraints/handcuffs/cable/blue /obj/item/restraints/handcuffs/cable/blue
icon_state = "cuff_blue" item_color = "blue"
item_state = "coil_blue"
/obj/item/restraints/handcuffs/cable/green /obj/item/restraints/handcuffs/cable/green
icon_state = "cuff_green" item_color = "green"
item_state = "coil_green"
/obj/item/restraints/handcuffs/cable/pink /obj/item/restraints/handcuffs/cable/pink
icon_state = "cuff_pink" item_color = "pink"
item_state = "coil_pink"
/obj/item/restraints/handcuffs/cable/orange /obj/item/restraints/handcuffs/cable/orange
icon_state = "cuff_orange" item_color = "orange"
item_state = "coil_orange"
/obj/item/restraints/handcuffs/cable/cyan /obj/item/restraints/handcuffs/cable/cyan
icon_state = "cuff_cyan" item_color = "cyan"
item_state = "coil_cyan"
/obj/item/restraints/handcuffs/cable/white /obj/item/restraints/handcuffs/cable/white
icon_state = "cuff_white" item_color = "white"
item_state = "coil_white"
/obj/item/restraints/handcuffs/alien /obj/item/restraints/handcuffs/alien
icon_state = "handcuffAlien" icon_state = "handcuffAlien"
@@ -209,17 +214,18 @@
/obj/item/restraints/handcuffs/cable/zipties /obj/item/restraints/handcuffs/cable/zipties
name = "zipties" name = "zipties"
desc = "Plastic, disposable zipties that can be used to restrain temporarily but are destroyed after use." desc = "Plastic, disposable zipties that can be used to restrain temporarily but are destroyed after use."
icon_state = "cuff_white" icon_state = "cuff"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi' lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi' righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
materials = list() materials = list()
breakouttime = 450 //Deciseconds = 45s breakouttime = 450 //Deciseconds = 45s
trashtype = /obj/item/restraints/handcuffs/cable/zipties/used trashtype = /obj/item/restraints/handcuffs/cable/zipties/used
item_color = "white"
/obj/item/restraints/handcuffs/cable/zipties/used /obj/item/restraints/handcuffs/cable/zipties/used
desc = "A pair of broken zipties." desc = "A pair of broken zipties."
icon_state = "cuff_white_used" icon_state = "cuff_used"
item_state = "cuff_white" item_state = "cuff"
/obj/item/restraints/handcuffs/cable/zipties/used/attack() /obj/item/restraints/handcuffs/cable/zipties/used/attack()
return return
+6 -1
View File
@@ -169,6 +169,11 @@
W.ini_dir = W.dir W.ini_dir = W.dir
//END: oh fuck i'm so sorry //END: oh fuck i'm so sorry
else if(istype(O, /obj/item/restraints/handcuffs/cable))
var/obj/item/cuffs = O
cuffs.item_color = item_color
cuffs.update_icon()
if (QDELETED(O)) if (QDELETED(O))
return //It's a stack and has already been merged return //It's a stack and has already been merged
@@ -261,7 +266,7 @@
if (user.get_inactive_held_item() == src) if (user.get_inactive_held_item() == src)
if(zero_amount()) if(zero_amount())
return return
change_stack(user,1) return change_stack(user,1)
else else
..() ..()
+44 -75
View File
@@ -1,3 +1,14 @@
GLOBAL_LIST_INIT(cable_colors, list(
"yellow" = "#ffff00",
"green" = "#00aa00",
"blue" = "#1919c8",
"pink" = "#ff3cc8",
"orange" = "#ff8000",
"cyan" = "#00ffff",
"white" = "#ffffff",
"red" = "#ff0000"
))
/////////////////////////////// ///////////////////////////////
//CABLE STRUCTURE //CABLE STRUCTURE
/////////////////////////////// ///////////////////////////////
@@ -23,61 +34,52 @@ By design, d1 is the smallest direction and d2 is the highest
*/ */
/obj/structure/cable /obj/structure/cable
level = 1 //is underfloor
anchored =1
on_blueprints = TRUE
var/datum/powernet/powernet
name = "power cable" name = "power cable"
desc = "A flexible, superconducting insulated cable for heavy-duty power transfer." desc = "A flexible, superconducting insulated cable for heavy-duty power transfer."
icon = 'icons/obj/power_cond/power_cond_red.dmi' icon = 'icons/obj/power_cond/cables.dmi'
icon_state = "0-1" icon_state = "0-1"
level = 1 //is underfloor
layer = WIRE_LAYER //Above hidden pipes, GAS_PIPE_HIDDEN_LAYER
anchored = TRUE
on_blueprints = TRUE
var/d1 = 0 // cable direction 1 (see above) var/d1 = 0 // cable direction 1 (see above)
var/d2 = 1 // cable direction 2 (see above) var/d2 = 1 // cable direction 2 (see above)
layer = WIRE_LAYER //Above hidden pipes, GAS_PIPE_HIDDEN_LAYER var/datum/powernet/powernet
var/cable_color = "red"
var/obj/item/stack/cable_coil/stored var/obj/item/stack/cable_coil/stored
var/cable_color = "red"
/obj/structure/cable/yellow /obj/structure/cable/yellow
cable_color = "yellow" cable_color = "yellow"
icon = 'icons/obj/power_cond/power_cond_yellow.dmi'
/obj/structure/cable/green /obj/structure/cable/green
cable_color = "green" cable_color = "green"
icon = 'icons/obj/power_cond/power_cond_green.dmi'
/obj/structure/cable/blue /obj/structure/cable/blue
cable_color = "blue" cable_color = "blue"
icon = 'icons/obj/power_cond/power_cond_blue.dmi'
/obj/structure/cable/pink /obj/structure/cable/pink
cable_color = "pink" cable_color = "pink"
icon = 'icons/obj/power_cond/power_cond_pink.dmi'
/obj/structure/cable/orange /obj/structure/cable/orange
cable_color = "orange" cable_color = "orange"
icon = 'icons/obj/power_cond/power_cond_orange.dmi'
/obj/structure/cable/cyan /obj/structure/cable/cyan
cable_color = "cyan" cable_color = "cyan"
icon = 'icons/obj/power_cond/power_cond_cyan.dmi'
/obj/structure/cable/white /obj/structure/cable/white
cable_color = "white" cable_color = "white"
icon = 'icons/obj/power_cond/power_cond_white.dmi'
// the power cable object // the power cable object
/obj/structure/cable/Initialize() /obj/structure/cable/Initialize(mapload, param_color)
. = ..() . = ..()
// ensure d1 & d2 reflect the icon_state for entering and exiting cable // ensure d1 & d2 reflect the icon_state for entering and exiting cable
var/dash = findtext(icon_state, "-") var/dash = findtext(icon_state, "-")
d1 = text2num( copytext( icon_state, 1, dash ) ) d1 = text2num( copytext( icon_state, 1, dash ) )
d2 = text2num( copytext( icon_state, dash+1 ) ) d2 = text2num( copytext( icon_state, dash+1 ) )
var/turf/T = get_turf(src) // hide if turf is not intact var/turf/T = get_turf(src) // hide if turf is not intact
if(level==1) if(level==1)
hide(T.intact) hide(T.intact)
GLOB.cable_list += src //add it to the global cable list GLOB.cable_list += src //add it to the global cable list
@@ -87,6 +89,12 @@ By design, d1 is the smallest direction and d2 is the highest
else else
stored = new/obj/item/stack/cable_coil(null,1,cable_color) stored = new/obj/item/stack/cable_coil(null,1,cable_color)
var/list/cable_colors = GLOB.cable_colors
cable_color = param_color || cable_color || pick(cable_colors)
if(cable_colors[cable_color])
cable_color = cable_colors[cable_color]
update_icon()
/obj/structure/cable/Destroy() // called when a cable is deleted /obj/structure/cable/Destroy() // called when a cable is deleted
if(powernet) if(powernet)
cut_cable_from_powernet() // update the powernets cut_cable_from_powernet() // update the powernets
@@ -115,6 +123,7 @@ By design, d1 is the smallest direction and d2 is the highest
icon_state = "[d1]-[d2]-f" icon_state = "[d1]-[d2]-f"
else else
icon_state = "[d1]-[d2]" icon_state = "[d1]-[d2]"
add_atom_colour(cable_color, FIXED_COLOUR_PRIORITY)
/obj/structure/cable/proc/handlecable(obj/item/W, mob/user, params) /obj/structure/cable/proc/handlecable(obj/item/W, mob/user, params)
var/turf/T = get_turf(src) var/turf/T = get_turf(src)
@@ -175,26 +184,6 @@ By design, d1 is the smallest direction and d2 is the highest
if(current_size >= STAGE_FIVE) if(current_size >= STAGE_FIVE)
deconstruct() deconstruct()
/obj/structure/cable/proc/cableColor(colorC = "red")
cable_color = colorC
switch(colorC)
if("red")
icon = 'icons/obj/power_cond/power_cond_red.dmi'
if("yellow")
icon = 'icons/obj/power_cond/power_cond_yellow.dmi'
if("green")
icon = 'icons/obj/power_cond/power_cond_green.dmi'
if("blue")
icon = 'icons/obj/power_cond/power_cond_blue.dmi'
if("pink")
icon = 'icons/obj/power_cond/power_cond_pink.dmi'
if("orange")
icon = 'icons/obj/power_cond/power_cond_orange.dmi'
if("cyan")
icon = 'icons/obj/power_cond/power_cond_cyan.dmi'
if("white")
icon = 'icons/obj/power_cond/power_cond_white.dmi'
/obj/structure/cable/proc/update_stored(length = 1, colorC = "red") /obj/structure/cable/proc/update_stored(length = 1, colorC = "red")
stored.amount = length stored.amount = length
stored.item_color = colorC stored.item_color = colorC
@@ -456,8 +445,8 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
name = "cable coil" name = "cable coil"
gender = NEUTER //That's a cable coil sounds better than that's some cable coils gender = NEUTER //That's a cable coil sounds better than that's some cable coils
icon = 'icons/obj/power.dmi' icon = 'icons/obj/power.dmi'
icon_state = "coil_red" icon_state = "coil"
item_state = "coil_red" item_state = "coil"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
max_amount = MAXCOIL max_amount = MAXCOIL
@@ -497,8 +486,12 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
. = ..() . = ..()
if(new_amount) // MAXCOIL by default if(new_amount) // MAXCOIL by default
amount = new_amount amount = new_amount
if(param_color)
item_color = param_color var/list/cable_colors = GLOB.cable_colors
item_color = param_color || item_color || pick(cable_colors)
if(cable_colors[item_color])
item_color = cable_colors[item_color]
pixel_x = rand(-2,2) pixel_x = rand(-2,2)
pixel_y = rand(-2,2) pixel_y = rand(-2,2)
update_icon() update_icon()
@@ -528,18 +521,9 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
/obj/item/stack/cable_coil/update_icon() /obj/item/stack/cable_coil/update_icon()
if(!item_color) icon_state = "[initial(item_state)][amount < 3 ? amount : ""]"
item_color = pick("red", "yellow", "blue", "green") name = "cable [amount < 3 ? "piece" : "coil"]"
item_state = "coil_[item_color]" add_atom_colour(item_color, FIXED_COLOUR_PRIORITY)
if(amount == 1)
icon_state = "coil_[item_color]1"
name = "cable piece"
else if(amount == 2)
icon_state = "coil_[item_color]2"
name = "cable piece"
else
icon_state = "coil_[item_color]"
name = "cable coil"
/obj/item/stack/cable_coil/attack_hand(mob/user) /obj/item/stack/cable_coil/attack_hand(mob/user)
var/obj/item/stack/cable_coil/new_cable = ..() var/obj/item/stack/cable_coil/new_cable = ..()
@@ -562,8 +546,8 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
////////////////////////////////////////////// //////////////////////////////////////////////
/obj/item/stack/cable_coil/proc/get_new_cable(location) /obj/item/stack/cable_coil/proc/get_new_cable(location)
var/path = "/obj/structure/cable" + (item_color == "red" ? "" : "/" + item_color) var/path = /obj/structure/cable
return new path (location) return new path(location, item_color)
// called when cable_coil is clicked on a turf // called when cable_coil is clicked on a turf
/obj/item/stack/cable_coil/proc/place_turf(turf/T, mob/user, dirnew) /obj/item/stack/cable_coil/proc/place_turf(turf/T, mob/user, dirnew)
@@ -714,7 +698,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
return return
C.cableColor(item_color) C.update_icon()
C.d1 = nd1 C.d1 = nd1
C.d2 = nd2 C.d2 = nd2
@@ -750,11 +734,8 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
// Misc. // Misc.
///////////////////////////// /////////////////////////////
/obj/item/stack/cable_coil/cut
item_state = "coil_red2"
/obj/item/stack/cable_coil/cut/Initialize(mapload) /obj/item/stack/cable_coil/cut/Initialize(mapload)
. =..() . = ..()
amount = rand(1,2) amount = rand(1,2)
pixel_x = rand(-2,2) pixel_x = rand(-2,2)
pixel_y = rand(-2,2) pixel_y = rand(-2,2)
@@ -762,42 +743,30 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
/obj/item/stack/cable_coil/red /obj/item/stack/cable_coil/red
item_color = "red" item_color = "red"
icon_state = "coil_red"
/obj/item/stack/cable_coil/yellow /obj/item/stack/cable_coil/yellow
item_color = "yellow" item_color = "yellow"
icon_state = "coil_yellow"
/obj/item/stack/cable_coil/blue /obj/item/stack/cable_coil/blue
item_color = "blue" item_color = "blue"
icon_state = "coil_blue"
item_state = "coil_blue"
/obj/item/stack/cable_coil/green /obj/item/stack/cable_coil/green
item_color = "green" item_color = "green"
icon_state = "coil_green"
/obj/item/stack/cable_coil/pink /obj/item/stack/cable_coil/pink
item_color = "pink" item_color = "pink"
icon_state = "coil_pink"
/obj/item/stack/cable_coil/orange /obj/item/stack/cable_coil/orange
item_color = "orange" item_color = "orange"
icon_state = "coil_orange"
/obj/item/stack/cable_coil/cyan /obj/item/stack/cable_coil/cyan
item_color = "cyan" item_color = "cyan"
icon_state = "coil_cyan"
/obj/item/stack/cable_coil/white /obj/item/stack/cable_coil/white
item_color = "white" item_color = "white"
icon_state = "coil_white"
/obj/item/stack/cable_coil/random/Initialize(mapload)
. = ..()
item_color = pick("red","orange","yellow","green","cyan","blue","pink","white")
icon_state = "coil_[item_color]"
/obj/item/stack/cable_coil/random
item_color = null
/obj/item/stack/cable_coil/random/five /obj/item/stack/cable_coil/random/five
amount = 5 amount = 5
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB