2022-12-27 12:48:38 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using rjw;
|
|
|
|
|
using rjw.Modules.Interactions.Contexts;
|
|
|
|
|
using rjw.Modules.Interactions.Enums;
|
|
|
|
|
using rjw.Modules.Interactions.Rules.PartKindUsageRules;
|
|
|
|
|
using rjw.Modules.Shared;
|
|
|
|
|
using Verse;
|
|
|
|
|
|
|
|
|
|
namespace RJW_Genes.Interactions
|
|
|
|
|
{
|
2022-12-27 13:54:47 +00:00
|
|
|
|
//Summary//
|
2023-01-15 12:51:36 +00:00
|
|
|
|
//Set custom preferences for pawn. Gets integrated into rjw by AddtoIPartPreferenceRule in First
|
2022-12-27 13:54:47 +00:00
|
|
|
|
//Depending on the level of lifeforce increase the chance for using the mouth.
|
|
|
|
|
public class GenesPartKindUsageRule : IPartPreferenceRule
|
2022-12-27 12:48:38 +00:00
|
|
|
|
{
|
|
|
|
|
public IEnumerable<Weighted<LewdablePartKind>> ModifiersForDominant(InteractionContext context)
|
|
|
|
|
{
|
|
|
|
|
Pawn pawn = context.Internals.Dominant.Pawn;
|
2023-01-15 12:51:36 +00:00
|
|
|
|
Gene_LifeForce gene = pawn.genes.GetFirstGeneOfType<Gene_LifeForce>();
|
|
|
|
|
if (gene != null)
|
2022-12-27 12:48:38 +00:00
|
|
|
|
{
|
2023-01-15 12:51:36 +00:00
|
|
|
|
float weight = 2f;
|
|
|
|
|
if (gene.Value < gene.MinLevelForAlert)
|
|
|
|
|
{
|
|
|
|
|
weight *= 10;
|
|
|
|
|
}
|
|
|
|
|
else if (gene.Value < gene.targetValue)
|
|
|
|
|
{
|
|
|
|
|
weight *= 2.5f;
|
|
|
|
|
}
|
2023-01-17 15:44:08 +00:00
|
|
|
|
if (pawn.genes.HasGene(GeneDefOf.rjw_genes_cum_eater))
|
|
|
|
|
{
|
|
|
|
|
yield return new Weighted<LewdablePartKind>(weight, LewdablePartKind.Mouth);
|
|
|
|
|
yield return new Weighted<LewdablePartKind>(weight, LewdablePartKind.Beak);
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-21 06:46:55 +00:00
|
|
|
|
if (pawn.genes.HasGene(GeneDefOf.rjw_genes_fertilin_absorber))
|
2023-01-15 12:51:36 +00:00
|
|
|
|
{
|
|
|
|
|
yield return new Weighted<LewdablePartKind>(weight, LewdablePartKind.Vagina);
|
|
|
|
|
yield return new Weighted<LewdablePartKind>(weight, LewdablePartKind.Anus);
|
|
|
|
|
}
|
2022-12-27 12:48:38 +00:00
|
|
|
|
}
|
|
|
|
|
yield break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Weighted<LewdablePartKind>> ModifiersForSubmissive(InteractionContext context)
|
|
|
|
|
{
|
2023-01-15 12:51:36 +00:00
|
|
|
|
Pawn pawn = context.Internals.Dominant.Pawn;
|
|
|
|
|
Gene_LifeForce gene = pawn.genes.GetFirstGeneOfType<Gene_LifeForce>();
|
|
|
|
|
if (gene != null)
|
2022-12-27 12:48:38 +00:00
|
|
|
|
{
|
2023-01-15 12:51:36 +00:00
|
|
|
|
float weight = 2f;
|
|
|
|
|
if (gene.Value < gene.MinLevelForAlert)
|
|
|
|
|
{
|
|
|
|
|
weight *= 10;
|
|
|
|
|
}
|
|
|
|
|
else if (gene.Value < gene.targetValue)
|
|
|
|
|
{
|
|
|
|
|
weight *= 2.5f;
|
|
|
|
|
}
|
|
|
|
|
yield return new Weighted<LewdablePartKind>(weight, LewdablePartKind.Mouth);
|
|
|
|
|
yield return new Weighted<LewdablePartKind>(weight, LewdablePartKind.Beak);
|
2023-02-21 06:46:55 +00:00
|
|
|
|
|
|
|
|
|
if (pawn.genes.HasGene(GeneDefOf.rjw_genes_fertilin_absorber))
|
2023-01-15 12:51:36 +00:00
|
|
|
|
{
|
|
|
|
|
yield return new Weighted<LewdablePartKind>(weight, LewdablePartKind.Vagina);
|
|
|
|
|
yield return new Weighted<LewdablePartKind>(weight, LewdablePartKind.Anus);
|
|
|
|
|
}
|
2022-12-27 12:48:38 +00:00
|
|
|
|
}
|
|
|
|
|
yield break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|