diff --git a/code/__DEFINES/equipment.dm b/code/__DEFINES/equipment.dm index 5d5b81bf8c..fd97206a9d 100644 --- a/code/__DEFINES/equipment.dm +++ b/code/__DEFINES/equipment.dm @@ -159,6 +159,8 @@ #define BLOCK_KNOCKDOWN (1<<11) /// Whether wearing this suit grants you the ability to fire a smartgun #define SMARTGUN_HARNESS (1<<12) +///Whether wearing this headset grants you the ability to use the IFF targetting system of the smartgun +#define SMARTGUN_OPTIC (1<<13) //SUITS AND HELMETS==================================================================================== diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index 6e5e239ef5..1289e7057f 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -210,6 +210,7 @@ DEFINE_BITFIELD(flags_inventory, list( "NOPRESSUREDMAGE" = NOPRESSUREDMAGE, "BLOCK_KNOCKDOWN" = BLOCK_KNOCKDOWN, "SMARTGUN_HARNESS" = SMARTGUN_HARNESS, + "SMARTGUN_OPTIC" = SMARTGUN_OPTIC, )) DEFINE_BITFIELD(flags_jumpsuit, list( diff --git a/code/game/camera_manager/camera_manager.dm b/code/game/camera_manager/camera_manager.dm index 90e80ec703..7ed9947bce 100644 --- a/code/game/camera_manager/camera_manager.dm +++ b/code/game/camera_manager/camera_manager.dm @@ -192,6 +192,10 @@ var/obj/item/clothing/clothing = current.loc cam_location = clothing.loc + else if(istype(current.loc, /obj/item/device/overwatch_camera)) + var/obj/item/device/overwatch_camera/cam_gear = current.loc + cam_location = cam_gear.loc + // If we're not forcing an update for some reason and the cameras are in the same location, // we don't need to update anything. // Most security cameras will end here as they're not moving. diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 3b7d824928..c01bacfb41 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -366,3 +366,7 @@ GLOBAL_LIST_EMPTY_TYPED(all_cameras, /obj/structure/machinery/camera) /obj/structure/machinery/camera/cas/isXRay() return TRUE + +/obj/structure/machinery/camera/overwatch + name = "overwatch camera" + network = list(CAMERA_NET_OVERWATCH) diff --git a/code/game/objects/structures/crates_lockers/closets/job_closets.dm b/code/game/objects/structures/crates_lockers/closets/job_closets.dm index 3f21dabf16..21eeb84d0a 100644 --- a/code/game/objects/structures/crates_lockers/closets/job_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/job_closets.dm @@ -130,6 +130,7 @@ new /obj/item/ammo_magazine/smartgun(src) new /obj/item/ammo_magazine/smartgun(src) new /obj/item/clothing/glasses/night/m56_goggles/no_nightvision(src) + new /obj/item/storage/large_holster/machete/smartgunner(src) /obj/structure/closet/secure_closet/smartgunner_forecon name = "smartgunner locker" diff --git a/code/modules/clothing/glasses/night.dm b/code/modules/clothing/glasses/night.dm index 297254ec67..865ee40c2a 100644 --- a/code/modules/clothing/glasses/night.dm +++ b/code/modules/clothing/glasses/night.dm @@ -89,22 +89,34 @@ /obj/item/clothing/glasses/night/m56_goggles name = "\improper M56 head mounted sight" gender = NEUTER - desc = "A headset and goggles system for the M56 Smartgun weapon system. Has a low-res short-range imager, allowing for view of terrain." + desc = "A headset and optic system for the M56 Smartgun weapon system. Has a low-res short-range imager, allowing for view of terrain." icon = 'icons/obj/items/clothing/glasses.dmi' icon_state = "m56_goggles" deactive_state = "m56_goggles_0" toggleable = TRUE actions_types = list(/datum/action/item_action/toggle, /datum/action/item_action/m56_goggles/far_sight) vision_flags = SEE_TURFS + flags_inventory = SMARTGUN_OPTIC fullscreen_vision = null eye_protection = EYE_PROTECTION_FLAVOR req_skill = SKILL_SPEC_WEAPONS req_skill_level = SKILL_SPEC_SMARTGUN + var/obj/structure/machinery/camera/camera var/far_sight = FALSE var/obj/item/weapon/gun/smartgun/linked_smartgun = null +/obj/item/clothing/glasses/night/m56_goggles/Initialize(mapload) + . = ..() + camera = new /obj/structure/machinery/camera/overwatch(src) + +/obj/item/clothing/glasses/night/m56_goggles/equipped(mob/living/carbon/human/mob, slot) + if(camera) + camera.c_tag = mob.name + ..() + /obj/item/clothing/glasses/night/m56_goggles/Destroy() + QDEL_NULL(camera) linked_smartgun = null disable_far_sight() return ..() diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index caa38d8888..fa8e12c834 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -441,8 +441,7 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( pockets.bypass_w_limit = GLOB.allowed_helmet_items pockets.max_storage_space = storage_max_storage_space - camera = new /obj/structure/machinery/camera(src) - camera.network = list(CAMERA_NET_OVERWATCH) + camera = new /obj/structure/machinery/camera/overwatch(src) for(var/obj/visor as anything in built_in_visors) visor.forceMove(src) diff --git a/code/modules/clothing/suits/marine_armor/smartgunner.dm b/code/modules/clothing/suits/marine_armor/smartgunner.dm index b307602538..4d4dff70f8 100644 --- a/code/modules/clothing/suits/marine_armor/smartgunner.dm +++ b/code/modules/clothing/suits/marine_armor/smartgunner.dm @@ -23,7 +23,7 @@ /obj/item/device/walkman, ) var/list/smartgun_back = list( - /obj/item/storage/large_holster/machete, + /obj/item/storage/large_holster/machete/smartgunner, ) /obj/item/clothing/suit/storage/marine/smartgunner/Initialize() diff --git a/code/modules/cm_marines/equipment/gear.dm b/code/modules/cm_marines/equipment/gear.dm index 7ec7a68f6a..c396ff87f0 100644 --- a/code/modules/cm_marines/equipment/gear.dm +++ b/code/modules/cm_marines/equipment/gear.dm @@ -371,3 +371,37 @@ new /obj/item/reagent_container/food/snacks/cookie(src) if(5) new /obj/item/reagent_container/food/snacks/chocolatebar(src) + +/obj/item/device/overwatch_camera + name = "M5 Camera Gear" + desc = "A camera and associated headgear designed to allow marine commanders to see what their troops can see. A more robust version of this equipment is integrated into all standard USCM combat helmets." + icon = 'icons/obj/items/clothing/glasses.dmi' + icon_state = "overwatch_gear" + item_icons = list( + WEAR_L_EAR = 'icons/mob/humans/onmob/ears.dmi', + WEAR_R_EAR = 'icons/mob/humans/onmob/ears.dmi', + ) + item_state_slots = list( + WEAR_L_EAR = "cam_gear", + WEAR_R_EAR = "cam_gear", + ) + flags_equip_slot = SLOT_EAR + var/obj/structure/machinery/camera/camera + +/obj/item/device/overwatch_camera/Initialize(mapload, ...) + . = ..() + camera = new /obj/structure/machinery/camera/overwatch(src) + +/obj/item/device/overwatch_camera/Destroy() + QDEL_NULL(camera) + return ..() + +/obj/item/device/overwatch_camera/equipped(mob/living/carbon/human/mob, slot) + if(camera) + camera.c_tag = mob.name + ..() + +/obj/item/device/overwatch_camera/dropped(mob/user) + if(camera) + camera.c_tag = "Unknown" + ..() diff --git a/code/modules/cm_marines/overwatch.dm b/code/modules/cm_marines/overwatch.dm index 4b0ec5fff6..d617ae1140 100644 --- a/code/modules/cm_marines/overwatch.dm +++ b/code/modules/cm_marines/overwatch.dm @@ -218,7 +218,7 @@ if(mob_state == "Conscious" && (locate(/datum/effects/crit) in marine_human.effects_list)) mob_state = "Incapacitated" - if(!istype(marine_human.head, /obj/item/clothing/head/helmet/marine)) + if(!marine_has_camera(marine_human)) has_helmet = FALSE if(!marine_human.key || !marine_human.client) @@ -652,13 +652,33 @@ cam = null user.reset_view(null) -//returns the helmet camera the human is wearing -/obj/structure/machinery/computer/overwatch/proc/get_camera_from_target(mob/living/carbon/human/H) +/// checks if the human has an overwatch camera at all +/obj/structure/machinery/computer/overwatch/proc/marine_has_camera(mob/living/carbon/human/marine) + if(istype(marine.head, /obj/item/clothing/head/helmet/marine)) + return TRUE + if(istype(marine.wear_l_ear, /obj/item/device/overwatch_camera) || istype(marine.wear_r_ear, /obj/item/device/overwatch_camera)) + return TRUE + if(istype(marine.glasses, /obj/item/clothing/glasses/night/m56_goggles)) + return TRUE + return FALSE +/// returns the overwatch camera the human is wearing +/obj/structure/machinery/computer/overwatch/proc/get_camera_from_target(mob/living/carbon/human/marine) if(current_squad) - if(H && istype(H) && istype(H.head, /obj/item/clothing/head/helmet/marine)) - var/obj/item/clothing/head/helmet/marine/helm = H.head - return helm.camera - + if(marine && istype(marine)) + if(istype(marine.head, /obj/item/clothing/head/helmet/marine)) + var/obj/item/clothing/head/helmet/marine/helm = marine.head + return helm.camera + var/obj/item/device/overwatch_camera/cam_gear + if(istype(marine.wear_l_ear, /obj/item/device/overwatch_camera)) + cam_gear = marine.wear_l_ear + return cam_gear.camera + if(istype(marine.wear_r_ear, /obj/item/device/overwatch_camera)) + cam_gear = marine.wear_r_ear + return cam_gear.camera + var/obj/item/clothing/glasses/night/m56_goggles/m56_cam + if(istype(marine.glasses, /obj/item/clothing/glasses/night/m56_goggles)) + m56_cam = marine.glasses + return m56_cam.camera // Alerts all groundside marines about the incoming OB /obj/structure/machinery/computer/overwatch/proc/alert_ob(turf/target) diff --git a/code/modules/projectiles/guns/smartgun.dm b/code/modules/projectiles/guns/smartgun.dm index ef36f9fd32..5e9ee8b3a5 100644 --- a/code/modules/projectiles/guns/smartgun.dm +++ b/code/modules/projectiles/guns/smartgun.dm @@ -328,6 +328,10 @@ to_chat(H, SPAN_WARNING("You can't fire \the [src] with the feed cover open! (alt-click to close)")) balloon_alert(user, "cannot fire; feed cover open") return FALSE + if(iff_enabled) + if(!H.glasses || !(H.glasses.flags_inventory & SMARTGUN_OPTIC)) + balloon_alert(user, "m56 headset required for iff tracking") + return FALSE /obj/item/weapon/gun/smartgun/unique_action(mob/user) if(isobserver(usr) || isxeno(usr)) diff --git a/icons/mob/humans/onmob/ears.dmi b/icons/mob/humans/onmob/ears.dmi index 3482dcf6fe..48b4662a7f 100644 Binary files a/icons/mob/humans/onmob/ears.dmi and b/icons/mob/humans/onmob/ears.dmi differ diff --git a/icons/obj/items/clothing/glasses.dmi b/icons/obj/items/clothing/glasses.dmi index 13dd0c542c..e94d43c6bf 100644 Binary files a/icons/obj/items/clothing/glasses.dmi and b/icons/obj/items/clothing/glasses.dmi differ