Files
Delta-v/Content.Server/Dragon/Components/DragonComponent.cs
T
Lyndomenanddeltanedas 54bf76d8eb Dragons despawn with 10 mins between rifts, gib on death, etc (#3017)
* dragondeez

* no despawn

* Update MinorAntagonists.xml

Signed-off-by: Lyndomen <49795619+Lyndomen@users.noreply.github.com>

* comments

* use multiline comment

Signed-off-by: deltanedas <39013340+deltanedas@users.noreply.github.com>

* guidebooks cant have comments

Signed-off-by: deltanedas <39013340+deltanedas@users.noreply.github.com>

* dragons despawn in 10 minutes

* Dragon gib

* add popup

* popup only displays once

* changes

* dragon time

* Update DragonSystem.cs

Signed-off-by: Lyndomen <49795619+Lyndomen@users.noreply.github.com>

---------

Signed-off-by: Lyndomen <49795619+Lyndomen@users.noreply.github.com>
Signed-off-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
2025-02-23 13:45:51 +00:00

91 lines
3.1 KiB
C#

using Content.Shared.Damage; // DeltaV
using Content.Shared.NPC.Prototypes;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Dragon
{
[RegisterComponent]
public sealed partial class DragonComponent : Component
{
/// <summary>
/// If we have active rifts.
/// </summary>
[DataField("rifts")]
public List<EntityUid> Rifts = new();
public bool Weakened => WeakenedAccumulator > 0f;
/// <summary>
/// When any rift is destroyed how long is the dragon weakened for
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("weakenedDuration")]
public float WeakenedDuration = 60f;
/// <summary>
/// Has a rift been destroyed and the dragon in a temporary weakened state?
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("weakenedAccumulator")]
public float WeakenedAccumulator = 0f;
[ViewVariables(VVAccess.ReadWrite), DataField("riftAccumulator")]
public float RiftAccumulator = 0f;
/// <summary>
/// Maximum time the dragon can go without spawning a rift before they die.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("maxAccumulator")] public float RiftMaxAccumulator = 300f;
[DataField("spawnRiftAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string SpawnRiftAction = "ActionSpawnRift";
/// <summary>
/// Spawns a rift which can summon more mobs.
/// </summary>
[DataField("spawnRiftActionEntity")]
public EntityUid? SpawnRiftActionEntity;
[ViewVariables(VVAccess.ReadWrite), DataField("riftPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string RiftPrototype = "CarpRift";
[ViewVariables(VVAccess.ReadWrite), DataField("soundDeath")]
public SoundSpecifier? SoundDeath = new SoundPathSpecifier("/Audio/Animals/space_dragon_roar.ogg");
[ViewVariables(VVAccess.ReadWrite), DataField("soundRoar")]
public SoundSpecifier? SoundRoar =
new SoundPathSpecifier("/Audio/Animals/space_dragon_roar.ogg")
{
Params = AudioParams.Default.WithVolume(3f),
};
/// <summary>
/// NPC faction to re-add after being zombified.
/// Prevents zombie dragon from being attacked by its own carp.
/// </summary>
[DataField]
public ProtoId<NpcFactionPrototype> Faction = "Dragon";
/// <summary>
/// DeltaV: Damage dealt to dragon on death
/// So we dont just delete it
/// </summary>
[DataField]
public DamageSpecifier DeathDamage = new()
{
DamageDict = new()
{
{ "Blunt", 400 },
},
};
/// <summary>
/// DeltaV: Stops the halftime popup from displaying 1000 times
/// </summary>
[DataField]
public bool HalftimePopupShown;
}
}