diff --git a/code/datums/actions/items/toggles.dm b/code/datums/actions/items/toggles.dm index 53c9e4f53cc..449cf11124a 100644 --- a/code/datums/actions/items/toggles.dm +++ b/code/datums/actions/items/toggles.dm @@ -116,3 +116,36 @@ /datum/action/item_action/call_link name = "Call MODlink" +/datum/action/item_action/toggle_nv + name = "Toggle Night Vision" + var/stored_cutoffs + var/stored_colour + +/datum/action/item_action/toggle_nv/New(obj/item/clothing/glasses/target) + . = ..() + target.AddElement(/datum/element/update_icon_updates_onmob) + +/datum/action/item_action/toggle_nv/Trigger(trigger_flags) + if(!istype(target, /obj/item/clothing/glasses)) + return ..() + var/obj/item/clothing/glasses/goggles = target + var/mob/holder = goggles.loc + if(!istype(holder) || holder.get_slot_by_item(goggles) != ITEM_SLOT_EYES) + holder = null + if(stored_cutoffs) + goggles.color_cutoffs = stored_cutoffs + goggles.flash_protect = FLASH_PROTECTION_SENSITIVE + stored_cutoffs = null + if(stored_colour) + goggles.change_glass_color(stored_colour) + playsound(goggles, 'sound/items/night_vision_on.ogg', 30, TRUE, -3) + else + stored_cutoffs = goggles.color_cutoffs + stored_colour = goggles.glass_colour_type + goggles.color_cutoffs = list() + goggles.flash_protect = FLASH_PROTECTION_NONE + if(stored_colour) + goggles.change_glass_color(null) + playsound(goggles, 'sound/machines/click.ogg', 30, TRUE, -3) + holder?.update_sight() + goggles.update_appearance() diff --git a/code/game/objects/items/storage/uplink_kits.dm b/code/game/objects/items/storage/uplink_kits.dm index 96b2d10440d..d3e41b21a98 100644 --- a/code/game/objects/items/storage/uplink_kits.dm +++ b/code/game/objects/items/storage/uplink_kits.dm @@ -300,7 +300,7 @@ new /obj/item/clothing/suit/armor/vest/marine/pmc(src) //The armor kit is comparable to the infiltrator, 6 TC new /obj/item/clothing/head/helmet/marine/pmc(src) new /obj/item/clothing/mask/gas/sechailer(src) - new /obj/item/clothing/glasses/night(src) // 3~ TC + new /obj/item/clothing/glasses/night/colorless(src) // 3~ TC new /obj/item/clothing/gloves/krav_maga/combatglovesplus(src) //5TC new /obj/item/clothing/shoes/jackboots(src) new /obj/item/storage/belt/military/assault/fisher(src) //items in this belt easily costs 18 TC diff --git a/code/game/objects/structures/crates_lockers/closets/syndicate.dm b/code/game/objects/structures/crates_lockers/closets/syndicate.dm index aab8e4b8582..64be6a4df8d 100644 --- a/code/game/objects/structures/crates_lockers/closets/syndicate.dm +++ b/code/game/objects/structures/crates_lockers/closets/syndicate.dm @@ -20,7 +20,7 @@ /obj/structure/closet/syndicate/personal/PopulateContents() ..() new /obj/item/trench_tool(src) - new /obj/item/clothing/glasses/night(src) + new /obj/item/clothing/glasses/night/colorless(src) new /obj/item/ammo_box/magazine/m10mm(src) new /obj/item/storage/belt/military(src) new /obj/item/storage/belt/holster/nukie(src) diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index 33710d91998..ecd85253c21 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -634,6 +634,10 @@ Striking a noncultist, however, will tear their flesh."} icon_state = "blindfold" inhand_icon_state = "blindfold" flash_protect = FLASH_PROTECTION_WELDER + actions_types = null + color_cutoffs = list(40, 0, 0) //red + glass_colour_type = null + forced_glass_color = FALSE /obj/item/clothing/glasses/hud/health/night/cultblind/equipped(mob/living/user, slot) ..() diff --git a/code/modules/antagonists/ninja/outfit.dm b/code/modules/antagonists/ninja/outfit.dm index f91f660a3e8..924943dce77 100644 --- a/code/modules/antagonists/ninja/outfit.dm +++ b/code/modules/antagonists/ninja/outfit.dm @@ -1,7 +1,7 @@ /datum/outfit/ninja name = "Space Ninja" uniform = /obj/item/clothing/under/syndicate/ninja - glasses = /obj/item/clothing/glasses/night + glasses = /obj/item/clothing/glasses/night/colorless mask = /obj/item/clothing/mask/gas/ninja ears = /obj/item/radio/headset shoes = /obj/item/clothing/shoes/jackboots diff --git a/code/modules/antagonists/nukeop/outfits.dm b/code/modules/antagonists/nukeop/outfits.dm index 5cd89e6c842..fa214aa7046 100644 --- a/code/modules/antagonists/nukeop/outfits.dm +++ b/code/modules/antagonists/nukeop/outfits.dm @@ -67,7 +67,7 @@ /datum/outfit/syndicate/full name = "Syndicate Operative - Full Kit" - glasses = /obj/item/clothing/glasses/night + glasses = /obj/item/clothing/glasses/night/colorless mask = /obj/item/clothing/mask/gas/syndicate back = /obj/item/mod/control/pre_equipped/nuclear r_pocket = /obj/item/tank/internals/emergency_oxygen/engi diff --git a/code/modules/client/client_colour.dm b/code/modules/client/client_colour.dm index 5dbcaa0f824..4ca500a9e71 100644 --- a/code/modules/client/client_colour.dm +++ b/code/modules/client/client_colour.dm @@ -180,9 +180,15 @@ /datum/client_colour/glass_colour/yellow colour = "#ffff66" +/datum/client_colour/glass_colour/lightyellow + colour = "#ffffaa" + /datum/client_colour/glass_colour/red colour = "#ffaaaa" +/datum/client_colour/glass_colour/lightred + colour = "#ffcccc" + /datum/client_colour/glass_colour/darkred colour = "#bb5555" @@ -195,6 +201,9 @@ /datum/client_colour/glass_colour/purple colour = "#ff99ff" +/datum/client_colour/glass_colour/lightpurple + colour = "#ffccff" + /datum/client_colour/glass_colour/gray colour = "#cccccc" diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index a1c9a8ea44b..e2632dd394e 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -92,8 +92,14 @@ inhand_icon_state = "nvgmeson" flash_protect = FLASH_PROTECTION_SENSITIVE // Night vision mesons get the same but more intense - color_cutoffs = list(10, 30, 10) - glass_colour_type = /datum/client_colour/glass_colour/green + color_cutoffs = list(10, 35, 10) + glass_colour_type = /datum/client_colour/glass_colour/lightgreen + actions_types = list(/datum/action/item_action/toggle_nv) + forced_glass_color = TRUE + +/obj/item/clothing/glasses/meson/night/update_icon_state() + . = ..() + icon_state = length(color_cutoffs) ? initial(icon_state) : "nvgmeson_off" /obj/item/clothing/glasses/meson/gar name = "gar mesons" @@ -138,8 +144,14 @@ icon_state = "scihudnight" flash_protect = FLASH_PROTECTION_SENSITIVE // Real vivid purple - color_cutoffs = list(50, 10, 30) - glass_colour_type = /datum/client_colour/glass_colour/green + color_cutoffs = list(30, 5, 15) + glass_colour_type = /datum/client_colour/glass_colour/lightpurple + actions_types = list(/datum/action/item_action/toggle_nv) + forced_glass_color = TRUE + +/obj/item/clothing/glasses/science/night/update_icon_state() + . = ..() + icon_state = length(color_cutoffs) ? initial(icon_state) : "night_off" /obj/item/clothing/glasses/night name = "night vision goggles" @@ -149,8 +161,18 @@ flags_cover = GLASSESCOVERSEYES flash_protect = FLASH_PROTECTION_SENSITIVE // Dark green - color_cutoffs = list(10, 30, 10) - glass_colour_type = /datum/client_colour/glass_colour/green + color_cutoffs = list(10, 25, 10) + glass_colour_type = /datum/client_colour/glass_colour/lightgreen + actions_types = list(/datum/action/item_action/toggle_nv) + forced_glass_color = TRUE + +/obj/item/clothing/glasses/night/update_icon_state() + . = ..() + icon_state = length(color_cutoffs) ? initial(icon_state) : "night_off" + +/obj/item/clothing/glasses/night/colorless + desc = parent_type::desc + " Now with 50% less green!" + forced_glass_color = FALSE /obj/item/clothing/glasses/eyepatch name = "eyepatch" diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index e201ade95ec..0e1bc527467 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -67,8 +67,14 @@ flash_protect = FLASH_PROTECTION_SENSITIVE flags_cover = GLASSESCOVERSEYES // Blue green, dark - color_cutoffs = list(5, 15, 30) - glass_colour_type = /datum/client_colour/glass_colour/green + color_cutoffs = list(20, 20, 45) + glass_colour_type = /datum/client_colour/glass_colour/lightgreen + actions_types = list(/datum/action/item_action/toggle_nv) + forced_glass_color = TRUE + +/obj/item/clothing/glasses/hud/health/night/update_icon_state() + . = ..() + icon_state = length(color_cutoffs) ? initial(icon_state) : "night_off" /obj/item/clothing/glasses/hud/health/night/meson name = "night vision meson health scanner HUD" @@ -79,7 +85,8 @@ name = "night vision medical science scanner HUD" desc = "An clandestine medical science heads-up display that allows operatives to find \ dying captains and the perfect poison to finish them off in complete darkness." - clothing_traits = list(TRAIT_REAGENT_SCANNER) + clothing_traits = list(TRAIT_REAGENT_SCANNER, TRAIT_MEDICAL_HUD) + forced_glass_color = FALSE /obj/item/clothing/glasses/hud/health/sunglasses name = "medical HUDSunglasses" @@ -115,8 +122,14 @@ flash_protect = FLASH_PROTECTION_SENSITIVE flags_cover = GLASSESCOVERSEYES // Pale yellow - color_cutoffs = list(30, 20, 5) - glass_colour_type = /datum/client_colour/glass_colour/green + color_cutoffs = list(25, 15, 5) + glass_colour_type = /datum/client_colour/glass_colour/lightyellow + actions_types = list(/datum/action/item_action/toggle_nv) + forced_glass_color = TRUE + +/obj/item/clothing/glasses/hud/diagnostic/night/update_icon_state() + . = ..() + icon_state = length(color_cutoffs) ? initial(icon_state) : "night_off" /obj/item/clothing/glasses/hud/diagnostic/sunglasses name = "diagnostic sunglasses" @@ -187,8 +200,14 @@ flash_protect = FLASH_PROTECTION_SENSITIVE flags_cover = GLASSESCOVERSEYES // Red with a tint of green - color_cutoffs = list(35, 5, 5) - glass_colour_type = /datum/client_colour/glass_colour/green + color_cutoffs = list(40, 15, 10) + glass_colour_type = /datum/client_colour/glass_colour/lightred + actions_types = list(/datum/action/item_action/toggle_nv) + forced_glass_color = TRUE + +/obj/item/clothing/glasses/hud/security/night/update_icon_state() + . = ..() + icon_state = length(color_cutoffs) ? initial(icon_state) : "night_off" /obj/item/clothing/glasses/hud/security/sunglasses/gars name = "\improper HUD gar glasses" diff --git a/code/modules/clothing/outfits/ert.dm b/code/modules/clothing/outfits/ert.dm index db20562039b..2aa61b00460 100644 --- a/code/modules/clothing/outfits/ert.dm +++ b/code/modules/clothing/outfits/ert.dm @@ -242,7 +242,7 @@ /obj/item/storage/box/lights/mixed = 1, ) belt = /obj/item/storage/belt/janitor/full - glasses = /obj/item/clothing/glasses/night + glasses = /obj/item/clothing/glasses/night/colorless l_pocket = /obj/item/grenade/chem_grenade/cleaner r_pocket = /obj/item/grenade/chem_grenade/cleaner l_hand = /obj/item/storage/bag/trash/bluespace diff --git a/code/modules/mob_spawn/ghost_roles/unused_roles.dm b/code/modules/mob_spawn/ghost_roles/unused_roles.dm index d9cdd699ade..80f584d52c2 100644 --- a/code/modules/mob_spawn/ghost_roles/unused_roles.dm +++ b/code/modules/mob_spawn/ghost_roles/unused_roles.dm @@ -308,7 +308,7 @@ /datum/outfit/syndicatespace/syndicrew name = "Syndicate Ship Crew Member" - glasses = /obj/item/clothing/glasses/night + glasses = /obj/item/clothing/glasses/night/colorless mask = /obj/item/clothing/mask/gas/syndicate l_pocket = /obj/item/gun/ballistic/automatic/pistol r_pocket = /obj/item/knife/combat/survival diff --git a/icons/mob/clothing/eyes.dmi b/icons/mob/clothing/eyes.dmi index 20bf4d18381..92b155f62d5 100644 Binary files a/icons/mob/clothing/eyes.dmi and b/icons/mob/clothing/eyes.dmi differ diff --git a/icons/obj/clothing/glasses.dmi b/icons/obj/clothing/glasses.dmi index fd898d3105f..97f692551f9 100644 Binary files a/icons/obj/clothing/glasses.dmi and b/icons/obj/clothing/glasses.dmi differ diff --git a/sound/items/attributions.txt b/sound/items/attributions.txt new file mode 100644 index 00000000000..de55b8daebe --- /dev/null +++ b/sound/items/attributions.txt @@ -0,0 +1 @@ +night_vision_on.ogg by Syna-Max -- https://freesound.org/s/60345/ -- License: Attribution NonCommercial 4.0 diff --git a/sound/items/night_vision_on.ogg b/sound/items/night_vision_on.ogg new file mode 100644 index 00000000000..13ca202669c Binary files /dev/null and b/sound/items/night_vision_on.ogg differ