Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds pathology goggles and their variants #3233

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2359,7 +2359,7 @@
/obj/item/pen/red,
/obj/item/hand_labeler,
/obj/item/restraints/handcuffs,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/pathology,
/obj/item/storage/box/monkeycubes/mousecubes,
/obj/item/storage/box/monkeycubes/mousecubes,
/turf/open/floor/iron/white/side{
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/Blueshift/Blueshift.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -27002,7 +27002,7 @@
/obj/item/clothing/gloves/latex,
/obj/item/healthanalyzer,
/obj/item/clothing/glasses/hud/health,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/pathology,
/obj/machinery/light_switch/directional/south,
/obj/structure/cable,
/obj/structure/disposalpipe/segment{
Expand Down
4 changes: 2 additions & 2 deletions _maps/map_files/BoxStation/BoxStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -20407,7 +20407,7 @@
/obj/item/hand_labeler,
/obj/item/reagent_containers/spray/cleaner,
/obj/item/radio/headset/headset_med,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/pathology,
/obj/item/extrapolator,
/obj/item/device/antibody_scanner,
/obj/item/device/antibody_scanner,
Expand Down Expand Up @@ -68395,7 +68395,7 @@
/obj/item/hand_labeler,
/obj/item/reagent_containers/spray/cleaner,
/obj/item/radio/headset/headset_med,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/pathology,
/obj/item/extrapolator,
/obj/item/device/antibody_scanner,
/obj/item/device/antibody_scanner,
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/Deltastation/DeltaStation2.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -74688,7 +74688,7 @@
pixel_y = 3
},
/obj/item/clothing/gloves/latex,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/glasses/hud/health,
/obj/item/device/antibody_scanner,
/obj/item/device/antibody_scanner,
Expand Down
6 changes: 3 additions & 3 deletions _maps/map_files/Graveyard/Graveyard.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -9706,9 +9706,9 @@
/area/graveyard/bunker/science)
"dIY" = (
/obj/machinery/light/directional/west,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/gloves/latex,
/obj/item/clothing/gloves/latex,
/obj/item/clothing/gloves/latex,
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/IceBoxStation/IceBoxStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -36651,7 +36651,7 @@
/obj/structure/extinguisher_cabinet/directional/south,
/obj/machinery/light/directional/south,
/obj/structure/table/glass,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/glasses/hud/health,
/obj/item/healthanalyzer,
/obj/item/clothing/gloves/latex,
Expand Down
6 changes: 3 additions & 3 deletions _maps/map_files/MetaStation/MetaStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -32389,9 +32389,9 @@
/obj/structure/closet/secure_closet/wall/directional/west{
name = "Pathologist Equipment"
},
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/gloves/latex,
/obj/item/clothing/gloves/latex,
/obj/item/clothing/gloves/latex,
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/Ouroboros/Ouroboros.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -24313,7 +24313,7 @@
/obj/effect/turf_decal/bot,
/obj/structure/table/glass,
/obj/item/clothing/gloves/latex,
/obj/item/clothing/glasses/science{
/obj/item/clothing/glasses/pathology{
pixel_y = 6
},
/obj/item/clothing/glasses/hud/health,
Expand Down
6 changes: 3 additions & 3 deletions _maps/map_files/Theseus/Theseus.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -73219,9 +73219,9 @@
/obj/item/clothing/gloves/latex,
/obj/item/clothing/gloves/latex,
/obj/item/clothing/gloves/latex,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/glasses/pathology,
/obj/effect/turf_decal/trimline/green/filled/line,
/obj/effect/turf_decal/tile/neutral/half/contrasted{
dir = 1
Expand Down
6 changes: 3 additions & 3 deletions _maps/map_files/Voidraptor/VoidRaptor.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -5058,9 +5058,9 @@
/obj/structure/closet/secure_closet/wall/directional/west{
name = "Pathologist Equipment"
},
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/gloves/latex,
/obj/item/clothing/gloves/latex,
/obj/item/clothing/gloves/latex,
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/generic/CentCom.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -8059,7 +8059,7 @@
pixel_y = 3
},
/obj/item/plant_analyzer,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/pathology,
/obj/item/reagent_containers/spray/chemsprayer/bioterror{
pixel_x = -6;
pixel_y = 10
Expand Down
4 changes: 2 additions & 2 deletions _maps/map_files/tramstation/tramstation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -47314,8 +47314,8 @@
/obj/item/reagent_containers/cup/tube,
/obj/item/reagent_containers/cup/tube,
/obj/item/reagent_containers/cup/tube,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/glasses/pathology,
/obj/item/clothing/glasses/hud/health,
/obj/item/reagent_containers/syringe/antiviral,
/obj/item/reagent_containers/syringe/antiviral,
Expand Down
2 changes: 1 addition & 1 deletion _maps/templates/lazy_templates/nukie_base.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@
pixel_y = 3
},
/obj/item/plant_analyzer,
/obj/item/clothing/glasses/science,
/obj/item/clothing/glasses/pathology,
/obj/item/reagent_containers/spray/chemsprayer/bioterror{
pixel_x = -6;
pixel_y = 10
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits/monkestation/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@
#define TRAIT_TRASH_ITEM "trash_item"
/// This item came from a gift.
#define TRAIT_GIFT_ITEM "gift_item"
/// The mob can see pathogen clouds and such.
#define TRAIT_VIRUS_SCANNER "virus_scanner"

// /atom/movable
/// Things with this trait can pass through wooden barricades.
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_VENTCRAWLER_NUDE" = TRAIT_VENTCRAWLER_NUDE,
"TRAIT_VIRUSIMMUNE" = TRAIT_VIRUSIMMUNE,
"TRAIT_VIRUS_RESISTANCE" = TRAIT_VIRUS_RESISTANCE,
"TRAIT_VIRUS_SCANNER" = TRAIT_VIRUS_SCANNER,
"TRAIT_VORACIOUS" = TRAIT_VORACIOUS,
"TRAIT_WAS_EVOLVED" = TRAIT_WAS_EVOLVED,
"TRAIT_WATER_BREATHING" = TRAIT_WATER_BREATHING,
Expand Down
17 changes: 17 additions & 0 deletions code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
var/ghostvision = 1 //is the ghost able to see things humans can't?
var/mob/observetarget = null //The target mob that the ghost is observing. Used as a reference in logout()
var/data_huds_on = 0 //Are data HUDs currently enabled?
var/disease_view = FALSE //Is disease view currently enabled? (Init signals is on living and I'm not poking that bear.) MONKESTATION EDIT
var/health_scan = FALSE //Are health scans currently enabled?
var/chem_scan = FALSE //Are chem scans currently enabled?
var/gas_scan = FALSE //Are gas scans currently enabled?
Expand Down Expand Up @@ -784,6 +785,22 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
to_chat(src, span_notice("Data HUDs enabled."))
data_huds_on = 1

// MONKESTATION ADDITION START
/mob/dead/observer/verb/toggle_disease_view()
set name = "Toggle Disease View"
set desc = "Toggles whether you see disease infection vectors. (dormant, blood, contact and airborne)"
set category = "Ghost"

if(disease_view)
RemoveElement(/datum/element/virus_viewer)
to_chat(src, span_notice("Disease view disabled."))
else
AddElement(/datum/element/virus_viewer)
to_chat(src, span_notice("Disease view enabled."))

disease_view = !disease_view
// MONKESTATION ADDITION END

/mob/dead/observer/verb/toggle_health_scan()
set name = "Toggle Health Scan"
set desc = "Toggles whether you health-scan living beings on click"
Expand Down
2 changes: 2 additions & 0 deletions code/modules/research/techweb/all_nodes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@
"diagnostic_hud",
"health_hud",
"scigoggles",
"pathology_goggles", // monkestation edit
"security_hud",
)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1500)
Expand All @@ -1310,6 +1311,7 @@
"night_visision_goggles",
"nvgmesons",
"nv_scigoggles",
"nv_pathology_goggles", // monkestation edit
"security_hud_night",
"mech_light_amplification",
)
Expand Down
2 changes: 2 additions & 0 deletions monkestation/code/datums/actions/items/toggles.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/datum/action/item_action/toggle_virus_view
name = "Toggle Viral Analyzer"
20 changes: 20 additions & 0 deletions monkestation/code/datums/components/crafting/tailoring.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

/datum/crafting_recipe/virus_analyzer_glasses
name = "Viral Analyzer Glasses"
result = /obj/item/clothing/glasses/sunglasses/pathology
time = 2 SECONDS
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
reqs = list(
/obj/item/clothing/glasses/pathology = 1,
/obj/item/clothing/glasses/sunglasses = 1,
/obj/item/stack/cable_coil = 5
)
category = CAT_EQUIPMENT

/datum/crafting_recipe/virus_analyzer_removal
name = "Viral Analyzer removal"
result = /obj/item/clothing/glasses/sunglasses
time = 2 SECONDS
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
reqs = list(/obj/item/clothing/glasses/sunglasses/pathology = 1)
category = CAT_EQUIPMENT
118 changes: 118 additions & 0 deletions monkestation/code/datums/components/pathology_glasses.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// This is a component for glasses that makes them able to see pathogens and also toggle viewing them.
// Mainly used by "viral analyzer goggles", "viral analyzer glasses" and "night vision viral analyzer goggles", but works with any type of glasses.

/datum/component/pathology_glasses
var/icon_state_on = null
var/icon_state_off = null

var/worn_icon_state_on = null
var/worn_icon_state_off = null

var/glass_color_type_on = /datum/client_colour/glass_colour/lightgreen
var/glass_color_type_off = /datum/client_colour/glass_colour/lightpurple
var/use_glass_color = FALSE

var/color_cutoffs_on = null
var/color_cutoffs_off = null
var/use_color_cutoffs = FALSE

var/enabled = TRUE

var/action = /datum/action/item_action/toggle_virus_view

/datum/component/pathology_glasses/Initialize(icon_state_on, icon_state_off, worn_icon_state_on = icon_state_on, worn_icon_state_off = icon_state_off, glass_color_type_on, glass_color_type_off, use_glass_color = FALSE, color_cutoffs_on, color_cutoffs_off, use_color_cutoffs = FALSE)
var/obj/item/clothing/glasses/glasses = parent

if(!istype(glasses))
return COMPONENT_INCOMPATIBLE

src.icon_state_on = icon_state_on
src.icon_state_off = icon_state_off
src.worn_icon_state_on = worn_icon_state_on
src.worn_icon_state_off = worn_icon_state_off
src.use_glass_color = use_glass_color
src.use_color_cutoffs = use_color_cutoffs

if(use_glass_color)
src.glass_color_type_on ||= glass_color_type_on
src.glass_color_type_off ||= glass_color_type_off
glasses.glass_colour_type = glass_color_type_on

if(use_color_cutoffs)
src.color_cutoffs_on = color_cutoffs_on
src.color_cutoffs_off = color_cutoffs_off
glasses.color_cutoffs = color_cutoffs_on

action = glasses.add_item_action(action) // Doing it after setting the icon state vars makes sure the item action has the correct sprite.

/datum/component/pathology_glasses/RegisterWithParent()
RegisterSignal(parent, COMSIG_ITEM_UI_ACTION_CLICK, PROC_REF(on_action_click))
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equipped))

/datum/component/pathology_glasses/UnregisterFromParent()
UnregisterSignal(parent, list(COMSIG_ITEM_UI_ACTION_CLICK, COMSIG_ITEM_EQUIPPED))

/datum/component/pathology_glasses/proc/on_action_click(datum/source, mob/living/user, datum/action/action)
SIGNAL_HANDLER

if(src.action != action)
return

if(enabled)
disable(user)
else
enable(user)

/datum/component/pathology_glasses/proc/on_equipped(datum/source, mob/living/user, slot)
SIGNAL_HANDLER

if(!(slot & ITEM_SLOT_EYES))
return

if(enabled)
ADD_CLOTHING_TRAIT(user, TRAIT_VIRUS_SCANNER)

RegisterSignal(user, COMSIG_MOB_UNEQUIPPED_ITEM, PROC_REF(on_item_unequipped))

/datum/component/pathology_glasses/proc/on_item_unequipped(mob/living/user, obj/item/item)
SIGNAL_HANDLER

if(item != parent)
return

if(enabled)
REMOVE_CLOTHING_TRAIT(user, TRAIT_VIRUS_SCANNER)

UnregisterSignal(user, COMSIG_MOB_UNEQUIPPED_ITEM)

/datum/component/pathology_glasses/proc/enable(mob/living/user)
enabled = TRUE
update_icon_states(user)

ADD_CLOTHING_TRAIT(user, TRAIT_VIRUS_SCANNER)

playsound(get_turf(parent), 'sound/machines/click.ogg', vol = 30, vary = TRUE)

/datum/component/pathology_glasses/proc/disable(mob/living/user)
enabled = FALSE
update_icon_states(user)

REMOVE_CLOTHING_TRAIT(user, TRAIT_VIRUS_SCANNER)

playsound(get_turf(parent), 'sound/machines/click.ogg', vol = 30, vary = TRUE)

/datum/component/pathology_glasses/proc/update_icon_states(mob/living/user)
var/obj/item/clothing/glasses/glasses = parent

glasses.icon_state = enabled ? icon_state_on : icon_state_off
glasses.worn_icon_state = enabled ? worn_icon_state_on : worn_icon_state_off

if(use_glass_color)
glasses.change_glass_color(user, enabled ? glass_color_type_on : glass_color_type_off)

if(use_color_cutoffs)
glasses.color_cutoffs = enabled ? color_cutoffs_on : color_cutoffs_off
user.update_sight()

user.update_worn_glasses()
glasses.update_item_action_buttons()
Loading
Loading