Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
4b11401
Add stealth awareness, patrols and admin tools for scav guards
Jackriip Nov 9, 2026
d8652f3
Add the stealth test room map
Jackriip Nov 9, 2026
a1358a6
Add stealth guard unit tests
Jackriip Nov 9, 2026
3b8f10e
Hide bodies in containers from stealth guards
Jackriip Nov 9, 2026
eba30b4
Fix stealth z-change hook and test lighting
Jackriip Nov 9, 2026
b165c92
Keep AI awake on a forced-active z-level while ghosted
Jackriip Nov 9, 2026
7c3ac8f
Stealth guards calm down after downing their target, wary fades, admi…
Jackriip Nov 9, 2026
b52043a
Human NPC gunners check the bullet's real path for allies
Jackriip Nov 9, 2026
f05057a
Stealth guards show a ? or ! over their heads, and wary wears off aft…
Jackriip Nov 9, 2026
baeb3bd
Raise the guard's head mark clear of its head
Jackriip Nov 10, 2026
4a60145
Scav guard barks roll once for a line or an emote
Jackriip Nov 10, 2026
5f71419
Stealth guards: fix the review findings
Jackriip Nov 10, 2026
1bd1a7a
Stealth tests that run the real guard AI: patrol, walk home, target s…
Jackriip Nov 10, 2026
38eec77
Stealth guards hear: gunfire by loudness, footsteps, thrown things, k…
Jackriip Nov 10, 2026
f1a9046
Stealth test room: two lookouts, throwables, a crate of guns and gadg…
Jackriip Nov 10, 2026
72558e6
Stealth hearing tests: muffling, gun tiers, footsteps, lures, the mis…
Jackriip Nov 10, 2026
c42118c
An admin watching a guard's sight sees one mark at a time
Jackriip Nov 10, 2026
bd574cc
Scav guards carry seclites and see someone at their elbow in the dark
Jackriip Nov 10, 2026
0237c3a
Guards react at once to someone right in front, stay blind behind in …
Jackriip Nov 11, 2026
66a1cfb
Guards open the locker or crate they saw their target get into
Jackriip Nov 11, 2026
f66dc95
Stealth guards take bigger crits when caught unaware, a head shot can…
Jackriip Nov 11, 2026
9764ada
Guards hear glass underfoot, notice doors moving and get sharper by zone
Jackriip Nov 11, 2026
b456e25
An execution click no longer also clubs the target with the gun
Jackriip Nov 11, 2026
8a7e276
Guard flashlights light a real pool ahead, guards lean before they tu…
Jackriip Nov 11, 2026
aba4c04
A guard's flashlight pool against a near wall is bright enough to see by
Jackriip Nov 11, 2026
155e365
Guard flashlight pools actually light the floor
Jackriip Nov 11, 2026
d12af76
Keep the walk pace test's guard dormant so it doesn't walk back to it…
Jackriip Nov 11, 2026
e8d07fe
Make the stealth test room beatable: move the lookout off the door, a…
Jackriip Nov 11, 2026
c4be2c2
Stealth guards check disguises: scav fatigues, a mask and a lootable …
Jackriip Nov 11, 2026
890e7b7
Add a temporary Stealth: Test Planet admin verb: picks a zone, builds…
Jackriip Nov 11, 2026
0007e04
Add a hallway wing to the stealth test room: a one-tile corridor with…
Jackriip Nov 11, 2026
e484598
Stealth guard flashlights throw a beam: a wedge from the hand that le…
Jackriip Nov 12, 2026
655ec01
Guards see through a scav pass shown again soon after they waved it o…
Jackriip Nov 12, 2026
84b460e
A guard that waves someone on doesn't also nod at them straight after…
Jackriip Nov 12, 2026
d6ab261
A guard's beam passes through the diagonal when it walks round a corn…
Jackriip Nov 12, 2026
c6b3513
Light tests that read real lighting apply the guard's lamp themselves…
Jackriip Nov 12, 2026
852b2e2
Guards' flashlight beams show as a soft cone of light from the lamp, …
Jackriip Nov 12, 2026
6bae903
Guards' beam cones wait for the flashlight's light on the floor befor…
Jackriip Nov 12, 2026
c335b14
Guards check their lamp each tick while the cone waits, instead of a …
Jackriip Nov 12, 2026
23705d1
Guards' beam cones stop at walls while they wait on the lamp's light …
Jackriip Nov 13, 2026
6c7022b
Guards hear running, gunfire and other noises from less far
Jackriip Nov 13, 2026
257faad
Stealth guards lose you when they can't see you, and keep what they k…
Jackriip Nov 13, 2026
69fac67
Stealth head shots go by the round and the head's protection, shields…
Jackriip Nov 13, 2026
c54da03
Knife executions: cut the throat of someone from behind or someone he…
Jackriip Nov 13, 2026
8fbb83b
Knife executions: a knife-sized blade held in the hand, hidden behind…
Jackriip Nov 13, 2026
8b621c2
Knife executions: the cut ends on the throat, a hidden wind-up, plain…
Jackriip Nov 13, 2026
63626a4
Knife executions: the attacker holds the victim from behind with his …
Jackriip Nov 13, 2026
90393d4
Knife executions: the whole blade shows in front of the neck, no whit…
Jackriip Nov 13, 2026
2ec45bf
Knife executions: register the throat-clutch hand's signals with Regi…
Jackriip Nov 13, 2026
5b21957
Gun kata chip: hip throw, shoulder flip, wall slam, disarm and human …
Jackriip Nov 13, 2026
5f3fd39
Gun-fu motion goes in one file per move
Jackriip Nov 13, 2026
98a9c86
Gun-fu throws and flips turn the mover to face where the body goes
Jackriip Nov 13, 2026
57bd0c0
Gun-fu throws can't chain into a stunlock
Jackriip Nov 13, 2026
29fa105
A body held at gunpoint in a neck grab stays on its feet
Jackriip Nov 13, 2026
ed515e2
A hostage held up stands at once, and the shield follows the holder's…
Jackriip Nov 13, 2026
1d0354c
Stealth takedowns: the garrotte and the chokehold, tg's strangle clos…
Jackriip Nov 13, 2026
e183c42
Add the scav den: a rare ruin sold as a contested-lane tip, with name…
Jackriip Nov 13, 2026
811d725
A destroyed garrotte lets go of the neck
Jackriip Nov 13, 2026
04ebf6b
A scav den nobody docks at within an hour leaves the overmap and free…
Jackriip Nov 13, 2026
988edf2
Contracts can't hold a scav den on the chart, and the den's crawlways…
Jackriip Nov 13, 2026
e195aac
The shoulder flip's slam sound comes from its picture
Jackriip Nov 13, 2026
caf30fa
Den cameras tween their cone straight instead of swinging it the long…
Jackriip Nov 13, 2026
482c9de
Takedown hold keeps the victim standing and facing away when it closes
Jackriip Nov 13, 2026
ceb22c0
Dim red work lights along the den's back ways and corridors
Jackriip Nov 13, 2026
694b994
Merge the scav den into stealth
Jackriip Nov 13, 2026
3803380
Merge gun-fu and hostages into stealth
Jackriip Nov 13, 2026
b7f4d96
Merge the garrotte and chokehold takedowns into stealth
Jackriip Nov 13, 2026
85a12d2
Merge knife executions into stealth
Jackriip Nov 13, 2026
d72b5cf
One knife backstab: any sharp knife cuts the throat from behind with …
Jackriip Nov 13, 2026
b94b50e
A human shield only catches point-blank shots from the front, a guard…
Jackriip Nov 13, 2026
4d22c52
Knife executions: the attacker holds the victim with his own arms and…
Jackriip Nov 13, 2026
008e85c
Knife executions: seen from behind the attacker, the knife is drawn e…
Jackriip Nov 13, 2026
b58207e
A knife backstab on an unaware guard cuts on the click; players, othe…
Jackriip Nov 13, 2026
6647796
Den guards become a chrome-eyed harvester gang: leather and vests, bl…
Jackriip Nov 13, 2026
77ef7ca
A helpless guard keeps the knife hold; den rippers carry knives, mask…
Jackriip Nov 13, 2026
f97080a
Den harvesters wear plain black gloves, which take blood
Jackriip Nov 13, 2026
e4d87fb
Knife executions: scale the throat slash and blood spray through tg's…
Jackriip Nov 14, 2026
336e28c
Knife executions: clean up grab/release arm arcs, far-hand blade laye…
Jackriip Nov 14, 2026
c731fcc
Merge remote-tracking branch 'origin2/master' into feature/stealth
Jackriip Nov 16, 2026
0e349fb
Merge the finished knife executions into stealth
Jackriip Nov 16, 2026
140083b
Stealth keeps its core: the scav chop shop, takedowns, the gun kata c…
Jackriip Nov 16, 2026
4cdb4d9
Knife execution from the north: the blade is drawn shorter on the str…
Jackriip Nov 16, 2026
5f31c81
Bring back the scav chop shop: the den, its cameras, the rumour chart…
Jackriip Nov 17, 2026
8ddfe0a
Add a temporary admin verb that builds a jungle planet with the scav …
Jackriip Nov 17, 2026
0805bb8
Merge remote-tracking branch 'origin2/master' into feature/stealth
Jackriip Nov 17, 2026
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
4,262 changes: 4,262 additions & 0 deletions _maps/voidcrew/RandomRuins/SpaceRuins/rare_scav_den.dmm

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6749,6 +6749,9 @@
#include "voidcrew\_DEFINES\ship_signals.dm"
#include "voidcrew\_DEFINES\shuttles.dm"
#include "voidcrew\_DEFINES\sound.dm"
#include "voidcrew\_DEFINES\stealth.dm"
#include "voidcrew\_DEFINES\stealth_hearing.dm"
#include "voidcrew\_DEFINES\stealth_hostage.dm"
#include "voidcrew\_DEFINES\subsystems.dm"
#include "voidcrew\_DEFINES\techweb_nodes.dm"
#include "voidcrew\_DEFINES\trade.dm"
Expand Down Expand Up @@ -6847,6 +6850,7 @@
#include "voidcrew\edits\datums\alarm.dm"
#include "voidcrew\edits\datums\cogbar.dm"
#include "voidcrew\edits\datums\communications.dm"
#include "voidcrew\edits\datums\neck_slice_mute.dm"
#include "voidcrew\edits\datums\actions\mobs\charge.dm"
#include "voidcrew\edits\datums\components\gps.dm"
#include "voidcrew\edits\datums\components\jukebox.dm"
Expand Down Expand Up @@ -6962,6 +6966,7 @@
#include "voidcrew\edits\objects\items\extinguisher.dm"
#include "voidcrew\edits\objects\items\kinetic_accelerator_modkits.dm"
#include "voidcrew\edits\objects\items\posibrain.dm"
#include "voidcrew\edits\objects\items\shield_rear.dm"
#include "voidcrew\edits\objects\items\weapon_ladder.dm"
#include "voidcrew\edits\objects\structures\closet_containment.dm"
#include "voidcrew\edits\objects\structures\movable_fixtures.dm"
Expand Down Expand Up @@ -7344,6 +7349,7 @@
#include "voidcrew\modules\hyperviolence\hitlines\npc_blood.dm"
#include "voidcrew\modules\hyperviolence\overlays_exec\executions.dm"
#include "voidcrew\modules\hyperviolence\overlays_exec\gore_overlays.dm"
#include "voidcrew\modules\hyperviolence\overlays_exec\knife_executions.dm"
#include "voidcrew\modules\hyperviolence\overlays_exec\sleeve_mask.dm"
#include "voidcrew\modules\hyperviolence\visuals\_defines.dm"
#include "voidcrew\modules\hyperviolence\visuals\_motion_core.dm"
Expand All @@ -7355,6 +7361,7 @@
#include "voidcrew\modules\hyperviolence\visuals\flying_gore.dm"
#include "voidcrew\modules\hyperviolence\visuals\gut_motion.dm"
#include "voidcrew\modules\hyperviolence\visuals\hit_reactions.dm"
#include "voidcrew\modules\hyperviolence\visuals\knife_execution_motion.dm"
#include "voidcrew\modules\hyperviolence\visuals\npc_motion.dm"
#include "voidcrew\modules\hyperviolence\wire\_wire_defines.dm"
#include "voidcrew\modules\hyperviolence\wire\wire_cut.dm"
Expand Down Expand Up @@ -7886,6 +7893,30 @@
#include "voidcrew\modules\shuttle\survey\survey_data_disk.dm"
#include "voidcrew\modules\shuttle\survey\survey_designs.dm"
#include "voidcrew\modules\slime_extract_piles\slime_extract_piles.dm"
#include "voidcrew\modules\stealth\scav_camera.dm"
#include "voidcrew\modules\stealth\scav_den.dm"
#include "voidcrew\modules\stealth\scav_guards.dm"
#include "voidcrew\modules\stealth\stealth_admin.dm"
#include "voidcrew\modules\stealth\stealth_admin_noise.dm"
#include "voidcrew\modules\stealth\stealth_ai.dm"
#include "voidcrew\modules\stealth\stealth_closet.dm"
#include "voidcrew\modules\stealth\stealth_crits.dm"
#include "voidcrew\modules\stealth\stealth_den_planet.dm"
#include "voidcrew\modules\stealth\stealth_disguise.dm"
#include "voidcrew\modules\stealth\stealth_doors.dm"
#include "voidcrew\modules\stealth\stealth_hearing.dm"
#include "voidcrew\modules\stealth\stealth_hostage.dm"
#include "voidcrew\modules\stealth\stealth_hostage_pose.dm"
#include "voidcrew\modules\stealth\stealth_knife.dm"
#include "voidcrew\modules\stealth\stealth_light.dm"
#include "voidcrew\modules\stealth\stealth_meter.dm"
#include "voidcrew\modules\stealth\stealth_noise.dm"
#include "voidcrew\modules\stealth\stealth_noise_sources.dm"
#include "voidcrew\modules\stealth\stealth_patrol.dm"
#include "voidcrew\modules\stealth\stealth_perception.dm"
#include "voidcrew\modules\stealth\stealth_radio.dm"
#include "voidcrew\modules\stealth\stealth_skill.dm"
#include "voidcrew\modules\stealth\stealth_turns.dm"
#include "voidcrew\modules\storage\cargo_shelf.dm"
#include "voidcrew\modules\storage\smart_locker.dm"
#include "voidcrew\modules\storage\wall_locker.dm"
Expand Down
7 changes: 7 additions & 0 deletions voidcrew/_DEFINES/hyperviolence.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,10 @@
#define WOUND_SERIES_HV_CAROTID "wound_series_hv_carotid"
/// A torn aorta.
#define WOUND_SERIES_HV_AORTA "wound_series_hv_aorta"

// Knife executions (voidcrew/modules/hyperviolence/overlays_exec/knife_executions.dm).

/// Wind-up before a knife execution cuts the throat.
#define HV_KNIFE_EXECUTION_WINDUP (1.5 SECONDS)
/// do_after interaction key for a knife execution wind-up.
#define HV_KNIFE_EXECUTION_DOAFTER "hv_knife_execution"
315 changes: 315 additions & 0 deletions voidcrew/_DEFINES/stealth.dm

Large diffs are not rendered by default.

174 changes: 174 additions & 0 deletions voidcrew/_DEFINES/stealth_hearing.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
// Stealth guards: hearing (voidcrew/modules/stealth/stealth_noise.dm and friends). Step 2 of the stealth layer.

// ===== Noise kinds (stealth_noise()) =====
#define STEALTH_NOISE_GUN_QUIET "gun_quiet"
#define STEALTH_NOISE_GUN_PISTOL "gun_pistol"
#define STEALTH_NOISE_GUN_SMG "gun_smg"
#define STEALTH_NOISE_GUN_LONG "gun_long"
#define STEALTH_NOISE_IMPACT "impact"
#define STEALTH_NOISE_BLAST "blast"
#define STEALTH_NOISE_GLASS "glass"
#define STEALTH_NOISE_THROWN "thrown"
#define STEALTH_NOISE_KNOCK "knock"
#define STEALTH_NOISE_BASH "bash"
#define STEALTH_NOISE_DOOR "door"
#define STEALTH_NOISE_THUD "thud"
#define STEALTH_NOISE_VOICE "voice"
#define STEALTH_NOISE_SCREAM "scream"
#define STEALTH_NOISE_SHOUT "shout"
/// A step on broken glass or a dropped bulb (decision 37)
#define STEALTH_NOISE_CRUNCH "crunch"

/// Every kind, for the admin verb and the tests
#define STEALTH_NOISE_KINDS list(\
STEALTH_NOISE_GUN_QUIET,\
STEALTH_NOISE_GUN_PISTOL,\
STEALTH_NOISE_GUN_SMG,\
STEALTH_NOISE_GUN_LONG,\
STEALTH_NOISE_IMPACT,\
STEALTH_NOISE_BLAST,\
STEALTH_NOISE_GLASS,\
STEALTH_NOISE_THROWN,\
STEALTH_NOISE_KNOCK,\
STEALTH_NOISE_BASH,\
STEALTH_NOISE_DOOR,\
STEALTH_NOISE_THUD,\
STEALTH_NOISE_VOICE,\
STEALTH_NOISE_SCREAM,\
STEALTH_NOISE_SHOUT,\
STEALTH_NOISE_CRUNCH,\
)

// ===== What a guard does about a noise =====
/// Turns to face it and carries on
#define STEALTH_HEAR_GLANCE 1
/// One guard goes to look, then two, then everyone
#define STEALTH_HEAR_INVESTIGATE 2
/// The nearest few run to it and search; the rest hold, wary
#define STEALTH_HEAR_ALARM 3
/// A friend calling: whoever hears it runs to the one shouting
#define STEALTH_HEAR_SHOUT 4

// Fields of a stealth_noise_profile() list
#define STEALTH_PROFILE_REACH 1
#define STEALTH_PROFILE_LEVEL 2
#define STEALTH_PROFILE_FLAGS 3

// ===== Noise flags =====
/// Unheard through any wall or closed door
#define STEALTH_NOISE_LOS_ONLY (1<<0)
/// Walls and doors take half as much off it
#define STEALTH_NOISE_LOUD (1<<1)
/// Heard even when one of their own made it
#define STEALTH_NOISE_ALLIES_COUNT (1<<2)
/// Heard only by the group of the guard that made it
#define STEALTH_NOISE_GROUP_ONLY (1<<3)

// ===== Radio call kinds, lowest first: a pending call is only replaced by a more urgent one =====
#define STEALTH_CALL_REPORT 1
#define STEALTH_CALL_MISSING 2
#define STEALTH_CALL_ALARM 3

// Fields of a controller's pending_call
#define STEALTH_CALL_KIND 1
#define STEALTH_CALL_WHERE 2
#define STEALTH_CALL_DUE 3
#define STEALTH_CALL_NAME 4

// ===== Bark kinds =====
#define STEALTH_BARK_HEARD "stealth_heard"
#define STEALTH_BARK_HEARD_AGAIN "stealth_heard_again"
#define STEALTH_BARK_GUNFIRE "stealth_gunfire"
#define STEALTH_BARK_HOLD "stealth_hold"
#define STEALTH_BARK_HELP "stealth_help"
#define STEALTH_BARK_MISSING "stealth_missing"
#define STEALTH_BARK_RADIO_REPORT "stealth_radio_report"
#define STEALTH_BARK_RADIO_ALARM "stealth_radio_alarm"
#define STEALTH_BARK_RADIO_MISSING "stealth_radio_missing"
#define STEALTH_BARK_COPY "stealth_copy"
#define STEALTH_BARK_RADIO_DEAD "stealth_radio_dead"

// ===== Numbers (first playtest defaults; the owner tunes them) =====
// Reach in open air, in tiles. Each is at or under how far a player hears the same tg sound. Lowered in decision 43
// (playtest 2: "the distance they can hear things from seems a bit absurd, like running for example").
#define STEALTH_NOISE_RANGE_GUN_QUIET 3
#define STEALTH_NOISE_RANGE_GUN_PISTOL 8
#define STEALTH_NOISE_RANGE_GUN_SMG 10
#define STEALTH_NOISE_RANGE_GUN_LONG 12
#define STEALTH_NOISE_RANGE_IMPACT 4
#define STEALTH_NOISE_RANGE_IMPACT_QUIET 1
#define STEALTH_NOISE_RANGE_BLAST 14
#define STEALTH_NOISE_RANGE_GLASS 7
#define STEALTH_NOISE_RANGE_THROWN_SMALL 3
#define STEALTH_NOISE_RANGE_THROWN_MEDIUM 5
#define STEALTH_NOISE_RANGE_THROWN_HEAVY 6
#define STEALTH_NOISE_RANGE_KNOCK 5
#define STEALTH_NOISE_RANGE_BASH 6
#define STEALTH_NOISE_RANGE_DOOR 3
#define STEALTH_NOISE_RANGE_THUD 3
#define STEALTH_NOISE_RANGE_VOICE 4
#define STEALTH_NOISE_RANGE_SCREAM 8
#define STEALTH_NOISE_RANGE_SHOUT 9
/// A step on glass (tg plays it at 50: a player hears it 12 tiles off)
#define STEALTH_NOISE_RANGE_CRUNCH 4
/// The same with TRAIT_LIGHT_STEP (tg plays it at 30: 9 tiles)
#define STEALTH_NOISE_RANGE_CRUNCH_LIGHT 2
/// Tiles of reach a wall eats
#define STEALTH_MUFFLE_WALL 3
/// Tiles of reach a closed solid door eats
#define STEALTH_MUFFLE_DOOR 2
/// Gunfire and blasts go through walls better
#define STEALTH_MUFFLE_LOUD_MULT 0.5
/// Past this many walls and doors nothing is heard
#define STEALTH_MUFFLE_MAX_BLOCKERS 3
/// Inside this many muffled tiles a guard knows the spot
#define STEALTH_NOISE_EXACT_RANGE 6
/// One tile of error per this many tiles past exact
#define STEALTH_NOISE_FUZZ_STEP 3
#define STEALTH_NOISE_FUZZ_MAX 3
/// The same kind of noise this soon and this near an earlier one is the same noise (a volley is one event, decision 31)
#define STEALTH_NOISE_COALESCE (3 SECONDS)
#define STEALTH_NOISE_COALESCE_RANGE 3
#define STEALTH_GLANCE_TIME (3 SECONDS)
/// How long a guard told to hold faces the noise before it goes back to its round
#define STEALTH_HOLD_TIME (10 SECONDS)
/// A search moves to a newer noise at most this often
#define STEALTH_RECENTRE_COOLDOWN (4 SECONDS)
/// "The same spot" for counting lures
#define STEALTH_LURE_RADIUS 6
#define STEALTH_LURE_MEMORY (3 MINUTES)
/// How far a sentry walks from its post toward a small noise before it looks round and goes back. A third lure
/// at one spot it holds wary at its post if the noise is farther than this.
#define STEALTH_SENTRY_INVESTIGATE_RANGE 4
/// How long a guard that went to look has before its friends miss it
#define STEALTH_CHECKIN_TIME (30 SECONDS)
#define STEALTH_ALARM_RESPONDERS 4
/// After two alarms in memory
#define STEALTH_ALARM_RESPONDERS_LATER 2
#define STEALTH_ALARM_MEMORY (3 MINUTES)
/// While alert with its target in view
#define STEALTH_SHOUT_INTERVAL (10 SECONDS)
/// Hand to the earpiece, then this long before the call goes out
#define STEALTH_RADIO_CALL_TIME (3 SECONDS)
/// A call this far past due (its level slept) is never made
#define STEALTH_RADIO_CALL_STALE (5 SECONDS)
/// One alarm delivery per group per this long
#define STEALTH_RADIO_GROUP_COOLDOWN (10 SECONDS)
/// Carriers that move on a call
#define STEALTH_RADIO_RESPONDERS 4
/// Who a carrier's answer carries to, in muffled tiles
#define STEALTH_RELAY_VOICE_RANGE 5
#define STEALTH_RELAY_VOICE_RESPONDERS 2
/// How far a running step on plain floor in shoes carries to a guard
#define STEALTH_FOOTSTEP_RANGE 3
/// How far a player hears that same step (tg: volume 75, range 17 - 1 - 6)
#define STEALTH_FOOTSTEP_PLAYER_RANGE 8
/// The furthest any step is listened for
#define STEALTH_FOOTSTEP_MAX_RANGE 5
#define STEALTH_FOOTSTEP_CRAWL_RANGE 1
/// Notice a heard step adds
#define STEALTH_FOOTSTEP_NOTICE 0.5
/// How long the admin noise view keeps one event on screen
#define STEALTH_NOISE_VIEW_TIME (4 SECONDS)
/// icon_state of the empty grey "?" over a guard that heard something (stealth_meter.dmi)
#define STEALTH_METER_HEARD_STATE "q_y0"
17 changes: 17 additions & 0 deletions voidcrew/_DEFINES/stealth_hostage.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Hostages (stealth step 5, decisions 47+). voidcrew/modules/stealth/stealth_hostage.dm.
// Balance notes for developers; none of these numbers go in player text.

/// Guards never stand closer than this to someone holding one of their own.
#define STEALTH_HOSTAGE_HOLD_RANGE 3
/// "Back off" sends them to at least this far.
#define STEALTH_HOSTAGE_BACK_OFF_RANGE 6
/// How far a guard hears a demand.
#define STEALTH_HOSTAGE_DEMAND_RANGE 7
/// Between standoff lines.
#define STEALTH_HOSTAGE_BARK_INTERVAL (6 SECONDS)

#define STEALTH_BARK_HOSTAGE "stealth_hostage"
#define STEALTH_BARK_HOSTAGE_DROP "stealth_hostage_drop"
#define STEALTH_BARK_HOSTAGE_BACK "stealth_hostage_back"
#define STEALTH_BARK_HOSTAGE_EXECUTED "stealth_hostage_executed"
#define STEALTH_BARK_HOSTAGE_RELEASED "stealth_hostage_released"
13 changes: 13 additions & 0 deletions voidcrew/edits/datums/neck_slice_mute.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// A cut throat can't speak (owner decision 45, voidcrew/modules/hyperviolence/overlays_exec/knife_executions.dm). tg's neck_slice
// (code/datums/status_effects/debuffs/debuffs.dm) lasts while the throat still bleeds from a bad cut; for that long its
// owner has tg's TRAIT_MUTE, so say(), shouting and radios all fail through tg's own can_speak(). Gasps, gags, chokes and
// other emotes still show. Everyone alike: players and NPCs, however the throat was cut.

/datum/status_effect/neck_slice/on_apply()
. = ..()
if(.)
ADD_TRAIT(owner, TRAIT_MUTE, TRAIT_STATUS_EFFECT(id))

/datum/status_effect/neck_slice/on_remove()
REMOVE_TRAIT(owner, TRAIT_MUTE, TRAIT_STATUS_EFFECT(id))
return ..()
35 changes: 35 additions & 0 deletions voidcrew/edits/objects/items/shield_rear.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// A shield held in front of you doesn't stop a shot in the back (owner decision 45). Everyone alike: players and NPCs,
// whatever they know. tg blocks a projectile with a held shield in two places, both reached from the victim's
// bullet_act() (code/modules/mob/living/carbon/human/human_defense.dm): the energy shield's reflection
// (check_reflect() -> IsReflect()) and every shield's block (check_block() -> hit_reaction()). While a shot that comes
// from behind is being resolved, neither works.
//
// "From behind": the shot travels the way its victim faces (its angle, so a ricochet counts from where it really came
// from), the same rear arc as tg's check_behind(). Lying down doesn't count as behind here: the shield still covers.

/mob/living/carbon/human
/// Set while a projectile that hits this human in the back is being resolved
var/vc_shot_in_back = FALSE

/// Whether `shot` hits `victim` from behind: it travels the way the victim faces.
/proc/vc_shot_from_behind(mob/living/victim, obj/projectile/shot)
if(!istype(shot) || isnull(shot.angle))
return FALSE
return !!(victim.dir & angle2dir(shot.angle))

/mob/living/carbon/human/bullet_act(obj/projectile/bullet, def_zone, piercing_hit = FALSE)
var/was_in_back = vc_shot_in_back
vc_shot_in_back = vc_shot_from_behind(src, bullet)
. = ..()
vc_shot_in_back = was_in_back

/obj/item/shield/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK, damage_type = BRUTE)
if(attack_type == PROJECTILE_ATTACK && ishuman(owner) && owner.vc_shot_in_back)
return FALSE
return ..()

/obj/item/shield/energy/IsReflect(def_zone)
var/mob/living/carbon/human/holder = loc
if(ishuman(holder) && holder.vc_shot_in_back)
return FALSE
return ..()
Binary file added voidcrew/icons/effects/scav_camera_cone.dmi
Binary file not shown.
Binary file added voidcrew/icons/effects/stealth_beam.dmi
Binary file not shown.
Binary file added voidcrew/icons/effects/stealth_meter.dmi
Binary file not shown.
38 changes: 37 additions & 1 deletion voidcrew/modules/human_npcs/human_npc_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@
/proc/human_npc_ally_in_line(mob/living/shooter, atom/target)
var/turf/shooter_turf = get_turf(shooter)
var/turf/target_turf = get_turf(target)
for(var/turf/line_turf as anything in get_line(shooter_turf, target_turf))
for(var/turf/line_turf as anything in human_npc_shot_path(shooter_turf, target_turf))
if(line_turf == shooter_turf || line_turf == target_turf)
continue
for(var/mob/living/other in line_turf)
Expand All @@ -525,6 +525,42 @@
return TRUE
return FALSE

/**
* Every turf a shot from the centre of `start_turf` to the centre of `end_turf` passes through, in order. A bullet
* flies the straight line, so at an angle it clips turfs that get_line()'s one-turf-per-step line skips
* (someone beside the target, a tile off that line). Where the line runs exactly through a corner both
* turfs beside it count.
*/
/proc/human_npc_shot_path(turf/start_turf, turf/end_turf)
. = list(start_turf)
if(isnull(start_turf) || isnull(end_turf) || start_turf.z != end_turf.z)
return
var/x_sign = SIGN(end_turf.x - start_turf.x)
var/y_sign = SIGN(end_turf.y - start_turf.y)
var/x_count = abs(end_turf.x - start_turf.x)
var/y_count = abs(end_turf.y - start_turf.y)
var/x = start_turf.x
var/y = start_turf.y
var/x_done = 0
var/y_done = 0
while(x_done < x_count || y_done < y_count)
// Which grid line the shot crosses next: a vertical one (< 0), a horizontal one (> 0) or both at a corner.
var/decision = (1 + 2 * x_done) * y_count - (1 + 2 * y_done) * x_count
if(decision == 0)
. += locate(x + x_sign, y, start_turf.z)
. += locate(x, y + y_sign, start_turf.z)
x += x_sign
y += y_sign
x_done++
y_done++
else if(decision < 0)
x += x_sign
x_done++
else
y += y_sign
y_done++
. += locate(x, y, start_turf.z)

/// One step sideways, keeping no further from the target, for a clear shot.
/proc/human_npc_sidestep(mob/living/shooter, atom/target)
var/turf/our_turf = get_turf(shooter)
Expand Down
6 changes: 5 additions & 1 deletion voidcrew/modules/human_npcs/human_npc_spawning.dm
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ SUBSYSTEM_DEF(human_npcs)
/// family's own root subtype sets this to itself (tests make one of every type).
var/abstract_spawner_type = /obj/effect/spawner/human_npc

/// Called with the NPC once it is built, or null. Must not hold a ref to the spawner: it is gone by then.
/obj/effect/spawner/human_npc/proc/npc_spawned_callback()
return null

/obj/effect/spawner/human_npc/Initialize(mapload)
. = ..()
if(!ispath(npc_type, /mob/living/carbon/human/npc))
Expand All @@ -300,4 +304,4 @@ SUBSYSTEM_DEF(human_npcs)
return
#endif
// The mapped spawner's dir is the way the NPC faces.
spawn_human_npc(npc_type, get_turf(src), name = npc_name, faction = npc_faction, context = get_npc_spawn_context(), dir = dir)
spawn_human_npc(npc_type, get_turf(src), npc_spawned_callback(), name = npc_name, faction = npc_faction, context = get_npc_spawn_context(), dir = dir)
Loading
Loading