diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 1b90304cdbc..5e960e553ce 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -61,6 +61,8 @@ //var/item_state = null // Used to specify the item state for the on-mob overlays. var/item_state_slots //overrides the default item_state for particular slots. + var/build_from_parts = FALSE // when it uses coloration and a part of it wants to remain uncolored. e.g., handle of the screwdriver is colored while the head is not. + var/worn_overlay = null // used similarly as above, except for inhands. //ITEM_ICONS ARE DEPRECATED. USE CONTAINED SPRITES IN FUTURE // Used to specify the icon file to be used when the item is worn. If not set the default icon for that slot will be used. @@ -85,6 +87,7 @@ var/icon_override //Used to override hardcoded clothing dmis in human clothing pr + var/charge_failure_message = " cannot be recharged." var/cleaving = FALSE diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index caccecbc42d..cc8e3337bd8 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -58,10 +58,11 @@ /obj/item/stack/examine(mob/user) if(..(user, 1)) - if(!uses_charge) - to_chat(user, "There [src.amount == 1 ? "is" : "are"] [src.amount] [src.singular_name]\s in the stack.") - else - to_chat(user, "There is enough charge for [get_amount()].") + if(!iscoil()) + if(!uses_charge) + to_chat(user, "There [src.amount == 1 ? "is" : "are"] [src.amount] [src.singular_name]\s in the stack.") + else + to_chat(user, "You have enough charge to produce [get_amount()].") /obj/item/stack/attack_self(mob/user as mob) list_recipes(user) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 8d6c08241d8..246a88d0afb 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -121,6 +121,8 @@ name = "cable restraints" desc = "Looks like some cables tied together. Could be used to tie something up." icon_state = "cablecuff" + item_state = "coil" + color = COLOR_RED item_icons = list( slot_l_hand_str = 'icons/mob/items/stacks/lefthand_materials.dmi', slot_r_hand_str = 'icons/mob/items/stacks/righthand_materials.dmi', @@ -129,47 +131,43 @@ cuff_sound = 'sound/weapons/cablecuff.ogg' cuff_type = "cable restraints" elastic = TRUE - var/our_color - var/build_from_parts = TRUE + build_from_parts = TRUE + worn_overlay = "end" /obj/item/handcuffs/cable/Initialize(mapload, new_color) . = ..() if(new_color) - our_color = new_color - update_icon() + color = new_color -/obj/item/handcuffs/cable/update_icon() if(build_from_parts) //random colors! - if(!our_color) - our_color = pick(possible_cable_coil_colours) - var/color_hex = possible_cable_coil_colours[our_color] - color = color_hex - item_state = "coil-[our_color]" // hardcoded. sucks, but inhands are hard and I can't be bothered. + if(!color) + color = pick(COLOR_RED, COLOR_BLUE, COLOR_LIME, COLOR_ORANGE, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN) add_overlay(overlay_image(icon, "[initial(icon_state)]_end", flags=RESET_COLOR)) /obj/item/handcuffs/cable/yellow - our_color = "Yellow" - -/obj/item/handcuffs/cable/green - our_color = "Green" - -/obj/item/handcuffs/cable/pink - our_color = "Pink" + color = COLOR_YELLOW /obj/item/handcuffs/cable/blue - our_color = "Blue" + color = COLOR_BLUE + +/obj/item/handcuffs/cable/green + color = COLOR_GREEN + +/obj/item/handcuffs/cable/pink + color = COLOR_PINK /obj/item/handcuffs/cable/orange - our_color = "Orange" + color = COLOR_ORANGE /obj/item/handcuffs/cable/cyan - our_color = "Cyan" - -/obj/item/handcuffs/cable/red - our_color = "Red" + color = COLOR_CYAN /obj/item/handcuffs/cable/white - our_color = "White" + color = COLOR_WHITE + +/obj/item/handcuffs/cable/random/Initialize() + color = pick(COLOR_RED, COLOR_BLUE, COLOR_LIME, COLOR_ORANGE, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN) + . = ..() /obj/item/handcuffs/cable/attackby(var/obj/item/I, mob/user as mob) ..() @@ -184,7 +182,7 @@ else if(I.iswirecutter()) user.visible_message("[user] cuts the [src].", SPAN_NOTICE("You cut the [src].")) playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) - new/obj/item/stack/cable_coil(get_turf(src), 15, our_color) + new/obj/item/stack/cable_coil(get_turf(src), 15, color) qdel(src) update_icon(user) diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index b86bd6d112f..a03974eb45a 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -66,25 +66,14 @@ drop_sound = 'sound/items/drop/screwdriver.ogg' pickup_sound = 'sound/items/pickup/screwdriver.ogg' lock_picking_level = 5 - var/build_from_parts = TRUE //if the tool uses random coloring - var/tool_colors = list( //if you're wondering why "blue" = COLOR_BLUE, it's so that inhands work. - "blue" = COLOR_BLUE, - "red" = COLOR_RED, - "purple" = COLOR_PURPLE, - "brown" = COLOR_BROWN, - "green" = COLOR_GREEN, - "cyan" = COLOR_CYAN, - "yellow" = COLOR_YELLOW - ) + build_from_parts = TRUE + worn_overlay = "head" /obj/item/screwdriver/Initialize() . = ..() if(build_from_parts) //random colors! - var/our_color = pick(tool_colors) - var/color_hex = tool_colors[our_color] - color = color_hex - item_state = "[initial(icon_state)]-[our_color]" // hardcoded. sucks, but inhands are hard and I can't be bothered. - add_overlay(overlay_image(icon, "[initial(icon_state)]_head", flags=RESET_COLOR)) + color = pick(COLOR_BLUE, COLOR_RED, COLOR_PURPLE, COLOR_BROWN, COLOR_GREEN, COLOR_CYAN, COLOR_YELLOW) + add_overlay(overlay_image(icon, "[initial(icon_state)]_[worn_overlay]", flags=RESET_COLOR)) /obj/item/screwdriver/update_icon() var/matrix/tf = matrix() @@ -144,25 +133,14 @@ drop_sound = 'sound/items/drop/wirecutter.ogg' pickup_sound = 'sound/items/pickup/wirecutter.ogg' var/bomb_defusal_chance = 30 // 30% chance to safely defuse a bomb - var/build_from_parts = TRUE - var/tool_colors = list( - "blue" = COLOR_BLUE, - "red" = COLOR_RED, - "purple" = COLOR_PURPLE, - "brown" = COLOR_BROWN, - "green" = COLOR_GREEN, - "cyan" = COLOR_CYAN, - "yellow" = COLOR_YELLOW - ) + build_from_parts = TRUE + worn_overlay = "head" /obj/item/wirecutters/Initialize() . = ..() if(build_from_parts) - var/our_color = pick(tool_colors) - var/color_hex = tool_colors[our_color] - color = color_hex - item_state = "[initial(icon_state)]-[our_color]" // hardcoded. sucks, but inhands are hard and I can't be bothered. - add_overlay(overlay_image(icon, "[initial(icon_state)]_head", flags=RESET_COLOR)) + color = pick(COLOR_BLUE, COLOR_RED, COLOR_PURPLE, COLOR_BROWN, COLOR_GREEN, COLOR_CYAN, COLOR_YELLOW) + add_overlay(overlay_image(icon, "[initial(icon_state)]_[worn_overlay]", flags=RESET_COLOR)) /obj/item/wirecutters/update_icon() var/matrix/tf = matrix() @@ -734,7 +712,6 @@ w_class = ITEMSIZE_SMALL toolspeed = 3 usesound = 'sound/items/drill_use.ogg' - var/drillcolor = null var/current_tool = 1 var/list/tools = list( "screwdriverbit", @@ -744,16 +721,7 @@ /obj/item/powerdrill/Initialize() . = ..() - - switch(pick("red", "blue", "yellow", "green")) - if ("red") - drillcolor = "red" - if ("blue") - drillcolor = "blue" - if ("green") - drillcolor = "green" - if ("yellow") - drillcolor = "yellow" + var/drillcolor = pick("red", "blue", "yellow", "green") icon_state = "powerdrill[drillcolor]" item_state = "powerdrill[drillcolor]" diff --git a/code/modules/hydroponics/trays/tray_tools.dm b/code/modules/hydroponics/trays/tray_tools.dm index e7290495e98..cbd280571a7 100644 --- a/code/modules/hydroponics/trays/tray_tools.dm +++ b/code/modules/hydroponics/trays/tray_tools.dm @@ -4,6 +4,7 @@ name = "plant clippers" desc = "A tool used to take samples from plants." icon_state = "plantclippers" + item_state = "plantclippers" item_icons = list( slot_l_hand_str = 'icons/mob/items/lefthand_hydro.dmi', slot_r_hand_str = 'icons/mob/items/righthand_hydro.dmi', @@ -19,18 +20,6 @@ tf.Translate(-1,0) //Could do this with pixel_x but let's just update the appearance once. transform = tf -/obj/item/wirecutters/pickup(mob/user) - ..() - update_icon() - -/obj/item/wirecutters/dropped(mob/user) - ..() - update_icon() - -/obj/item/wirecutters/attack_hand() - ..() - update_icon() - /obj/item/device/analyzer/plant_analyzer name = "plant analyzer" icon = 'icons/obj/device.dmi' diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index d6b4fd9db91..703ea42c53d 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -226,9 +226,13 @@ There are several things that need to be remembered: //Overlays for the worn overlay so you can overlay while you overlay //eg: ammo counters, primed grenade flashing, etc. -//"item_icons" is used automatically for inhands etc. to make sure it gets the correct inhand file -/obj/item/proc/worn_overlays(item_icons) +//"icon_file" is used automatically for inhands etc. to make sure it gets the correct inhand file +/obj/item/proc/worn_overlays(icon_file) . = list() + if(build_from_parts) + var/mutable_appearance/M = mutable_appearance(icon_file, "[item_state]_[worn_overlay]") + M.appearance_flags = RESET_COLOR + . += M //BASE MOB SPRITE /mob/living/carbon/human/proc/update_body(var/update_icons=1) @@ -1123,7 +1127,6 @@ There are several things that need to be remembered: if(update_icons) update_icons() - /mob/living/carbon/human/update_inv_r_hand(var/update_icons=1) if (QDELING(src)) return @@ -1133,7 +1136,9 @@ There are several things that need to be remembered: r_hand.screen_loc = ui_rhand //TODO //determine icon state to use - var/t_state + var/t_state = r_hand.item_state || r_hand.icon_state + + var/image/result_layer if(r_hand.contained_sprite) r_hand.auto_adapt_species(src) t_state = "[UNDERSCORE_OR_NULL(r_hand.icon_species_tag)][r_hand.item_state][WORN_RHAND]" @@ -1142,8 +1147,6 @@ There are several things that need to be remembered: else if(r_hand.item_state_slots && r_hand.item_state_slots[slot_r_hand_str]) t_state = r_hand.item_state_slots[slot_r_hand_str] - else - t_state = r_hand.item_state || r_hand.icon_state //determine icon to use var/icon/t_icon @@ -1155,12 +1158,20 @@ There are several things that need to be remembered: else t_icon = INV_R_HAND_DEF_ICON - overlays_raw[R_HAND_LAYER] = image(t_icon, t_state) + result_layer = image(t_icon, t_state) + + if(r_hand.color) + result_layer.color = r_hand.color + + var/image/worn_overlays = r_hand.worn_overlays(t_icon) + if(worn_overlays) + result_layer.overlays.Add(worn_overlays) + + overlays_raw[R_HAND_LAYER] = result_layer if(update_icons) update_icons() - /mob/living/carbon/human/update_inv_l_hand(var/update_icons=1) if (QDELING(src)) return @@ -1170,7 +1181,9 @@ There are several things that need to be remembered: l_hand.screen_loc = ui_lhand //TODO //determine icon state to use - var/t_state + var/t_state = l_hand.item_state || l_hand.icon_state + + var/image/result_layer if(l_hand.contained_sprite) l_hand.auto_adapt_species(src) t_state = "[UNDERSCORE_OR_NULL(l_hand.icon_species_tag)][l_hand.item_state][WORN_LHAND]" @@ -1179,8 +1192,6 @@ There are several things that need to be remembered: else if(l_hand.item_state_slots && l_hand.item_state_slots[slot_l_hand_str]) t_state = l_hand.item_state_slots[slot_l_hand_str] - else - t_state = l_hand.item_state || l_hand.icon_state //determine icon to use var/icon/t_icon @@ -1192,7 +1203,16 @@ There are several things that need to be remembered: else t_icon = INV_L_HAND_DEF_ICON - overlays_raw[L_HAND_LAYER] = image(t_icon, t_state) + result_layer = image(t_icon, t_state) + + if(l_hand.color) + result_layer.color = l_hand.color + + var/image/worn_overlays = l_hand.worn_overlays(t_icon) + if(worn_overlays) + result_layer.overlays.Add(worn_overlays) + + overlays_raw[L_HAND_LAYER] = result_layer if(update_icons) update_icons() diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index a8dcdeda688..828f47dce9f 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -21,28 +21,17 @@ If d1 = 0 and d2 = dir, it's a O-X cable, getting from the center of the tile to If d1 = dir1 and d2 = dir2, it's a full X-X cable, getting from dir1 to dir2 By design, d1 is the smallest direction and d2 is the highest */ -var/static/list/possible_cable_coil_colours = list( - "Yellow" = COLOR_YELLOW, - "Green" = COLOR_LIME, - "Pink" = COLOR_PINK, - "Blue" = COLOR_BLUE, - "Orange" = COLOR_ORANGE, - "Cyan" = COLOR_CYAN, - "Red" = COLOR_RED, - "White" = COLOR_WHITE - ) - /obj/structure/cable level = 1 anchored =1 var/datum/powernet/powernet name = "power cable" - desc = "A flexible superconducting cable for heavy-duty power transfer" + desc = "A flexible superconducting cable for heavy-duty power transfer." icon = 'icons/obj/power_cond_white.dmi' icon_state = "0-1" var/d1 = 0 var/d2 = 1 - layer = 2.44 //Just below unary stuff, which is at 2.45 and above pipes, which are at 2.4 + layer = CABLE_LAYER //Just below unary stuff, which is at 2.45 and above pipes, which are at 2.4 color = COLOR_RED var/obj/machinery/power/breakerbox/breaker_box @@ -159,6 +148,7 @@ var/static/list/possible_cable_coil_colours = list( for(var/mob/O in viewers(src, null)) O.show_message(SPAN_WARNING("[user] cuts the cable."), 1) + playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) if(d1 == 11 || d2 == 11) var/turf/turf = GetBelow(src) @@ -176,7 +166,7 @@ var/static/list/possible_cable_coil_colours = list( else if(W.iscoil()) var/obj/item/stack/cable_coil/coil = W if (coil.get_amount() < 1) - to_chat(user, "Not enough cable") + to_chat(user, "You don't have enough cable.") return coil.cable_join(src, user) @@ -473,10 +463,13 @@ obj/structure/cable/proc/cableColor(var/colorC) name = "power cable" icon = 'icons/obj/power.dmi' icon_state = "coil" + item_state = "coil" + desc = "A coil of wire used in delicate electronics and cable laying." + singular_name = "length" + gender = NEUTER amount = MAXCOIL max_amount = MAXCOIL - var/our_color = "Red" - desc = "A coil of wire used in delicate electronics and cable laying." + color = COLOR_RED throwforce = 10 w_class = ITEMSIZE_SMALL throw_speed = 2 @@ -484,18 +477,34 @@ obj/structure/cable/proc/cableColor(var/colorC) matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 20) flags = CONDUCT slot_flags = SLOT_BELT - item_state = "coil" attack_verb = list("whipped", "lashed", "disciplined", "flogged") stacktype = /obj/item/stack/cable_coil drop_sound = 'sound/items/drop/accessory.ogg' pickup_sound = 'sound/items/pickup/accessory.ogg' + var/static/list/possible_cable_coil_colours = list( + "Yellow" = COLOR_YELLOW, + "Green" = COLOR_LIME, + "Pink" = COLOR_PINK, + "Blue" = COLOR_BLUE, + "Orange" = COLOR_ORANGE, + "Cyan" = COLOR_CYAN, + "Red" = COLOR_RED, + "White" = COLOR_WHITE + ) + build_from_parts = TRUE + worn_overlay = "end" -/obj/item/stack/cable_coil/Initialize(mapload, amt, new_color) +/obj/item/stack/cable_coil/iscoil() + return TRUE + +/obj/item/stack/cable_coil/Initialize(mapload, amt, param_color = null) . = ..(mapload, amt) + + if(param_color) // It should be red by default, so only recolor it if parameter was specified. + color = param_color + pixel_x = rand(-2,2) pixel_y = rand(-2,2) - if(new_color) - our_color = new_color update_icon() update_wclass() @@ -595,23 +604,24 @@ obj/structure/cable/proc/cableColor(var/colorC) to_chat(user, SPAN_WARNING("You don't have enough cable for this!")) /obj/item/stack/cable_coil/update_icon() + if(!color) + color = pick(possible_cable_coil_colours) name = "[initial(name)]" if(amount == 1) icon_state = "[initial(icon_state)]1" + item_state = "[initial(icon_state)]1" name += " piece" else if(amount == 2) icon_state = "[initial(icon_state)]2" + item_state = "[initial(icon_state)]2" name += " piece" else icon_state = "[initial(icon_state)]" + item_state = "[initial(icon_state)]" name += " coil" + update_held_icon() cut_overlays() add_overlay(overlay_image(icon, "[icon_state]_end", flags=RESET_COLOR)) - if(our_color) - var/color_hex = possible_cable_coil_colours[our_color] - color = color_hex - item_state = "coil-[our_color]" - update_held_icon() /obj/item/stack/cable_coil/attackby(var/obj/item/W, var/mob/user) if(W.ismultitool()) @@ -626,33 +636,24 @@ obj/structure/cable/proc/cableColor(var/colorC) if(!selected_color) return - our_color = selected_color - if(!our_color) - our_color = "Red" - update_icon() + var/final_color = possible_cable_coil_colours[selected_color] + if(!final_color) + final_color = possible_cable_coil_colours["Red"] + selected_color = "Red" + color = final_color to_chat(user, SPAN_NOTICE("You change \the [src]'s color to [lowertext(selected_color)].")) /obj/item/stack/cable_coil/proc/update_wclass() if(amount == 1) w_class = ITEMSIZE_TINY - slot_flags = SLOT_EARS + slot_flags = SLOT_BELT | SLOT_EARS //one cable piece can fit in your ear. else w_class = ITEMSIZE_SMALL - slot_flags = null + slot_flags = SLOT_BELT /obj/item/stack/cable_coil/examine(mob/user) - if(get_dist(src, user) > 1) - return - - if(get_amount() == 1) - to_chat(user, "A short piece of power cable.") - else if(get_amount() == 2) - to_chat(user, "A piece of power cable.") - else - to_chat(user, "A coil of power cable. There are [get_amount()] lengths of cable in the coil.") - -/obj/item/stack/cable_coil/iscoil() - return TRUE + ..() + to_chat(user, "There [src.amount == 1 ? "is" : "are"] [src.amount] [src.singular_name]\s of cable in the coil.") /obj/item/stack/cable_coil/verb/make_restraint(mob/user) set name = "Make Cable Restraints" @@ -666,7 +667,7 @@ obj/structure/cable/proc/cableColor(var/colorC) return to_chat(user, SPAN_NOTICE("You start winding some cable together to make some restraints.")) if(do_after(user, 150)) - new/obj/item/handcuffs/cable(user.loc, our_color) + new/obj/item/handcuffs/cable(user.loc, color) to_chat(user, SPAN_NOTICE("You wind some cable together to make some restraints.")) playsound(src.loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2) src.use(15) @@ -720,7 +721,6 @@ obj/structure/cable/proc/cableColor(var/colorC) // called when cable_coil is clicked on a turf/simulated/floor /obj/item/stack/cable_coil/proc/turf_place(turf/F, mob/user) - var/color_hex = possible_cable_coil_colours[our_color] if(!isturf(user.loc)) return @@ -762,7 +762,7 @@ obj/structure/cable/proc/cableColor(var/colorC) var/obj/structure/cable/C = new(F) var/obj/structure/cable/D = new(GetBelow(F)) - C.cableColor(color_hex) + C.cableColor(color) C.d1 = 11 C.d2 = dirn @@ -775,7 +775,7 @@ obj/structure/cable/proc/cableColor(var/colorC) C.mergeConnectedNetworks(C.d2) C.mergeConnectedNetworksOnTurf() - D.cableColor(color_hex) + D.cableColor(color) D.d1 = 12 D.d2 = 0 @@ -795,7 +795,7 @@ obj/structure/cable/proc/cableColor(var/colorC) var/obj/structure/cable/C = new(F) - C.cableColor(color_hex) + C.cableColor(color) //set up the new cable C.d1 = 0 //it's a O-X node cable @@ -823,7 +823,6 @@ obj/structure/cable/proc/cableColor(var/colorC) // called when cable_coil is click on an installed obj/cable // or click on a turf that already contains a "node" cable /obj/item/stack/cable_coil/proc/cable_join(obj/structure/cable/C, mob/user) - var/color_hex = possible_cable_coil_colours[our_color] var/turf/U = user.loc if(!isturf(U)) return @@ -861,7 +860,7 @@ obj/structure/cable/proc/cableColor(var/colorC) return var/obj/structure/cable/NC = new(U) - NC.cableColor(color_hex) + NC.cableColor(color) NC.d1 = 0 NC.d2 = fdirn @@ -907,7 +906,7 @@ obj/structure/cable/proc/cableColor(var/colorC) return - C.cableColor(color_hex) + C.cableColor(color) C.d1 = nd1 C.d2 = nd2 @@ -953,28 +952,28 @@ obj/structure/cable/proc/cableColor(var/colorC) update_wclass() /obj/item/stack/cable_coil/yellow - our_color = "Yellow" + color = COLOR_YELLOW /obj/item/stack/cable_coil/blue - our_color = "Blue" + color = COLOR_BLUE /obj/item/stack/cable_coil/green - our_color = "Green" + color = COLOR_GREEN /obj/item/stack/cable_coil/pink - our_color = "Pink" + color = COLOR_PINK /obj/item/stack/cable_coil/orange - our_color = "Orange" + color = COLOR_ORANGE /obj/item/stack/cable_coil/cyan - our_color = "Cyan" + color = COLOR_CYAN /obj/item/stack/cable_coil/white - our_color = "White" + color = COLOR_WHITE /obj/item/stack/cable_coil/random/Initialize() - our_color = pick(possible_cable_coil_colours) + color = pick(possible_cable_coil_colours) . = ..() ////////////////////////////// @@ -996,7 +995,7 @@ obj/structure/cable/proc/cableColor(var/colorC) user.visible_message(SPAN_WARNING("[user] starts winding some cable together to make a noose, tying it to the ceiling!"), SPAN_NOTICE("You start to wind some cable together to make a noose, tying it to the ceiling.")) if(do_after(user, 250)) - new/obj/structure/noose(user.loc, our_color) + new/obj/structure/noose(user.loc, color) to_chat(user, SPAN_NOTICE("You wind some cable together to make a noose, tying it to the ceiling.")) playsound(user.loc, 'sound/effects/noose_idle.ogg', 50, 1, -3) src.use(25) @@ -1012,7 +1011,7 @@ obj/structure/cable/proc/cableColor(var/colorC) anchored = 1 can_buckle = 1 layer = 5 - var/our_color = "Red" + color = null var/image/over = null var/ticks = 0 @@ -1025,20 +1024,20 @@ obj/structure/cable/proc/cableColor(var/colorC) buckled_mob.visible_message(SPAN_DANGER("[buckled_mob] falls over and hits the ground!"),\ SPAN_DANGER("You fall over and hit the ground!")) buckled_mob.adjustBruteLoss(10) - new/obj/item/stack/cable_coil(get_turf(src), 25, our_color) + new/obj/item/stack/cable_coil(get_turf(src), 25, color) qdel(src) return ..() -/obj/structure/noose/Initialize(mapload, new_color) +/obj/structure/noose/Initialize(mapload, param_color = null) . = ..() pixel_y += 16 //Noose looks like it's "hanging" in the air over = image(icon, "noose_overlay") over.layer = MOB_LAYER + 0.1 - if(new_color) - our_color = new_color - var/color_hex = possible_cable_coil_colours[our_color] - color = color_hex + if(param_color) + color = param_color + if(!color) + color = pick(COLOR_RED, COLOR_BLUE, COLOR_LIME, COLOR_ORANGE, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN) /obj/structure/noose/Destroy() STOP_PROCESSING(SSprocessing, src) diff --git a/code/modules/power/cable_heavyduty.dm b/code/modules/power/cable_heavyduty.dm index 81c76b3065f..f7b4a8530ec 100644 --- a/code/modules/power/cable_heavyduty.dm +++ b/code/modules/power/cable_heavyduty.dm @@ -2,9 +2,9 @@ name = "heavy-duty power cable" desc = "A tough, heavy-duty coil of power cable." icon = 'icons/obj/power.dmi' - our_color = null icon_state = "wire" item_state = "wire" + color = null /obj/structure/cable/heavyduty icon = 'icons/obj/power_cond_heavy.dmi' diff --git a/html/changelogs/wezzy_color_uncrappening.yml b/html/changelogs/wezzy_color_uncrappening.yml new file mode 100644 index 00000000000..0ec539b6345 --- /dev/null +++ b/html/changelogs/wezzy_color_uncrappening.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Wowzewow (Wezzy) + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Finally makes tool inhands work properly." \ No newline at end of file diff --git a/icons/mob/items/lefthand_hydro.dmi b/icons/mob/items/lefthand_hydro.dmi index 59498ec649f..18d0a1e9b30 100644 Binary files a/icons/mob/items/lefthand_hydro.dmi and b/icons/mob/items/lefthand_hydro.dmi differ diff --git a/icons/mob/items/lefthand_tools.dmi b/icons/mob/items/lefthand_tools.dmi index 4c4121ba758..04e670c462d 100644 Binary files a/icons/mob/items/lefthand_tools.dmi and b/icons/mob/items/lefthand_tools.dmi differ diff --git a/icons/mob/items/righthand_hydro.dmi b/icons/mob/items/righthand_hydro.dmi index 142c37fbb82..3d5c528e4f0 100644 Binary files a/icons/mob/items/righthand_hydro.dmi and b/icons/mob/items/righthand_hydro.dmi differ diff --git a/icons/mob/items/righthand_tools.dmi b/icons/mob/items/righthand_tools.dmi index abed50d50f3..b083665204e 100644 Binary files a/icons/mob/items/righthand_tools.dmi and b/icons/mob/items/righthand_tools.dmi differ diff --git a/icons/mob/items/stacks/lefthand_materials.dmi b/icons/mob/items/stacks/lefthand_materials.dmi index ef00e1a3f79..70ac3748c95 100644 Binary files a/icons/mob/items/stacks/lefthand_materials.dmi and b/icons/mob/items/stacks/lefthand_materials.dmi differ diff --git a/icons/mob/items/stacks/righthand_materials.dmi b/icons/mob/items/stacks/righthand_materials.dmi index 17ae468fe8b..f59557d87b9 100644 Binary files a/icons/mob/items/stacks/righthand_materials.dmi and b/icons/mob/items/stacks/righthand_materials.dmi differ diff --git a/icons/obj/handcuffs.dmi b/icons/obj/handcuffs.dmi index 994048e6249..d88290d948f 100644 Binary files a/icons/obj/handcuffs.dmi and b/icons/obj/handcuffs.dmi differ diff --git a/icons/obj/power.dmi b/icons/obj/power.dmi index a905de431fc..59d6d97d939 100644 Binary files a/icons/obj/power.dmi and b/icons/obj/power.dmi differ