]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Cargo bounty corrections (#28255)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Tue, 28 May 2024 00:51:50 +0000 (02:51 +0200)
committerGitHub <noreply@github.com>
Tue, 28 May 2024 00:51:50 +0000 (17:51 -0700)
cargo bounty corrections

Content.Server/Cargo/Systems/CargoSystem.Bounty.cs
Content.Shared/Cargo/Prototypes/CargoBountyPrototype.cs
Resources/Prototypes/Catalog/Bounties/bounties.yml
Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/bread.yml
Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/cake.yml
Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/misc.yml
Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml
Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pizza.yml
Resources/Prototypes/Entities/Objects/Consumable/Food/ingredients.yml
Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml
Resources/Prototypes/tags.yml

index e132e4f12a368ee28b055da5a9e9e4d0ddf85e0d..0fcfd160bb3923f8be041a2e37e70673947ed55e 100644 (file)
@@ -11,6 +11,7 @@ using Content.Shared.Cargo.Prototypes;
 using Content.Shared.Database;
 using Content.Shared.NameIdentifier;
 using Content.Shared.Stacks;
+using Content.Shared.Whitelist;
 using JetBrains.Annotations;
 using Robust.Server.Containers;
 using Robust.Shared.Containers;
@@ -23,6 +24,7 @@ public sealed partial class CargoSystem
 {
     [Dependency] private readonly ContainerSystem _container = default!;
     [Dependency] private readonly NameIdentifierSystem _nameIdentifier = default!;
+    [Dependency] private readonly EntityWhitelistSystem _whitelistSys = default!;
 
     [ValidatePrototypeId<NameIdentifierGroupPrototype>]
     private const string BountyNameIdentifierGroup = "Bounty";
@@ -311,7 +313,7 @@ public sealed partial class CargoSystem
             var temp = new HashSet<EntityUid>();
             foreach (var entity in entities)
             {
-                if (!entry.Whitelist.IsValid(entity, EntityManager))
+                if (!_whitelistSys.IsValid(entry.Whitelist, entity) || (entry.Blacklist != null && _whitelistSys.IsValid(entry.Blacklist, entity)))
                     continue;
 
                 count += _stackQuery.CompOrNull(entity)?.Count ?? 1;
index bf4907b0dd4b9b838afdee934ab624282c5f04a1..b40b03672eff55c4fa00ac4db4e5d71a3b7d5725 100644 (file)
@@ -31,7 +31,7 @@ public sealed partial class CargoBountyPrototype : IPrototype
     /// <summary>
     /// The entries that must be satisfied for the cargo bounty to be complete.
     /// </summary>
-    [DataField( required: true)]
+    [DataField(required: true)]
     public List<CargoBountyItemEntry> Entries = new();
 
     /// <summary>
@@ -50,6 +50,12 @@ public readonly partial record struct CargoBountyItemEntry()
     [DataField(required: true)]
     public EntityWhitelist Whitelist { get; init; } = default!;
 
+    /// <summary>
+    /// A blacklist that can be used to exclude items in the whitelist.
+    /// </summary>
+    [DataField]
+    public EntityWhitelist? Blacklist { get; init; } = null;
+
     // todo: implement some kind of simple generic condition system
 
     /// <summary>
index 3c1bd02fcfc48250b1cb4352bbdc9a5498e628ab..bedfe442872eeb9876ac05666eb9b7112d1fe615 100644 (file)
     whitelist:
       tags:
       - Pie
+    blacklist:
+      tags:
+      - Slice
 
 - type: cargoBounty
   id: BountyPrisonUniform
     whitelist:
       tags:
       - Fruit
+    blacklist:
+      tags:
+      - Slice
+      - Cake
+      - Pie
+      - Bread
 
 - type: cargoBounty
   id: BountyVegetable
     whitelist:
       tags:
       - Vegetable
+    blacklist:
+      tags:
+      - Slice
+      - Cake
+      - Pie
+      - Bread
 
 - type: cargoBounty
   id: BountyChili
index 7600882925a5a1d0db97d765c9a1d6086cc55d76..12a6e2a246b3a393116f1f123e4bb2acdac32ea1 100644 (file)
@@ -34,7 +34,9 @@
     flavors:
       - bread
   - type: Tag
-    tags: [] #override bread
+    tags:
+    - Bread
+    - Slice
   - type: SolutionContainerManager
     solutions:
       food:
   - type: Tag
     tags:
     - Fruit
+    - Bread
+    - Slice
 
 - type: entity
   name: cornbread
   - type: Tag
     tags:
     - Meat
+    - Bread
+    - Slice
 
 - type: entity
   name: mimana bread
   - type: Tag
     tags:
     - Meat
+    - Bread
+    - Slice
 
 - type: entity
   name: spider meat bread
   - type: Tag
     tags:
     - Meat
+    - Bread
+    - Slice
 
 - type: entity
   name: tofu bread
   - type: Tag
     tags:
     - Meat
+    - Bread
+    - Slice
 
 # Other than bread/slices
 
   id: FoodBreadBaguette
   description: Bon appétit!
   components:
-  - type: Tag
-    tags:
-    - Baguette
   - type: Sprite
     state: baguette
   - type: SliceableFood
     tags:
     - VimPilot
     - DoorBumpOpener
+    - Bread
   - type: CanEscapeInventory
     baseResistTime: 2
   - type: Puller
index c939dec52c67860da70ee31a43a382cd99feabeb..922d49388850d791635e9a6764ea2c09eedc775c 100644 (file)
@@ -23,6 +23,9 @@
           Quantity: 5
   - type: Item
     size: Normal
+  - type: Tag
+    tags:
+    - Cake
 
 - type: entity
   parent: FoodCakeBase
           Quantity: 1
   - type: Item
     size: Tiny
+  - type: Tag
+    tags:
+    - Cake
+    - Slice
 
 # Custom Cake Example
 
@@ -63,6 +70,7 @@
     slice: FoodCakeBlueberrySlice
   - type: Tag
     tags:
+    - Cake
     - Fruit
 
 - type: entity
@@ -78,7 +86,9 @@
       color: blue
   - type: Tag
     tags:
+    - Cake
     - Fruit
+    - Slice
 
 # Cake
 
     slice: FoodCakeOrangeSlice
   - type: Tag
     tags:
+    - Cake
     - Fruit
 
 - type: entity
     state: orange-slice
   - type: Tag
     tags:
+    - Cake
     - Fruit
+    - Slice
 # Tastes like sweetness, cake, oranges.
 
 - type: entity
     slice: FoodCakeLimeSlice
   - type: Tag
     tags:
+    - Cake
     - Fruit
 
 - type: entity
     state: lime-slice
   - type: Tag
     tags:
+    - Cake
     - Fruit
+    - Slice
 # Tastes like sweetness, cake, limes.
 
 - type: entity
     slice: FoodCakeLemonSlice
   - type: Tag
     tags:
+    - Cake
     - Fruit
 
 - type: entity
     state: lemon-slice
   - type: Tag
     tags:
+    - Cake
     - Fruit
+    - Slice
 # Tastes like sweetness, cake, lemons.
 
 - type: entity
           Quantity: 5
   - type: Tag
     tags:
+    - Cake
     - Fruit
 
 - type: entity
           Quantity: 1
   - type: Tag
     tags:
+    - Cake
     - Fruit
+    - Slice
 
 - type: entity
   name: chocolate cake
     slice: FoodCakeAppleSlice
   - type: Tag
     tags:
+    - Cake
     - Fruit
 
 - type: entity
     state: apple-slice
   - type: Tag
     tags:
+    - Cake
     - Fruit
+    - Slice
 # Tastes like sweetness, cake, slime.
 
 - type: entity
           Quantity: 11
   - type: Tag
     tags:
+    - Cake
     - Fruit
 
 - type: entity
           Quantity: 2.2
   - type: Tag
     tags:
+    - Cake
     - Fruit
+    - Slice
 # Tastes like sweetness, cake, pumpkin.
 
 - type: entity
     tags:
     - VimPilot
     - DoorBumpOpener
+    - Cake
   - type: CanEscapeInventory
     baseResistTime: 2
   - type: Puller
     color: "#FFFF00"
     radius: 1.4
     energy: 1.4
+  - type: Tag
+    tags:
+    - Slice
index b1bbdfb530551cf6fc67999410128382cdccbbbe..fde181d8b9b20858e3d149c4b916773fc2a79d48 100644 (file)
 
 # Nuggets
 
-- type: Tag
-  id: Nugget
-
 - type: entity
   name: chicken nugget
   parent: FoodBakedBase
           Quantity: 5
         - ReagentId: Theobromine
           Quantity: 3
+  - type: Tag
+    tags:
+    - Slice
 
 - type: entity
   name: special brownies
           Quantity: 3
         - ReagentId: THC
           Quantity: 25
+  - type: Tag
+    tags:
+    - Slice
 
 - type: entity
   name: onion rings
index 8cd1c5dfab677f6eaed2504f2b39dbdcff60a7fb..f97d87a9c5031aad5d47b72e750e0bcfd88bba09 100644 (file)
           Quantity: 1.2
         - ReagentId: Vitamin
           Quantity: 1
+  - type: Tag
+    tags:
+    - Pie
+    - Slice
 
 # Pie
 
@@ -94,6 +98,7 @@
     tags:
     - Fruit
     - Pie
+    - Slice
 # Tastes like pie, apple.
 
 - type: entity
     tags:
     - Fruit
     - Pie
+    - Slice
 # Tastes like pie, cream, banana.
 
 - type: entity
     tags:
     - Fruit
     - Pie
+    - Slice
 # Tastes like pie, blackberries.
 
 - type: entity
     tags:
     - Fruit
     - Pie
+    - Slice
 # Tastes like pie, cherries.
 
 - type: entity
     tags:
     - Meat
     - Pie
+    - Slice
 # Tastes like pie, meat.
 
 - type: entity
     tags:
     - Meat
     - Pie
+    - Slice
 # Tastes like pie, meat, acid.
 
 - type: entity
index bdce1d440861088d21dcef0be5716e831e1edb24..154f34063c81ba30e18e8d74e7cab86573534548 100644 (file)
@@ -59,6 +59,7 @@
     tags:
     - Pizza
     - ReptilianFood
+    - Slice
 
 # Pizza
 
     tags:
     - Meat
     - Pizza
+    - Slice
 # Tastes like crust, tomato, cheese, meat.
 
 - type: entity
     tags:
     - Meat
     - Pizza
+    - Slice
 # Tastes like crust, tomato, cheese, meat, laziness.
 
 - type: entity
     tags:
     - Meat
     - Pizza
+    - Slice
 # Tastes like crust, tomato, cheese, sausage, sass.
 
 - type: entity
     - state: pineapple
   - type: SliceableFood
     slice: FoodPizzaPineappleSlice
+  - type: Tag
+    tags:
+    - Meat
+    - Pizza
 
 - type: entity
-  name: slice of pineapple pizza
+  name: slice of Hawaiian pizza
   parent: FoodPizzaSliceBase
   id: FoodPizzaPineappleSlice
   description: A slice of joy/sin.
     tags:
     - Meat
     - Pizza
+    - Slice
 # Tastes like crust, tomato, cheese, pineapple, ham.
 
 #TODO: This is a meme pizza from /tg/. It has specially coded mechanics.
     tags:
     - Meat
     - Pizza
+    - Slice
 # Tastes like crust, tomato, cheese, pepperoni, 9 millimeter bullets.
 
 #TODO: Make this do poison damage and make cut pizza slices eventually rot into this.
index 1df6615a9fbd3cf13a89d785b306339a3aa3a408..dcf2f3355ce7e7e3be1047875ecd30254d61aca6 100644 (file)
       - dough
   - type: Sprite
     state: dough-slice
+  - type: Tag
+    tags:
+    - Slice
 
 - type: entity
   name: cornmeal dough
       - dough
   - type: Sprite
     state: cornmealdough-slice
+  - type: Tag
+    tags:
+    - Slice
 
 - type: entity
   name: tortilla dough
   - type: Construction
     graph: Tortilla
     node: start
+  - type: Tag
+    tags:
+    - Slice
 
 - type: entity
   name: flattened tortilla dough
         reagents:
         - ReagentId: Nutriment
           Quantity: 5
+  - type: Tag
+    tags:
+    - Slice
 
 - type: entity
   name: chèvre log
           Quantity: 1
         - ReagentId: Vitamin
           Quantity: 0.2
+  - type: Tag
+    tags:
+    - Slice
 
 - type: entity
   name: tofu
           Quantity: 3
         - ReagentId: Nutriment
           Quantity: 2
+  - type: Tag
+    tags:
+    - Slice
 
 - type: entity
   name: burned mess
index 888e4e4e3530c22535debe38de368980af1eefec..a74e3450e94038979700b774d3cc2a91e63e25dc 100644 (file)
     state: slice
   - type: Extractable
     grindableSolutionName: food
+  - type: Tag
+    tags:
+    - Slice
 
 - type: entity
   name: pineapple slice
   - type: Tag
     tags:
     - Fruit
+    - Slice
 
 - type: entity
   name: onion slice
           Quantity: 1
         - ReagentId: Vitamin
           Quantity: 1
+  - type: Tag
+    tags:
+    - Vegetable
+    - Slice
 
 - type: entity
   name: red onion slice
           Quantity: 1
         - ReagentId: Vitamin
           Quantity: 1
+  - type: Tag
+    tags:
+    - Vegetable
+    - Slice
 
 - type: entity
   name: chili pepper
   - type: Tag
     tags:
     - Fruit
+    - Slice
 
 - type: entity
   name: grapes
index 253aa485653ee067298898869082fd93fb5efe11..439ad47c0f803dd43fe88f0c584db43d1378d025 100644 (file)
@@ -27,9 +27,6 @@
 - type: Tag
   id: ATVKeys
 
-- type: Tag
-  id: Baguette
-
 - type: Tag
   id: Balloon
 
 - type: Tag
   id: CableCoil
 
+- type: Tag
+  id: Cake
+
 - type: Tag
   id: CaneBlade
 
 - type: Tag
   id: NozzleBackTank
 
+- type: Tag
+  id: Nugget # for chicken nuggets
+
 - type: Tag
   id: NukeOpsUplink
 
 - type: Tag
   id: Skewer
 
+- type: Tag
+  id: Slice # sliced fruit, vegetables, pizza etc.
+
 - type: Tag
   id: SmallAIChip