Cargo system (#487)

* simple storeship arriving

* pupu

* ship cycling

* buy positions prototypes

* i hate UI

* PriceControl

* second tab ui

* baloon! pallets!

* update shop in town

* setup billboard timer

* split to sell and buy categories

* renaming gaming

* actually selling

* fix infinity selling

* improve timer

* move description too rigt part UI

* bar selling

* iron cabinet

* purge currency categories

* remove town balance, add money box

* special proposal, FTLImmune anchor

* fix UI

* remove tests buying

* Update CP14StoreWindow.xaml.cs

* currency converter

* currency clean up

* Update CP14CargoSystem.cs

* clean up part 2

* rider petpet

* coins audio

* coin improvment

* Update coins.yml

* translate

* more coins roundstart

* Update wallet.yml

* Update wallet.yml

* generate coin problem fix

* refactor proto reading

* fixes

* huh

* shuttle logshit fix, add to tavern map

* Update CP14StationTravelingStoreShipTargetComponent.cs
This commit is contained in:
Ed
2024-10-15 15:22:06 +03:00
committed by GitHub
parent 4425b77c90
commit d259191d3d
93 changed files with 2793 additions and 2241 deletions

View File

@@ -13,7 +13,7 @@ public sealed class CP14CurrencyCollectConditionSystem : EntitySystem
{
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly SharedObjectivesSystem _objectives = default!;
[Dependency] private readonly CP14CurrencySystem _currency = default!;
[Dependency] private readonly CP14SharedCurrencySystem _currency = default!;
private EntityQuery<ContainerManagerComponent> _containerQuery;
@@ -35,7 +35,7 @@ public sealed class CP14CurrencyCollectConditionSystem : EntitySystem
private void OnAfterAssign(Entity<CP14CurrencyCollectConditionComponent> condition, ref ObjectiveAfterAssignEvent args)
{
_metaData.SetEntityName(condition.Owner, Loc.GetString(condition.Comp.ObjectiveText), args.Meta);
_metaData.SetEntityDescription(condition.Owner, Loc.GetString(condition.Comp.ObjectiveDescription, ("coins", _currency.GetPrettyCurrency(condition.Comp.Currency))), args.Meta);
_metaData.SetEntityDescription(condition.Owner, Loc.GetString(condition.Comp.ObjectiveDescription, ("coins", _currency.GetCurrencyPrettyString(condition.Comp.Currency))), args.Meta);
_objectives.SetIcon(condition.Owner, condition.Comp.ObjectiveSprite);
}
@@ -71,7 +71,7 @@ public sealed class CP14CurrencyCollectConditionSystem : EntitySystem
foreach (var entity in container.ContainedEntities)
{
// check if this is the item
count += CheckCurrency(entity, condition);
count += _currency.GetTotalCurrency(entity);
// if it is a container check its contents
if (_containerQuery.TryGetComponent(entity, out var containerManager))
@@ -88,7 +88,7 @@ public sealed class CP14CurrencyCollectConditionSystem : EntitySystem
private void CheckEntity(EntityUid entity, CP14CurrencyCollectConditionComponent condition, ref Stack<ContainerManagerComponent> containerStack, ref int counter)
{
// check if this is the item
counter += CheckCurrency(entity, condition);
counter += _currency.GetTotalCurrency(entity);
//we don't check the inventories of sentient entity
if (!TryComp<MindContainerComponent>(entity, out _))
@@ -98,16 +98,4 @@ public sealed class CP14CurrencyCollectConditionSystem : EntitySystem
containerStack.Push(containerManager);
}
}
private int CheckCurrency(EntityUid entity, CP14CurrencyCollectConditionComponent condition)
{
// check if this is the target
if (!TryComp<CP14CurrencyComponent>(entity, out var target))
return 0;
if (target.Category != condition.Category)
return 0;
return _currency.GetTotalCurrency(entity);
}
}