17 [Serialize(
TransactionType.Purchased, IsPropertySaveable.Yes, description:
"Do the items need to have been purchased or sold?")]
20 [Serialize(
"", IsPropertySaveable.Yes, description:
"Identifier of the item that must have been purchased or sold.")]
23 [Serialize(
"", IsPropertySaveable.Yes, description:
"Tag of the item that must have been purchased or sold.")]
26 [Serialize(1, IsPropertySaveable.Yes, description:
"Minimum number of matching items that must have been purchased or sold.")]
40 if (GameMain.GameSession?.Campaign?.CargoManager is not CargoManager cargoManager)
46 int totalPurchased = 0;
47 foreach ((Identifier
id, var items) in cargoManager.PurchasedItems)
51 totalPurchased += items.Find(i => i.ItemPrefabIdentifier ==
ItemIdentifier)?.Quantity ?? 0;
55 foreach (var item
in items)
57 if (item.ItemPrefab.Tags.Contains(
ItemTag))
59 totalPurchased += item.Quantity;
72 foreach ((Identifier
id, var items) in cargoManager.SoldItems)
76 totalSold += items.Count(i => i.ItemPrefab.Identifier ==
ItemIdentifier);
80 totalSold += items.Count(i => i.ItemPrefab.Tags.Contains(
ItemTag));
Check whether specific kinds of items have been purchased or sold during the round.
Identifier ItemIdentifier
override? bool DetermineSuccess()
CheckPurchasedItemsAction(ScriptedEvent parentEvent, ContentXElement element)