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;
{
[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";
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;
/// <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>
[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>
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
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
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
slice: FoodCakeBlueberrySlice
- type: Tag
tags:
+ - Cake
- Fruit
- type: entity
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
# 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
Quantity: 1.2
- ReagentId: Vitamin
Quantity: 1
+ - type: Tag
+ tags:
+ - Pie
+ - Slice
# Pie
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
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.
- 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
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
- 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