* 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
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using System.Text;
|
|
using Content.Shared.Stacks;
|
|
using Robust.Shared.Prototypes;
|
|
namespace Content.Shared._CP14.Currency;
|
|
|
|
public partial class CP14SharedCurrencySystem : EntitySystem
|
|
{
|
|
public static readonly KeyValuePair<EntProtoId, int> CP = new("CP14CopperCoin1", 1);
|
|
public static readonly KeyValuePair<EntProtoId, int> SP = new("CP14SilverCoin1", 10);
|
|
public static readonly KeyValuePair<EntProtoId, int> GP = new("CP14GoldCoin1", 100);
|
|
public static readonly KeyValuePair<EntProtoId, int> PP = new("CP14PlatinumCoin1", 1000);
|
|
|
|
public string GetCurrencyPrettyString(int currency)
|
|
{
|
|
var total = currency;
|
|
|
|
if (total <= 0)
|
|
return string.Empty;
|
|
|
|
var gp = total / 100;
|
|
total %= 100;
|
|
|
|
var sp = total / 10;
|
|
total %= 10;
|
|
|
|
var cp = total;
|
|
|
|
var sb = new StringBuilder();
|
|
|
|
if (gp > 0)
|
|
sb.Append( " " + Loc.GetString("cp14-currency-examine-gp", ("coin", gp)));
|
|
if (sp > 0)
|
|
sb.Append( " " + Loc.GetString("cp14-currency-examine-sp", ("coin", sp)));
|
|
if (cp > 0)
|
|
sb.Append( " " + Loc.GetString("cp14-currency-examine-cp", ("coin", cp)));
|
|
|
|
return sb.ToString();
|
|
}
|
|
}
|