42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using Verse;
|
|
|
|
namespace rjwquirks.Modules.Quirks.Comps
|
|
{
|
|
public abstract class SexAppraisalModifier : QuirkComp
|
|
{
|
|
public string factorName;
|
|
public QuirkModifierPriority priority = QuirkModifierPriority.Normal;
|
|
|
|
public void TryModifyValue(Pawn quirkOwner, Pawn partner, string factorName, ref float value)
|
|
{
|
|
if (this.factorName != factorName)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (parent.partnerPreference?.PartnerSatisfies(quirkOwner, partner) != true)
|
|
{
|
|
return;
|
|
}
|
|
|
|
ModifyValue(quirkOwner, partner, ref value);
|
|
}
|
|
|
|
public abstract void ModifyValue(Pawn quirkOwner, Pawn partner, ref float value);
|
|
|
|
public override IEnumerable<string> ConfigErrors(QuirkDef parent)
|
|
{
|
|
foreach (string error in base.ConfigErrors(parent))
|
|
{
|
|
yield return error;
|
|
}
|
|
|
|
if (factorName.NullOrEmpty())
|
|
{
|
|
yield return "<factorName> is empty";
|
|
}
|
|
}
|
|
}
|
|
}
|