diff --git a/Content.Client/Lathe/UI/LatheMenu.xaml.cs b/Content.Client/Lathe/UI/LatheMenu.xaml.cs index fe66da2a96..fd3319c434 100644 --- a/Content.Client/Lathe/UI/LatheMenu.xaml.cs +++ b/Content.Client/Lathe/UI/LatheMenu.xaml.cs @@ -131,10 +131,8 @@ public sealed partial class LatheMenu : DefaultWindow else sb.Append('\n'); - var adjustedAmount = amount; - if (prototype.ApplyMaterialDiscount) - adjustedAmount = (int) (adjustedAmount * component.MaterialUseMultiplier); - + var adjustedAmount = SharedLatheSystem.AdjustMaterial(amount, prototype.ApplyMaterialDiscount, component.MaterialUseMultiplier); + sb.Append(adjustedAmount); sb.Append(' '); sb.Append(Loc.GetString(proto.Name)); diff --git a/Content.IntegrationTests/Tests/CargoTest.cs b/Content.IntegrationTests/Tests/CargoTest.cs index 82bf818ddb..0d60be4d78 100644 --- a/Content.IntegrationTests/Tests/CargoTest.cs +++ b/Content.IntegrationTests/Tests/CargoTest.cs @@ -31,15 +31,19 @@ public sealed class CargoTest { var mapId = testMap.MapId; - foreach (var proto in protoManager.EnumeratePrototypes()) + Assert.Multiple(() => { - var ent = entManager.SpawnEntity(proto.Product, new MapCoordinates(Vector2.Zero, mapId)); - var price = pricing.GetPrice(ent); + foreach (var proto in protoManager.EnumeratePrototypes()) + { + var ent = entManager.SpawnEntity(proto.Product, new MapCoordinates(Vector2.Zero, mapId)); + var price = pricing.GetPrice(ent); - Assert.That(price, Is.LessThan(proto.PointCost), $"Found arbitrage on {proto.ID} cargo product! Cost is {proto.PointCost} but sell is {price}!"); - entManager.DeleteEntity(ent); - } + Assert.That(price, Is.LessThan(proto.PointCost), $"Found arbitrage on {proto.ID} cargo product! Cost is {proto.PointCost} but sell is {price}!"); + entManager.DeleteEntity(ent); + } + }); + mapManager.DeleteMap(mapId); }); diff --git a/Content.IntegrationTests/Tests/Construction/ConstructionPrototypeTest.cs b/Content.IntegrationTests/Tests/Construction/ConstructionPrototypeTest.cs index e51b7870f7..d9021a0a27 100644 --- a/Content.IntegrationTests/Tests/Construction/ConstructionPrototypeTest.cs +++ b/Content.IntegrationTests/Tests/Construction/ConstructionPrototypeTest.cs @@ -1,14 +1,11 @@ -using System.Threading.Tasks; using Content.Server.Construction.Components; -using Content.Server.Stack; using Content.Shared.Construction.Prototypes; -using Content.Shared.Construction.Steps; -using Content.Shared.Prototypes; using NUnit.Framework; using Robust.Shared.GameObjects; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Prototypes; +using System.Threading.Tasks; namespace Content.IntegrationTests.Tests.Construction { @@ -90,6 +87,37 @@ namespace Content.IntegrationTests.Tests.Construction await pairTracker.CleanReturnAsync(); } + [Test] + public async Task DeconstructionIsValid() + { + await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings { NoClient = true }); + var server = pairTracker.Pair.Server; + + var entMan = server.ResolveDependency(); + var protoMan = server.ResolveDependency(); + var compFact = server.ResolveDependency(); + + var name = compFact.GetComponentName(typeof(ConstructionComponent)); + Assert.Multiple(() => + { + foreach (var proto in protoMan.EnumeratePrototypes()) + { + if (proto.Abstract || !proto.Components.TryGetValue(name, out var reg)) + continue; + + var comp = (ConstructionComponent) reg.Component; + var target = comp.DeconstructionNode; + if (target == null) + continue; + + var graph = protoMan.Index(comp.Graph); + Assert.That(graph.Nodes.ContainsKey(target), $"Invalid deconstruction node \"{target}\" on graph \"{graph.ID}\" for construction entity \"{proto.ID}\"!"); + } + }); + + await pairTracker.CleanReturnAsync(); + } + [Test] public async Task TestStartReachesValidTarget() { diff --git a/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs b/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs new file mode 100644 index 0000000000..e1d0a3fb48 --- /dev/null +++ b/Content.IntegrationTests/Tests/MaterialArbitrageTest.cs @@ -0,0 +1,301 @@ +using Content.Server.Cargo.Systems; +using Content.Server.Construction.Completions; +using Content.Server.Construction.Components; +using Content.Server.Destructible; +using Content.Server.Destructible.Thresholds.Behaviors; +using Content.Server.Stack; +using Content.Shared.Construction.Prototypes; +using Content.Shared.Construction.Steps; +using Content.Shared.Lathe; +using Content.Shared.Research.Prototypes; +using Content.Shared.Stacks; +using NUnit.Framework; +using Robust.Shared.GameObjects; +using Robust.Shared.Map; +using Robust.Shared.Prototypes; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Content.IntegrationTests.Tests; + +/// +/// This test checks that any destructible or constructible entities do not drop more resources than are required to +/// create them. +/// +[TestFixture] +public sealed class MaterialArbitrageTest +{ + [Test] + public async Task NoMaterialArbitrage() + { + // TODO check lathe resource prices? + // I CBF doing that atm because I know that will probably fail for most lathe recipies. + + await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings() {NoClient = true}); + var server = pairTracker.Pair.Server; + + var testMap = await PoolManager.CreateTestMap(pairTracker); + await server.WaitIdleAsync(); + + var entManager = server.ResolveDependency(); + var sysManager = server.ResolveDependency(); + var mapManager = server.ResolveDependency(); + Assert.That(mapManager.IsMapInitialized(testMap.MapId)); + + var protoManager = server.ResolveDependency(); + var pricing = sysManager.GetEntitySystem(); + var stackSys = sysManager.GetEntitySystem(); + var compFact = server.ResolveDependency(); + + var constructionName = compFact.GetComponentName(typeof(ConstructionComponent)); + var destructibleName = compFact.GetComponentName(typeof(DestructibleComponent)); + var stackName = compFact.GetComponentName(typeof(StackComponent)); + + // construct inverted lathe recipe dictionary + Dictionary latheRecipes = new(); + foreach (var proto in protoManager.EnumeratePrototypes()) + { + latheRecipes.Add(proto.Result, proto); + } + + // Lets assume the possible lathe for resource multipliers: + var multiplier = MathF.Pow(LatheComponent.DefaultPartRatingMaterialUseMultiplier, MachinePartComponent.MaxRating - 1); + + // create construction dictionary + Dictionary constructionRecipes = new(); + foreach (var proto in protoManager.EnumeratePrototypes()) + { + if (proto.NoSpawn || proto.Abstract) + continue; + + if (!proto.Components.TryGetValue(constructionName, out var destructible)) + continue; + + var comp = (ConstructionComponent) destructible.Component; + constructionRecipes.Add(proto.ID, comp); + } + + // Get ingredients required to construct an entity + Dictionary> constructionMaterials = new(); + foreach (var (id, comp) in constructionRecipes) + { + var materials = new Dictionary(); + var graph = protoManager.Index(comp.Graph); + if (!graph.TryPath(graph.Start, comp.Node, out var path) || path.Length == 0) + continue; + + var cur = graph.Nodes[graph.Start]; + foreach (var node in path) + { + var edge = cur.GetEdge(node.Name); + cur = node; + + foreach (var step in edge.Steps) + { + if (step is MaterialConstructionGraphStep materialStep) + materials[materialStep.MaterialPrototypeId] = materialStep.Amount + materials.GetValueOrDefault(materialStep.MaterialPrototypeId); + } + } + constructionMaterials.Add(id, materials); + } + + Dictionary priceCache = new(); + + Dictionary Ents, Dictionary Mats)> spawnedOnDestroy = new(); + + // Here we get the set of entities/materials spawned when destroying an entity. + foreach (var proto in protoManager.EnumeratePrototypes()) + { + if (proto.NoSpawn || proto.Abstract) + continue; + + if (!proto.Components.TryGetValue(destructibleName, out var destructible)) + continue; + + var comp = (DestructibleComponent) destructible.Component; + + var spawnedEnts = new Dictionary(); + var spawnedMats = new Dictionary(); + + // This test just blindly assumes that ALL spawn entity behaviors get triggered. In reality, some entities + // might only trigger a subset. If that starts being a problem, this test either needs fixing or needs to + // get an ignored prototypes list. + + foreach (var threshold in comp.Thresholds) + { + foreach (var behaviour in threshold.Behaviors) + { + if (behaviour is not SpawnEntitiesBehavior spawn) + continue; + + foreach (var (key, value) in spawn.Spawn) + { + spawnedEnts[key] = spawnedEnts.GetValueOrDefault(key) + value.Max; + + var spawnProto = protoManager.Index(key); + if (!spawnProto.Components.TryGetValue(stackName, out var reg)) + continue; + + var stack = (StackComponent) reg.Component; + spawnedMats[stack.StackTypeId] = value.Max + spawnedMats.GetValueOrDefault(stack.StackTypeId); + } + } + } + + if (spawnedEnts.Count > 0) + spawnedOnDestroy.Add(proto.ID, (spawnedEnts, spawnedMats)); + } + + // This is the main loop where we actually check for destruction arbitrage + Assert.Multiple(async () => + { + foreach (var (id, (spawnedEnts, spawnedMats)) in spawnedOnDestroy) + { + // Check cargo sell price + // several constructible entities have no sell price + // also this test only really matters if the entity is also purchaseable.... eh.. + var spawnedPrice = await GetSpawnedPrice(spawnedEnts); + var price = await GetPrice(id); + if (spawnedPrice > 0 && price > 0) + Assert.LessOrEqual(spawnedPrice, price, $"{id} increases in price after being destroyed"); + + // Check lathe production + if (latheRecipes.TryGetValue(id, out var recipe)) + { + foreach (var (matId, amount) in recipe.RequiredMaterials) + { + var actualAmount = SharedLatheSystem.AdjustMaterial(amount, recipe.ApplyMaterialDiscount, multiplier); + if (spawnedMats.TryGetValue(matId, out var numSpawned)) + Assert.LessOrEqual(numSpawned, actualAmount, $"destroying a {id} spawns more {matId} than required to produce via an (upgraded) lathe."); + } + } + + // Check construction. + if (constructionMaterials.TryGetValue(id, out var constructionMats)) + { + foreach (var (matId, amount) in constructionMats) + { + if (spawnedMats.TryGetValue(matId, out var numSpawned)) + Assert.LessOrEqual(numSpawned, amount, $"destroying a {id} spawns more {matId} than required to construct it."); + } + } + } + }); + + // Finally, lets also check for deconstruction arbitrage. + // Get ingredients returned when deconstructing an entity + Dictionary> deconstructionMaterials = new(); + foreach (var (id, comp) in constructionRecipes) + { + if (comp.DeconstructionNode == null) + continue; + + var materials = new Dictionary(); + var graph = protoManager.Index(comp.Graph); + + if (!graph.TryPath(comp.Node, comp.DeconstructionNode, out var path) || path.Length == 0) + continue; + + var cur = graph.Nodes[comp.Node]; + foreach (var node in path) + { + var edge = cur.GetEdge(node.Name); + cur = node; + + foreach (var completion in edge.Completed) + { + if (completion is not SpawnPrototype spawnCompletion) + continue; + + var spawnProto = protoManager.Index(spawnCompletion.Prototype); + if (!spawnProto.Components.TryGetValue(stackName, out var reg)) + continue; + + var stack = (StackComponent) reg.Component; + + materials[stack.StackTypeId] = spawnCompletion.Amount + materials.GetValueOrDefault(stack.StackTypeId); + } + } + deconstructionMaterials.Add(id, materials); + } + + // This is functionally the same loop as before, but now testinng deconstruction rather than destruction. + // This is pretty braindead. In principle construction graphs can have loops and whatnot. + + Assert.Multiple(async () => + { + foreach (var (id, deconstructedMats) in deconstructionMaterials) + { + // Check cargo sell price + var deconstructedPrice = await GetDeconstructedPrice(deconstructedMats); + var price = await GetPrice(id); + if (deconstructedPrice > 0 && price > 0) + Assert.LessOrEqual(deconstructedPrice, price, $"{id} increases in price after being deconstructed"); + + // Check lathe production + if (latheRecipes.TryGetValue(id, out var recipe)) + { + foreach (var (matId, amount) in recipe.RequiredMaterials) + { + var actualAmount = SharedLatheSystem.AdjustMaterial(amount, recipe.ApplyMaterialDiscount, multiplier); + if (deconstructedMats.TryGetValue(matId, out var numSpawned)) + Assert.LessOrEqual(numSpawned, actualAmount, $"deconstructing {id} spawns more {matId} than required to produce via an (upgraded) lathe."); + } + } + + // Check construction. + if (constructionMaterials.TryGetValue(id, out var constructionMats)) + { + foreach (var (matId, amount) in constructionMats) + { + if (deconstructedMats.TryGetValue(matId, out var numSpawned)) + Assert.LessOrEqual(numSpawned, amount, $"deconstructing a {id} spawns more {matId} than required to construct it."); + } + } + } + }); + + await server.WaitPost(() => mapManager.DeleteMap(testMap.MapId)); + await pairTracker.CleanReturnAsync(); + + async Task GetSpawnedPrice(Dictionary ents) + { + double price = 0; + foreach (var (id, num) in ents) + { + price += num * await GetPrice(id); + } + + return price; + } + + async Task GetPrice(string id) + { + if (!priceCache.TryGetValue(id, out var price)) + { + await server.WaitPost(() => + { + var ent = entManager.SpawnEntity(id, testMap.GridCoords); + stackSys.SetCount(ent, 1); + priceCache[id] = price = pricing.GetPrice(ent); + entManager.DeleteEntity(ent); + }); + } + return price; + } + + + async Task GetDeconstructedPrice(Dictionary mats) + { + double price = 0; + foreach (var (id, num) in mats) + { + var matProto = protoManager.Index(id).Spawn; + price += num * await GetPrice(matProto); + } + return price; + } + } +} diff --git a/Content.Server/Construction/Components/MachinePartComponent.cs b/Content.Server/Construction/Components/MachinePartComponent.cs index 00a77d1d0b..997b8b28a8 100644 --- a/Content.Server/Construction/Components/MachinePartComponent.cs +++ b/Content.Server/Construction/Components/MachinePartComponent.cs @@ -12,5 +12,12 @@ namespace Content.Server.Construction.Components [ViewVariables(VVAccess.ReadWrite)] [DataField("rating")] public int Rating { get; private set; } = 1; + + /// + /// This number is used in tests to ensure that you can't use high quality machines for arbitrage. In + /// principle there is nothing wrong with using higher quality parts, but you have to be careful to not + /// allow them to be put into a lathe or something like that. + /// + public const int MaxRating = 4; } } diff --git a/Content.Shared/Lathe/LatheComponent.cs b/Content.Shared/Lathe/LatheComponent.cs index beb840e5b4..752eec5aba 100644 --- a/Content.Shared/Lathe/LatheComponent.cs +++ b/Content.Shared/Lathe/LatheComponent.cs @@ -83,7 +83,9 @@ namespace Content.Shared.Lathe /// The value that is used to calculate the modifier /// [DataField("partRatingMaterialUseMultiplier")] - public float PartRatingMaterialUseMultiplier = 0.75f; + public float PartRatingMaterialUseMultiplier = DefaultPartRatingMaterialUseMultiplier; + + public const float DefaultPartRatingMaterialUseMultiplier = 0.75f; #endregion } diff --git a/Content.Shared/Lathe/SharedLatheSystem.cs b/Content.Shared/Lathe/SharedLatheSystem.cs index d8a53cdfb9..4edae91ab4 100644 --- a/Content.Shared/Lathe/SharedLatheSystem.cs +++ b/Content.Shared/Lathe/SharedLatheSystem.cs @@ -4,6 +4,7 @@ using JetBrains.Annotations; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; +using System.Net.Mail; namespace Content.Shared.Lathe; @@ -50,9 +51,7 @@ public abstract class SharedLatheSystem : EntitySystem foreach (var (material, needed) in recipe.RequiredMaterials) { - var adjustedAmount = recipe.ApplyMaterialDiscount - ? (int) (needed * component.MaterialUseMultiplier) - : needed; + var adjustedAmount = AdjustMaterial(needed, recipe.ApplyMaterialDiscount, component.MaterialUseMultiplier); if (_materialStorage.GetMaterialAmount(component.Owner, material) < adjustedAmount * amount) return false; @@ -60,6 +59,9 @@ public abstract class SharedLatheSystem : EntitySystem return true; } + public static int AdjustMaterial(int original, bool reduce, float multiplier) + => reduce ? (int) MathF.Ceiling(original * multiplier) : original; + protected abstract bool HasRecipe(EntityUid uid, LatheRecipePrototype recipe, LatheComponent component); } diff --git a/Resources/Prototypes/Catalog/Cargo/cargo_food.yml b/Resources/Prototypes/Catalog/Cargo/cargo_food.yml index 3af8cecc3a..9491a41cf3 100644 --- a/Resources/Prototypes/Catalog/Cargo/cargo_food.yml +++ b/Resources/Prototypes/Catalog/Cargo/cargo_food.yml @@ -4,7 +4,7 @@ sprite: Objects/Consumable/Food/Baked/pizza.rsi state: margherita product: CrateFoodPizza - cost: 500 + cost: 550 category: Food group: market diff --git a/Resources/Prototypes/Catalog/Cargo/cargo_vending.yml b/Resources/Prototypes/Catalog/Cargo/cargo_vending.yml index 17ff47f872..fe03a3522a 100644 --- a/Resources/Prototypes/Catalog/Cargo/cargo_vending.yml +++ b/Resources/Prototypes/Catalog/Cargo/cargo_vending.yml @@ -52,7 +52,7 @@ sprite: Objects/Specific/Service/vending_machine_restock.rsi state: base product: CrateVendingMachineRestockGamesFilled - cost: 650 + cost: 750 category: Service group: market diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/bowl.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/bowl.yml index 95a6bda222..e6392877f3 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/bowl.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/bowl.yml @@ -71,6 +71,8 @@ - Trash - type: Recyclable - type: SpaceGarbage + - type: StaticPrice + price: 0 - type: entity name: bowl diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/tin.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/tin.yml index 651d8cd93a..c1867876e4 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/tin.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Containers/tin.yml @@ -74,6 +74,8 @@ max: 1 - !type:DoActsBehavior acts: [ "Destruction" ] + - type: StaticPrice + price: 50 - type: entity parent: FoodTinBase @@ -129,6 +131,8 @@ max: 1 - !type:DoActsBehavior acts: [ "Destruction" ] + - type: StaticPrice + price: 50 - type: entity parent: FoodTinBase @@ -179,6 +183,8 @@ max: 1 - !type:DoActsBehavior acts: [ "Destruction" ] + - type: StaticPrice + price: 50 - type: entity parent: FoodTinBase @@ -241,6 +247,8 @@ - id: FoodTinMREOpen sound: path: /Audio/Items/can_open3.ogg + - type: StaticPrice + price: 50 - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml index 7f5f6ce8a4..9810e1a322 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml @@ -195,6 +195,7 @@ materialRequirements: Cable: 5 - type: Construction + deconstructionTarget: null graph: ThermomachineBoard node: freezer @@ -215,6 +216,7 @@ Cable: 5 - type: Construction graph: ThermomachineBoard + deconstructionTarget: null node: heater - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Materials/shards.yml b/Resources/Prototypes/Entities/Objects/Materials/shards.yml index 3e24726fae..ac7508ec0a 100644 --- a/Resources/Prototypes/Entities/Objects/Materials/shards.yml +++ b/Resources/Prototypes/Entities/Objects/Materials/shards.yml @@ -76,6 +76,8 @@ damage: types: Piercing: 5 + - type: StaticPrice + price: 0 - type: entity parent: ShardBase diff --git a/Resources/Prototypes/Entities/Objects/Shields/shields.yml b/Resources/Prototypes/Entities/Objects/Shields/shields.yml index 5321f56a81..e54758ac84 100644 --- a/Resources/Prototypes/Entities/Objects/Shields/shields.yml +++ b/Resources/Prototypes/Entities/Objects/Shields/shields.yml @@ -42,6 +42,8 @@ SheetGlass: min: 5 max: 5 + - type: StaticPrice + price: 50 #Security Shields @@ -115,6 +117,8 @@ MaterialWoodPlank: min: 5 max: 5 + - type: StaticPrice + price: 150 - type: entity name: makeshift shield diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml index eebe8fa732..5eb7038079 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml @@ -116,6 +116,7 @@ - type: Construction graph: ShotgunSawn node: shotgundoublebarreled + deconstructionTarget: null - type: entity name: Enforcer @@ -161,3 +162,4 @@ - type: Construction graph: ShotgunSawn node: shotgunsawn + deconstructionTarget: null diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml index 932e0cc682..efb641d8d8 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml @@ -192,3 +192,5 @@ states: enum.Trigger.TriggerVisualState.Primed: primed enum.Trigger.TriggerVisualState.Unprimed: complete + - type: StaticPrice + price: 25 diff --git a/Resources/Prototypes/Entities/Structures/Furniture/chairs.yml b/Resources/Prototypes/Entities/Structures/Furniture/chairs.yml index 482dcf64f1..140cd8e0cc 100644 --- a/Resources/Prototypes/Entities/Structures/Furniture/chairs.yml +++ b/Resources/Prototypes/Entities/Structures/Furniture/chairs.yml @@ -175,6 +175,8 @@ - type: Tag tags: - Wooden + - type: StaticPrice + price: 75 - type: entity name: ritual chair diff --git a/Resources/Prototypes/Entities/Structures/Lighting/ground_lighting.yml b/Resources/Prototypes/Entities/Structures/Lighting/ground_lighting.yml index 7b3eafa35c..3f8bbc0f99 100644 --- a/Resources/Prototypes/Entities/Structures/Lighting/ground_lighting.yml +++ b/Resources/Prototypes/Entities/Structures/Lighting/ground_lighting.yml @@ -46,7 +46,7 @@ components: - type: Construction graph: LightFixture - node: tubeLight + node: groundLight - type: Sprite sprite: Structures/Lighting/LightPosts/small_light_post.rsi snapCardinals: true @@ -117,3 +117,5 @@ damage: types: Heat: 20 + - type: StaticPrice + price: 25 diff --git a/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml b/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml index ba775473d0..479245ce5d 100644 --- a/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml +++ b/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml @@ -527,6 +527,8 @@ layer: - MachineLayer - type: Recyclable + - type: StaticPrice + price: 60 - type: entity parent: GasCanisterBrokenBase diff --git a/Resources/Prototypes/Entities/Structures/Storage/Crates/crates.yml b/Resources/Prototypes/Entities/Structures/Storage/Crates/crates.yml index 60b6f7805c..0f3bfb795d 100644 --- a/Resources/Prototypes/Entities/Structures/Storage/Crates/crates.yml +++ b/Resources/Prototypes/Entities/Structures/Storage/Crates/crates.yml @@ -22,6 +22,8 @@ node: crateplastic containers: - entity_storage + - type: StaticPrice + price: 150 - type: entity parent: CrateBaseWeldable @@ -280,6 +282,8 @@ node: cratelivestock containers: - entity_storage + - type: StaticPrice + price: 125 - type: entity parent: CrateGeneric @@ -325,4 +329,6 @@ - LargeMobMask layer: - LargeMobLayer + - type: StaticPrice + price: 60 diff --git a/Resources/Prototypes/Entities/Structures/Walls/girders.yml b/Resources/Prototypes/Entities/Structures/Walls/girders.yml index 521c765bde..33d0beefef 100644 --- a/Resources/Prototypes/Entities/Structures/Walls/girders.yml +++ b/Resources/Prototypes/Entities/Structures/Walls/girders.yml @@ -49,7 +49,7 @@ - !type:DoActsBehavior acts: [ "Destruction" ] - type: StaticPrice - price: 0.5 + price: 10 - type: entity id: ReinforcedGirder @@ -85,3 +85,5 @@ max: 1 - !type:DoActsBehavior acts: [ "Destruction" ] + - type: StaticPrice + price: 66 diff --git a/Resources/Prototypes/Entities/Structures/Walls/railing.yml b/Resources/Prototypes/Entities/Structures/Walls/railing.yml index fbdf61ca18..fcd27e8196 100644 --- a/Resources/Prototypes/Entities/Structures/Walls/railing.yml +++ b/Resources/Prototypes/Entities/Structures/Walls/railing.yml @@ -154,7 +154,7 @@ spawn: PartRodMetal1: min: 0 - max: 2 + max: 1 - !type:DoActsBehavior acts: [ "Destruction" ] - type: Climbable diff --git a/Resources/Prototypes/Entities/Structures/Windows/plasma.yml b/Resources/Prototypes/Entities/Structures/Windows/plasma.yml index 756fc968f0..3a2b9bf0c3 100644 --- a/Resources/Prototypes/Entities/Structures/Windows/plasma.yml +++ b/Resources/Prototypes/Entities/Structures/Windows/plasma.yml @@ -40,7 +40,7 @@ damageOverlay: sprite: Structures/Windows/cracks.rsi - type: StaticPrice - price: 20.5 + price: 60 - type: RadiationBlocker resistance: 2 @@ -81,4 +81,4 @@ - !type:DoActsBehavior acts: [ "Destruction" ] - type: StaticPrice - price: 20.5 + price: 30 diff --git a/Resources/Prototypes/Entities/Structures/Windows/reinforced.yml b/Resources/Prototypes/Entities/Structures/Windows/reinforced.yml index 79f0725dcc..8a9b891a10 100644 --- a/Resources/Prototypes/Entities/Structures/Windows/reinforced.yml +++ b/Resources/Prototypes/Entities/Structures/Windows/reinforced.yml @@ -48,8 +48,6 @@ trackAllDamage: true damageOverlay: sprite: Structures/Windows/cracks.rsi - - type: StaticPrice - price: 150 - type: entity parent: ReinforcedWindow @@ -68,7 +66,7 @@ node: tintedWindow - type: Occluder - type: StaticPrice - price: 0.75 + price: 44 - type: entity id: WindowReinforcedDirectional @@ -109,4 +107,4 @@ - !type:DoActsBehavior acts: [ "Destruction" ] - type: StaticPrice - price: 0.75 + price: 22 diff --git a/Resources/Prototypes/Entities/Structures/Windows/rplasma.yml b/Resources/Prototypes/Entities/Structures/Windows/rplasma.yml index 2642493a03..8a41e3f665 100644 --- a/Resources/Prototypes/Entities/Structures/Windows/rplasma.yml +++ b/Resources/Prototypes/Entities/Structures/Windows/rplasma.yml @@ -51,7 +51,7 @@ damageOverlay: sprite: Structures/Windows/cracks.rsi - type: StaticPrice - price: 20.75 + price: 132 - type: entity id: PlasmaReinforcedWindowDirectional @@ -99,4 +99,4 @@ - !type:DoActsBehavior acts: [ "Destruction" ] - type: StaticPrice - price: 20.75 + price: 66 diff --git a/Resources/Prototypes/Entities/Structures/Windows/window.yml b/Resources/Prototypes/Entities/Structures/Windows/window.yml index 98c637d2e6..2234f3de72 100644 --- a/Resources/Prototypes/Entities/Structures/Windows/window.yml +++ b/Resources/Prototypes/Entities/Structures/Windows/window.yml @@ -169,7 +169,7 @@ graph: WindowDirectional node: windowDirectional - type: StaticPrice - price: 0.5 + price: 5 - type: entity id: WindowTintedDirectional @@ -194,7 +194,7 @@ - type: Occluder boundingBox: "-0.5,-0.5,0.5,-0.3" - type: StaticPrice - price: 0.5 + price: 5 - type: entity id: WindowFrostedDirectional @@ -214,4 +214,4 @@ sprite: Structures/Windows/directional.rsi state: frosted_window - type: StaticPrice - price: 0.5 + price: 5 diff --git a/Resources/Prototypes/Entities/Structures/plastic_flaps.yml b/Resources/Prototypes/Entities/Structures/plastic_flaps.yml index 621f1bc521..1f6ede9c05 100644 --- a/Resources/Prototypes/Entities/Structures/plastic_flaps.yml +++ b/Resources/Prototypes/Entities/Structures/plastic_flaps.yml @@ -42,6 +42,8 @@ - type: Construction graph: PlasticFlapsGraph node: plasticFlaps + - type: StaticPrice + price: 150 - type: entity id: PlasticFlapsOpaque diff --git a/Resources/Prototypes/Recipes/Lathes/security.yml b/Resources/Prototypes/Recipes/Lathes/security.yml index f2e24967e4..bd521a503a 100644 --- a/Resources/Prototypes/Recipes/Lathes/security.yml +++ b/Resources/Prototypes/Recipes/Lathes/security.yml @@ -149,6 +149,7 @@ id: TargetHuman result: TargetHuman completetime: 5 + applyMaterialDiscount: false # ingredients dropped when destroyed materials: Steel: 10 @@ -156,6 +157,7 @@ id: TargetClown result: TargetClown completetime: 5 + applyMaterialDiscount: false # ingredients dropped when destroyed materials: Steel: 10 @@ -163,5 +165,6 @@ id: TargetSyndicate result: TargetSyndicate completetime: 5 + applyMaterialDiscount: false # ingredients dropped when destroyed materials: Steel: 10