mirror of
https://github.com/amevarashi/RJW-Sexperience.git
synced 2024-08-14 23:54:08 +00:00
Filters for food with cum
This commit is contained in:
parent
ad7c00d665
commit
ad76a1857b
5 changed files with 80 additions and 0 deletions
|
@ -128,4 +128,24 @@
|
||||||
</li>
|
</li>
|
||||||
</stages>
|
</stages>
|
||||||
</ThoughtDef>
|
</ThoughtDef>
|
||||||
|
|
||||||
|
<SpecialThingFilterDef>
|
||||||
|
<defName>AllowWithCum</defName>
|
||||||
|
<label>allow food with cum</label>
|
||||||
|
<description>Allow food that was spiced up by adding sexual fluids.</description>
|
||||||
|
<parentCategory>Foods</parentCategory>
|
||||||
|
<allowedByDefault>true</allowedByDefault>
|
||||||
|
<saveKey>allowWithCum</saveKey>
|
||||||
|
<workerClass>RJWSexperience.SpecialThingFilterWorker_Cum</workerClass>
|
||||||
|
</SpecialThingFilterDef>
|
||||||
|
|
||||||
|
<SpecialThingFilterDef>
|
||||||
|
<defName>AllowWithoutCum</defName>
|
||||||
|
<label>allow food without cum</label>
|
||||||
|
<description>Allow food normal food.</description>
|
||||||
|
<parentCategory>Foods</parentCategory>
|
||||||
|
<allowedByDefault>true</allowedByDefault>
|
||||||
|
<saveKey>allowWithoutCum</saveKey>
|
||||||
|
<workerClass>RJWSexperience.SpecialThingFilterWorker_NoCum</workerClass>
|
||||||
|
</SpecialThingFilterDef>
|
||||||
</Defs>
|
</Defs>
|
|
@ -0,0 +1,12 @@
|
||||||
|
using Verse;
|
||||||
|
|
||||||
|
namespace RJWSexperience
|
||||||
|
{
|
||||||
|
public class SpecialThingFilterWorker_Cum : SpecialThingFilterWorker_CumBase
|
||||||
|
{
|
||||||
|
public override bool Matches(Thing t)
|
||||||
|
{
|
||||||
|
return IsCum(t) || IsFoodWithCum(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
using RimWorld;
|
||||||
|
using Verse;
|
||||||
|
|
||||||
|
namespace RJWSexperience
|
||||||
|
{
|
||||||
|
public abstract class SpecialThingFilterWorker_CumBase : SpecialThingFilterWorker
|
||||||
|
{
|
||||||
|
public override bool CanEverMatch(ThingDef def)
|
||||||
|
{
|
||||||
|
return def.IsIngestible && def.IsProcessedFood;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected bool IsCum(Thing t) => IsCum(t.def);
|
||||||
|
|
||||||
|
protected bool IsCum(ThingDef t) => t == VariousDefOf.GatheredCum;
|
||||||
|
|
||||||
|
protected bool IsFoodWithCum(Thing food)
|
||||||
|
{
|
||||||
|
CompIngredients compIngredients = food.TryGetComp<CompIngredients>();
|
||||||
|
|
||||||
|
if (compIngredients == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
foreach (ThingDef ingredient in compIngredients.ingredients)
|
||||||
|
{
|
||||||
|
if (IsCum(ingredient))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
using Verse;
|
||||||
|
|
||||||
|
namespace RJWSexperience
|
||||||
|
{
|
||||||
|
public class SpecialThingFilterWorker_NoCum : SpecialThingFilterWorker_CumBase
|
||||||
|
{
|
||||||
|
public override bool Matches(Thing t)
|
||||||
|
{
|
||||||
|
return !IsCum(t) && !IsFoodWithCum(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -70,6 +70,8 @@
|
||||||
<Compile Include="DebugAction.cs" />
|
<Compile Include="DebugAction.cs" />
|
||||||
<Compile Include="ExtensionMethods\PawnExtensions.cs" />
|
<Compile Include="ExtensionMethods\PawnExtensions.cs" />
|
||||||
<Compile Include="ExtensionMethods\SexPropsExtensions.cs" />
|
<Compile Include="ExtensionMethods\SexPropsExtensions.cs" />
|
||||||
|
<Compile Include="FilterWorkers\SpecialThingFilterWorker_CumBase.cs" />
|
||||||
|
<Compile Include="FilterWorkers\SpecialThingFilterWorker_NoCum.cs" />
|
||||||
<Compile Include="GlobalSuppressions.cs" />
|
<Compile Include="GlobalSuppressions.cs" />
|
||||||
<Compile Include="Harmony.cs" />
|
<Compile Include="Harmony.cs" />
|
||||||
<Compile Include="IngestionOutcomeDoers.cs" />
|
<Compile Include="IngestionOutcomeDoers.cs" />
|
||||||
|
@ -89,6 +91,7 @@
|
||||||
<Compile Include="Patches\Rimworld_Patch.cs" />
|
<Compile Include="Patches\Rimworld_Patch.cs" />
|
||||||
<Compile Include="Patches\RJW_Patch.cs" />
|
<Compile Include="Patches\RJW_Patch.cs" />
|
||||||
<Compile Include="SexperienceMod.cs" />
|
<Compile Include="SexperienceMod.cs" />
|
||||||
|
<Compile Include="FilterWorkers\SpecialThingFilterWorker_Cum.cs" />
|
||||||
<Compile Include="StatParts.cs" />
|
<Compile Include="StatParts.cs" />
|
||||||
<Compile Include="Thoughts\ThoughtDef_Opinionbased.cs" />
|
<Compile Include="Thoughts\ThoughtDef_Opinionbased.cs" />
|
||||||
<Compile Include="Thoughts\ThoughtDef_Recordbased.cs" />
|
<Compile Include="Thoughts\ThoughtDef_Recordbased.cs" />
|
||||||
|
|
Loading…
Reference in a new issue