2023-01-23 01:50:05 +03:00
|
|
|
using Content.Shared.Actions;
|
|
|
|
|
using Robust.Shared.GameStates;
|
|
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Spider;
|
|
|
|
|
|
|
|
|
|
[RegisterComponent, NetworkedComponent]
|
|
|
|
|
[Access(typeof(SharedSpiderSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class SpiderComponent : Component
|
2023-01-23 01:50:05 +03:00
|
|
|
{
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
[DataField("webPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
|
|
|
|
public string WebPrototype = "SpiderWeb";
|
|
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2023-09-08 18:16:05 -07:00
|
|
|
[DataField("webAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
|
|
|
|
public string WebAction = "ActionSpiderWeb";
|
2023-09-23 04:49:39 -04:00
|
|
|
|
|
|
|
|
[DataField] public EntityUid? Action;
|
2025-07-17 18:34:00 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether the spider will spawn webs when not controlled by a player.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public bool SpawnsWebsAsNonPlayer = true;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The cooldown in seconds between web spawns when not controlled by a player.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public TimeSpan WebSpawnCooldown = TimeSpan.FromSeconds(45f);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The next time the spider can spawn a web when not controlled by a player.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public TimeSpan? NextWebSpawn;
|
2023-01-23 01:50:05 +03:00
|
|
|
}
|
|
|
|
|
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class SpiderWebActionEvent : InstantActionEvent { }
|