Adde some explanations in the code

This commit is contained in:
Shabakur 2022-12-27 14:54:47 +01:00
parent 1f865320b0
commit e8f9f94130
8 changed files with 17 additions and 8 deletions

View file

@ -34,7 +34,7 @@ namespace RJW_Genes
}
//Get total fluidamount a persom has.
//Get total fluidamount a person has.
public static float GetTotalFluidAmount(Pawn pawn, float multiplier = 1f)
{
var partBPR = Genital_Helper.get_genitalsBPR(pawn);

View file

@ -39,7 +39,7 @@ namespace RJW_Genes
yield break;
}
//Depending on how low the value is it will increase sexdrive and if it reaches zero it will create a random rape mental break.
//Depending on how low the value is it will increase sexdrive and if it reaches zero it will create a mental break which will make the pawn rape others.
//Not using base.Tick() as it is used to start mental breaks, but we have another way to do it.
public override void Tick()
{

View file

@ -14,7 +14,6 @@ namespace RJW_Genes
[HarmonyPatch(typeof(SexUtility), nameof(SexUtility.SatisfyPersonal))]
public static class Patch_LifeForce
{
public static void Postfix(SexProps props)
{
// ShortCuts: Exit Early if Pawn or Partner are null (can happen with Animals or Masturbation)
@ -27,7 +26,7 @@ namespace RJW_Genes
{
Pawn_GeneTracker genes = props.pawn.genes;
Gene_LifeForce gene = genes.GetFirstGeneOfType<Gene_LifeForce>();
gene.Resource.Value += CumUtility.GetTotalFluidAmount(props.partner); //total amount may need to be modified to be balanced
gene.Resource.Value += CumUtility.GetTotalFluidAmount(props.partner); //total amount may need to be modified to be balanced or maybe I should just consider one at random
}
}
}

View file

@ -12,6 +12,8 @@ namespace RJW_Genes
{
public class Gene_Aphrodisiac_Pheromones : Gene
{
//Summary one every one check for all pawns nearby and in line of sight and add/renew a hediff which increases sexdrive for six hours.
public override void Tick()
{
base.Tick();
@ -24,11 +26,12 @@ namespace RJW_Genes
}
}
//Creatus an IEnumerable of all pawns which are closeby and in lineofsight
private IEnumerable<Pawn> AffectedPawns(IntVec3 pos, Map map)
{
foreach (Pawn pawn in map.mapPawns.AllPawns)
{
if (pos.DistanceTo(pawn.Position) < 5)
if (pos.DistanceTo(pawn.Position) < 5 && GenSight.LineOfSight(pos, pawn.Position, pawn.Map))
{
yield return pawn;
}
@ -37,6 +40,7 @@ namespace RJW_Genes
yield break;
}
//Applies er renews a hediff which increases sexdrive for 6 hours
private void InduceAphrodisiac(Pawn pawn)
{
Hediff hediff = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.Aphrodisiac_Pheromone);