2020-12-24 13:42:40 +00:00
|
|
|
#nullable enable
|
2019-11-17 11:18:39 -05:00
|
|
|
using System.Collections.Generic;
|
2021-03-05 01:08:38 +01:00
|
|
|
using Content.Shared.Preferences;
|
2019-11-17 11:18:39 -05:00
|
|
|
using Robust.Shared.Prototypes;
|
2021-03-05 01:08:38 +01:00
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
2019-11-17 11:18:39 -05:00
|
|
|
using Robust.Shared.ViewVariables;
|
2020-01-20 09:20:36 +01:00
|
|
|
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
|
2019-11-17 11:18:39 -05:00
|
|
|
|
2020-08-13 14:40:27 +02:00
|
|
|
namespace Content.Shared.Roles
|
2019-11-17 11:18:39 -05:00
|
|
|
{
|
|
|
|
|
[Prototype("startingGear")]
|
2021-02-20 00:05:24 +01:00
|
|
|
public class StartingGearPrototype : IPrototype
|
2019-11-17 11:18:39 -05:00
|
|
|
{
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("equipment")] private Dictionary<Slots, string> _equipment = new();
|
2020-12-24 13:42:40 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// if empty, there is no skirt override - instead the uniform provided in equipment is added.
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("innerclothingskirt")]
|
2020-12-24 13:42:40 +00:00
|
|
|
private string _innerClothingSkirt = default!;
|
2021-03-05 01:08:38 +01:00
|
|
|
|
|
|
|
|
[DataField("satchel")]
|
|
|
|
|
private string _satchel = string.Empty;
|
|
|
|
|
|
|
|
|
|
[DataField("duffelbag")]
|
|
|
|
|
private string _duffelbag = string.Empty;
|
2019-11-17 11:18:39 -05:00
|
|
|
|
2020-06-22 06:37:03 +10:00
|
|
|
public IReadOnlyDictionary<string, string> Inhand => _inHand;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// hand index, item prototype
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("inhand")]
|
|
|
|
|
private Dictionary<string, string> _inHand = new(0);
|
2020-01-20 09:20:36 +01:00
|
|
|
|
2021-03-05 01:08:38 +01:00
|
|
|
[ViewVariables]
|
|
|
|
|
[field: DataField("id", required: true)]
|
|
|
|
|
public string ID { get; } = default!;
|
2020-12-24 13:42:40 +00:00
|
|
|
|
|
|
|
|
public string GetGear(Slots slot, HumanoidCharacterProfile? profile)
|
|
|
|
|
{
|
|
|
|
|
if (profile != null)
|
|
|
|
|
{
|
|
|
|
|
if ((slot == Slots.INNERCLOTHING) && (profile.Clothing == ClothingPreference.Jumpskirt) && (_innerClothingSkirt != ""))
|
|
|
|
|
return _innerClothingSkirt;
|
2021-01-03 15:22:14 +00:00
|
|
|
if ((slot == Slots.BACKPACK) && (profile.Backpack == BackpackPreference.Satchel) && (_satchel != ""))
|
|
|
|
|
return _satchel;
|
|
|
|
|
if ((slot == Slots.BACKPACK) && (profile.Backpack == BackpackPreference.Duffelbag) && (_duffelbag != ""))
|
|
|
|
|
return _duffelbag;
|
2020-12-24 13:42:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_equipment.ContainsKey(slot))
|
|
|
|
|
{
|
|
|
|
|
return _equipment[slot];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return "";
|
|
|
|
|
}
|
2019-11-17 11:18:39 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|