Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #348 from Cosmic-Overlord/Update_motion_detector
Browse files Browse the repository at this point in the history
Update motion_detector.dm
  • Loading branch information
Waselon authored Oct 26, 2023
2 parents 5ae0378 + 6559f4b commit 40b23d8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/game/objects/items/motion_detector.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
var/mob/living/carbon/human/operator
///If a hostile was detected
var/hostile_detected = FALSE
///The time needed after the last move to not be detected by this motion detector
var/move_sensitivity = 1 SECONDS
///The range of this motion detector
var/range = 16
///The list of all the blips
Expand Down Expand Up @@ -131,10 +133,14 @@
for (var/mob/living/carbon/human/nearby_human AS in cheap_get_humans_near(operator, range))
if(nearby_human == operator)
continue
if(nearby_human.last_move_time + move_sensitivity < world.time)
continue
if(HAS_TRAIT(nearby_human, TRAIT_LIGHT_STEP))
continue
prepare_blip(nearby_human, nearby_human.wear_id?.iff_signal & operator.wear_id?.iff_signal ? MOTION_DETECTOR_FRIENDLY : MOTION_DETECTOR_HOSTILE)
for (var/mob/living/carbon/xenomorph/nearby_xeno AS in cheap_get_xenos_near(operator, range))
if(nearby_xeno.last_move_time + move_sensitivity < world.time )
continue
prepare_blip(nearby_xeno, MOTION_DETECTOR_HOSTILE)
if(hostile_detected)
playsound(loc, 'sound/items/tick.ogg', 100, 0, 7, 2)
Expand Down

0 comments on commit 40b23d8

Please sign in to comment.