Skip to content

Commit

Permalink
techno visor
Browse files Browse the repository at this point in the history
  • Loading branch information
Paxilmaniac committed Dec 18, 2024
1 parent 27083ba commit 3390db3
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/modules/loadout/categories/heads.dm
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@

/* /datum/loadout_item/head/plague_doctor // DOPPLER EDIT REMOVAL
name = "Cap (Plague Doctor)"
item_path = /obj/item/clothing/head/bio_hood/plague
item_path = /obj/item/clothing/head/bio_hood/plague */

/datum/loadout_item/head/rose
name = "Rose"
Expand All @@ -150,7 +150,7 @@

/datum/loadout_item/head/harebell
name = "Harebell"
item_path = /obj/item/food/grown/harebell */
item_path = /obj/item/food/grown/harebell

/datum/loadout_item/head/wig
name = "Wig"
Expand Down
4 changes: 4 additions & 0 deletions modular_doppler/loadout_categories/categories/glasses.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@
/datum/loadout_item/glasses/fake_blindfold
name = "Fake Blindfold"
item_path = /obj/item/clothing/glasses/trickblindfold

/datum/loadout_item/glasses/techno_visor
name = "Techno-Visor"
item_path = /obj/item/clothing/glasses/techno_visor
47 changes: 47 additions & 0 deletions modular_doppler/super_glasses/code/glasses_stats_thief.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/datum/component/glasses_stats_thief

/datum/component/glasses_stats_thief/Initialize(successful_robberies = 1)
if(!isclothing(parent))
return COMPONENT_INCOMPATIBLE

RegisterSignal(parent, COMSIG_ITEM_INTERACTING_WITH_ATOM, PROC_REF(try_consume))
RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(examine))

src.successful_robberies = successful_robberies

Check failure on line 10 in modular_doppler/super_glasses/code/glasses_stats_thief.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined field: "successful_robberies" on /datum/component/glasses_stats_thief

Check failure on line 10 in modular_doppler/super_glasses/code/glasses_stats_thief.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD0404: Unknown identifier "successful_robberies"

/datum/component/glasses_stats_thief/proc/examine(datum/source, mob/user, list/examine_list)
SIGNAL_HANDLER

examine_list += span_notice("You can use this on another pair of glasses to copy the hud, flash protection, night vision, etc. from them.")

/// Checks if the atom interacted with has the requirements to be consumed or not
/datum/component/glasses_stats_thief/proc/try_consume(datum/source, mob/living/user, obj/item/thing)
SIGNAL_HANDLER

var/obj/item/clothing/glasses/attacking_glasses = thing
if(!istype(attacking_glasses))
return
// Do the glasses attacking us have any of the things we care about?
if(!attacking_glasses.color_cutoffs && (!attacking_glasses.flash_protect != FLASH_PROTECTION_NONE) && (!length(attacking_glasses.clothing_traits)) && !attacking_glasses.vision_flags)
return
INVOKE_ASYNC(src, PROC_REF(consume), user, thing)

/// Attempts to consume the glasses we are passed and add their stats to the parent
/datum/component/glasses_stats_thief/proc/consume(mob/living/carbon/human/user, obj/item/clothing/glasses/slick_shades)
if(!slick_shades)
return
if(!do_after(user, 5 SECONDS, slick_shades))
return

var/obj/item/clothing/glasses/thief = parent

thief.color_cutoffs = slick_shades.color_cutoffs
thief.forced_glass_color = slick_shades.forced_glass_color
thief.change_glass_color(slick_shades.glass_colour_type)
thief.clothing_traits = slick_shades.clothing_traits
thief.flash_protect = slick_shades.flash_protect
thief.vision_flags = slick_shades.vision_flags
thief.tint = slick_shades.tint
playsound(slick_shades, 'sound/effects/industrial_scan/industrial_scan1.ogg', 50, TRUE)
do_sparks(3, FALSE, slick_shades)
qdel(slick_shades)
38 changes: 38 additions & 0 deletions modular_doppler/super_glasses/code/techno_visors.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/obj/item/clothing/glasses/techno_visor
name = "techno-visor"
desc = "A complicated, curved visor with a network of cameras that allow vision through it. \
Has the unique ability to consume the traits of specialized huds and glasses it touches, \
becoming like the much lamer piece of eyewear it just destroyed. Surely it's fine to have this \
so close to your eyes."
icon = 'modular_doppler/super_glasses/icons/visors.dmi'
icon_state = "black"
worn_icon = 'modular_doppler/super_glasses/icons/worn/visors.dmi'
worn_icon_state = "black"
obj_flags = UNIQUE_RENAME | INFINITE_RESKIN
uses_advanced_reskins = TRUE
unique_reskin = list(
"Tactical Black" = list(
RESKIN_ICON_STATE = "black",
RESKIN_WORN_ICON_STATE = "black",
),
"Shiny Steel" = list(
RESKIN_ICON_STATE = "shiny",
RESKIN_WORN_ICON_STATE = "shiny",
),
"Polished Copper" = list(
RESKIN_ICON_STATE = "copper",
RESKIN_WORN_ICON_STATE = "copper",
),
"Display Green" = list(
RESKIN_ICON_STATE = "green",
RESKIN_WORN_ICON_STATE = "green",
),
"Vintage Computer" = list(
RESKIN_ICON_STATE = "vintage",
RESKIN_WORN_ICON_STATE = "vintage",
),
)

/obj/item/clothing/glasses/techno_visor/Initialize(mapload)
. = ..()
AddComponent(/datum/component/glasses_stats_thief)
Binary file added modular_doppler/super_glasses/icons/visors.dmi
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -7206,6 +7206,8 @@
#include "modular_doppler\sprite_swaps\code\bigclosets.dm"
#include "modular_doppler\stone\code\ore_veins.dm"
#include "modular_doppler\stone\code\stone.dm"
#include "modular_doppler\super_glasses\code\glasses_stats_thief.dm"
#include "modular_doppler\super_glasses\code\techno_visors.dm"
#include "modular_doppler\tableflip\tableflip.dm"
#include "modular_doppler\the-business\code\twitch.dm"
#include "modular_doppler\time_clock\code\console.dm"
Expand Down

0 comments on commit 3390db3

Please sign in to comment.