Airship + Unittest (#496)
* wings * update cargo shuttle * update goblin sound * add new unit test * Update CP14EntityTest.cs * Update CP14RitualTest.cs * add buy and sell hints * paper reading * hardwork * clean task * body forkfiltered * Update crystal.yml * more fork flitered * Update basic.yml * Update wild.yml * Update CP14EntityTest.cs * realise pusharing * pusharing alchemical vials * coin disappear works * Fix
This commit is contained in:
@@ -37,11 +37,16 @@ public partial class CP14SharedCurrencySystem : EntitySystem
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public int GetTotalCurrency(EntityUid uid, CP14CurrencyComponent? currency = null)
|
||||
public int GetTotalCurrency(EntityUid uid)
|
||||
{
|
||||
if (!Resolve(uid, ref currency))
|
||||
if (!TryComp<CP14CurrencyComponent>(uid, out var currency))
|
||||
return 0;
|
||||
|
||||
return GetTotalCurrency(uid, currency);
|
||||
}
|
||||
|
||||
public int GetTotalCurrency(EntityUid uid, CP14CurrencyComponent currency)
|
||||
{
|
||||
var total = currency.Currency;
|
||||
|
||||
if (TryComp<StackComponent>(uid, out var stack))
|
||||
|
||||
@@ -12,35 +12,44 @@ namespace Content.Shared._CP14.TravelingStoreShip;
|
||||
public sealed partial class CP14StationTravelingStoreShipTargetComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public EntityUid Shuttle;
|
||||
public EntityUid? Shuttle;
|
||||
|
||||
[DataField]
|
||||
public EntityUid TradePostMap;
|
||||
public EntityUid? TradePostMap;
|
||||
|
||||
[DataField]
|
||||
public bool OnStation;
|
||||
|
||||
[DataField]
|
||||
public ResPath ShuttlePath = new("/Maps/_CP14/Ships/balloon.yml");
|
||||
public ResPath ShuttlePath = new("/Maps/_CP14/Ships/cargo_shuttle.yml");
|
||||
|
||||
[DataField]
|
||||
public TimeSpan NextTravelTime = TimeSpan.Zero;
|
||||
|
||||
[DataField]
|
||||
public TimeSpan StationWaitTime = TimeSpan.FromMinutes(6);
|
||||
public TimeSpan StationWaitTime = TimeSpan.FromMinutes(1);
|
||||
|
||||
[DataField]
|
||||
public TimeSpan TradePostWaitTime = TimeSpan.FromMinutes(4);
|
||||
public TimeSpan TradePostWaitTime = TimeSpan.FromMinutes(1);
|
||||
|
||||
[DataField]
|
||||
public Dictionary<ProtoId<CP14StoreBuyPositionPrototype>, int> CurrentBuyPositions = new(); //Proto, price
|
||||
public Dictionary<CP14StoreBuyPositionPrototype, int> CurrentBuyPositions = new(); //Proto, price
|
||||
|
||||
[DataField]
|
||||
public MinMax SpecialBuyPositionCount = new(1, 2);
|
||||
|
||||
[DataField]
|
||||
public Dictionary<ProtoId<CP14StoreSellPositionPrototype>, int> CurrentSellPositions = new(); //Proto, price
|
||||
public Dictionary<CP14StoreSellPositionPrototype, int> CurrentSellPositions = new(); //Proto, price
|
||||
|
||||
[DataField]
|
||||
public MinMax SpecialSellPositionCount = new(1, 2);
|
||||
|
||||
[DataField]
|
||||
public int Balance = 0;
|
||||
|
||||
/// <summary>
|
||||
/// a queue of purchased items. The oldest purchases are taken out one by one to be unloaded onto the ship
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Queue<KeyValuePair<CP14StoreBuyPositionPrototype, int>> BuyedQueue = new();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,12 @@ public sealed partial class CP14StoreBuyPositionPrototype : IPrototype
|
||||
[DataField(required: true)]
|
||||
public LocId Name = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// a unique code that can be used to purchase items.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public string Code = string.Empty;
|
||||
|
||||
[DataField]
|
||||
public LocId Desc = string.Empty;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user