Files
SmArtKar 479ac46740 Reworks goliaths, slightly changes watchers/legions/brimdemons/lobstrocities (#96028)
## About The Pull Request

Goliaths no longer instantly stun the mobs they hit with their tentacle
for full 10 seconds, instead leashing them to the spot they were grabbed
at or dragging them towards themselves. The ranged tetris-piece attack
has been changed to a full cross which tethers the target preventing
them from moving away more than 1 tile, while the line and the ring
attacks tether the mob directly to the goliath itself and drag them in.



https://github.com/user-attachments/assets/0b566a12-17ae-4a8a-97ac-5734c89c83d4

The tentacles can be manually removed after standing for 6 seconds, or
by hitting them for 75 damage total (3 PKC swings, or 5 bayonet hits).
They also naturally retract after 10/15 (cross/line and ring) seconds
like before.
Goliaths themselves have received a massive speed boost, going from 3
second movement delay to 1.2 seconds (150% buff) and no longer can
friendly fire with their tentacles (and ancient goliaths have their
trophy drop guaranteed)

Brimdemons, lobstrocities, watchers and legions also received some
changes:
- Brimdemons no longer can wound with their beams (they were basically
guaranteed to land a nasty burn wound with the initial blast), but are
now affected by laser armor and their beam DOT (not the initial 25 burn
damage upon firing) has been increased from 5 to 7. Their blasts can now
be interrupted by hitting them from their side or from their back
- Lobstrocities have had their retreat distance decreased from 8 to 6,
making them much less likely to randomly lose aggro on the miner (their
aggro range is 9 tiles, meaning that even a single tile of movement on
miner's part will result in lobsters losing interest in them when on CD)
- Watchers now try to stick to 3-5 (previously 4-6) tiles of distance
between themselves and their target, and legions try to maintain 4-6
tiles of distance as opposed to running away completely. This should
make fighting both of them more interesting and engaging, and make
dealing with them during vents less cancerous.

Sprites for the tentacle item and mob overlay are by thgvr from
https://github.com/shiptest-ss13/Shiptest/pull/2432

## Why It's Good For The Game

Goliaths are extremely outdated in their attack design, 10 second
hardstuns are basically a guaranteed death if there are any other mobs
around and aren't very engaging to fight on their own as they are very
easy to evade with 3 second movement delays.
Change to lobstrocities should just make their AI less jank, and
watcher/legion range changes should make them less slippery when
fighting with PKC or zero range PKA, or during vent defense.

## Changelog
🆑 SmArtKar, thgvr
balance: Goliaths no longer hardstun, but instead bind and drag their
targets in with their tentacles. They are, however, much faster now.
balance: Brimdemon beams can no longer wound, but deal a bit more DOT
damage. Their beams can also be interrupted by hitting them from the
side or back in melee.
balance: Watchers and legions now try to maintain a few tiles of
distance from their targets instead of retreating.
fix: Lobstrocity AI should no longer sometimes flee out of their aggro
range when retreating.
/🆑
2026-05-12 19:16:02 +01:00

200 lines
5.4 KiB
Plaintext

/// Keeps the parent within the distance of its owner as naturally as possible,
/// but teleporting if necessary.
/datum/component/leash
/// The owner of the leash. If this is qdeleted, the leash is as well.
var/atom/owner
/// The maximum distance you can move from your owner
var/distance
/// The object type to create on the old turf when forcibly teleporting out
var/force_teleport_out_effect
/// The object type to create on the new turf when forcibly teleporting out
var/force_teleport_in_effect
/// Avoid sending out "too far" bubbles
var/silent = FALSE
/// Should we snap instead of teleporting back?
var/snap_on_teleport = FALSE
VAR_PRIVATE
// Pathfinding can yield, so only move us closer if this is the best one
current_path_tick = 0
last_completed_path_tick = 0
performing_path_move = FALSE
/datum/component/leash/Initialize(
atom/owner,
distance = 3,
force_teleport_out_effect,
force_teleport_in_effect,
silent = FALSE,
snap_on_teleport = FALSE,
)
. = ..()
if (!ismovable(parent))
stack_trace("Parent must be a movable")
return COMPONENT_INCOMPATIBLE
if (!isatom(owner))
stack_trace("[owner] (owner) is not an atom")
return COMPONENT_INCOMPATIBLE
if (!isnum(distance))
stack_trace("[distance] (distance) must be a number")
return COMPONENT_INCOMPATIBLE
if (!isnull(force_teleport_out_effect) && !ispath(force_teleport_out_effect))
stack_trace("force_teleport_out_effect must be null or a path, not [force_teleport_out_effect]")
return COMPONENT_INCOMPATIBLE
if (!isnull(force_teleport_in_effect) && !ispath(force_teleport_in_effect))
stack_trace("force_teleport_in_effect must be null or a path, not [force_teleport_in_effect]")
return COMPONENT_INCOMPATIBLE
src.owner = owner
src.distance = distance
src.force_teleport_out_effect = force_teleport_out_effect
src.force_teleport_in_effect = force_teleport_in_effect
src.silent = silent
src.snap_on_teleport = snap_on_teleport
RegisterSignal(owner, COMSIG_QDELETING, PROC_REF(on_owner_qdel))
RegisterSignal(parent, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(on_parent_pre_move))
check_distance()
if (!ismovable(owner))
return
var/static/list/container_connections = list(
COMSIG_MOVABLE_MOVED = PROC_REF(on_owner_moved),
)
AddComponent(/datum/component/connect_containers, owner, container_connections)
RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(on_owner_moved))
/datum/component/leash/Destroy()
owner = null
return ..()
/datum/component/leash/proc/set_distance(distance)
ASSERT(isnum(distance))
src.distance = distance
check_distance()
/datum/component/leash/proc/on_owner_qdel()
SIGNAL_HANDLER
PRIVATE_PROC(TRUE)
qdel(src)
/datum/component/leash/proc/on_owner_moved(atom/movable/source)
SIGNAL_HANDLER
PRIVATE_PROC(TRUE)
check_distance()
/datum/component/leash/proc/on_parent_pre_move(atom/movable/source, atom/new_location)
SIGNAL_HANDLER
PRIVATE_PROC(TRUE)
if (performing_path_move)
return NONE
var/turf/new_location_turf = get_turf(new_location)
if (get_dist(new_location_turf, owner) <= distance)
return NONE
if (ismob(source) && !silent)
source.balloon_alert(source, "too far!")
return COMPONENT_MOVABLE_BLOCK_PRE_MOVE
/datum/component/leash/proc/check_distance()
set waitfor = FALSE
PRIVATE_PROC(TRUE)
if (get_dist(parent, owner) <= distance)
return
var/atom/movable/atom_parent = parent
if (isnull(owner.loc))
atom_parent.moveToNullspace() // If our parent is in nullspace I guess we gotta go there too
return
if (isnull(atom_parent.loc))
force_teleport_back("in nullspace") // If we're in nullspace, get outta there
return
SEND_SIGNAL(parent, COMSIG_LEASH_PATH_STARTED)
current_path_tick += 1
var/our_path_tick = current_path_tick
var/list/path = get_path_to(parent, owner, mintargetdist = distance)
if (last_completed_path_tick > our_path_tick || QDELETED(src))
return
last_completed_path_tick = our_path_tick
commit_path(path)
/datum/component/leash/proc/commit_path(list/turf/path)
SHOULD_NOT_SLEEP(TRUE)
PRIVATE_PROC(TRUE)
performing_path_move = TRUE
var/atom/movable/movable_parent = parent
for (var/turf/to_move as anything in path)
// Could be an older path, don't make us teleport back
if (!to_move.Adjacent(parent))
continue
if (!movable_parent.Move(to_move))
force_teleport_back("bad path step")
performing_path_move = FALSE
return
if (get_dist(parent, owner) > distance)
force_teleport_back("incomplete path")
performing_path_move = FALSE
SEND_SIGNAL(parent, COMSIG_LEASH_PATH_COMPLETE)
/datum/component/leash/proc/force_teleport_back(reason)
PRIVATE_PROC(TRUE)
if (snap_on_teleport)
qdel(src)
return
var/atom/movable/movable_parent = parent
if (force_teleport_out_effect)
new force_teleport_out_effect(movable_parent.loc)
movable_parent.forceMove(get_turf(owner))
if (force_teleport_in_effect)
new force_teleport_in_effect(movable_parent.loc)
if (ismob(movable_parent))
SSblackbox.record_feedback("tally", "leash_force_teleport_back", 1, reason)
if(!silent)
movable_parent.balloon_alert(movable_parent, "moved out of range!")
SEND_SIGNAL(parent, COMSIG_LEASH_FORCE_TELEPORT)
/// A debug spawner that will create a corgi leashed to a bike horn, plus a beam
/obj/effect/spawner/debug_leash
/obj/effect/spawner/debug_leash/Initialize(mapload)
. = ..()
var/obj/item/bikehorn/bike_horn = new(loc)
var/mob/living/basic/pet/dog/corgi/corgi = new(loc)
corgi.AddComponent(/datum/component/leash, bike_horn)
corgi.Beam(bike_horn)