forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27083ba
commit 3390db3
Showing
7 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 GitHub Actions / Run Linters
|
||
|
||
/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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters