mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Compare commits
4 commits
2380db1ce6
...
a72dc01d73
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a72dc01d73 | ||
|
|
7220accf4a | ||
|
|
8d3eeda0bf | ||
|
|
f2871744fd |
10 changed files with 62 additions and 145 deletions
|
|
@ -5,7 +5,6 @@
|
||||||
<randomChosen>true</randomChosen>
|
<randomChosen>true</randomChosen>
|
||||||
<exclusionTags>
|
<exclusionTags>
|
||||||
<li>Wing</li>
|
<li>Wing</li>
|
||||||
<li>Wings</li>
|
|
||||||
</exclusionTags>
|
</exclusionTags>
|
||||||
<graphicData>
|
<graphicData>
|
||||||
<drawLoc>Tailbone</drawLoc>
|
<drawLoc>Tailbone</drawLoc>
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,8 @@ namespace RJW_Genes
|
||||||
public static readonly GeneDef rjw_genes_vaginal_absorber;
|
public static readonly GeneDef rjw_genes_vaginal_absorber;
|
||||||
public static readonly GeneDef rjw_genes_anal_absorber;
|
public static readonly GeneDef rjw_genes_anal_absorber;
|
||||||
public static readonly GeneDef rjw_genes_drainer;
|
public static readonly GeneDef rjw_genes_drainer;
|
||||||
|
public static readonly GeneDef rjw_genes_seduce;
|
||||||
|
public static readonly GeneDef rjw_genes_paralysingkiss;
|
||||||
|
|
||||||
// Cosmetic
|
// Cosmetic
|
||||||
public static readonly GeneDef rjw_genes_succubus_tail;
|
public static readonly GeneDef rjw_genes_succubus_tail;
|
||||||
|
|
@ -96,4 +98,5 @@ namespace RJW_Genes
|
||||||
public static readonly MentalBreakDef rjw_genes_lifeforce_randomrape;
|
public static readonly MentalBreakDef rjw_genes_lifeforce_randomrape;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,6 @@ namespace RJW_Genes
|
||||||
{
|
{
|
||||||
public class GeneUtility
|
public class GeneUtility
|
||||||
{
|
{
|
||||||
//Instead of seperate functions this should be simpeler
|
|
||||||
public static bool HasGeneNullCheck(Pawn pawn, GeneDef genedef)
|
|
||||||
{
|
|
||||||
if (pawn.genes == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pawn.genes.HasGene(genedef);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Split function so I can offsetlifeforce from gene without needing to look for the gene agian (for the constant drain tick)
|
//Split function so I can offsetlifeforce from gene without needing to look for the gene agian (for the constant drain tick)
|
||||||
public static Gene_LifeForce GetLifeForceGene(Pawn pawn)
|
public static Gene_LifeForce GetLifeForceGene(Pawn pawn)
|
||||||
|
|
@ -35,10 +26,11 @@ namespace RJW_Genes
|
||||||
{
|
{
|
||||||
if (old_value > 0.2f && drain.Resource.Value <= 0.2f)
|
if (old_value > 0.2f && drain.Resource.Value <= 0.2f)
|
||||||
{
|
{
|
||||||
//Mood debuff
|
//TODO: Mood debuff
|
||||||
}
|
}
|
||||||
else if (old_value > 0f && drain.Resource.Value <= 0f)
|
else if (old_value > 0f && drain.Resource.Value <= 0f)
|
||||||
{
|
{
|
||||||
|
Pawn pawn = drain.Pawn;
|
||||||
if (!drain.Pawn.health.hediffSet.HasHediff(HediffDefOf.rjw_genes_fertilin_craving))
|
if (!drain.Pawn.health.hediffSet.HasHediff(HediffDefOf.rjw_genes_fertilin_craving))
|
||||||
{
|
{
|
||||||
drain.Pawn.health.AddHediff(HediffDefOf.rjw_genes_fertilin_craving);
|
drain.Pawn.health.AddHediff(HediffDefOf.rjw_genes_fertilin_craving);
|
||||||
|
|
@ -46,24 +38,6 @@ namespace RJW_Genes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsMechbreeder(Pawn pawn)
|
|
||||||
{
|
|
||||||
if (pawn.genes == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_mechbreeder);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool HasLifeForce(Pawn pawn)
|
|
||||||
{
|
|
||||||
if (pawn.genes == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_lifeforce);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool HasLowLifeForce(Pawn pawn)
|
public static bool HasLowLifeForce(Pawn pawn)
|
||||||
{
|
{
|
||||||
if (HasLifeForce(pawn))
|
if (HasLifeForce(pawn))
|
||||||
|
|
@ -90,42 +64,6 @@ namespace RJW_Genes
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsInsectIncubator(Pawn pawn)
|
|
||||||
{
|
|
||||||
if (pawn.genes == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_insectincubator);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool IsYouthFountain(Pawn pawn)
|
|
||||||
{
|
|
||||||
if (pawn.genes == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_youth_fountain);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool IsAgeDrainer(Pawn pawn)
|
|
||||||
{
|
|
||||||
if (pawn.genes == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_sex_age_drain);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool IsInsectBreeder(Pawn pawn)
|
|
||||||
{
|
|
||||||
if (pawn.genes == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_insectbreeder);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static float MaxEggSizeMul(Pawn pawn)
|
public static float MaxEggSizeMul(Pawn pawn)
|
||||||
{
|
{
|
||||||
float MaxEggSize = 1;
|
float MaxEggSize = 1;
|
||||||
|
|
@ -135,51 +73,6 @@ namespace RJW_Genes
|
||||||
}
|
}
|
||||||
return MaxEggSize;
|
return MaxEggSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static bool IsElastic(Pawn pawn)
|
|
||||||
{
|
|
||||||
if (pawn.genes == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_elasticity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool IsCumflationImmune(Pawn pawn)
|
|
||||||
{
|
|
||||||
if (pawn.genes == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_cumflation_immunity);
|
|
||||||
}
|
|
||||||
public static bool IsGenerousDonor(Pawn pawn)
|
|
||||||
{
|
|
||||||
if (pawn.genes == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_generous_donor);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool isPussyHealer(Pawn pawn)
|
|
||||||
{
|
|
||||||
if (pawn.genes == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_pussyhealing);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool IsUnbreakable(Pawn pawn)
|
|
||||||
{
|
|
||||||
if (pawn.genes == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_unbreakable);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<Gene_GenitaliaResizingGene> GetGenitaliaResizingGenes(Pawn pawn)
|
public static List<Gene_GenitaliaResizingGene> GetGenitaliaResizingGenes(Pawn pawn)
|
||||||
{
|
{
|
||||||
var ResizingGenes = new List<Gene_GenitaliaResizingGene>();
|
var ResizingGenes = new List<Gene_GenitaliaResizingGene>();
|
||||||
|
|
@ -194,5 +87,36 @@ namespace RJW_Genes
|
||||||
|
|
||||||
return ResizingGenes;
|
return ResizingGenes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unified small check for a pawn if it has a specified Gene.
|
||||||
|
/// Handles some errors and returns false as default.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pawn">The pawn for which to look up a gene.</param>
|
||||||
|
/// <param name="genedef">The gene to look up.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool HasGeneNullCheck(Pawn pawn, GeneDef genedef)
|
||||||
|
{
|
||||||
|
if (pawn.genes == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return pawn.genes.HasGene(genedef);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool HasLifeForce(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_lifeforce); }
|
||||||
|
public static bool IsMechbreeder(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_mechbreeder); }
|
||||||
|
public static bool IsInsectIncubator(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_insectincubator); }
|
||||||
|
public static bool IsYouthFountain(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_youth_fountain); }
|
||||||
|
public static bool IsAgeDrainer(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_sex_age_drain); }
|
||||||
|
public static bool IsInsectBreeder(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_insectbreeder); }
|
||||||
|
public static bool IsElastic(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_elasticity); }
|
||||||
|
public static bool IsCumflationImmune(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_cumflation_immunity); }
|
||||||
|
public static bool IsGenerousDonor(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_generous_donor); }
|
||||||
|
public static bool IsPussyHealer(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_pussyhealing); }
|
||||||
|
public static bool IsUnbreakable(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_unbreakable); }
|
||||||
|
public static bool HasParalysingKiss(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_paralysingkiss); }
|
||||||
|
public static bool HasSeduce(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_seduce); }
|
||||||
|
public static bool IsSexualDrainer(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_drainer); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -23,11 +23,11 @@ namespace RJW_Genes
|
||||||
FloatRange tendQualityRange;
|
FloatRange tendQualityRange;
|
||||||
tendQualityRange.min = 0.4f;
|
tendQualityRange.min = 0.4f;
|
||||||
tendQualityRange.max = 0.8f;
|
tendQualityRange.max = 0.8f;
|
||||||
if (GeneUtility.isPussyHealer(pawn))
|
if (GeneUtility.IsPussyHealer(pawn))
|
||||||
{
|
{
|
||||||
Heal(partner, tendQualityRange);
|
Heal(partner, tendQualityRange);
|
||||||
}
|
}
|
||||||
if (GeneUtility.isPussyHealer(partner))
|
if (GeneUtility.IsPussyHealer(partner))
|
||||||
{
|
{
|
||||||
Heal(pawn, tendQualityRange);
|
Heal(pawn, tendQualityRange);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,4 @@
|
||||||
using System;
|
using Verse;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Text;
|
|
||||||
using Verse;
|
|
||||||
using Verse.AI;
|
using Verse.AI;
|
||||||
using RimWorld;
|
using RimWorld;
|
||||||
namespace RJW_Genes
|
namespace RJW_Genes
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,14 @@ namespace RJW_Genes
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else if (GeneUtility.HasSeduce(pawn))
|
||||||
|
{
|
||||||
|
if (throwMessages)
|
||||||
|
{
|
||||||
|
Messages.Message(pawn.Name + " cannot be seduced, as they also have the Seduce-Ability", pawn, MessageTypeDefOf.RejectInput, false);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
else if (pawn.Downed)
|
else if (pawn.Downed)
|
||||||
{
|
{
|
||||||
if (throwMessages)
|
if (throwMessages)
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,4 @@
|
||||||
using HarmonyLib;
|
using System.Collections.Generic;
|
||||||
using rjw;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Verse;
|
using Verse;
|
||||||
using RimWorld;
|
using RimWorld;
|
||||||
|
|
||||||
|
|
@ -13,7 +7,7 @@ namespace RJW_Genes
|
||||||
public class Gene_Aphrodisiac_Pheromones : Gene
|
public class Gene_Aphrodisiac_Pheromones : Gene
|
||||||
{
|
{
|
||||||
|
|
||||||
//Summary once every one hour check for all pawns nearby and in line of sight (same room) and add/renew a hediff which lasts for 1 hour.
|
// Summary: once every one hour check for all pawns nearby and in line of sight (same room) and add/renew a hediff which lasts for 1 hour.
|
||||||
public override void Tick()
|
public override void Tick()
|
||||||
{
|
{
|
||||||
base.Tick();
|
base.Tick();
|
||||||
|
|
@ -31,21 +25,23 @@ namespace RJW_Genes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Creatus an IEnumerable of all pawns which are closeby and in lineofsight, self and other pawns with aphrodisiac pheromones gene are skipped (to prevent loops).
|
// Creates an IEnumerable of all pawns which are closeby and in lineofsight, self and other pawns with aphrodisiac pheromones gene are skipped (to prevent loops).
|
||||||
private IEnumerable<Pawn> AffectedPawns(IntVec3 pos, Map map)
|
private IEnumerable<Pawn> AffectedPawns(IntVec3 pos, Map map)
|
||||||
{
|
{
|
||||||
foreach (Pawn pawn in map.mapPawns.AllPawns)
|
foreach (Pawn pawn in map.mapPawns.AllPawns)
|
||||||
{
|
{
|
||||||
if (pawn != null && this.pawn != null && pawn != this.pawn && pos.DistanceTo(pawn.Position) < 5 && GenSight.LineOfSight(pos, pawn.Position, pawn.Map) && !GeneUtility.HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_aphrodisiac_pheromones))
|
if (pawn != null && this.pawn != null && pawn != this.pawn
|
||||||
|
&& pos.DistanceTo(pawn.Position) < 5 && GenSight.LineOfSight(pos, pawn.Position, pawn.Map)
|
||||||
|
&& !GeneUtility.HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_aphrodisiac_pheromones))
|
||||||
{
|
{
|
||||||
yield return pawn;
|
yield return pawn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//IEnumerator<Pawn> enumerator = null;
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Applies or renews a hediff which increases sexdrive for 1 hours
|
// Applies or renews a hediff which increases sexdrive for 6 hours
|
||||||
private void InduceAphrodisiac(Pawn pawn, float sexfrequency)
|
private void InduceAphrodisiac(Pawn pawn, float sexfrequency)
|
||||||
{
|
{
|
||||||
Hediff hediff = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.rjw_genes_aphrodisiac_pheromone);
|
Hediff hediff = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.rjw_genes_aphrodisiac_pheromone);
|
||||||
|
|
@ -68,7 +64,7 @@ namespace RJW_Genes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Function to modify aphrodisiac strength, currently has no effect, but it's an easy hook for other modders.
|
// Function to modify aphrodisiac strength, currently has no effect, but provides an easy hook for other modders and patches.
|
||||||
public float ModifySexfrequency(Pawn pawn, float sexfrequency)
|
public float ModifySexfrequency(Pawn pawn, float sexfrequency)
|
||||||
{
|
{
|
||||||
return sexfrequency;
|
return sexfrequency;
|
||||||
|
|
@ -1,17 +1,9 @@
|
||||||
using System;
|
using Verse;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Verse;
|
|
||||||
using RimWorld;
|
|
||||||
using rjw.Modules.Interactions;
|
using rjw.Modules.Interactions;
|
||||||
using rjw.Modules.Interactions.Internals.Implementation;
|
using rjw.Modules.Interactions.Internals.Implementation;
|
||||||
using rjw.Modules.Interactions.Objects;
|
using rjw.Modules.Interactions.Objects;
|
||||||
using rjw;
|
|
||||||
using rjw.Modules.Interactions.Enums;
|
|
||||||
|
|
||||||
//Modefied code based of RJW-AI code at https://gitgud.io/Ed86/rjw-ia/-/tree/master/
|
//Modified code based of RJW-AI code at https://gitgud.io/Ed86/rjw-ia/-/tree/master/
|
||||||
namespace RJW_Genes
|
namespace RJW_Genes
|
||||||
{
|
{
|
||||||
[StaticConstructorOnStartup]
|
[StaticConstructorOnStartup]
|
||||||
|
|
@ -25,7 +17,6 @@ namespace RJW_Genes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static SubSuccubusTailCustomRequirementHandler()
|
static SubSuccubusTailCustomRequirementHandler()
|
||||||
{
|
{
|
||||||
Register();
|
Register();
|
||||||
|
|
@ -50,3 +41,4 @@ namespace RJW_Genes
|
||||||
//public static readonly StringListDef filter = DefDatabase<StringListDef>.GetNamed("SubSuccubusTailFilter");
|
//public static readonly StringListDef filter = DefDatabase<StringListDef>.GetNamed("SubSuccubusTailFilter");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@
|
||||||
<Compile Include="Genes\Life_Force\Gene_LifeForce.cs" />
|
<Compile Include="Genes\Life_Force\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\Patch_LifeForce.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" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue