RJW-Sexperience/RJWSexperience/IdeologyAddon/Ideology/GoodwillSituationWorker_Mem...

25 lines
623 B
C#
Raw Normal View History

2022-07-11 16:07:35 +00:00
using RimWorld;
2021-07-27 14:28:31 +00:00
2021-08-21 16:29:59 +00:00
namespace RJWSexperience.Ideology
2021-07-27 14:28:31 +00:00
{
2022-07-11 16:07:35 +00:00
public class GoodwillSituationWorker_OneWayReceive : GoodwillSituationWorker_MemeCompatibility
{
public override int GetNaturalGoodwillOffset(Faction other)
{
if (!Applies(other))
return 0;
return def.naturalGoodwillOffset;
}
2021-07-27 14:28:31 +00:00
2022-07-11 16:07:35 +00:00
protected bool Applies(Faction other)
{
Ideo primaryideo = Faction.OfPlayer.ideos?.PrimaryIdeo;
Ideo primaryideo2 = other.ideos?.PrimaryIdeo;
if (primaryideo == null || primaryideo2 == null)
return false;
2021-07-27 14:28:31 +00:00
2022-07-11 16:07:35 +00:00
return primaryideo.memes.Contains(def.meme) && !primaryideo2.memes.Contains(def.meme);
}
}
2021-07-27 14:28:31 +00:00
}