CatStation/Content.Server/Physics/Components/ChasingWalkComponent.cs
AndrewFenriz 53e29ab962
Move admin smites to prototypes (#45550)
* Add prototype-backed admin verb framework

* Add reusable admin verb operations

* Add smite-specific admin operations

* Migrate admin smites to prototypes

* More docs for god of docs

* We dont have prediction here, so...

* Final cleanup

* Fix adminSmite

* Add segment display control

* Add generic thermoregulator

* Add thermobath systems

* Replace hotplate with thermobath

* Refine thermobath layout

* move simple smites to effects

* move comps to effects

* move add action to effect

* move add mind role to effect

* move add user interfaces to effect

* move godmode to effect

* move eye zoom to effect

* move speed swap to effect

* move spill bloodstream to effect

* move remove organs to effect

* move cream pie to effect

* move slip to effect

* fix server effect usings

* move homing rod to effect

* move locker stuff to effect

* move tabletop dimension to effect

* move pinball to effect

* move yeet to effect

* move silicon laws to effect

* move ghost kick to effect

* remove admin operations

* revert sht

* remove BOM

* use admin verb prototypes for smites

* add heart attack smite prototype

* docs update

* fix AdminSmiteVomitOrgans

* split and move to shared

* move to shared

* move to shared and predict

* PredictedQueueDel

* fix Popup

* fix HomingRod

* port DeleteEntityEntityEffectSystem

* fix StuffIntoLockerEntityEffectSystem

* upd

* fix eye

* fix movement

* fix!!

* fix and doc

* Add admin verb category prototype

* upd AdminVerbPrototype

* split verbs

* SuperSuperSuperBonk

* Update PopupMessageEntityEffectSystem.cs

* fields

---------

Co-authored-by: Pok245 <113675512+Pok27@users.noreply.github.com>
2026-09-18 19:01:16 +00:00

106 lines
3.3 KiB
C#

using Content.Server.EntityEffects.Effects.Smite;
using Content.Server.Physics.Controllers;
using Content.Server.Weapons.Ranged.Systems;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Physics.Components;
/// <summary>
/// A component which makes its entity chasing entity with selected component.
/// </summary>
[RegisterComponent, Access(typeof(ChasingWalkSystem), typeof(HomingRodEntityEffectSystem), typeof(GunSystem)), AutoGenerateComponentPause]
public sealed partial class ChasingWalkComponent : Component
{
/// <summary>
/// The next moment in time when the entity is pushed toward its goal
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan NextImpulseTime;
/// <summary>
/// Push-to-target frequency.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float ImpulseInterval = 2f;
/// <summary>
/// The max angle the entity can turn each impulse
/// </summary>
[DataField]
public Angle MaxAngleVectorChangePerImpulse = Angle.FromDegrees(180);
/// <summary>
/// The minimum speed at which this entity will move.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float MinSpeed = 1.5f;
/// <summary>
/// The maximum speed at which this entity will move.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float MaxSpeed = 3f;
/// <summary>
/// The current speed.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float Speed;
/// <summary>
/// If the entity should stop moving if they are already on top of the target
/// </summary>
[DataField]
public bool StopAtTarget = true;
/// <summary>
/// The minimum time interval in which an object can change its motion target.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float ChangeVectorMinInterval = 5f;
/// <summary>
/// The maximum time interval in which an object can change its motion target.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float ChangeVectorMaxInterval = 25f;
/// <summary>
/// The next change of direction time.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan NextChangeVectorTime;
/// <summary>
/// List of components used to select a target to chase.
/// </summary>
[DataField]
public ComponentRegistry ChasingComponent = [];
/// <summary>
/// The maximum radius in which the entity chooses the target component to follow
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float MaxChaseRadius = 25;
/// <summary>
/// The entity uid that is being chased.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public EntityUid? ChasingEntity;
/// <summary>
/// whether the entity should point in the direction its moving
/// </summary>
[DataField]
public bool RotateWithImpulse;
/// <summary>
/// Sprite rotation offset.
/// </summary>
[DataField]
public Angle RotationAngleOffset = Angle.Zero;
}