New Feature: Kitchen spike rework (#38723)
* Start * Wow, text * Ultra raw * More stuff * Wow, DOT and gibbing!!! * More stuff * More * Update * Yes * Almost there * Done? * I forgot * Update * Update * Update * Update * Update * Update * Update * Update * Update * Beck * Unhardcode
This commit is contained in:
@@ -1,40 +1,143 @@
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Shared.Kitchen.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Used to mark entity that should act as a spike.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[AutoGenerateComponentState, AutoGenerateComponentPause]
|
||||
[Access(typeof(SharedKitchenSpikeSystem))]
|
||||
public sealed partial class KitchenSpikeComponent : Component
|
||||
{
|
||||
[DataField("delay")]
|
||||
public float SpikeDelay = 7.0f;
|
||||
/// <summary>
|
||||
/// Default sound to play when the victim is hooked or unhooked.
|
||||
/// </summary>
|
||||
private static readonly ProtoId<SoundCollectionPrototype> DefaultSpike = new("Spike");
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("sound")]
|
||||
public SoundSpecifier SpikeSound = new SoundPathSpecifier("/Audio/Effects/Fluids/splat.ogg");
|
||||
/// <summary>
|
||||
/// Default sound to play when the victim is butchered.
|
||||
/// </summary>
|
||||
private static readonly ProtoId<SoundCollectionPrototype> DefaultSpikeButcher = new("SpikeButcher");
|
||||
|
||||
public List<string>? PrototypesToSpawn;
|
||||
/// <summary>
|
||||
/// ID of the container where the victim will be stored.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public string ContainerId = "body";
|
||||
|
||||
// TODO: Spiking alive mobs? (Replace with uid) (deal damage to their limbs on spiking, kill on first butcher attempt?)
|
||||
public string MeatSource1p = "?";
|
||||
public string MeatSource0 = "?";
|
||||
public string Victim = "?";
|
||||
/// <summary>
|
||||
/// Container where the victim will be stored.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public ContainerSlot BodyContainer = default!;
|
||||
|
||||
// Prevents simultaneous spiking of two bodies (could be replaced with CancellationToken, but I don't see any situation where Cancel could be called)
|
||||
public bool InUse;
|
||||
/// <summary>
|
||||
/// Sound to play when the victim is hooked or unhooked.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public SoundSpecifier SpikeSound = new SoundCollectionSpecifier(DefaultSpike);
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum KitchenSpikeVisuals : byte
|
||||
/// <summary>
|
||||
/// Sound to play when the victim is butchered.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public SoundSpecifier ButcherSound = new SoundCollectionSpecifier(DefaultSpikeButcher);
|
||||
|
||||
/// <summary>
|
||||
/// Damage that will be applied to the victim when they are hooked or unhooked.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public DamageSpecifier SpikeDamage = new()
|
||||
{
|
||||
Status
|
||||
}
|
||||
DamageDict = new Dictionary<string, FixedPoint2>
|
||||
{
|
||||
{ "Piercing", 10 },
|
||||
},
|
||||
};
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum KitchenSpikeStatus : byte
|
||||
/// <summary>
|
||||
/// Damage that will be applied to the victim when they are butchered.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public DamageSpecifier ButcherDamage = new()
|
||||
{
|
||||
Empty,
|
||||
Bloody
|
||||
}
|
||||
DamageDict = new Dictionary<string, FixedPoint2>
|
||||
{
|
||||
{ "Slash", 20 },
|
||||
},
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Damage that the victim will receive over time.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public DamageSpecifier TimeDamage = new()
|
||||
{
|
||||
DamageDict = new Dictionary<string, FixedPoint2>
|
||||
{
|
||||
{ "Blunt", 1 }, // Mobs are only gibbed from blunt (at least for now).
|
||||
},
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The next time when the damage will be applied to the victim.
|
||||
/// </summary>
|
||||
[AutoPausedField, AutoNetworkedField]
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
public TimeSpan NextDamage;
|
||||
|
||||
/// <summary>
|
||||
/// How often the damage should be applied to the victim.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public TimeSpan DamageInterval = TimeSpan.FromSeconds(10);
|
||||
|
||||
/// <summary>
|
||||
/// Time that it will take to put the victim on the spike.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public TimeSpan HookDelay = TimeSpan.FromSeconds(7);
|
||||
|
||||
/// <summary>
|
||||
/// Time that it will take to put the victim off the spike.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public TimeSpan UnhookDelay = TimeSpan.FromSeconds(10);
|
||||
|
||||
/// <summary>
|
||||
/// Time that it will take to butcher the victim while they are alive.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is summed up with a <see cref="ButcherableComponent"/>'s butcher delay in butcher DoAfter.
|
||||
/// </remarks>
|
||||
[DataField, AutoNetworkedField]
|
||||
public TimeSpan ButcherDelayAlive = TimeSpan.FromSeconds(8);
|
||||
|
||||
/// <summary>
|
||||
/// Value by which the butchering delay will be multiplied if the victim is dead.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public float ButcherModifierDead = 0.5f;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum KitchenSpikeVisuals : byte
|
||||
{
|
||||
Status,
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum KitchenSpikeStatus : byte
|
||||
{
|
||||
Empty,
|
||||
Bloody, // TODO: Add sprites for different species.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user