[MIRROR] Adds the Active Sonar mod to the game. [MDB IGNORE] (#14513)

* 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.

* Adds the Active Sonar mod to the game.

Co-authored-by: Wallem <66052067+Wallemations@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-06-25 22:17:18 +01:00
committed by GitHub
co-authored by Wallem
parent 3cac70554e
commit 89b60b4144
7 changed files with 77 additions and 3 deletions
@@ -545,3 +545,40 @@
icon_state = "light_ash"
icon = 'icons/effects/weather_effects.dmi'
duration = 3.2 SECONDS
/obj/effect/temp_visual/sonar_ping
duration = 3 SECONDS
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
anchored = TRUE
randomdir = FALSE
/// The image shown to modsuit users
var/image/modsuit_image
/// The person in the modsuit at the moment, really just used to remove this from their screen
var/datum/weakref/mod_man
/// The icon state applied to the image created for this ping.
var/real_icon_state = "sonar_ping"
/obj/effect/temp_visual/sonar_ping/Initialize(mapload, mob/living/looker, mob/living/creature)
. = ..()
if(!looker || !creature)
return INITIALIZE_HINT_QDEL
modsuit_image = image(icon = icon, loc = looker.loc, icon_state = real_icon_state, layer = ABOVE_ALL_MOB_LAYER, pixel_x = ((creature.x - looker.x) * 32), pixel_y = ((creature.y - looker.y) * 32))
modsuit_image.plane = ABOVE_LIGHTING_PLANE
mod_man = WEAKREF(looker)
add_mind(looker)
/obj/effect/temp_visual/sonar_ping/Destroy()
var/mob/living/previous_user = mod_man?.resolve()
if(previous_user)
remove_mind(previous_user)
// Null so we don't shit the bed when we delete
modsuit_image = null
return ..()
/// Add the image to the modsuit wearer's screen
/obj/effect/temp_visual/sonar_ping/proc/add_mind(mob/living/looker)
looker?.client?.images |= modsuit_image
/// Remove the image from the modsuit wearer's screen
/obj/effect/temp_visual/sonar_ping/proc/remove_mind(mob/living/looker)
looker?.client?.images -= modsuit_image
@@ -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!"))
@@ -1392,6 +1392,13 @@
build_path = /obj/item/mod/module/anomaly_locked/kinesis
department_type = MODULE_ENGINEERING
/datum/design/module/mod_sonar
name = "MOD Module: Active Sonar"
id = "mod_sonar"
materials = list(/datum/material/titanium = 250, /datum/material/glass = 1000, /datum/material/gold = 500, /datum/material/uranium = 250)
build_path = /obj/item/mod/module/active_sonar
department_type = MODULE_SECURITY
/datum/design/module/projectile_dampener
name = "MOD Module: Projectile Dampener"
id = "mod_projectile_dampener"
+4 -3
View File
@@ -955,7 +955,7 @@
"paladin_module",
"robocop_module",
"corporate_module",
"drone_module",
"drone_module",
"oxygen_module",
"safeguard_module",
"protectstation_module",
@@ -964,7 +964,7 @@
"remove_module",
)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
/datum/techweb_node/ai_adv
id = "ai_adv"
display_name = "Advanced Artificial Intelligence"
@@ -1657,7 +1657,8 @@
"mod_mag_harness",
"mod_pathfinder",
"mod_holster",
"mod_projectile_dampener"
"mod_sonar",
"mod_projectile_dampener",
)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 813 KiB

After

Width:  |  Height:  |  Size: 911 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.