2023-06-25 13:54:32 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2022-07-26 03:55:56 +00:00
|
|
|
|
using Verse;
|
|
|
|
|
|
|
|
|
|
namespace RJWSexperience.Ideology.Precepts
|
|
|
|
|
{
|
2023-06-25 13:54:32 +00:00
|
|
|
|
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field values are loaded from XML")]
|
|
|
|
|
public abstract class DefExtension_ModifyMtb : DefModExtension, IPreceptTipPostfix
|
2022-07-26 03:55:56 +00:00
|
|
|
|
{
|
2023-06-25 13:54:32 +00:00
|
|
|
|
protected abstract string TipTemplateKey { get; }
|
|
|
|
|
|
2022-07-26 03:55:56 +00:00
|
|
|
|
public float multiplier = 1f;
|
2023-06-25 13:54:32 +00:00
|
|
|
|
|
|
|
|
|
public string GetTip() => TipTemplateKey.Translate(multiplier.ToString());
|
|
|
|
|
|
|
|
|
|
public override IEnumerable<string> ConfigErrors()
|
|
|
|
|
{
|
|
|
|
|
if (multiplier == 1f)
|
|
|
|
|
{
|
|
|
|
|
yield return "There is no point if <multiplier> is 1";
|
|
|
|
|
}
|
|
|
|
|
else if (multiplier <= 0f)
|
|
|
|
|
{
|
|
|
|
|
yield return "<multiplier> must be > 0";
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-26 03:55:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|