Another Merchant gameplay attempt (#1308)
* setup UI * setup debug data * graph control setup * reputation trade component * unlocking logic * smoe real reputation costing * remove sponsors part, add trading specific UI nodes * port to default pricing system * buy cooldown * fuck off trading cabinets * real good cooldown UI * Cool unlock sound * reputation earning * cool purchare sound * coin & sprite work * delete old guidebooks * cool purcharing VFX * better ui * victoria gardens * Update migration.yml * Update migration.yml * cooldown removed * contracts * Update migration.yml * remove CP14Material * materials appraise * food appraise * auto economy pricing system * alchemy reagents appraise * coins resprite * alchemy appraise 2 * modular weapon appraise * selling platform * Update PricingSystem.cs * Update CP14TradingPlatformSystem.cs * merchants returns + map update * Update CP14StationEconomySystem.Price.cs
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
using Content.Server.Cargo.Components;
|
||||
using Content.Server.Item;
|
||||
using Content.Shared._CP14.ModularCraft;
|
||||
using Content.Shared._CP14.ModularCraft.Components;
|
||||
using Content.Shared._CP14.ModularCraft.Prototypes;
|
||||
using Content.Shared.Throwing;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Materials;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -182,6 +184,36 @@ public sealed class CP14ModularCraftSystem : CP14SharedModularCraftSystem
|
||||
|
||||
var indexedPart = _proto.Index(partProto);
|
||||
|
||||
if (TryComp<PhysicalCompositionComponent>(part, out var partMaterial))
|
||||
{
|
||||
var startMaterial = EnsureComp<PhysicalCompositionComponent>(start);
|
||||
|
||||
//Merge materials
|
||||
foreach (var (material, count) in partMaterial.MaterialComposition)
|
||||
{
|
||||
if (startMaterial.MaterialComposition.TryGetValue(material, out var existingCount))
|
||||
startMaterial.MaterialComposition[material] = existingCount + count;
|
||||
else
|
||||
startMaterial.MaterialComposition[material] = count;
|
||||
}
|
||||
|
||||
//Merge solutions
|
||||
foreach (var (sol, count) in partMaterial.ChemicalComposition)
|
||||
{
|
||||
if (startMaterial.ChemicalComposition.TryGetValue(sol, out var existingCount))
|
||||
startMaterial.ChemicalComposition[sol] = existingCount + count;
|
||||
else
|
||||
startMaterial.ChemicalComposition[sol] = count;
|
||||
}
|
||||
}
|
||||
|
||||
if (TryComp<StaticPriceComponent>(part, out var staticPartPrice))
|
||||
{
|
||||
var startStaticPrice = EnsureComp<StaticPriceComponent>(start);
|
||||
|
||||
startStaticPrice.Price += staticPartPrice.Price;
|
||||
}
|
||||
|
||||
foreach (var modifier in indexedPart.Modifiers)
|
||||
{
|
||||
modifier.Effect(EntityManager, start, part);
|
||||
|
||||
Reference in New Issue
Block a user