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

XM4 Armor Integral Motion Detector #5586

Merged
merged 22 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
7 changes: 7 additions & 0 deletions code/game/objects/items/devices/motion_detector.dm
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@
if(ishuman(A.loc))
return A.loc

/obj/item/device/motiondetector/xm4

/obj/item/device/motiondetector/xm4/get_user()
var/atom/A = loc
if(ishuman(A.loc))
return A.loc
MobiusWon marked this conversation as resolved.
Show resolved Hide resolved
MobiusWon marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/device/motiondetector/proc/apply_debuff(mob/M)
return

Expand Down
71 changes: 71 additions & 0 deletions code/modules/clothing/suits/marine_armor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,77 @@
name = "\improper XM4 pattern intelligence officer armor"
uniform_restricted = list(/obj/item/clothing/under/marine/officer, /obj/item/clothing/under/rank/qm_suit, /obj/item/clothing/under/marine/officer/intel)
specialty = "XM4 pattern intel"
// XM4 Integral Motion Detector
actions_types = list(/datum/action/item_action/toggle, /datum/action/item_action/intel/toggle_motion_detector)
var/motion_detector = 0
MobiusWon marked this conversation as resolved.
Show resolved Hide resolved
var/obj/item/device/motiondetector/xm4/MD
MobiusWon marked this conversation as resolved.
Show resolved Hide resolved
var/long_range_cooldown = 2
var/recycletime = 120

/obj/item/clothing/suit/storage/marine/medium/rto/intel/Initialize(mapload, ...)
MD = new(src)
. = ..()
Birdtalon marked this conversation as resolved.
Show resolved Hide resolved
update_icon()
/datum/action/item_action/intel/action_activate()
if(!ishuman(owner))
return

/datum/action/item_action/intel/update_button_icon()
return

/datum/action/item_action/intel/toggle_motion_detector/New(Target, obj/item/holder)
. = ..()
name = "Toggle Motion Detector"
action_icon_state = "motion_detector"
button.name = name
button.overlays.Cut()
button.overlays += image('icons/mob/hud/actions.dmi', button, action_icon_state)

/datum/action/item_action/intel/toggle_motion_detector/action_activate()
. = ..()
var/obj/item/clothing/suit/storage/marine/medium/rto/intel/io = holder_item
io.toggle_motion_detector(usr)

/datum/action/item_action/intel/toggle_motion_detector/proc/update_icon()
if(!holder_item)
return
var/obj/item/clothing/suit/storage/marine/medium/rto/intel/io = holder_item
if(io.motion_detector)
button.icon_state = "template_on"
else
button.icon_state = "template"

/obj/item/clothing/suit/storage/marine/medium/rto/intel/process()
if(!motion_detector)
STOP_PROCESSING(SSobj, src)
if(motion_detector)
recycletime--
if(!recycletime)
recycletime = initial(recycletime)
MD.refresh_blip_pool()

long_range_cooldown--
if(long_range_cooldown)
return
long_range_cooldown = initial(long_range_cooldown)
MD.scan()

/obj/item/clothing/suit/storage/marine/medium/rto/intel/proc/toggle_motion_detector(mob/user)
to_chat(user, "[icon2html(src, usr)] You [motion_detector? "<B>disable</b>" : "<B>enable</b>"] \the [src]'s motion detector.")
MobiusWon marked this conversation as resolved.
Show resolved Hide resolved
if(!motion_detector)
playsound(loc,'sound/items/detector_turn_on.ogg', 25, 1)
else
playsound(loc,'sound/items/detector_turn_off.ogg', 25, 1)
motion_detector = !motion_detector
var/datum/action/item_action/intel/toggle_motion_detector/TMD = locate(/datum/action/item_action/intel/toggle_motion_detector) in actions
TMD.update_icon()
motion_detector()

/obj/item/clothing/suit/storage/marine/medium/rto/intel/proc/motion_detector()
if(motion_detector)
START_PROCESSING(SSobj, src)
if(!motion_detector)
MobiusWon marked this conversation as resolved.
Show resolved Hide resolved
STOP_PROCESSING(SSobj, src)

/obj/item/clothing/suit/storage/marine/MP
name = "\improper M2 pattern MP armor"
Expand Down
16 changes: 16 additions & 0 deletions code/modules/mob/living/carbon/human/human_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,22 @@
TMD.update_icon()
sg.motion_detector()

for(var/i in cont)
if(istype(i, /obj/item/device/assembly/prox_sensor))
var/obj/item/device/assembly/prox_sensor/prox = i
if(prox.scanning)
prox.toggle_scan()
if(istype(i, /obj/item/device/motiondetector))
var/obj/item/device/motiondetector/md = i
md.toggle_active(src, old_active = TRUE, forced = TRUE)
if(istype(i, /obj/item/clothing/suit/storage/marine/medium/rto/intel))
var/obj/item/clothing/suit/storage/marine/medium/rto/intel/xm4 = i
if(xm4.motion_detector)
xm4.motion_detector = FALSE
var/datum/action/item_action/intel/toggle_motion_detector/TMD = locate(/datum/action/item_action/intel/toggle_motion_detector) in xm4.actions
TMD.update_icon()
xm4.motion_detector()

MobiusWon marked this conversation as resolved.
Show resolved Hide resolved
/mob/living/carbon/human/proc/disable_headsets()
//Disable all radios to reduce radio spam for dead people
var/list/cont = contents_recursive()
Expand Down
Loading