2022-04-22 18:28:59 +00:00
|
|
|
|
using RimWorld;
|
|
|
|
|
using Verse;
|
|
|
|
|
|
2022-04-27 10:56:16 +00:00
|
|
|
|
namespace RJWSexperience.Cum.FilterWorkers
|
2022-04-22 18:28:59 +00:00
|
|
|
|
{
|
|
|
|
|
public abstract class SpecialThingFilterWorker_CumBase : SpecialThingFilterWorker
|
|
|
|
|
{
|
|
|
|
|
public override bool CanEverMatch(ThingDef def)
|
|
|
|
|
{
|
|
|
|
|
return def.IsIngestible && def.IsProcessedFood;
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-17 11:34:35 +00:00
|
|
|
|
protected bool IsCum(ThingDef t) => t == RsDefOf.Thing.GatheredCum;
|
2022-04-22 18:28:59 +00:00
|
|
|
|
|
|
|
|
|
protected bool IsFoodWithCum(Thing food)
|
|
|
|
|
{
|
|
|
|
|
CompIngredients compIngredients = food.TryGetComp<CompIngredients>();
|
|
|
|
|
|
2023-04-17 11:34:35 +00:00
|
|
|
|
if (compIngredients?.ingredients == null)
|
2022-04-22 18:28:59 +00:00
|
|
|
|
return false;
|
|
|
|
|
|
2023-04-17 11:34:35 +00:00
|
|
|
|
for (int i = 0; i < compIngredients.ingredients.Count; i++)
|
2022-04-22 18:28:59 +00:00
|
|
|
|
{
|
2023-04-17 11:34:35 +00:00
|
|
|
|
if (IsCum(compIngredients.ingredients[i]))
|
2022-04-22 18:28:59 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|