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

M56 Headset Functionality #454

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0ac9b91
Da Revolva
Mar 27, 2024
b1f8fc5
Oopsiedaisies
Mar 27, 2024
2803a43
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Mar 30, 2024
e747764
Revert "Oopsiedaisies"
Mar 30, 2024
c3cee8a
Auto stash before revert of "Oopsiedaisies"
Mar 30, 2024
6c995e9
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Mar 31, 2024
763913d
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Apr 3, 2024
0fae340
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Apr 5, 2024
49133af
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Apr 7, 2024
4e9b759
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Apr 8, 2024
807e1ae
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Apr 10, 2024
2aa51ac
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Apr 23, 2024
47fb185
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
May 21, 2024
cd11ccc
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Aug 15, 2024
939b7fa
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Aug 22, 2024
5256522
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Aug 23, 2024
e3d4a54
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Aug 25, 2024
0f33748
Fix
Aug 25, 2024
a54119c
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Aug 25, 2024
619ba83
Merge branches 'master' and 'master' of https://github.com/PvE-CMSS13…
Aug 25, 2024
64c3fa7
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Aug 27, 2024
b198276
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Aug 27, 2024
ff918c9
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Aug 28, 2024
5b47911
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Aug 29, 2024
36a9f84
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Sep 1, 2024
f784dab
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13
Sep 4, 2024
21dcde7
Merge remote-tracking branch 'PvE-CMSS13/master'
Sep 5, 2024
78a8b12
Merge remote-tracking branch 'PvE-CMSS13/master'
Sep 9, 2024
26f127c
Merge remote-tracking branch 'PvE-CMSS13/master'
Sep 13, 2024
b5b0566
Merge remote-tracking branch 'PvE-CMSS13/master'
Sep 14, 2024
20bd788
machete
Sep 14, 2024
bdff330
Camera Bullshit
Sep 14, 2024
8bea3ac
Desc Alteration
Sep 14, 2024
cd9d059
Update helmet.dm
Max-023 Sep 14, 2024
7896c70
Pvt Drake smacks his headset
Max-023 Sep 14, 2024
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
2 changes: 2 additions & 0 deletions code/__DEFINES/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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====================================================================================

Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions code/game/camera_manager/camera_manager.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions code/game/machinery/camera/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 13 additions & 1 deletion code/modules/clothing/glasses/night.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..()
Expand Down
3 changes: 1 addition & 2 deletions code/modules/clothing/head/helmet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/suits/marine_armor/smartgunner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some smartgunners use loadout machetes and that would prevent them from using it, i see no reason for this change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is added to the locker as well so they would still be able to use the machete.

)

/obj/item/clothing/suit/storage/marine/smartgunner/Initialize()
Expand Down
34 changes: 34 additions & 0 deletions code/modules/cm_marines/equipment/gear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
..()
34 changes: 27 additions & 7 deletions code/modules/cm_marines/overwatch.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/projectiles/guns/smartgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Binary file modified icons/mob/humans/onmob/ears.dmi
Binary file not shown.
Binary file modified icons/obj/items/clothing/glasses.dmi
Binary file not shown.
Loading