mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
sexage check Fertilin and FertilinDraingene
Fertilin and all subgenes are only active if pawn is old enough to have sex, 13 if rjw teensex is enabled else 18. Added a fertilindraingene which greatly increases fertilin burn, but gives a lot of metabolic efficiency Also moved a few files into subfolders.
This commit is contained in:
parent
2e1e74e0b1
commit
09157e923d
21 changed files with 166 additions and 81 deletions
71
Source/Genes/Life_Force/Abilities/AbilityUtility.cs
Normal file
71
Source/Genes/Life_Force/Abilities/AbilityUtility.cs
Normal file
|
@ -0,0 +1,71 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse.Sound;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
using rjw.Modules.Interactions.Helpers;
|
||||
using rjw.Modules.Interactions.Enums;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class AbilityUtility
|
||||
{
|
||||
public static void PussyHeal(SexProps props)
|
||||
{
|
||||
if (InteractionHelper.GetWithExtension(props.dictionaryKey).DominantHasFamily(GenitalFamily.Vagina) || InteractionHelper.GetWithExtension(props.dictionaryKey).SubmissiveHasFamily(GenitalFamily.Vagina))
|
||||
{
|
||||
Pawn pawn = props.pawn;
|
||||
Pawn partner = props.partner;
|
||||
FloatRange tendQualityRange;
|
||||
tendQualityRange.min = 0.4f;
|
||||
tendQualityRange.max = 0.8f;
|
||||
if (GeneUtility.isPussyHealer(pawn))
|
||||
{
|
||||
Heal(partner, tendQualityRange);
|
||||
}
|
||||
if (GeneUtility.isPussyHealer(partner))
|
||||
{
|
||||
Heal(pawn, tendQualityRange);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Heal(Pawn pawn, FloatRange tendQualityRange)
|
||||
{
|
||||
bool any_wound_tended = false;
|
||||
List<Hediff> hediffs = pawn.health.hediffSet.hediffs;
|
||||
for (int i = hediffs.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if ((hediffs[i] is Hediff_Injury || hediffs[i] is Hediff_MissingPart) && hediffs[i].TendableNow(false))
|
||||
{
|
||||
hediffs[i].Tended(tendQualityRange.RandomInRange, tendQualityRange.TrueMax, 1);
|
||||
any_wound_tended = true;
|
||||
}
|
||||
}
|
||||
return any_wound_tended;
|
||||
}
|
||||
|
||||
public static float LifeForceCost(Ability ability)
|
||||
{
|
||||
if (ability.comps != null)
|
||||
{
|
||||
using (List<AbilityComp>.Enumerator enumerator = ability.comps.GetEnumerator())
|
||||
{
|
||||
while (enumerator.MoveNext())
|
||||
{
|
||||
CompAbilityEffect_LifeForceCost compAbilityEffect_HemogenCost;
|
||||
if ((compAbilityEffect_HemogenCost = (enumerator.Current as CompAbilityEffect_LifeForceCost)) != null)
|
||||
{
|
||||
return compAbilityEffect_HemogenCost.Props.fertilinCost;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue