Skip to content

Commit

Permalink
Overwatch Camera gear
Browse files Browse the repository at this point in the history
x
  • Loading branch information
realforest2001 committed Jan 21, 2024
1 parent a6a28b6 commit 51ccdea
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 11 deletions.
3 changes: 3 additions & 0 deletions code/game/machinery/camera/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,6 @@ GLOBAL_LIST_EMPTY_TYPED(all_cameras, /obj/structure/machinery/camera)

/obj/structure/machinery/camera/cas/isXRay()
return TRUE

/obj/structure/machinery/camera/overwatch
network = list(CAMERA_NET_OVERWATCH)
1 change: 1 addition & 0 deletions code/game/machinery/vending/vendor_types/requisitions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@

list("MISCELLANEOUS", -1, null, null),
list("Bedroll", 30, /obj/item/roller/bedroll, VENDOR_ITEM_REGULAR),
list("M5 Camera Gear", 3, /obj/item/device/overwatch_camera, VENDOR_ITEM_REGULAR),
)

/obj/structure/machinery/cm_vending/sorted/uniform_supply/ui_state(mob/user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
list("Falling Falcons Shoulder Patch", round(scale * 15), /obj/item/clothing/accessory/patch/falcon, VENDOR_ITEM_REGULAR),
list("USCM Shoulder Patch", round(scale * 15), /obj/item/clothing/accessory/patch, VENDOR_ITEM_REGULAR),
list("Bedroll", round(scale * 20), /obj/item/roller/bedroll, VENDOR_ITEM_REGULAR),
list("M5 Camera Gear", 0.5, /obj/item/device/overwatch_camera, VENDOR_ITEM_REGULAR),

list("OPTICS", -1, null, null, null),
list("Advanced Medical Optic (CORPSMAN ONLY)", round(scale * 4), /obj/item/device/helmet_visor/medical/advanced, VENDOR_ITEM_REGULAR),
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 @@ -423,8 +423,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
20 changes: 20 additions & 0 deletions code/modules/cm_marines/equipment/gear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,23 @@
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)
28 changes: 21 additions & 7 deletions code/modules/cm_marines/overwatch.dm
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
if(DEAD)
mob_state = "Dead"

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 @@ -619,13 +619,27 @@
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
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

// Alerts all groundside marines about the incoming OB
/obj/structure/machinery/computer/overwatch/proc/alert_ob(turf/target)
Expand Down
Binary file modified icons/mob/humans/onmob/ears.dmi
Binary file not shown.
Binary file modified icons/mob/humans/onmob/eyes.dmi
Binary file not shown.
Binary file modified icons/obj/items/clothing/glasses.dmi
Binary file not shown.
4 changes: 2 additions & 2 deletions tgui/packages/tgui/interfaces/OverwatchConsole.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ const SquadMonitor = (props, context) => {
}>
{squad_leader.name}
</Button>
)) || <Box color="yellow">{squad_leader.name} (NO HELMET)</Box>}
)) || <Box color="yellow">{squad_leader.name} (NO CAMERA)</Box>}
</Table.Cell>
<Table.Cell p="2px">{squad_leader.role}</Table.Cell>
<Table.Cell
Expand Down Expand Up @@ -505,7 +505,7 @@ const SquadMonitor = (props, context) => {
}>
{marine.name}
</Button>
)) || <Box color="yellow">{marine.name} (NO HELMET)</Box>}
)) || <Box color="yellow">{marine.name} (NO CAMERA)</Box>}
</Table.Cell>
<Table.Cell p="2px">{marine.role}</Table.Cell>
<Table.Cell
Expand Down

0 comments on commit 51ccdea

Please sign in to comment.