Cargo bounty corrections (#28255)

cargo bounty corrections
This commit is contained in:
slarticodefast
2024-05-28 02:51:50 +02:00
committed by GitHub
parent b95df6530d
commit c740fbc68c
11 changed files with 138 additions and 13 deletions

View File

@@ -11,6 +11,7 @@ using Content.Shared.Cargo.Prototypes;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.NameIdentifier; using Content.Shared.NameIdentifier;
using Content.Shared.Stacks; using Content.Shared.Stacks;
using Content.Shared.Whitelist;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Server.Containers; using Robust.Server.Containers;
using Robust.Shared.Containers; using Robust.Shared.Containers;
@@ -23,6 +24,7 @@ public sealed partial class CargoSystem
{ {
[Dependency] private readonly ContainerSystem _container = default!; [Dependency] private readonly ContainerSystem _container = default!;
[Dependency] private readonly NameIdentifierSystem _nameIdentifier = default!; [Dependency] private readonly NameIdentifierSystem _nameIdentifier = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelistSys = default!;
[ValidatePrototypeId<NameIdentifierGroupPrototype>] [ValidatePrototypeId<NameIdentifierGroupPrototype>]
private const string BountyNameIdentifierGroup = "Bounty"; private const string BountyNameIdentifierGroup = "Bounty";
@@ -311,7 +313,7 @@ public sealed partial class CargoSystem
var temp = new HashSet<EntityUid>(); var temp = new HashSet<EntityUid>();
foreach (var entity in entities) 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; continue;
count += _stackQuery.CompOrNull(entity)?.Count ?? 1; count += _stackQuery.CompOrNull(entity)?.Count ?? 1;

View File

@@ -31,7 +31,7 @@ public sealed partial class CargoBountyPrototype : IPrototype
/// <summary> /// <summary>
/// The entries that must be satisfied for the cargo bounty to be complete. /// The entries that must be satisfied for the cargo bounty to be complete.
/// </summary> /// </summary>
[DataField( required: true)] [DataField(required: true)]
public List<CargoBountyItemEntry> Entries = new(); public List<CargoBountyItemEntry> Entries = new();
/// <summary> /// <summary>
@@ -50,6 +50,12 @@ public readonly partial record struct CargoBountyItemEntry()
[DataField(required: true)] [DataField(required: true)]
public EntityWhitelist Whitelist { get; init; } = default!; 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 // todo: implement some kind of simple generic condition system
/// <summary> /// <summary>

View File

@@ -309,6 +309,9 @@
whitelist: whitelist:
tags: tags:
- Pie - Pie
blacklist:
tags:
- Slice
- type: cargoBounty - type: cargoBounty
id: BountyPrisonUniform id: BountyPrisonUniform
@@ -541,6 +544,12 @@
whitelist: whitelist:
tags: tags:
- Fruit - Fruit
blacklist:
tags:
- Slice
- Cake
- Pie
- Bread
- type: cargoBounty - type: cargoBounty
id: BountyVegetable id: BountyVegetable
@@ -552,6 +561,12 @@
whitelist: whitelist:
tags: tags:
- Vegetable - Vegetable
blacklist:
tags:
- Slice
- Cake
- Pie
- Bread
- type: cargoBounty - type: cargoBounty
id: BountyChili id: BountyChili

View File

@@ -34,7 +34,9 @@
flavors: flavors:
- bread - bread
- type: Tag - type: Tag
tags: [] #override bread tags:
- Bread
- Slice
- type: SolutionContainerManager - type: SolutionContainerManager
solutions: solutions:
food: food:
@@ -116,6 +118,8 @@
- type: Tag - type: Tag
tags: tags:
- Fruit - Fruit
- Bread
- Slice
- type: entity - type: entity
name: cornbread name: cornbread
@@ -274,6 +278,8 @@
- type: Tag - type: Tag
tags: tags:
- Meat - Meat
- Bread
- Slice
- type: entity - type: entity
name: mimana bread name: mimana bread
@@ -418,6 +424,8 @@
- type: Tag - type: Tag
tags: tags:
- Meat - Meat
- Bread
- Slice
- type: entity - type: entity
name: spider meat bread name: spider meat bread
@@ -476,6 +484,8 @@
- type: Tag - type: Tag
tags: tags:
- Meat - Meat
- Bread
- Slice
- type: entity - type: entity
name: tofu bread name: tofu bread
@@ -585,6 +595,8 @@
- type: Tag - type: Tag
tags: tags:
- Meat - Meat
- Bread
- Slice
# Other than bread/slices # Other than bread/slices
@@ -594,9 +606,6 @@
id: FoodBreadBaguette id: FoodBreadBaguette
description: Bon appétit! description: Bon appétit!
components: components:
- type: Tag
tags:
- Baguette
- type: Sprite - type: Sprite
state: baguette state: baguette
- type: SliceableFood - type: SliceableFood
@@ -824,6 +833,7 @@
tags: tags:
- VimPilot - VimPilot
- DoorBumpOpener - DoorBumpOpener
- Bread
- type: CanEscapeInventory - type: CanEscapeInventory
baseResistTime: 2 baseResistTime: 2
- type: Puller - type: Puller

View File

@@ -23,6 +23,9 @@
Quantity: 5 Quantity: 5
- type: Item - type: Item
size: Normal size: Normal
- type: Tag
tags:
- Cake
- type: entity - type: entity
parent: FoodCakeBase parent: FoodCakeBase
@@ -45,6 +48,10 @@
Quantity: 1 Quantity: 1
- type: Item - type: Item
size: Tiny size: Tiny
- type: Tag
tags:
- Cake
- Slice
# Custom Cake Example # Custom Cake Example
@@ -63,6 +70,7 @@
slice: FoodCakeBlueberrySlice slice: FoodCakeBlueberrySlice
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- type: entity - type: entity
@@ -78,7 +86,9 @@
color: blue color: blue
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- Slice
# Cake # Cake
@@ -203,6 +213,7 @@
slice: FoodCakeOrangeSlice slice: FoodCakeOrangeSlice
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- type: entity - type: entity
@@ -214,7 +225,9 @@
state: orange-slice state: orange-slice
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- Slice
# Tastes like sweetness, cake, oranges. # Tastes like sweetness, cake, oranges.
- type: entity - type: entity
@@ -229,6 +242,7 @@
slice: FoodCakeLimeSlice slice: FoodCakeLimeSlice
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- type: entity - type: entity
@@ -240,7 +254,9 @@
state: lime-slice state: lime-slice
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- Slice
# Tastes like sweetness, cake, limes. # Tastes like sweetness, cake, limes.
- type: entity - type: entity
@@ -255,6 +271,7 @@
slice: FoodCakeLemonSlice slice: FoodCakeLemonSlice
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- type: entity - type: entity
@@ -266,7 +283,9 @@
state: lemon-slice state: lemon-slice
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- Slice
# Tastes like sweetness, cake, lemons. # Tastes like sweetness, cake, lemons.
- type: entity - type: entity
@@ -296,6 +315,7 @@
Quantity: 5 Quantity: 5
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- type: entity - type: entity
@@ -323,7 +343,9 @@
Quantity: 1 Quantity: 1
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- Slice
- type: entity - type: entity
name: chocolate cake name: chocolate cake
@@ -379,6 +401,7 @@
slice: FoodCakeAppleSlice slice: FoodCakeAppleSlice
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- type: entity - type: entity
@@ -391,7 +414,9 @@
state: apple-slice state: apple-slice
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- Slice
# Tastes like sweetness, cake, slime. # Tastes like sweetness, cake, slime.
- type: entity - type: entity
@@ -436,6 +461,7 @@
Quantity: 11 Quantity: 11
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- type: entity - type: entity
@@ -457,7 +483,9 @@
Quantity: 2.2 Quantity: 2.2
- type: Tag - type: Tag
tags: tags:
- Cake
- Fruit - Fruit
- Slice
# Tastes like sweetness, cake, pumpkin. # Tastes like sweetness, cake, pumpkin.
- type: entity - type: entity
@@ -686,6 +714,7 @@
tags: tags:
- VimPilot - VimPilot
- DoorBumpOpener - DoorBumpOpener
- Cake
- type: CanEscapeInventory - type: CanEscapeInventory
baseResistTime: 2 baseResistTime: 2
- type: Puller - type: Puller
@@ -752,3 +781,6 @@
color: "#FFFF00" color: "#FFFF00"
radius: 1.4 radius: 1.4
energy: 1.4 energy: 1.4
- type: Tag
tags:
- Slice

View File

@@ -163,9 +163,6 @@
# Nuggets # Nuggets
- type: Tag
id: Nugget
- type: entity - type: entity
name: chicken nugget name: chicken nugget
parent: FoodBakedBase parent: FoodBakedBase
@@ -530,6 +527,9 @@
Quantity: 5 Quantity: 5
- ReagentId: Theobromine - ReagentId: Theobromine
Quantity: 3 Quantity: 3
- type: Tag
tags:
- Slice
- type: entity - type: entity
name: special brownies name: special brownies
@@ -585,6 +585,9 @@
Quantity: 3 Quantity: 3
- ReagentId: THC - ReagentId: THC
Quantity: 25 Quantity: 25
- type: Tag
tags:
- Slice
- type: entity - type: entity
name: onion rings name: onion rings

View File

@@ -52,6 +52,10 @@
Quantity: 1.2 Quantity: 1.2
- ReagentId: Vitamin - ReagentId: Vitamin
Quantity: 1 Quantity: 1
- type: Tag
tags:
- Pie
- Slice
# Pie # Pie
@@ -94,6 +98,7 @@
tags: tags:
- Fruit - Fruit
- Pie - Pie
- Slice
# Tastes like pie, apple. # Tastes like pie, apple.
- type: entity - type: entity
@@ -182,6 +187,7 @@
tags: tags:
- Fruit - Fruit
- Pie - Pie
- Slice
# Tastes like pie, cream, banana. # Tastes like pie, cream, banana.
- type: entity - type: entity
@@ -224,6 +230,7 @@
tags: tags:
- Fruit - Fruit
- Pie - Pie
- Slice
# Tastes like pie, blackberries. # Tastes like pie, blackberries.
- type: entity - type: entity
@@ -263,6 +270,7 @@
tags: tags:
- Fruit - Fruit
- Pie - Pie
- Slice
# Tastes like pie, cherries. # Tastes like pie, cherries.
- type: entity - type: entity
@@ -302,6 +310,7 @@
tags: tags:
- Meat - Meat
- Pie - Pie
- Slice
# Tastes like pie, meat. # Tastes like pie, meat.
- type: entity - type: entity
@@ -342,6 +351,7 @@
tags: tags:
- Meat - Meat
- Pie - Pie
- Slice
# Tastes like pie, meat, acid. # Tastes like pie, meat, acid.
- type: entity - type: entity

View File

@@ -59,6 +59,7 @@
tags: tags:
- Pizza - Pizza
- ReptilianFood - ReptilianFood
- Slice
# Pizza # Pizza
@@ -135,6 +136,7 @@
tags: tags:
- Meat - Meat
- Pizza - Pizza
- Slice
# Tastes like crust, tomato, cheese, meat. # Tastes like crust, tomato, cheese, meat.
- type: entity - type: entity
@@ -291,6 +293,7 @@
tags: tags:
- Meat - Meat
- Pizza - Pizza
- Slice
# Tastes like crust, tomato, cheese, meat, laziness. # Tastes like crust, tomato, cheese, meat, laziness.
- type: entity - type: entity
@@ -391,6 +394,7 @@
tags: tags:
- Meat - Meat
- Pizza - Pizza
- Slice
# Tastes like crust, tomato, cheese, sausage, sass. # Tastes like crust, tomato, cheese, sausage, sass.
- type: entity - type: entity
@@ -411,9 +415,13 @@
- state: pineapple - state: pineapple
- type: SliceableFood - type: SliceableFood
slice: FoodPizzaPineappleSlice slice: FoodPizzaPineappleSlice
- type: Tag
tags:
- Meat
- Pizza
- type: entity - type: entity
name: slice of pineapple pizza name: slice of Hawaiian pizza
parent: FoodPizzaSliceBase parent: FoodPizzaSliceBase
id: FoodPizzaPineappleSlice id: FoodPizzaPineappleSlice
description: A slice of joy/sin. description: A slice of joy/sin.
@@ -432,6 +440,7 @@
tags: tags:
- Meat - Meat
- Pizza - Pizza
- Slice
# Tastes like crust, tomato, cheese, pineapple, ham. # Tastes like crust, tomato, cheese, pineapple, ham.
#TODO: This is a meme pizza from /tg/. It has specially coded mechanics. #TODO: This is a meme pizza from /tg/. It has specially coded mechanics.
@@ -504,6 +513,7 @@
tags: tags:
- Meat - Meat
- Pizza - Pizza
- Slice
# Tastes like crust, tomato, cheese, pepperoni, 9 millimeter bullets. # Tastes like crust, tomato, cheese, pepperoni, 9 millimeter bullets.
#TODO: Make this do poison damage and make cut pizza slices eventually rot into this. #TODO: Make this do poison damage and make cut pizza slices eventually rot into this.

View File

@@ -302,6 +302,9 @@
- dough - dough
- type: Sprite - type: Sprite
state: dough-slice state: dough-slice
- type: Tag
tags:
- Slice
- type: entity - type: entity
name: cornmeal dough name: cornmeal dough
@@ -331,6 +334,9 @@
- dough - dough
- type: Sprite - type: Sprite
state: cornmealdough-slice state: cornmealdough-slice
- type: Tag
tags:
- Slice
- type: entity - type: entity
name: tortilla dough name: tortilla dough
@@ -363,6 +369,9 @@
- type: Construction - type: Construction
graph: Tortilla graph: Tortilla
node: start node: start
- type: Tag
tags:
- Slice
- type: entity - type: entity
name: flattened tortilla dough name: flattened tortilla dough
@@ -503,6 +512,9 @@
reagents: reagents:
- ReagentId: Nutriment - ReagentId: Nutriment
Quantity: 5 Quantity: 5
- type: Tag
tags:
- Slice
- type: entity - type: entity
name: chèvre log name: chèvre log
@@ -550,6 +562,9 @@
Quantity: 1 Quantity: 1
- ReagentId: Vitamin - ReagentId: Vitamin
Quantity: 0.2 Quantity: 0.2
- type: Tag
tags:
- Slice
- type: entity - type: entity
name: tofu name: tofu
@@ -595,6 +610,9 @@
Quantity: 3 Quantity: 3
- ReagentId: Nutriment - ReagentId: Nutriment
Quantity: 2 Quantity: 2
- type: Tag
tags:
- Slice
- type: entity - type: entity
name: burned mess name: burned mess

View File

@@ -1065,6 +1065,9 @@
state: slice state: slice
- type: Extractable - type: Extractable
grindableSolutionName: food grindableSolutionName: food
- type: Tag
tags:
- Slice
- type: entity - type: entity
name: pineapple slice name: pineapple slice
@@ -1085,6 +1088,7 @@
- type: Tag - type: Tag
tags: tags:
- Fruit - Fruit
- Slice
- type: entity - type: entity
name: onion slice name: onion slice
@@ -1108,6 +1112,10 @@
Quantity: 1 Quantity: 1
- ReagentId: Vitamin - ReagentId: Vitamin
Quantity: 1 Quantity: 1
- type: Tag
tags:
- Vegetable
- Slice
- type: entity - type: entity
name: red onion slice name: red onion slice
@@ -1131,6 +1139,10 @@
Quantity: 1 Quantity: 1
- ReagentId: Vitamin - ReagentId: Vitamin
Quantity: 1 Quantity: 1
- type: Tag
tags:
- Vegetable
- Slice
- type: entity - type: entity
name: chili pepper name: chili pepper
@@ -1650,6 +1662,7 @@
- type: Tag - type: Tag
tags: tags:
- Fruit - Fruit
- Slice
- type: entity - type: entity
name: grapes name: grapes

View File

@@ -27,9 +27,6 @@
- type: Tag - type: Tag
id: ATVKeys id: ATVKeys
- type: Tag
id: Baguette
- type: Tag - type: Tag
id: Balloon id: Balloon
@@ -258,6 +255,9 @@
- type: Tag - type: Tag
id: CableCoil id: CableCoil
- type: Tag
id: Cake
- type: Tag - type: Tag
id: CaneBlade id: CaneBlade
@@ -926,6 +926,9 @@
- type: Tag - type: Tag
id: NozzleBackTank id: NozzleBackTank
- type: Tag
id: Nugget # for chicken nuggets
- type: Tag - type: Tag
id: NukeOpsUplink id: NukeOpsUplink
@@ -1122,6 +1125,9 @@
- type: Tag - type: Tag
id: Skewer id: Skewer
- type: Tag
id: Slice # sliced fruit, vegetables, pizza etc.
- type: Tag - type: Tag
id: SmallAIChip id: SmallAIChip