Public market + Solutions requests (#1503)
* Add platform markup to trading platform prices
Introduces a PlatformMarkupProcent field to CP14TradingPlatformComponent and applies it to price calculations in both client and server logic. Adds a new public trading platform entity with a higher markup and updates related sprites and metadata.
* Add platform markup percent to selling platforms
Introduces a PlatformMarkupProcent field to CP14SellingPlatformComponent, allowing selling platforms to apply a markup or markdown to item prices. Updates server logic to use this value when calculating payouts and UI state. Adds a new public selling platform entity with a lower markup in the trade_platform.yml prototype.
* Add Brad Potions trading requests prototype
Introduces a new YAML prototype defining multiple cp14TradingRequest entries for the BradPotions faction, each specifying requirements for various potion effects with minimum purity and amount.
* Apply platform markup to selling prices and payouts
Updated the selling request control and platform window to factor in the platform's markup percentage when displaying prices. Adjusted the server-side payout logic to multiply the payout by the platform markup percentage, ensuring consistency between client display and server rewards.
* replace mapping to public platforms
* bug + remove eepy potions request
* Clarify purity requirement in workbench reagent text
Updated the reagent requirement string in both English and Russian locale files to indicate that the required purity is '{$purity}%+' instead of just '{$purity}%'. This clarifies that the purity must be at least the specified percentage.
This commit is contained in:
@@ -60,21 +60,20 @@ public sealed partial class SolutionResource : CP14WorkbenchCraftRequirement
|
||||
if (!solutionSys.TryGetDrawableSolution(ent, out var soln, out var solution))
|
||||
continue;
|
||||
|
||||
|
||||
var volume = solution.Volume;
|
||||
if (volume < Amount)
|
||||
continue;
|
||||
|
||||
foreach (var (id, quantity) in solution.Contents)
|
||||
{
|
||||
if (id.Prototype != Reagent)
|
||||
continue;
|
||||
|
||||
if (quantity < Amount)
|
||||
continue;
|
||||
|
||||
//Purity check
|
||||
if (quantity / volume < Purity)
|
||||
continue;
|
||||
|
||||
solutionSys.RemoveEachReagent(soln.Value, Amount);
|
||||
solutionSys.Draw(ent, soln.Value, Amount);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user