Restructuring, some sorting into folders

This commit is contained in:
Vegapnk 2023-01-22 09:06:28 +01:00
parent ac1fdc99be
commit 31e96bd5e3
36 changed files with 80 additions and 65 deletions

View File

@ -11,7 +11,7 @@ using rjw;
namespace RJW_BGS namespace RJW_BGS
{ {
[HarmonyPatch(typeof(Hediff_BasePregnancy), "Initialize")] [HarmonyPatch(typeof(Hediff_BasePregnancy), "Initialize")]
public static class PatchRJWBestialityPregnancyUtility public static class Patch_RJW_BestialityPregnancyUtility
{ {
[HarmonyPostfix] [HarmonyPostfix]
public static void AddGenes(Pawn mother, Pawn dad, ref Hediff_BasePregnancy __instance) public static void AddGenes(Pawn mother, Pawn dad, ref Hediff_BasePregnancy __instance)

View File

@ -7,7 +7,7 @@ using rjw;
namespace RJW_BGS namespace RJW_BGS
{ {
[HarmonyPatch(typeof(Hediff_InsectEgg), "GiveBirth")] [HarmonyPatch(typeof(Hediff_InsectEgg), "GiveBirth")]
public static class PatchRJWHediffInsect_Egg public static class Patch_RJW_HediffInsect_Egg
{ {
[HarmonyTranspiler] [HarmonyTranspiler]
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)

View File

@ -19,7 +19,7 @@ namespace RJW_BGS
//typeof(bool) //typeof(bool)
} }
)] )]
public static class PatchVanillaPregnancyUtility public static class Patch_Vanilla_PregnancyUtility
{ {
[HarmonyPostfix] [HarmonyPostfix]
public static void AnimalInheritedGenes(Pawn father, Pawn mother, ref GeneSet __result) public static void AnimalInheritedGenes(Pawn father, Pawn mother, ref GeneSet __result)

View File

@ -1,23 +1,22 @@
using System; using RimWorld;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse; using Verse;
namespace RJW_Genes namespace RJW_Genes
{ {
/// <summary>
/// This class checks for pawns with LifeForce and Cumeater Gene to add Fertilin when eating cum (the Item from RJW-Sexperience).
/// </summary>
public class IngestionOutcomeDoer_LifeForceOffset : IngestionOutcomeDoer public class IngestionOutcomeDoer_LifeForceOffset : IngestionOutcomeDoer
{ {
public const float FERTILIN_PER_UNIT = 1f;
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested) protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
{ {
if (GeneUtility.HasLifeForce(pawn) && GeneUtility.HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_cum_eater)) if (GeneUtility.HasLifeForce(pawn) && GeneUtility.HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_cum_eater))
{ {
float num = ingested.stackCount * this.FertilinPerUnit / 100; float num = ingested.stackCount * FERTILIN_PER_UNIT / 100;
GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(pawn), num); GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(pawn), num);
} }
} }
public float FertilinPerUnit = 1f;
} }
} }

View File

@ -39,7 +39,7 @@ namespace RJW_Genes
{ {
return null; return null;
} }
int num = Mathf.RoundToInt(((gene_lifeforce.targetValue - gene_lifeforce.Value) * 100 + 10) / ingestionOutcomeDoer.FertilinPerUnit); int num = Mathf.RoundToInt(((gene_lifeforce.targetValue - gene_lifeforce.Value) * 100 + 10) / ingestionOutcomeDoer.FERTILIN_PER_UNIT);
if (gatheredCum != null && num > 0) if (gatheredCum != null && num > 0)
{ {
Job job = JobMaker.MakeJob(RimWorld.JobDefOf.Ingest, gatheredCum); Job job = JobMaker.MakeJob(RimWorld.JobDefOf.Ingest, gatheredCum);

View File

@ -9,9 +9,12 @@ using RimWorld;
using Verse; using Verse;
namespace RJW_Genes namespace RJW_Genes
{ {
/// <summary>
/// This Patch hooks after "SatisfyPersonal"(i.E. when the pawn finished fucking) and covers LifeForceGain.
/// If the pawn has LifeForce, all relevant Genes are checked and applied.
/// </summary>
[HarmonyPatch(typeof(SexUtility), nameof(SexUtility.SatisfyPersonal))] [HarmonyPatch(typeof(SexUtility), nameof(SexUtility.SatisfyPersonal))]
public static class Patch_LifeForce public static class Patch_SatisfyPersonal_LifeForceGain
{ {
public static void Postfix(SexProps props) public static void Postfix(SexProps props)
{ {
@ -32,19 +35,19 @@ namespace RJW_Genes
float absorb_factor = 0f; float absorb_factor = 0f;
if (GeneUtility.HasLifeForce(props.partner)) if (GeneUtility.HasLifeForce(props.partner))
{ {
Pawn succubus = props.partner; Pawn PawnWithLifeForce = props.partner;
if (!props.isRevese) if (!props.isRevese)
{ {
if (props.isReceiver) if (props.isReceiver)
{ {
// Scenario Dom Succubus, normal // Scenario Dom Succubus, normal
absorb_factor = BaseDom(props, succubus); absorb_factor = BaseDom(props, PawnWithLifeForce);
} }
else else
{ {
// Scenario Sub Succubus, normal // Scenario Sub Succubus, normal
absorb_factor = BaseSub(props, succubus); absorb_factor = BaseSub(props, PawnWithLifeForce);
} }
} }
else else
@ -52,28 +55,29 @@ namespace RJW_Genes
if (props.isReceiver) if (props.isReceiver)
{ {
// Scenario Dom Succubus, Reverse // Scenario Dom Succubus, Reverse
absorb_factor = BaseSub(props, succubus); absorb_factor = BaseSub(props, PawnWithLifeForce);
} }
else else
{ {
// Scenario Sub Succubus, Reverse // Scenario Sub Succubus, Reverse
absorb_factor = BaseDom(props, succubus); absorb_factor = BaseDom(props, PawnWithLifeForce);
} }
} }
//If we remove this check fertelin is always lost, but the succubus doesn't always gain any // If we remove this check fertilin is always lost, but the succubus doesn't always gain any
if (absorb_factor != 0f) if (absorb_factor != 0f)
{ {
TransferFertilin(props, absorb_factor); TransferFertilin(props, absorb_factor);
} }
if (GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_drainer) && !props.pawn.health.hediffSet.HasHediff(HediffDefOf.rjw_genes_succubus_drained)) if (GeneUtility.HasGeneNullCheck(PawnWithLifeForce, GeneDefOf.rjw_genes_drainer) && !props.pawn.health.hediffSet.HasHediff(HediffDefOf.rjw_genes_succubus_drained))
{ {
props.pawn.health.AddHediff(HediffDefOf.rjw_genes_succubus_drained); props.pawn.health.AddHediff(HediffDefOf.rjw_genes_succubus_drained);
GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(succubus), 0.25f); GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(PawnWithLifeForce), 0.25f);
} }
} }
} }
public static void TransferFertilin(SexProps props, float absorb_percentage = 1f) public static void TransferFertilin(SexProps props, float absorb_percentage = 1f)
{ {
Pawn_GeneTracker genes = props.partner.genes; Pawn_GeneTracker genes = props.partner.genes;
@ -120,39 +124,51 @@ namespace RJW_Genes
return total_fluid; return total_fluid;
} }
public static float BaseDom(SexProps props, Pawn succubus) /// <summary>
/// Handles the Case that the Life-Force wielder initiated the Sex (They are "Dom").
/// </summary>
/// <param name="props">The summary of the sex act, used for checking conditions.</param>
/// <param name="PawnWithLifeForce">The pawn that might gain LifeForce through this method.</param>
/// <returns></returns>
public static float BaseDom(SexProps props, Pawn PawnWithLifeForce)
{ {
float absorb_factor = 0f; float absorb_factor = 0f;
if (props.sexType == xxx.rjwSextype.Sixtynine && GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_cum_eater)) if (props.sexType == xxx.rjwSextype.Sixtynine && GeneUtility.HasGeneNullCheck(PawnWithLifeForce, GeneDefOf.rjw_genes_cum_eater))
{ {
absorb_factor += 1f; absorb_factor += 1f;
} }
return absorb_factor; return absorb_factor;
} }
public static float BaseSub(SexProps props, Pawn succubus) /// <summary>
/// Handles the Case that the Life-Force wielder got initiated into sex (They are "Sub").
/// </summary>
/// <param name="props">The summary of the sex act, used for checking conditions.</param>
/// <param name="PawnWithLifeForce">The pawn that might gain LifeForce through this method.</param>
/// <returns></returns>
public static float BaseSub(SexProps props, Pawn PawnWithLifeForce)
{ {
float absorb_factor = 0f; float absorb_factor = 0f;
if ((props.sexType == xxx.rjwSextype.Oral || props.sexType == xxx.rjwSextype.Fellatio || props.sexType == xxx.rjwSextype.Sixtynine) if ((props.sexType == xxx.rjwSextype.Oral || props.sexType == xxx.rjwSextype.Fellatio || props.sexType == xxx.rjwSextype.Sixtynine)
&& GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_cum_eater)) && GeneUtility.HasGeneNullCheck(PawnWithLifeForce, GeneDefOf.rjw_genes_cum_eater))
{ {
absorb_factor += 1f; absorb_factor += 1f;
} }
else if (props.sexType == xxx.rjwSextype.Vaginal && GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_vaginal_absorber)) else if (props.sexType == xxx.rjwSextype.Vaginal && GeneUtility.HasGeneNullCheck(PawnWithLifeForce, GeneDefOf.rjw_genes_vaginal_absorber))
{ {
absorb_factor += 1f; absorb_factor += 1f;
} }
else if (props.sexType == xxx.rjwSextype.Anal && GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_anal_absorber)) else if (props.sexType == xxx.rjwSextype.Anal && GeneUtility.HasGeneNullCheck(PawnWithLifeForce, GeneDefOf.rjw_genes_anal_absorber))
{ {
absorb_factor += 1f; absorb_factor += 1f;
} }
else if (props.sexType == xxx.rjwSextype.DoublePenetration) else if (props.sexType == xxx.rjwSextype.DoublePenetration)
{ {
if (GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_vaginal_absorber)) if (GeneUtility.HasGeneNullCheck(PawnWithLifeForce, GeneDefOf.rjw_genes_vaginal_absorber))
{ {
absorb_factor += 0.5f; absorb_factor += 0.5f;
} }
if (GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_anal_absorber)) if (GeneUtility.HasGeneNullCheck(PawnWithLifeForce, GeneDefOf.rjw_genes_anal_absorber))
{ {
absorb_factor += 0.5f; absorb_factor += 0.5f;
} }

View File

@ -65,14 +65,14 @@
<ItemGroup> <ItemGroup>
<Compile Include="Animal_Inheritance\Harmony_Init.cs" /> <Compile Include="Animal_Inheritance\Harmony_Init.cs" />
<Compile Include="Animal_Inheritance\InheritanceUtility.cs" /> <Compile Include="Animal_Inheritance\InheritanceUtility.cs" />
<Compile Include="Animal_Inheritance\PatchRJWBestialityPregnancyUtility.cs" /> <Compile Include="Animal_Inheritance\Patches\Patch_RJW_BestialityPregnancyUtility.cs" />
<Compile Include="Animal_Inheritance\PatchRJWHediffInsect_Egg.cs" /> <Compile Include="Animal_Inheritance\Patches\Patch_RJW_HediffInsect_Egg.cs" />
<Compile Include="Animal_Inheritance\PatchVanillaPregnancyUtility.cs" /> <Compile Include="Animal_Inheritance\Patches\Patch_Vanilla_PregnancyUtility.cs" />
<Compile Include="Animal_Inheritance\RaceGeneDef.cs" /> <Compile Include="Animal_Inheritance\Defs\RaceGeneDef.cs" />
<Compile Include="Animal_Inheritance\RaceGeneDef_Helper.cs" /> <Compile Include="Animal_Inheritance\Defs\RaceGeneDef_Helper.cs" />
<Compile Include="Animal_Inheritance\RJW_BGSSettings.cs" /> <Compile Include="Animal_Inheritance\Settings\RJW_BGSSettings.cs" />
<Compile Include="Animal_Inheritance\RJW_BGSSettingsController.cs" /> <Compile Include="Animal_Inheritance\Settings\RJW_BGSSettingsController.cs" />
<Compile Include="Animal_Inheritance\BestialityGeneInheritanceDef.cs" /> <Compile Include="Animal_Inheritance\Defs\BestialityGeneInheritanceDef.cs" />
<Compile Include="Common\ModLog.cs" /> <Compile Include="Common\ModLog.cs" />
<Compile Include="GeneDefOf.cs" /> <Compile Include="GeneDefOf.cs" />
<Compile Include="Genes\Breeding\Gene_MechBreeder.cs" /> <Compile Include="Genes\Breeding\Gene_MechBreeder.cs" />
@ -121,57 +121,57 @@
<Compile Include="Genes\Genitalia\Gene_EquineGenitalia.cs" /> <Compile Include="Genes\Genitalia\Gene_EquineGenitalia.cs" />
<Compile Include="Genes\Genitalia\GenitaliaChanger.cs" /> <Compile Include="Genes\Genitalia\GenitaliaChanger.cs" />
<Compile Include="Genes\Life_Force\Abilities\AbilityUtility.cs" /> <Compile Include="Genes\Life_Force\Abilities\AbilityUtility.cs" />
<Compile Include="Genes\Life_Force\Alert_LowFertilin.cs" /> <Compile Include="Genes\Life_Force\UI\Alert_LowFertilin.cs" />
<Compile Include="Genes\Life_Force\Abilities\CompAbilityEffect_Seduce.cs" /> <Compile Include="Genes\Life_Force\Abilities\CompAbilityEffect_Seduce.cs" />
<Compile Include="Genes\Life_Force\Abilities\CompAbilityEffect_LifeForceCost.cs" /> <Compile Include="Genes\Life_Force\Abilities\CompAbilityEffect_LifeForceCost.cs" />
<Compile Include="Genes\Life_Force\Abilities\CompAbilityEffect_CockEater.cs" /> <Compile Include="Genes\Life_Force\Abilities\CompAbilityEffect_CockEater.cs" />
<Compile Include="Genes\Life_Force\Abilities\CompProperties_Seduce.cs" /> <Compile Include="Genes\Life_Force\Abilities\CompProperties_Seduce.cs" />
<Compile Include="Genes\Life_Force\Abilities\CompProperties_AbilityCockEater.cs" /> <Compile Include="Genes\Life_Force\Abilities\CompProperties_AbilityCockEater.cs" />
<Compile Include="Genes\Life_Force\Gene_LifeForceDrain.cs" /> <Compile Include="Genes\Life_Force\Genes\Gene_LifeForceDrain.cs" />
<Compile Include="Genes\Life_Force\HediffCompProperties_SeverityFromFertilin.cs" /> <Compile Include="Genes\Life_Force\HediffCompProperties_SeverityFromFertilin.cs" />
<Compile Include="Genes\Life_Force\HediffComp_SeverityFromFertilin.cs" /> <Compile Include="Genes\Life_Force\HediffComp_SeverityFromFertilin.cs" />
<Compile Include="Genes\Life_Force\IncidentWorker_SuccubusDreamVisit.cs" /> <Compile Include="Genes\Life_Force\Events\SuccubusVisit\IncidentWorker_SuccubusDreamVisit.cs" />
<Compile Include="Genes\Life_Force\IngestionOutcomeDoer_LifeForceOffset.cs" /> <Compile Include="Genes\Life_Force\IngestionOutcomeDoer_LifeForceOffset.cs" />
<Compile Include="Genes\Life_Force\JobGiver_TryQuickieWith.cs" /> <Compile Include="Genes\Life_Force\JobGivers\JobGiver_TryQuickieWith.cs" />
<Compile Include="Genes\Life_Force\JobDrivers\JobDriver_Flirt.cs" /> <Compile Include="Genes\Life_Force\JobDrivers\JobDriver_Flirt.cs" />
<Compile Include="Genes\Life_Force\JobDrivers\JobDriver_SexOnSpotReceiver.cs" /> <Compile Include="Genes\Life_Force\JobDrivers\JobDriver_SexOnSpotReceiver.cs" />
<Compile Include="Genes\Life_Force\JobDrivers\JobDriver_SexOnSpot.cs" /> <Compile Include="Genes\Life_Force\JobDrivers\JobDriver_SexOnSpot.cs" />
<Compile Include="Genes\Life_Force\JobDrivers\JobDriver_Seduced.cs" /> <Compile Include="Genes\Life_Force\JobDrivers\JobDriver_Seduced.cs" />
<Compile Include="Genes\Life_Force\JobGiver_Flirt.cs" /> <Compile Include="Genes\Life_Force\JobGivers\JobGiver_Flirt.cs" />
<Compile Include="Genes\Life_Force\LordJob_SuccubusVisit.cs" /> <Compile Include="Genes\Life_Force\Events\SuccubusVisit\LordJob_SuccubusVisit.cs" />
<Compile Include="Genes\Life_Force\LordToil_Flirt.cs" /> <Compile Include="Genes\Life_Force\LordToil_Flirt.cs" />
<Compile Include="Genes\Life_Force\Patch_SexTicks_ChangePsyfocus.cs" /> <Compile Include="Genes\Life_Force\Patches\Patch_SexTicks_ChangePsyfocus.cs" />
<Compile Include="Genes\Life_Force\Patch_Vanilla_Inheritance_Fertilin.cs" /> <Compile Include="Genes\Life_Force\Patches\Patch_Vanilla_Inheritance_Fertilin.cs" />
<Compile Include="Genes\Life_Force\ThinkNode_ConditionalCannotInteract.cs" /> <Compile Include="Genes\Life_Force\ThinkNodes\ThinkNode_ConditionalCannotInteract.cs" />
<Compile Include="Genes\Life_Force\ThinkNode_ConditionalLowLifeForce.cs" /> <Compile Include="Genes\Life_Force\ThinkNodes\ThinkNode_ConditionalLowLifeForce.cs" />
<Compile Include="Genes\Life_Force\ThinkNode_ConditionalCritcalLifeForce.cs" /> <Compile Include="Genes\Life_Force\ThinkNodes\ThinkNode_ConditionalCritcalLifeForce.cs" />
<Compile Include="Genes\Life_Force\JobGiver_GetLifeForce.cs" /> <Compile Include="Genes\Life_Force\JobGivers\JobGiver_GetLifeForce.cs" />
<Compile Include="Genes\Life_Force\ThinkNode_NewFlirtTarget.cs" /> <Compile Include="Genes\Life_Force\ThinkNodes\ThinkNode_NewFlirtTarget.cs" />
<Compile Include="Genes\Special\Patch_AgeDrain.cs" /> <Compile Include="Genes\Special\Patch_AgeDrain.cs" />
<Compile Include="Interactions\CompAbility_SexInteractionRequirements.cs" /> <Compile Include="Interactions\SuccubusTailjob\CompAbility_SexInteractionRequirements.cs" />
<Compile Include="Genes\Life_Force\Abilities\CompAbilityEffect_PussyHeal.cs" /> <Compile Include="Genes\Life_Force\Abilities\CompAbilityEffect_PussyHeal.cs" />
<Compile Include="Genes\Life_Force\Abilities\CompProperties_AbilityLifeForceCost.cs" /> <Compile Include="Genes\Life_Force\Abilities\CompProperties_AbilityLifeForceCost.cs" />
<Compile Include="Interactions\CompProperties_SexInteractionRequirements.cs" /> <Compile Include="Interactions\SuccubusTailjob\CompProperties_SexInteractionRequirements.cs" />
<Compile Include="Genes\Life_Force\Abilities\CompProperties_AbilityPussyHeal.cs" /> <Compile Include="Genes\Life_Force\Abilities\CompProperties_AbilityPussyHeal.cs" />
<Compile Include="Genes\Life_Force\GeneGizmo_ResourceLifeForce.cs" /> <Compile Include="Genes\Life_Force\UI\GeneGizmo_ResourceLifeForce.cs" />
<Compile Include="Genes\Life_Force\JobDrivers\JobDriver_CastAbilityAfterSex.cs" /> <Compile Include="Genes\Life_Force\JobDrivers\JobDriver_CastAbilityAfterSex.cs" />
<Compile Include="Genes\Life_Force\LifeForceMentalState.cs" /> <Compile Include="Genes\Life_Force\MentalStates\LifeForceMentalState.cs" />
<Compile Include="Genes\Life_Force\LifeForceMentalStateWorker.cs" /> <Compile Include="Genes\Life_Force\MentalStates\LifeForceMentalStateWorker.cs" />
<Compile Include="Genes\Life_Force\JobGiver_LifeForce_RandomRape.cs" /> <Compile Include="Genes\Life_Force\JobGivers\JobGiver_LifeForce_RandomRape.cs" />
<Compile Include="Genes\Life_Force\LifeForceMentalBreakWorker.cs" /> <Compile Include="Genes\Life_Force\MentalStates\LifeForceMentalBreakWorker.cs" />
<Compile Include="Genes\Life_Force\Gene_LifeForce.cs" /> <Compile Include="Genes\Life_Force\Genes\Gene_LifeForce.cs" />
<Compile Include="Genes\RJW_Gene.cs" /> <Compile Include="Genes\RJW_Gene.cs" />
<Compile Include="Genes\Genitalia\GenitaliaUtility.cs" /> <Compile Include="Genes\Genitalia\GenitaliaUtility.cs" />
<Compile Include="Genes\Special\Gene_Aphrodisiac_Pheromones.cs" /> <Compile Include="Genes\Special\Gene_Aphrodisiac_Pheromones.cs" />
<Compile Include="Genes\Life_Force\Patch_LifeForce.cs" /> <Compile Include="Genes\Life_Force\Patches\Patch_SatisfyPersonal_LifeForceGain.cs" />
<Compile Include="Genes\Special\Patch_OrgasmRush.cs" /> <Compile Include="Genes\Special\Patch_OrgasmRush.cs" />
<Compile Include="Genes\Special\Patch_Youth_Fountain.cs" /> <Compile Include="Genes\Special\Patch_Youth_Fountain.cs" />
<Compile Include="HarmonyInit.cs" /> <Compile Include="HarmonyInit.cs" />
<Compile Include="HediffDefOf.cs" /> <Compile Include="HediffDefOf.cs" />
<Compile Include="Interactions\CustomSexInteraction_Helper.cs" /> <Compile Include="Interactions\SuccubusTailjob\CustomSexInteraction_Helper.cs" />
<Compile Include="Interactions\GenesPartKindUsageRule.cs" /> <Compile Include="Interactions\SuccubusTailjob\GenesPartKindUsageRule.cs" />
<Compile Include="Interactions\SubSuccubusTailCustomRequirementHandler.cs" /> <Compile Include="Interactions\SuccubusTailjob\SubSuccubusTailCustomRequirementHandler.cs" />
<Compile Include="Interactions\DomSuccubusTailCustomRequirementHandler.cs" /> <Compile Include="Interactions\SuccubusTailjob\DomSuccubusTailCustomRequirementHandler.cs" />
<Compile Include="JobDefOf.cs" /> <Compile Include="JobDefOf.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RJW_Genes.cs" /> <Compile Include="RJW_Genes.cs" />