diff --git a/Common/Assemblies/Rjw-Genes.dll b/Common/Assemblies/Rjw-Genes.dll
index f579951..e0c2fea 100644
Binary files a/Common/Assemblies/Rjw-Genes.dll and b/Common/Assemblies/Rjw-Genes.dll differ
diff --git a/Common/Defs/Genes/GeneDefs_LifeForce.xml b/Common/Defs/Genes/GeneDefs_LifeForce.xml
index 76b6ef6..ed1ea9a 100644
--- a/Common/Defs/Genes/GeneDefs_LifeForce.xml
+++ b/Common/Defs/Genes/GeneDefs_LifeForce.xml
@@ -3,10 +3,10 @@
rjw_genes_lifeforce
- Carriers of this gene have a reserve of biological strength powered by a resource called fertilin. The resource can be gained and spent in various ways, all of which are unlocked by other genes.\n\nCarriers lose 10 lifeforce per day from biological entropy.
+ Carriers of this gene have a reserve of biological strength powered by a resource called fertilin. The resource can be gained and spent in various ways, some of which are unlocked by other genes.\n\nCarriers lose 5 fertilin per day from biological entropy. \n\nGene is inactive until carrier is able to have sex.RJW_Genes.Gene_LifeForceRJW_Genes.GeneGizmo_ResourceLifeForce
- lifeforce
+ fertilin
0.25
0.5
@@ -28,12 +28,27 @@
rjw_genes_lifeforce_randomrape
- 180.0511
+
+ LifeForceDrain
+
+ draining
+ Carriers lose an additional 15 fertilin per day from biological entropy.
+ fertilin
+ RJW_Genes.Gene_LifeForceDrain
+ UI/Icons/Genes/Gene_HemogenDrain
+ rjw_genes_lifeforce
+ 0.15
+ rjw_genes_fertilin
+ -1
+ 1
+ 6
+
+
rjw_genes_pussyhealer
@@ -41,7 +56,7 @@
Carriers of this gene are able use vaginal sex to tend to other's wounds.Things/Mote/Heartrjw_genes_lifeforce
- 10
+ 9rjw_genes_fertilin
rjw_genes_pussyheal
@@ -51,7 +66,6 @@
1-1
- 18
life
@@ -78,7 +92,6 @@
1-1
- 18
life
@@ -95,7 +108,7 @@
Carriers of this gene are able to briefly stun an enemy with a kiss.Things/Mote/Heartrjw_genes_lifeforce
- 11
+ 12rjw_genes_fertilin
rjw_genes_paralysingkiss
@@ -105,7 +118,6 @@
1-1
- 18
stun
@@ -121,7 +133,7 @@
Carriers of this gene are able to seduce a pawn into having sex with them.Things/Mote/Heartrjw_genes_lifeforce
- 11
+ 13rjw_genes_fertilin
rjw_genes_seduce
@@ -131,7 +143,7 @@
1-1
- 18
+
stun
diff --git a/Source/Genes/GeneUtility.cs b/Source/Genes/GeneUtility.cs
index 68e2969..f3493f9 100644
--- a/Source/Genes/GeneUtility.cs
+++ b/Source/Genes/GeneUtility.cs
@@ -18,28 +18,25 @@ namespace RJW_Genes
//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)
{
- Pawn_GeneTracker genes2 = pawn.genes;
- Gene_LifeForce gene_LifeForce = (genes2 != null) ? genes2.GetFirstGeneOfType() : null;
+ Pawn_GeneTracker genes = pawn.genes;
+ Gene_LifeForce gene_LifeForce = genes.GetFirstGeneOfType();
return gene_LifeForce;
}
- public static void OffsetLifeForce(Gene_LifeForce gene_LifeForce, float offset, bool applyStatFactor = true)
- {
- if (gene_LifeForce != null)
- {
- float old_value = gene_LifeForce.Value;
- gene_LifeForce.Value += offset;
- PostOffSetLifeForce(gene_LifeForce, old_value);
- }
+ public static void OffsetLifeForce(IGeneResourceDrain drain, float offset)
+ {
+ float old_value = drain.Resource.Value;
+ drain.Resource.Value += offset;
+ //PostOffSetLifeForce(drain, old_value);
}
- public static void PostOffSetLifeForce(Gene_LifeForce gene_LifeForce, float old_value)
+ public static void PostOffSetLifeForce(IGeneResourceDrain drain, float old_value)
{
- if (old_value > 0.15f && gene_LifeForce.Resource.Value <= 0.15f)
+ if (old_value > 0.2f && drain.Resource.Value <= 0.2f)
{
- Pawn pawn = gene_LifeForce.Pawn;
+ Pawn pawn = drain.Pawn;
- //Give thoughtdef
+ //Do things
}
}
diff --git a/Source/Genes/Life_Force/AbilityUtility.cs b/Source/Genes/Life_Force/Abilities/AbilityUtility.cs
similarity index 100%
rename from Source/Genes/Life_Force/AbilityUtility.cs
rename to Source/Genes/Life_Force/Abilities/AbilityUtility.cs
diff --git a/Source/Genes/Life_Force/CompAbilityEffect_CockEater.cs b/Source/Genes/Life_Force/Abilities/CompAbilityEffect_CockEater.cs
similarity index 83%
rename from Source/Genes/Life_Force/CompAbilityEffect_CockEater.cs
rename to Source/Genes/Life_Force/Abilities/CompAbilityEffect_CockEater.cs
index 88d0dad..d4d12ea 100644
--- a/Source/Genes/Life_Force/CompAbilityEffect_CockEater.cs
+++ b/Source/Genes/Life_Force/Abilities/CompAbilityEffect_CockEater.cs
@@ -37,7 +37,7 @@ namespace RJW_Genes
if (GenitaliaChanger.IsArtificial(part))
continue;
- if (rjw.Genital_Helper.is_penis(part))
+ if (Genital_Helper.is_penis(part))
{
GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(this.parent.pawn), part.Severity); ;
pawn.health.RemoveHediff(part);
@@ -83,5 +83,17 @@ namespace RJW_Genes
}
return base.Valid(target, throwMessages);
}
+ public override bool GizmoDisabled(out string reason)
+ {
+ Pawn_GeneTracker genes = this.parent.pawn.genes;
+ Gene_LifeForce gene_LifeForce = (genes != null) ? genes.GetFirstGeneOfType() : null;
+ if (gene_LifeForce == null)
+ {
+ reason = "AbilityDisabledNoFertilinGene".Translate(this.parent.pawn);
+ return true;
+ }
+ reason = null;
+ return false;
+ }
}
}
diff --git a/Source/Genes/Life_Force/CompAbilityEffect_LifeForceCost.cs b/Source/Genes/Life_Force/Abilities/CompAbilityEffect_LifeForceCost.cs
similarity index 85%
rename from Source/Genes/Life_Force/CompAbilityEffect_LifeForceCost.cs
rename to Source/Genes/Life_Force/Abilities/CompAbilityEffect_LifeForceCost.cs
index 363b414..d291185 100644
--- a/Source/Genes/Life_Force/CompAbilityEffect_LifeForceCost.cs
+++ b/Source/Genes/Life_Force/Abilities/CompAbilityEffect_LifeForceCost.cs
@@ -8,11 +8,9 @@ using Verse.AI;
using RimWorld;
namespace RJW_Genes
{
- // Token: 0x02000F66 RID: 3942
public class CompAbilityEffect_LifeForceCost : CompAbilityEffect
{
- // Token: 0x17000FFB RID: 4091
- // (get) Token: 0x06005D18 RID: 23832 RVA: 0x001FA767 File Offset: 0x001F8967
+
public new CompProperties_AbilityLifeForceCost Props
{
get
@@ -21,8 +19,6 @@ namespace RJW_Genes
}
}
- // Token: 0x17000FFC RID: 4092
- // (get) Token: 0x06005D19 RID: 23833 RVA: 0x001FA774 File Offset: 0x001F8974
private bool HasEnoughFertilin
{
get
@@ -33,14 +29,13 @@ namespace RJW_Genes
}
}
- // Token: 0x06005D1A RID: 23834 RVA: 0x001FA7B7 File Offset: 0x001F89B7
public override void Apply(LocalTargetInfo target, LocalTargetInfo dest)
{
base.Apply(target, dest);
- GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(this.parent.pawn), -this.Props.fertilinCost, true);
+ GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(this.parent.pawn), -this.Props.fertilinCost);
}
- // Token: 0x06005D1B RID: 23835 RVA: 0x001FA7E0 File Offset: 0x001F89E0
+
public override bool GizmoDisabled(out string reason)
{
Pawn_GeneTracker genes = this.parent.pawn.genes;
@@ -111,8 +106,7 @@ namespace RJW_Genes
}
return num2;
}
-
- //Modified version of HemogenCost in Ability
+
}
}
diff --git a/Source/Genes/Life_Force/CompAbilityEffect_PussyHeal.cs b/Source/Genes/Life_Force/Abilities/CompAbilityEffect_PussyHeal.cs
similarity index 100%
rename from Source/Genes/Life_Force/CompAbilityEffect_PussyHeal.cs
rename to Source/Genes/Life_Force/Abilities/CompAbilityEffect_PussyHeal.cs
diff --git a/Source/Genes/Life_Force/CompAbilityEffect_Seduce.cs b/Source/Genes/Life_Force/Abilities/CompAbilityEffect_Seduce.cs
similarity index 100%
rename from Source/Genes/Life_Force/CompAbilityEffect_Seduce.cs
rename to Source/Genes/Life_Force/Abilities/CompAbilityEffect_Seduce.cs
diff --git a/Source/Genes/Life_Force/CompProperties_AbilityCockEater.cs b/Source/Genes/Life_Force/Abilities/CompProperties_AbilityCockEater.cs
similarity index 100%
rename from Source/Genes/Life_Force/CompProperties_AbilityCockEater.cs
rename to Source/Genes/Life_Force/Abilities/CompProperties_AbilityCockEater.cs
diff --git a/Source/Genes/Life_Force/CompProperties_AbilityLifeForceCost.cs b/Source/Genes/Life_Force/Abilities/CompProperties_AbilityLifeForceCost.cs
similarity index 100%
rename from Source/Genes/Life_Force/CompProperties_AbilityLifeForceCost.cs
rename to Source/Genes/Life_Force/Abilities/CompProperties_AbilityLifeForceCost.cs
diff --git a/Source/Genes/Life_Force/CompProperties_AbilityPussyHeal.cs b/Source/Genes/Life_Force/Abilities/CompProperties_AbilityPussyHeal.cs
similarity index 100%
rename from Source/Genes/Life_Force/CompProperties_AbilityPussyHeal.cs
rename to Source/Genes/Life_Force/Abilities/CompProperties_AbilityPussyHeal.cs
diff --git a/Source/Genes/Life_Force/CompProperties_Seduce.cs b/Source/Genes/Life_Force/Abilities/CompProperties_Seduce.cs
similarity index 100%
rename from Source/Genes/Life_Force/CompProperties_Seduce.cs
rename to Source/Genes/Life_Force/Abilities/CompProperties_Seduce.cs
diff --git a/Source/Genes/Life_Force/Gene_LifeForce.cs b/Source/Genes/Life_Force/Gene_LifeForce.cs
index da5c65b..c5cfa12 100644
--- a/Source/Genes/Life_Force/Gene_LifeForce.cs
+++ b/Source/Genes/Life_Force/Gene_LifeForce.cs
@@ -6,18 +6,35 @@ using System.Threading.Tasks;
using UnityEngine;
using Verse;
using RimWorld;
-
+using rjw;
namespace RJW_Genes
{
public class Gene_LifeForce : Gene_Resource, IGeneResourceDrain
{
- public override void ExposeData()
+ //Gene should only be active if sex is allowed for this pawn
+ public override bool Active
{
- base.ExposeData();
+ get
+ {
+ if (this.Overridden)
+ {
+ return false;
+ }
+ Pawn pawn = this.pawn;
+
+ return ((pawn != null) ? pawn.ageTracker : null) == null ||
+ ((float)this.pawn.ageTracker.AgeBiologicalYears >= this.def.minAgeActive && this.pawn.ageTracker.AgeBiologicalYears >= (RJWSettings.AllowYouthSex ? 13f : 18f));
+ }
}
- public bool ShouldConsumeLifeForceNow()
+ public override void ExposeData()
+ {
+ base.ExposeData();
+ Scribe_Values.Look(ref this.StoredCumAllowed, "StoredCumAllowed", true, false);
+ }
+
+ public bool ShouldConsumeLifeForceNow()
{
return this.Value < this.targetValue;
}
@@ -43,14 +60,7 @@ namespace RJW_Genes
//base.Tick();
if (this.CanOffset && this.Resource != null)
{
- if (this.CanOffset)
- {
- if (this.Resource == null)
- {
- return;
- }
- GeneUtility.OffsetLifeForce(this, -this.ResourceLossPerDay / 60000f);
- }
+ GeneUtility.OffsetLifeForce(this, -this.ResourceLossPerDay / 60000f);
//this.Resource.Value -= this.ResourceLossPerDay / 60000;
if (this.Resource.Value <= 0 && this.pawn.IsHashIntervalTick(300))
{
@@ -62,11 +72,9 @@ namespace RJW_Genes
}
}
}
- //GeneResourceDrainUtility.TickResourceDrain(this);
}
public bool StoredCumAllowed = true;
-
public Gene_Resource Resource
{
get
@@ -117,7 +125,7 @@ namespace RJW_Genes
{
get
{
- return 0.15f;
+ return 0.2f;
}
}
public override float MaxLevelOffset
diff --git a/Source/Genes/Life_Force/Gene_LifeForceDrain.cs b/Source/Genes/Life_Force/Gene_LifeForceDrain.cs
new file mode 100644
index 0000000..335e257
--- /dev/null
+++ b/Source/Genes/Life_Force/Gene_LifeForceDrain.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using Verse;
+using RimWorld;
+
+namespace RJW_Genes
+{
+ public class Gene_LifeForceDrain : Gene, IGeneResourceDrain
+ {
+ public Gene_Resource Resource
+ {
+ get
+ {
+ if (this.cachedLifeForceGene == null || !this.cachedLifeForceGene.Active)
+ {
+ this.cachedLifeForceGene = this.pawn.genes.GetFirstGeneOfType();
+ }
+ return this.cachedLifeForceGene;
+ }
+ }
+
+ public bool CanOffset
+ {
+ get
+ {
+ return this.Active && this.Resource != null && this.Resource.Active;
+ }
+ }
+
+ public float ResourceLossPerDay
+ {
+ get
+ {
+ return this.def.resourceLossPerDay;
+ }
+ }
+
+ public Pawn Pawn
+ {
+ get
+ {
+ return this.pawn;
+ }
+ }
+
+ public string DisplayLabel
+ {
+ get
+ {
+ return this.Label + " (" + "Gene".Translate() + ")";
+ }
+ }
+
+ public override void Tick()
+ {
+ base.Tick();
+ if (this.CanOffset && this.Resource != null)
+ {
+ GeneUtility.OffsetLifeForce(this, -this.ResourceLossPerDay / 60000);
+ }
+ }
+
+ public override IEnumerable GetGizmos()
+ {
+ foreach (Gizmo gizmo in GeneResourceDrainUtility.GetResourceDrainGizmos(this))
+ {
+ yield return gizmo;
+ }
+ IEnumerator enumerator = null;
+ yield break;
+ yield break;
+ }
+
+ [Unsaved(false)]
+ private Gene_LifeForce cachedLifeForceGene;
+
+ private const float MinAgeForDrain = 3f;
+ }
+}
diff --git a/Source/Genes/Life_Force/Interactionchances.cs b/Source/Genes/Life_Force/Interactionchances.cs
deleted file mode 100644
index fd7a43d..0000000
--- a/Source/Genes/Life_Force/Interactionchances.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Verse;
-using RimWorld;
-namespace RJW_Genes
-{
- public class Interaction_weights
- {
- public InteractionDef interaction;
- public int weight = 1;
-
- }
-}
diff --git a/Source/Genes/Life_Force/JobDriver_CastAbilityAfterSex.cs b/Source/Genes/Life_Force/JobDrivers/JobDriver_CastAbilityAfterSex.cs
similarity index 100%
rename from Source/Genes/Life_Force/JobDriver_CastAbilityAfterSex.cs
rename to Source/Genes/Life_Force/JobDrivers/JobDriver_CastAbilityAfterSex.cs
diff --git a/Source/Genes/Life_Force/JobDriver_Seduced.cs b/Source/Genes/Life_Force/JobDrivers/JobDriver_Seduced.cs
similarity index 100%
rename from Source/Genes/Life_Force/JobDriver_Seduced.cs
rename to Source/Genes/Life_Force/JobDrivers/JobDriver_Seduced.cs
diff --git a/Source/Genes/Life_Force/JobDriver_SexOnSpot.cs b/Source/Genes/Life_Force/JobDrivers/JobDriver_SexOnSpot.cs
similarity index 100%
rename from Source/Genes/Life_Force/JobDriver_SexOnSpot.cs
rename to Source/Genes/Life_Force/JobDrivers/JobDriver_SexOnSpot.cs
diff --git a/Source/Genes/Life_Force/JobDriver_SexOnSpotReceiver.cs b/Source/Genes/Life_Force/JobDrivers/JobDriver_SexOnSpotReceiver.cs
similarity index 100%
rename from Source/Genes/Life_Force/JobDriver_SexOnSpotReceiver.cs
rename to Source/Genes/Life_Force/JobDrivers/JobDriver_SexOnSpotReceiver.cs
diff --git a/Source/Genes/Life_Force/LifeForceMentalStateWorker.cs b/Source/Genes/Life_Force/LifeForceMentalStateWorker.cs
index e9ed20f..eaeaf89 100644
--- a/Source/Genes/Life_Force/LifeForceMentalStateWorker.cs
+++ b/Source/Genes/Life_Force/LifeForceMentalStateWorker.cs
@@ -4,7 +4,6 @@ using Verse.AI;
using rjw;
namespace RJW_Genes
{
- // Token: 0x020000FB RID: 251
public class LifeForceMentalStateWorker : MentalStateWorker
{
public override bool StateCanOccur(Pawn pawn)
diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj
index 2ad19b6..54c7b22 100644
--- a/Source/Rjw-Genes.csproj
+++ b/Source/Rjw-Genes.csproj
@@ -114,17 +114,18 @@
-
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
@@ -133,14 +134,13 @@
-
-
+
+
-
+
-
-
+