Skip to content

Commit

Permalink
Encryption keys now use a single icon file.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 authored and comma committed Jan 25, 2024
1 parent f351438 commit 204bdc8
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 25 deletions.
7 changes: 7 additions & 0 deletions code/__defines/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#define COLOR_GREEN_GRAY "#8daf6a"
#define COLOR_DARK_GREEN_GRAY "#54654c"
#define COLOR_BLUE_GRAY "#6a97b0"
#define COLOR_MID_BLUE_GRAY "#666699"
#define COLOR_DARK_BLUE_GRAY "#3e4855"
#define COLOR_SURGERY_BLUE "#e0f2f6"
#define COLOR_SUN "#ec8b2f"
Expand Down Expand Up @@ -92,6 +93,12 @@
#define COLOR_CRYSTAL "#00c8a5"
#define COLOR_ASTEROID_ROCK "#735555"
#define COLOR_DIAMOND "#d8d4ea"
#define COLOR_BLOOD_RED "#990000"
#define COLOR_PALE_GOLD "#cc9900"
#define COLOR_ROYAL_BLUE "#0033ff"
#define COLOR_VERDANT_GREEN "#287d00"
#define COLOR_SCIENCE_PURPLE "#6633cc"


#define PIPE_COLOR_GREY "#808080"
#define PIPE_COLOR_RED "#ff0000"
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/turret_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
else if (enabled)
if (lethal)
icon_state = "control_kill"
set_light(1.5, 1,"#990000")
set_light(1.5, 1,COLOR_BLOOD_RED)
else
icon_state = "control_stun"
set_light(1.5, 1,"#ff9900")
Expand Down
30 changes: 27 additions & 3 deletions code/game/objects/items/devices/radio/encryptionkey.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,40 @@
name = "standard encryption key"
desc = "An encryption key for a radio headset. Contains cypherkeys."
icon = 'icons/obj/items/device/radio/key.dmi'
icon_state = "cypherkey"
item_state = ""
icon_state = ICON_STATE_WORLD
w_class = ITEM_SIZE_TINY
slot_flags = SLOT_EARS
material = /decl/material/solid/metal/steel
matter = list(/decl/material/solid/fiberglass = MATTER_AMOUNT_REINFORCEMENT)
color = COLOR_GRAY80
var/contact_color = COLOR_PALE_GOLD
var/fill_color = COLOR_MID_BLUE_GRAY
var/inlay_color = COLOR_RED
var/translate_binary
var/list/can_decrypt

/obj/item/encryptionkey/Initialize()
. = ..()
update_icon()

/obj/item/encryptionkey/on_update_icon()
. = ..()
if(contact_color)
var/image/I = image(icon, "[icon_state]_contact")
I.color = contact_color
I.appearance_flags |= RESET_COLOR
add_overlay(I)
if(fill_color)
var/image/I = image(icon, "[icon_state]_fill")
I.color = fill_color
I.appearance_flags |= RESET_COLOR
add_overlay(I)
if(inlay_color)
var/image/I = image(icon, "[icon_state]_inlay")
I.color = inlay_color
I.appearance_flags |= RESET_COLOR
add_overlay(I)

/obj/item/encryptionkey/attack_self(mob/user)
if(alert(user, "Do you wish to factory reset this encryption key? This will remove ALL channel access and cannot be undone.", "Factory Reset", "No", "Yes") == "Yes" && !user.incapacitated() && user.get_held_slot_for_item(src))
can_decrypt = null
Expand All @@ -33,6 +58,5 @@
. = ..()

/obj/item/encryptionkey/binary
icon_state = "cypherkey"
translate_binary = TRUE
origin_tech = @'{"esoteric":3}'
32 changes: 15 additions & 17 deletions code/game/objects/items/devices/radio/headsets_shared.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/obj/item/encryptionkey/cargo
name = "supply radio encryption key"
icon_state = "med_cypherkey"
inlay_color = COLOR_ASSEMBLY_WHITE
can_decrypt = list(access_cargo)

/obj/item/radio/headset/headset_mining
Expand All @@ -16,7 +16,7 @@

/obj/item/encryptionkey/mining
name = "mining radio encryption key"
icon_state = "med_cypherkey"
inlay_color = COLOR_ASSEMBLY_WHITE
can_decrypt = list(access_mining)
/obj/item/radio/headset/headset_sec
name = "security radio headset"
Expand All @@ -25,7 +25,7 @@

/obj/item/encryptionkey/sec
name = "security radio encryption key"
icon_state = "sec_cypherkey"
inlay_color = COLOR_BLOOD_RED
can_decrypt = list(access_security)

/obj/item/radio/headset/headset_med
Expand All @@ -36,7 +36,7 @@

/obj/item/encryptionkey/med
name = "medical radio encryption key"
icon_state = "med_cypherkey"
inlay_color = COLOR_ASSEMBLY_WHITE
can_decrypt = list(access_medical)

/obj/item/radio/headset/headset_service
Expand All @@ -47,7 +47,7 @@

/obj/item/encryptionkey/service
name = "service radio encryption key"
icon_state = "srv_cypherkey"
inlay_color = COLOR_VERDANT_GREEN
can_decrypt = list(access_bar)

/obj/item/radio/headset/headset_sci
Expand All @@ -58,7 +58,7 @@

/obj/item/encryptionkey/sci
name = "science radio encryption key"
icon_state = "sci_cypherkey"
inlay_color = COLOR_SCIENCE_PURPLE
can_decrypt = list(access_research)

/obj/item/radio/headset/headset_eng
Expand All @@ -69,7 +69,7 @@

/obj/item/encryptionkey/eng
name = "engineering radio encryption key"
icon_state = "eng_cypherkey"
inlay_color = PIPE_COLOR_YELLOW
can_decrypt = list(access_engine)

/obj/item/radio/headset/heads
Expand All @@ -79,9 +79,14 @@

/obj/item/encryptionkey/command
name = "command encryption key"
icon_state = "com_cypherkey"
inlay_color = COLOR_ROYAL_BLUE
can_decrypt = list(access_bridge)

/obj/item/encryptionkey/heads
color = COLOR_GOLD
fill_color = COLOR_PALE_GOLD
inlay_color = COLOR_ROYAL_BLUE

/obj/item/radio/headset/heads/ce
name = "chief engineer's headset"
desc = "The headset of the boss engineer."
Expand All @@ -90,7 +95,6 @@

/obj/item/encryptionkey/heads/ce
name = "chief engineer's encryption key"
icon_state = "cap_cypherkey"
can_decrypt = list(
access_bridge,
access_engine
Expand All @@ -104,7 +108,6 @@

/obj/item/encryptionkey/heads/cmo
name = "chief medical officer's encryption key"
icon_state = "cap_cypherkey"
can_decrypt = list(
access_bridge,
access_medical
Expand All @@ -118,7 +121,6 @@

/obj/item/encryptionkey/heads/rd
name = "research director's encryption key"
icon_state = "cap_cypherkey"
can_decrypt = list(
access_bridge,
access_research
Expand All @@ -131,7 +133,6 @@

/obj/item/encryptionkey/heads/captain
name = "captain's encryption key"
icon_state = "cap_cypherkey"
can_decrypt = list(
access_bridge,
access_security,
Expand All @@ -149,7 +150,6 @@

/obj/item/encryptionkey/heads/hop
name = "head of personnel's encryption key"
icon_state = "hop_cypherkey"
can_decrypt = list(
access_bar,
access_cargo,
Expand All @@ -165,8 +165,8 @@
encryption_keys = list(/obj/item/encryptionkey/heads/hos)

/obj/item/encryptionkey/heads/hos
name = "head of personnel's encryption key"
icon_state = "hos_cypherkey"
name = "head of security's encryption key"
inlay_color = COLOR_BLOOD_RED
can_decrypt = list(
access_bridge,
access_security
Expand All @@ -183,7 +183,6 @@
encryption_keys = list(/obj/item/encryptionkey/ert)

/obj/item/encryptionkey/mercenary
icon_state = "cypherkey"
origin_tech = @'{"esoteric":2}'
can_decrypt = list(access_mercenary)

Expand All @@ -203,7 +202,6 @@
encryption_keys = list(/obj/item/encryptionkey/entertainment)

/obj/item/encryptionkey/raider
icon_state = "cypherkey"
origin_tech = @'{"esoteric":2}'
can_decrypt = list(access_raider)

Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items/devices/spy_bug.dm
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,5 @@
broadcasting = 0
canhear_range = 1
name = "spy device"
icon_state = "syn_cypherkey"
icon = 'icons/obj/items/device/radio/spybug.dmi'
icon_state = ICON_STATE_WORLD
4 changes: 3 additions & 1 deletion code/modules/mob/living/silicon/ai/ai_radio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
/obj/item/encryptionkey/heads/ai_integrated
name = "ai integrated encryption key"
desc = "Integrated encryption key."
icon_state = "cap_cypherkey"
color = COLOR_GOLD
fill_color = COLOR_PALE_GOLD
inlay_color = COLOR_ROYAL_BLUE
can_decrypt = list(
access_bridge,
access_security,
Expand Down
Binary file modified icons/obj/items/device/radio/key.dmi
Binary file not shown.
Binary file added icons/obj/items/device/radio/spybug.dmi
Binary file not shown.
2 changes: 1 addition & 1 deletion maps/ministation/jobs/security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
total_positions = 2
outfit_type = /decl/hierarchy/outfit/job/ministation/security
department_types = list(/decl/department/security)
selection_color = "#990000"
selection_color = COLOR_BLOOD_RED
economic_power = 7
minimal_player_age = 7
access = list(
Expand Down
1 change: 0 additions & 1 deletion mods/content/corporate/datum/antagonists/commando.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
)

/obj/item/encryptionkey/hacked
icon_state = "cypherkey"
can_decrypt = list(access_hacked)
origin_tech = @'{"esoteric":3}'

Expand Down

0 comments on commit 204bdc8

Please sign in to comment.