Adds the Active Sonar mod to the game. (#67828)

Adds the Active Sonar Module to the game, a module which lets you see the locations of living creatures within a 9 tile radius.
It can be attained by researching Security Modules, and then printed like any other module.
It takes 3 complexity to house, has a 25 second cooldown, and takes a good amount of energy to use.
This commit is contained in:
Wallem
2022-06-25 10:54:50 -07:00
committed by GitHub
parent fd862572a8
commit bd44b995fd
7 changed files with 77 additions and 3 deletions
@@ -337,3 +337,32 @@
projectile.damage /= damage_multiplier
projectile.speed /= speed_multiplier
projectile.cut_overlay(projectile_effect)
///Active Sonar - Displays a hud circle on the turf of any living creatures in the given radius
/obj/item/mod/module/active_sonar
name = "MOD active sonar"
desc = "Ancient tech from the 20th century, this module uses sonic waves to detect living creatures within the user's radius. \
Its loud ping is much harder to hide in an indoor station than in the outdoor operations it was designed for."
icon_state = "active_sonar"
module_type = MODULE_USABLE
use_power_cost = DEFAULT_CHARGE_DRAIN * 5
complexity = 3
incompatible_modules = list(/obj/item/mod/module/active_sonar)
cooldown_time = 25 SECONDS
/obj/item/mod/module/active_sonar/on_use()
. = ..()
if(!.)
return
balloon_alert(mod.wearer, "readying sonar...")
playsound(mod.wearer, 'sound/mecha/skyfall_power_up.ogg', vol = 20, vary = TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
if(!do_after(mod.wearer, 1.1 SECONDS))
return
var/creatures_detected = 0
for(var/mob/living/creature in range(9, mod.wearer))
if(creature == mod.wearer || creature.stat == DEAD)
continue
new /obj/effect/temp_visual/sonar_ping(mod.wearer.loc, mod.wearer, creature)
creatures_detected++
playsound(mod.wearer, 'sound/effects/ping_hit.ogg', vol = 75, vary = TRUE, extrarange = MEDIUM_RANGE_SOUND_EXTRARANGE) // Should be audible for the radius of the sonar
to_chat(mod.wearer, span_notice("You slam your fist into the ground, sending out a sonic wave that detects [creatures_detected] living beings nearby!"))