Salvage expeditions (#12745)

This commit is contained in:
metalgearsloth
2023-04-20 10:43:13 +10:00
committed by GitHub
parent 486d7c179e
commit 122350f19c
79 changed files with 2764 additions and 662 deletions

View File

@@ -2,6 +2,13 @@ namespace Content.Shared.Procedural;
public sealed class Dungeon
{
/// <summary>
/// Starting position used to generate the dungeon from.
/// </summary>
public Vector2i Position;
public Vector2i Center;
public List<DungeonRoom> Rooms = new();
/// <summary>

View File

@@ -0,0 +1,13 @@
using Content.Shared.Parallax.Biomes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Procedural.Loot;
/// <summary>
/// Adds a biome template layer for dungeon loot.
/// </summary>
public sealed class BiomeTemplateLoot : IDungeonLoot
{
[DataField("proto", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<BiomeTemplatePrototype>))]
public string Prototype = string.Empty;
}

View File

@@ -1,35 +0,0 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Procedural.Loot;
/// <summary>
/// Spawns loot at points in the specified rooms
/// </summary>
public sealed class ClusterLoot : IDungeonLoot
{
/// <summary>
/// Minimum spawns in a cluster.
/// </summary>
[DataField("minCluster")]
public int MinClusterAmount;
/// <summary>
/// Maximum spawns in a cluster.
/// </summary>
[DataField("maxCluster")] public int MaxClusterAmount;
/// <summary>
/// Amount to spawn for the entire loot.
/// </summary>
[DataField("max")]
public int Amount;
/// <summary>
/// Number of points to spawn.
/// </summary>
[DataField("points")] public int Points;
[DataField("proto", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string Prototype { get; } = string.Empty;
}

View File

@@ -0,0 +1,24 @@
using Content.Shared.Random;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Procedural.Loot;
/// <summary>
/// Spawns loot at points in the specified area inside of a dungeon room.
/// </summary>
public sealed class DungeonClusterLoot : IDungeonLoot
{
/// <summary>
/// Spawns in a cluster.
/// </summary>
[DataField("clusterAmount")]
public int ClusterAmount = 1;
/// <summary>
/// Number of clusters to spawn.
/// </summary>
[DataField("clusters")] public int Points = 1;
[DataField("lootTable", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<WeightedRandomPrototype>))]
public string Prototype { get; } = string.Empty;
}

View File

@@ -3,5 +3,4 @@ namespace Content.Shared.Procedural.Loot;
[ImplicitDataDefinitionForInheritors]
public interface IDungeonLoot
{
string Prototype { get; }
}

View File

@@ -1,4 +1,6 @@
using Content.Shared.Salvage;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Procedural.Loot;
@@ -12,6 +14,12 @@ public sealed class SalvageLootPrototype : IPrototype
[DataField("desc")] public string Description = string.Empty;
/// <summary>
/// Mission types this loot is not allowed to spawn for
/// </summary>
[DataField("blacklist")]
public List<SalvageMissionType> Blacklist = new();
/// <summary>
/// All of the loot rules
/// </summary>

View File

@@ -1,10 +0,0 @@
namespace Content.Shared.Procedural.Rewards;
/// <summary>
/// Payout to the station's bank account.
/// </summary>
public sealed class BankReward : ISalvageReward
{
[DataField("amount")]
public int Amount = 0;
}

View File

@@ -1,7 +0,0 @@
namespace Content.Shared.Procedural.Rewards;
[ImplicitDataDefinitionForInheritors]
public interface ISalvageReward
{
}

View File

@@ -1,14 +0,0 @@
using Robust.Shared.Prototypes;
namespace Content.Shared.Procedural.Rewards;
/// <summary>
/// Given after successful completion of a salvage mission.
/// </summary>
[Prototype("salvageReward")]
public sealed class SalvageRewardPrototype : IPrototype
{
[IdDataField] public string ID { get; } = string.Empty;
[DataField("reward", required: true)] public ISalvageReward Reward = default!;
}