Several genes and changes

- Succubus wings now have the flight abilty (same as longjump)
- Modified aphrodisiac pheromones to increase with strenght based on carrier's sexdrive.
- Added paralysing kiss, touch range stun which uses fertilin
- Added seduce, beckon like ability which results in sex if target reached caster. Uses fertilin
This commit is contained in:
Shabakur 2023-01-06 12:42:04 +01:00
parent 5555083bc2
commit 400b48787d
25 changed files with 687 additions and 171 deletions

View file

@ -19,19 +19,24 @@ namespace RJW_Genes
base.Tick();
if (this.pawn.IsHashIntervalTick(2500))
{
foreach (Pawn pawn in this.AffectedPawns(this.pawn.Position, this.pawn.Map))
{
this.InduceAphrodisiac(pawn);
}
//Only spread pheromones if sexdrive above 1
float sexfrequency = this.pawn.GetStatValue(StatDef.Named("SexFrequency"));
if(sexfrequency > 1f)
{
foreach (Pawn pawn in this.AffectedPawns(this.pawn.Position, this.pawn.Map))
{
this.InduceAphrodisiac(pawn, sexfrequency);
}
}
}
}
//Creatus an IEnumerable of all pawns which are closeby and in lineofsight
//Creatus an IEnumerable of all pawns which are closeby and in lineofsight, self and other pawns with aphrodisiac pheromones gene are skipped.
private IEnumerable<Pawn> AffectedPawns(IntVec3 pos, Map map)
{
foreach (Pawn pawn in map.mapPawns.AllPawns)
{
if (pos.DistanceTo(pawn.Position) < 5 && GenSight.LineOfSight(pos, pawn.Position, pawn.Map))
if (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;
}
@ -41,17 +46,35 @@ namespace RJW_Genes
}
//Applies er renews a hediff which increases sexdrive for 6 hours
private void InduceAphrodisiac(Pawn pawn)
private void InduceAphrodisiac(Pawn pawn, float sexfrequency)
{
Hediff hediff = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.Aphrodisiac_Pheromone);
if (hediff != null)
{
hediff.Severity = 1f;
}
else
{
pawn.health.AddHediff(HediffDefOf.Aphrodisiac_Pheromone);
Hediff aphrodisiac = HediffMaker.MakeHediff(HediffDefOf.Aphrodisiac_Pheromone, pawn);
foreach (StatModifier stat in aphrodisiac.CurStage.statFactors)
{
//Log.Message(pawn.Name.ToString());
//Log.Message(stat.stat.defName);
//Log.Message(stat.value.ToString());
if (stat.stat.defName == "SexFrequency")
{
stat.value = ModifySexfrequency(pawn, sexfrequency);
pawn.health.AddHediff(aphrodisiac);
}
}
}
}
//Function to modify aphrodisiac strength, currently has no effect, but it's an easy hook for other modders.
public float ModifySexfrequency(Pawn pawn, float sexfrequency)
{
return sexfrequency;
}
}
}