Files
SPT-Server-Build/Libraries/SPTarkov.Server.Core/Models/Spt/Config/AirdropConfig.cs
T
Jesse 54f0d0779c Convert TemplateItem to MongoId (#436)
* Convert TemplateItem to MongoId

* Push new extensions

* Handle null mongoid's being passed to regex

* Handle null strings, fixes item events

* Updated loot generation to work with new property `composedKey`

Fixed typo in `SlotId`

* Fix missing method after merge

* Remove duplicately named MongoIDExtensions?

* Fixed location loot generation to handle impending loot json changes

* Updated location JSONs with new properties (excluding lighthouse loose loot)

* Fixed build issue with ItemTplGenerator

* use correct handing for new mongo ids

* Added helper method to improve readability

---------

Co-authored-by: Chomp <dev@dev.sp-tarkov.com>
2025-07-02 10:14:04 +01:00

109 lines
3.5 KiB
C#

using System.Text.Json.Serialization;
using SPTarkov.Server.Core.Models.Common;
using SPTarkov.Server.Core.Models.Enums;
namespace SPTarkov.Server.Core.Models.Spt.Config;
public record AirdropConfig : BaseConfig
{
[JsonPropertyName("kind")]
public override string Kind { get; set; } = "spt-airdrop";
[JsonPropertyName("airdropTypeWeightings")]
public required Dictionary<SptAirdropTypeEnum, double> AirdropTypeWeightings { get; set; }
/// <summary>
/// What rewards will the loot crate contain, keyed by drop type e.g. mixed/weaponArmor/foodMedical/barter
/// </summary>
[JsonPropertyName("loot")]
public required Dictionary<string, AirdropLoot> Loot { get; set; }
[JsonPropertyName("customAirdropMapping")]
public required Dictionary<string, SptAirdropTypeEnum> CustomAirdropMapping { get; set; }
}
/// <summary>
/// Loot inside crate
/// </summary>
public record AirdropLoot
{
[JsonExtensionData]
public Dictionary<string, object>? ExtensionData { get; set; }
[JsonPropertyName("icon")]
[JsonConverter(typeof(JsonStringEnumConverter))]
public required AirdropTypeEnum Icon { get; set; }
/// <summary>
/// Min/max of weapons inside crate
/// </summary>
[JsonPropertyName("weaponPresetCount")]
public required MinMax<int> WeaponPresetCount { get; set; }
/// <summary>
/// Min/max of armors (head/chest/rig) inside crate
/// </summary>
[JsonPropertyName("armorPresetCount")]
public required MinMax<int> ArmorPresetCount { get; set; }
/// <summary>
/// Min/max of items inside crate
/// </summary>
[JsonPropertyName("itemCount")]
public required MinMax<int> ItemCount { get; set; }
/// <summary>
/// Min/max of sealed weapon boxes inside crate
/// </summary>
[JsonPropertyName("weaponCrateCount")]
public required MinMax<int> WeaponCrateCount { get; set; }
/// <summary>
/// Items to never allow - tpls
/// </summary>
[JsonPropertyName("itemBlacklist")]
public required List<MongoId> ItemBlacklist { get; set; }
/// <summary>
/// Item type (parentId) to allow inside crate
/// </summary>
[JsonPropertyName("itemTypeWhitelist")]
public required List<MongoId> ItemTypeWhitelist { get; set; }
/// <summary>
/// Item type/ item tpls to limit count of inside crate - key: item base type: value: max count
/// </summary>
[JsonPropertyName("itemLimits")]
public required Dictionary<MongoId, int> ItemLimits { get; set; }
/// <summary>
/// Items to limit stack size of key: item tpl value: min/max stack size
/// </summary>
[JsonPropertyName("itemStackLimits")]
public required Dictionary<MongoId, MinMax<int>> ItemStackLimits { get; set; }
/// <summary>
/// Armor levels to allow inside crate e.g. [4,5,6]
/// </summary>
[JsonPropertyName("armorLevelWhitelist")]
public List<int>? ArmorLevelWhitelist { get; set; }
/// <summary>
/// Should boss items be added to airdrop crate
/// </summary>
[JsonPropertyName("allowBossItems")]
public bool AllowBossItems { get; set; }
[JsonPropertyName("useForcedLoot")]
public bool UseForcedLoot { get; set; }
[JsonPropertyName("forcedLoot")]
public Dictionary<string, MinMax<int>>? ForcedLoot { get; set; }
[JsonPropertyName("useRewardItemBlacklist")]
public bool UseRewardItemBlacklist { get; set; }
[JsonPropertyName("blockSeasonalItemsOutOfSeason")]
public bool BlockSeasonalItemsOutOfSeason { get; set; }
}