mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 21:40:55 +01:00
fixes tool colors (#9129)
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
slot_l_hand_str = 'icons/mob/items/lefthand_tools.dmi',
|
||||
slot_r_hand_str = 'icons/mob/items/righthand_tools.dmi',
|
||||
)
|
||||
icon_state = "screwdriver2"
|
||||
icon_state = "screwdriver"
|
||||
item_state = "screwdriver"
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT | SLOT_EARS
|
||||
@@ -66,25 +66,25 @@
|
||||
drop_sound = 'sound/items/drop/screwdriver.ogg'
|
||||
pickup_sound = 'sound/items/pickup/screwdriver.ogg'
|
||||
lock_picking_level = 5
|
||||
var/random_color = TRUE //if the tool uses random coloring
|
||||
var/static/list/tool_colors = list(
|
||||
COLOR_BLUE,
|
||||
COLOR_RED,
|
||||
COLOR_PINK,
|
||||
COLOR_BROWN,
|
||||
COLOR_GREEN,
|
||||
COLOR_CYAN,
|
||||
COLOR_YELLOW
|
||||
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
|
||||
)
|
||||
var/random_icon = TRUE
|
||||
|
||||
/obj/item/screwdriver/Initialize()
|
||||
. = ..()
|
||||
if(random_color) //random colors!
|
||||
icon_state = "screwdriver"
|
||||
if(build_from_parts) //random colors!
|
||||
var/our_color = pick(tool_colors)
|
||||
add_atom_colour(tool_colors[our_color])
|
||||
update_icon()
|
||||
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))
|
||||
|
||||
/obj/item/screwdriver/update_icon()
|
||||
var/matrix/tf = matrix()
|
||||
@@ -93,13 +93,6 @@
|
||||
tf.Translate(-3,0) //Could do this with pixel_x but let's just update the appearance once.
|
||||
transform = tf
|
||||
|
||||
if(!random_color) //icon override
|
||||
return
|
||||
cut_overlays()
|
||||
var/mutable_appearance/base_overlay = mutable_appearance(icon, "[icon_state]_head")
|
||||
base_overlay.appearance_flags = RESET_COLOR
|
||||
add_overlay(base_overlay)
|
||||
|
||||
/obj/item/screwdriver/pickup(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
@@ -112,13 +105,6 @@
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/screwdriver/worn_overlays()
|
||||
. = list()
|
||||
if(random_color)
|
||||
var/mutable_appearance/M = mutable_appearance(icon, "[icon_state]_head")
|
||||
M.appearance_flags = RESET_COLOR
|
||||
. += M
|
||||
|
||||
/obj/item/screwdriver/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob, var/target_zone)
|
||||
if(!istype(M) || user.a_intent == "help")
|
||||
return ..()
|
||||
@@ -143,6 +129,7 @@
|
||||
slot_r_hand_str = 'icons/mob/items/righthand_tools.dmi',
|
||||
)
|
||||
icon_state = "wirecutters"
|
||||
item_state = "wirecutters"
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
force = 6
|
||||
@@ -157,23 +144,25 @@
|
||||
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/random_color = TRUE
|
||||
var/static/list/tool_colors = list(
|
||||
COLOR_BLUE,
|
||||
COLOR_RED,
|
||||
COLOR_PINK,
|
||||
COLOR_BROWN,
|
||||
COLOR_GREEN,
|
||||
COLOR_CYAN,
|
||||
COLOR_YELLOW
|
||||
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
|
||||
)
|
||||
|
||||
/obj/item/wirecutters/Initialize()
|
||||
. = ..()
|
||||
if(random_color) //random colors!
|
||||
if(build_from_parts)
|
||||
var/our_color = pick(tool_colors)
|
||||
add_atom_colour(tool_colors[our_color])
|
||||
update_icon()
|
||||
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))
|
||||
|
||||
/obj/item/wirecutters/update_icon()
|
||||
var/matrix/tf = matrix()
|
||||
@@ -182,13 +171,6 @@
|
||||
tf.Translate(-1,0) //Could do this with pixel_x but let's just update the appearance once.
|
||||
transform = tf
|
||||
|
||||
if(!random_color) //icon override
|
||||
return
|
||||
cut_overlays()
|
||||
var/mutable_appearance/base_overlay = mutable_appearance(icon, "[icon_state]_head")
|
||||
base_overlay.appearance_flags = RESET_COLOR
|
||||
add_overlay(base_overlay)
|
||||
|
||||
/obj/item/wirecutters/pickup(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
@@ -201,13 +183,6 @@
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/wirecutters/worn_overlays()
|
||||
. = list()
|
||||
if(random_color)
|
||||
var/mutable_appearance/M = mutable_appearance(icon, "[icon_state]_head")
|
||||
M.appearance_flags = RESET_COLOR
|
||||
. += M
|
||||
|
||||
/obj/item/wirecutters/attack(mob/living/carbon/C, mob/user, var/target_zone)
|
||||
if(user.a_intent == I_HELP && (C.handcuffed) && (istype(C.handcuffed, /obj/item/handcuffs/cable)))
|
||||
user.visible_message(SPAN_NOTICE("\The [user] cuts \the [C]'s restraints with \the [src]!"),\
|
||||
@@ -819,4 +794,4 @@
|
||||
to_chat(user, "You switch \the [src] to the [tool] fitting.")
|
||||
playsound(loc, 'sound/items/change_drill.ogg', 50, 1)
|
||||
update_tool()
|
||||
return TRUE
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user