Expeditions rework (#18960)

This commit is contained in:
metalgearsloth
2023-09-19 22:52:01 +10:00
committed by GitHub
parent 86fa8ae180
commit 036b9ef74f
40 changed files with 774 additions and 1097 deletions

View File

@@ -0,0 +1,33 @@
using Content.Shared.Random;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Procedural.Loot;
/// <summary>
/// Randomly places loot in free areas inside the dungeon.
/// </summary>
public sealed partial class RandomSpawnsLoot : IDungeonLoot
{
[ViewVariables(VVAccess.ReadWrite), DataField("entries", required: true)]
public List<RandomSpawnLootEntry> Entries = new();
}
[DataDefinition]
public partial record struct RandomSpawnLootEntry : IBudgetEntry
{
[ViewVariables(VVAccess.ReadWrite), DataField("proto", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string Proto { get; set; } = string.Empty;
/// <summary>
/// Cost for this loot to spawn.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("cost")]
public float Cost { get; set; } = 1f;
/// <summary>
/// Unit probability for this entry. Weighted against the entire table.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("prob")]
public float Prob { get; set; } = 1f;
}