mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Adding Lifeforce and succubus wings gene
Adds lifeforce gene and functions for gaining lifeforce from oral sex and mental break if lifeforce reaches zero. Also add succubus wings drawn by me
This commit is contained in:
parent
f0a9cce9c9
commit
1f865320b0
25 changed files with 690 additions and 39 deletions
Binary file not shown.
34
Common/Defs/Genes/GeneDefs_Cosmetic.xml
Normal file
34
Common/Defs/Genes/GeneDefs_Cosmetic.xml
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
|
||||
<!-- Hair restrictions -->
|
||||
<GeneDef Name="rjw_genes_wings" Abstract="True">
|
||||
<displayCategory>Miscellaneous</displayCategory>
|
||||
<randomChosen>true</randomChosen>
|
||||
<exclusionTags>
|
||||
<li>Wing</li>
|
||||
<li>Wings</li>
|
||||
</exclusionTags>
|
||||
<graphicData>
|
||||
<drawLoc>Tailbone</drawLoc>
|
||||
</graphicData>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef ParentName="rjw_genes_wings">
|
||||
<defName>rjw_genes_Succubus_Wings</defName>
|
||||
<label>succubus wings</label>
|
||||
<description>Carriers of this gene grow succubus wings.</description>
|
||||
<iconPath>UI/Icons/Genes/Gene_TailFurry</iconPath>
|
||||
<iconColor>(0.75, 0.75, 0.75)</iconColor>
|
||||
<displayOrderInCategory>1000</displayOrderInCategory>
|
||||
<biostatCpx>1</biostatCpx>
|
||||
<graphicData>
|
||||
<graphicPath>Things/Pawn/Humanlike/BodyAttachments/rjw_genes_Succubus_Wings/Succubus_Wings</graphicPath>
|
||||
<colorType>Hair</colorType>
|
||||
<drawScale>2</drawScale>
|
||||
<drawOffsetNorth>(0.0, 0.19, -0.1)</drawOffsetNorth>
|
||||
<drawOffsetSouth>(0.0, 0.0, -0.1)</drawOffsetSouth>
|
||||
<drawOffsetEast>(0.1, 0.0, 0.0)</drawOffsetEast>
|
||||
</graphicData>
|
||||
</GeneDef>
|
||||
</Defs>
|
36
Common/Defs/Genes/GeneDefs_LifeForce.xml
Normal file
36
Common/Defs/Genes/GeneDefs_LifeForce.xml
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
<GeneDef>
|
||||
<defName>rjw_genes_lifeforce</defName>
|
||||
<label>lifeforce</label>
|
||||
<description>Carriers of this gene have a reserve of biological strength powered by a resource called lifeforce. 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.</description>
|
||||
<geneClass>RJW_Genes.Gene_LifeForce</geneClass>
|
||||
<resourceGizmoType>RJW_Genes.GeneGizmo_ResourceLifeForce</resourceGizmoType>
|
||||
<resourceLabel>lifeforce</resourceLabel>
|
||||
<resourceGizmoThresholds>
|
||||
<li>0.25</li>
|
||||
<li>0.5</li>
|
||||
<li>0.75</li>
|
||||
</resourceGizmoThresholds>
|
||||
<showGizmoOnWorldView>true</showGizmoOnWorldView>
|
||||
<showGizmoWhenDrafted>true</showGizmoWhenDrafted>
|
||||
<resourceDescription>A reserve of biological strength which can be gained and spent in a variety of ways. \n\nLifeforce can be increased by absorbing cum, typically through oral sex or stored cum. \n\nIf lifeforce reaches zero, {PAWN_nameDef} will become very unhappy and may try to obtain some forcefully.</resourceDescription>
|
||||
<iconPath>UI/Icons/Genes/Gene_Hemogenic</iconPath>
|
||||
<selectionWeight>0</selectionWeight>
|
||||
<displayCategory>Hemogen</displayCategory>
|
||||
<displayOrderInCategory>-2</displayOrderInCategory>
|
||||
<customEffectDescriptions>
|
||||
<li>Gives lifeforce supply.</li>
|
||||
</customEffectDescriptions>
|
||||
<symbolPack>
|
||||
<prefixSymbols>
|
||||
<li><symbol>hemo</symbol></li>
|
||||
</prefixSymbols>
|
||||
</symbolPack>
|
||||
<mentalBreakDef>rjw_genes_lifeforce_randomrape</mentalBreakDef>
|
||||
<minAgeActive>13</minAgeActive>
|
||||
<resourceLossPerDay>0.02</resourceLossPerDay>
|
||||
<biostatCpx>1</biostatCpx>
|
||||
<biostatMet>1</biostatMet>
|
||||
</GeneDef>
|
||||
</Defs>
|
10
Common/Defs/JobDefs/Jobs_LifeForce.xml
Normal file
10
Common/Defs/JobDefs/Jobs_LifeForce.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<Defs>
|
||||
<JobDef>
|
||||
<defName>rjw_genes_lifeforce_randomrape</defName>
|
||||
<driverClass>rjw.JobDriver_RandomRape</driverClass>
|
||||
<reportString>Raping</reportString>
|
||||
<casualInterruptible>false</casualInterruptible>
|
||||
</JobDef>
|
||||
</Defs>
|
30
Common/Defs/MentalStateDefs/MentalState_Lifeforce.xml
Normal file
30
Common/Defs/MentalStateDefs/MentalState_Lifeforce.xml
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<Defs>
|
||||
<MentalBreakDef>
|
||||
<defName>rjw_genes_lifeforce_randomrape</defName>
|
||||
<mentalState>rjw_genes_lifeforce_randomrape</mentalState>
|
||||
<baseCommonality>1.5</baseCommonality>
|
||||
<intensity>Extreme</intensity>
|
||||
</MentalBreakDef>
|
||||
|
||||
<MentalStateDef ParentName="BaseMentalState">
|
||||
<defName>rjw_genes_lifeforce_randomrape</defName>
|
||||
<stateClass>RJW_Genes.LifeForceMentalState</stateClass>
|
||||
<workerClass>RJW_Genes.LifeForceMentalStateWorker</workerClass>
|
||||
<label>random rape</label>
|
||||
<category>Malicious</category>
|
||||
<prisonersCanDo>true</prisonersCanDo>
|
||||
<colonistsOnly>false</colonistsOnly>
|
||||
<minTicksBeforeRecovery>30000</minTicksBeforeRecovery>
|
||||
<recoveryMtbDays>0.8</recoveryMtbDays>
|
||||
<maxTicksBeforeRecovery>80000</maxTicksBeforeRecovery>
|
||||
<nameColor>(0.5, 0.9, 0.5)</nameColor>
|
||||
<beginLetterLabel>random rape</beginLetterLabel>
|
||||
<beginLetter>{0} has run out of lifeforce and is looking to obtain some.</beginLetter>
|
||||
<beginLetterDef>ThreatSmall</beginLetterDef>
|
||||
<recoveryMessage>{0} is no longer raping randomly.</recoveryMessage>
|
||||
<baseInspectLine>Mental state: Random Rape</baseInspectLine>
|
||||
<recoverFromSleep>true</recoverFromSleep>
|
||||
</MentalStateDef>
|
||||
</Defs>
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Patch>
|
||||
<!-- Copied from Vanilla BingingDrug. live selfish till rape someone. In the future add others ways to obtain lifeforce. -->
|
||||
<Operation Class="PatchOperationAdd">
|
||||
<xpath>Defs/ThinkTreeDef[defName="MentalStateCritical"]/thinkRoot[@Class="ThinkNode_Tagger"]/subNodes</xpath>
|
||||
<value>
|
||||
<li Class="ThinkNode_ConditionalMentalState">
|
||||
<state>rjw_genes_lifeforce_randomrape</state>
|
||||
<subNodes>
|
||||
<li Class="ThinkNode_ConditionalNeedPercentageAbove">
|
||||
<need>Rest</need>
|
||||
<threshold>0.05</threshold>
|
||||
<invert>true</invert>
|
||||
<subNodes>
|
||||
<li Class="JobGiver_GetRest"/>
|
||||
</subNodes>
|
||||
</li>
|
||||
<li Class="ThinkNode_PrioritySorter">
|
||||
<minPriority>0.5</minPriority>
|
||||
<subNodes>
|
||||
<li Class="JobGiver_GetFood"/>
|
||||
<li Class="ThinkNode_Priority_GetJoy">
|
||||
<subNodes>
|
||||
<li Class="JobGiver_GetJoy"/>
|
||||
</subNodes>
|
||||
</li>
|
||||
</subNodes>
|
||||
</li>
|
||||
<li Class="rjw.JobGiver_RandomRape"/>
|
||||
<li Class="JobGiver_WanderColony" />
|
||||
</subNodes>
|
||||
</li>
|
||||
</value>
|
||||
</Operation>
|
||||
</Patch>
|
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
|
@ -5,6 +5,8 @@ VisualStudioVersion = 17.0.32014.148
|
|||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rjw-Genes", "Source\Rjw-Genes.csproj", "{D7D21B4A-1DA7-41D8-B202-C58CA8FA62AA}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FB09ADF4-FC35-4C1F-9135-2B4C4E4ED347}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using rjw;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
|
||||
namespace RJW_BGS
|
||||
{
|
||||
[StaticConstructorOnStartup]
|
||||
internal static class First
|
||||
{
|
||||
static First()
|
||||
{
|
||||
//RJWcopy.Racegroupdictbuilder();
|
||||
//Prints all found race dicts (debugging only)
|
||||
//logAllFoundRaceGroupGenes
|
||||
|
||||
}
|
||||
|
||||
private static void logAllFoundRaceGroupGenes()
|
||||
{
|
||||
foreach (RaceGroupDef def in DefDatabase<RaceGroupDef>.AllDefs)
|
||||
{
|
||||
Log.Message("defName = " + def.defName);
|
||||
if (def.raceNames != null)
|
||||
{
|
||||
foreach (string race in def.raceNames)
|
||||
{
|
||||
Log.Message(race);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
29
Source/First.cs
Normal file
29
Source/First.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using rjw;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
using rjw.Modules.Interactions.Rules.PartKindUsageRules;
|
||||
using rjw.Modules.Interactions.Internals.Implementation;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
[StaticConstructorOnStartup]
|
||||
internal static class First
|
||||
{
|
||||
static First()
|
||||
{
|
||||
AddtoIPartPreferenceRule();
|
||||
}
|
||||
|
||||
//Modified code from https://gitgud.io/lutepickle/rjw_menstruation/-/tree/main/1.4/source/RJW_Menstruation/RJW_Menstruation
|
||||
private static void AddtoIPartPreferenceRule()
|
||||
{
|
||||
List<IPartPreferenceRule> partPreferenceRules = Unprivater.GetProtectedValue<List<IPartPreferenceRule>>("_partKindUsageRules", typeof(PartPreferenceDetectorService));
|
||||
partPreferenceRules.Add(new Interactions.GenesPartKindUsageRule());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -71,5 +71,8 @@ namespace RJW_Genes
|
|||
// Special
|
||||
public static readonly GeneDef rjw_genes_orgasm_rush;
|
||||
public static readonly GeneDef rjw_genes_aphrodisiac_pheromones;
|
||||
|
||||
// LifeForce
|
||||
public static readonly GeneDef rjw_genes_lifeforce;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,5 +33,35 @@ namespace RJW_Genes
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
//Get total fluidamount a persom has.
|
||||
public static float GetTotalFluidAmount(Pawn pawn, float multiplier = 1f)
|
||||
{
|
||||
var partBPR = Genital_Helper.get_genitalsBPR(pawn);
|
||||
var parts = Genital_Helper.get_PartsHediffList(pawn, partBPR);
|
||||
float total_cum = 0;
|
||||
if (!parts.NullOrEmpty())
|
||||
{
|
||||
CompHediffBodyPart CompHediff;
|
||||
|
||||
foreach (Hediff part in parts)
|
||||
{
|
||||
if (GenitaliaChanger.IsArtificial(part))
|
||||
continue;
|
||||
|
||||
if (rjw.Genital_Helper.is_penis(part))
|
||||
{
|
||||
CompHediff = part.TryGetComp<rjw.CompHediffBodyPart>();
|
||||
if (CompHediff != null)
|
||||
{
|
||||
total_cum += CompHediff.FluidAmmount * multiplier;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return total_cum;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,41 @@ namespace RJW_Genes
|
|||
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)
|
||||
{
|
||||
if (HasLifeForce(pawn))
|
||||
{
|
||||
Gene_LifeForce gene = pawn.genes.GetFirstGeneOfType<Gene_LifeForce>();
|
||||
if (gene.Resource.Value < gene.targetValue)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool HasCriticalLifeForce(Pawn pawn)
|
||||
{
|
||||
if (HasLifeForce(pawn))
|
||||
{
|
||||
Gene_LifeForce gene = pawn.genes.GetFirstGeneOfType<Gene_LifeForce>();
|
||||
if (gene.Resource.Value < gene.MinLevelForAlert)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsInsectIncubator(Pawn pawn)
|
||||
{
|
||||
if (pawn.genes == null)
|
||||
|
|
83
Source/Genes/Life_Force/GeneGizmo_ResourceLifeForce.cs
Normal file
83
Source/Genes/Life_Force/GeneGizmo_ResourceLifeForce.cs
Normal file
|
@ -0,0 +1,83 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
using UnityEngine;
|
||||
namespace RJW_Genes
|
||||
{
|
||||
//Copied from GeneGizmo_ResourceHemogen, with small modifications
|
||||
public class GeneGizmo_ResourceLifeForce : GeneGizmo_Resource
|
||||
{
|
||||
public GeneGizmo_ResourceLifeForce(Gene_Resource gene, List<IGeneResourceDrain> drainGenes, Color barColor, Color barhighlightColor) : base(gene, drainGenes, barColor, barhighlightColor)
|
||||
{
|
||||
this.draggableBar = true;
|
||||
}
|
||||
|
||||
public override GizmoResult GizmoOnGUI(Vector2 topLeft, float maxWidth, GizmoRenderParms parms)
|
||||
{
|
||||
return base.GizmoOnGUI(topLeft, maxWidth, parms);
|
||||
}
|
||||
|
||||
protected override string GetTooltip()
|
||||
{
|
||||
|
||||
this.tmpDrainGenes.Clear();
|
||||
string text = string.Format("{0}: {1} / {2}\n", this.gene.ResourceLabel.CapitalizeFirst().Colorize(ColoredText.TipSectionTitleColor), this.gene.ValueForDisplay, this.gene.MaxForDisplay);
|
||||
if (this.gene.pawn.IsColonistPlayerControlled || this.gene.pawn.IsPrisonerOfColony)
|
||||
{
|
||||
if (this.gene.targetValue <= 0f)
|
||||
{
|
||||
text += "NeverConsumeCum";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = text + ("ConsumeCumBelow" + ": ") + this.gene.PostProcessValue(this.gene.targetValue);
|
||||
}
|
||||
}
|
||||
if (!this.drainGenes.NullOrEmpty<IGeneResourceDrain>())
|
||||
{
|
||||
float num = 0f;
|
||||
foreach (IGeneResourceDrain geneResourceDrain in this.drainGenes)
|
||||
{
|
||||
if (geneResourceDrain.CanOffset)
|
||||
{
|
||||
this.tmpDrainGenes.Add(new Pair<IGeneResourceDrain, float>(geneResourceDrain, geneResourceDrain.ResourceLossPerDay));
|
||||
num += geneResourceDrain.ResourceLossPerDay;
|
||||
}
|
||||
}
|
||||
if (num != 0f)
|
||||
{
|
||||
string text2 = (num < 0f) ? "RegenerationRate".Translate() : "DrainRate".Translate();
|
||||
text = string.Concat(new string[]
|
||||
{
|
||||
text,
|
||||
"\n\n",
|
||||
text2,
|
||||
": ",
|
||||
"PerDay".Translate(Mathf.Abs(this.gene.PostProcessValue(num))).Resolve()
|
||||
});
|
||||
foreach (Pair<IGeneResourceDrain, float> pair in this.tmpDrainGenes)
|
||||
{
|
||||
text = string.Concat(new string[]
|
||||
{
|
||||
text,
|
||||
"\n - ",
|
||||
pair.First.DisplayLabel.CapitalizeFirst(),
|
||||
": ",
|
||||
"PerDay".Translate(this.gene.PostProcessValue(-pair.Second).ToStringWithSign()).Resolve()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!this.gene.def.resourceDescription.NullOrEmpty())
|
||||
{
|
||||
text = text + "\n\n" + this.gene.def.resourceDescription.Formatted(this.gene.pawn.Named("PAWN")).Resolve();
|
||||
}
|
||||
return text;
|
||||
}
|
||||
private List<Pair<IGeneResourceDrain, float>> tmpDrainGenes = new List<Pair<IGeneResourceDrain, float>>();
|
||||
}
|
||||
}
|
138
Source/Genes/Life_Force/Gene_LifeForce.cs
Normal file
138
Source/Genes/Life_Force/Gene_LifeForce.cs
Normal file
|
@ -0,0 +1,138 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_LifeForce : Gene_Resource, IGeneResourceDrain
|
||||
{
|
||||
public override void ExposeData()
|
||||
{
|
||||
base.ExposeData();
|
||||
}
|
||||
|
||||
public bool ShouldConsumeLifeForceNow()
|
||||
{
|
||||
return this.Value < this.targetValue;
|
||||
}
|
||||
|
||||
//Same as Gene_Hemogen
|
||||
public override IEnumerable<Gizmo> GetGizmos()
|
||||
{
|
||||
foreach (Gizmo gizmo in base.GetGizmos())
|
||||
{
|
||||
yield return gizmo;
|
||||
}
|
||||
IEnumerator<Gizmo> enumerator = null;
|
||||
foreach (Gizmo gizmo2 in GeneResourceDrainUtility.GetResourceDrainGizmos(this))
|
||||
{
|
||||
yield return gizmo2;
|
||||
}
|
||||
enumerator = null;
|
||||
yield break;
|
||||
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.
|
||||
//Not using base.Tick() as it is used to start mental breaks, but we have another way to do it.
|
||||
public override void Tick()
|
||||
{
|
||||
//base.Tick();
|
||||
if (this.CanOffset && this.Resource != null)
|
||||
{
|
||||
this.Resource.Value -= this.ResourceLossPerDay / 60000;
|
||||
if (this.Resource.Value <= 0 && this.pawn.IsHashIntervalTick(300))
|
||||
{
|
||||
if (ModsConfig.BiotechActive && this.def.mentalBreakDef != null &&
|
||||
this.pawn.Spawned && !this.pawn.InMentalState && !this.pawn.Downed &&
|
||||
this.def.mentalBreakDef.Worker.BreakCanOccur(this.pawn))
|
||||
{
|
||||
this.def.mentalBreakDef.Worker.TryStart(this.pawn, "MentalStateReason_Gene".Translate() + ": " + this.LabelCap, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
//GeneResourceDrainUtility.TickResourceDrain(this);
|
||||
}
|
||||
|
||||
public Gene_Resource Resource
|
||||
{
|
||||
get
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
public Pawn Pawn
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.pawn;
|
||||
}
|
||||
}
|
||||
public bool CanOffset
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.pawn.Spawned && this.Active;
|
||||
}
|
||||
}
|
||||
|
||||
public float ResourceLossPerDay
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.def.resourceLossPerDay;
|
||||
}
|
||||
}
|
||||
|
||||
public string DisplayLabel
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.def.resourceLabel;
|
||||
}
|
||||
}
|
||||
|
||||
public override float InitialResourceMax
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1f;
|
||||
}
|
||||
}
|
||||
|
||||
public override float MinLevelForAlert
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0.15f;
|
||||
}
|
||||
}
|
||||
public override float MaxLevelOffset
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.MaxLevelOffset;
|
||||
}
|
||||
}
|
||||
protected override Color BarColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return Color.grey;
|
||||
}
|
||||
}
|
||||
protected override Color BarHighlightColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return Color.white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
38
Source/Genes/Life_Force/JobGiver_LifeForce_RandomRape.cs
Normal file
38
Source/Genes/Life_Force/JobGiver_LifeForce_RandomRape.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Verse;
|
||||
using Verse.AI;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class JobGiver_LifeForce_RandomRape : JobGiver_RandomRape
|
||||
{
|
||||
protected override Job TryGiveJob(Pawn pawn)
|
||||
{
|
||||
if (!can_rape(pawn, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
Pawn pawn2 = this.find_victim(pawn, pawn.Map);
|
||||
if (pawn2 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return JobMaker.MakeJob(JobDefOf.rjw_genes_lifeforce_randomrape, pawn2);
|
||||
}
|
||||
|
||||
//same as xxx.canrape from rjw, but without last requirements.
|
||||
public static bool can_rape(Pawn pawn, bool forced = false)
|
||||
{
|
||||
return RJWSettings.rape_enabled && (xxx.is_mechanoid(pawn) || ((xxx.can_fuck(pawn) ||
|
||||
(!xxx.is_male(pawn) && xxx.get_vulnerability(pawn) < RJWSettings.nonFutaWomenRaping_MaxVulnerability &&
|
||||
xxx.can_be_fucked(pawn))) && (!xxx.is_human(pawn) || ((pawn.ageTracker.Growth >= 1f || pawn.ageTracker.CurLifeStage.reproductive)))));
|
||||
}
|
||||
}
|
||||
}
|
32
Source/Genes/Life_Force/LifeForceMentalBreakWorker.cs
Normal file
32
Source/Genes/Life_Force/LifeForceMentalBreakWorker.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
using Verse.AI;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class LifeForceMentalBreakWorker : MentalBreakWorker
|
||||
{
|
||||
public override bool BreakCanOccur(Pawn pawn)
|
||||
{
|
||||
if (pawn.Spawned && base.BreakCanOccur(pawn))
|
||||
{
|
||||
if (!GeneUtility.HasLifeForce(pawn))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Gene_LifeForce gene = pawn.genes.GetFirstGeneOfType<Gene_LifeForce>();
|
||||
if( gene.Resource.Value <= 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
23
Source/Genes/Life_Force/LifeForceMentalState.cs
Normal file
23
Source/Genes/Life_Force/LifeForceMentalState.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
using System;
|
||||
using Verse;
|
||||
using Verse.AI;
|
||||
using rjw;
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class LifeForceMentalState : MentalState
|
||||
{
|
||||
public override void MentalStateTick()
|
||||
{
|
||||
if (this.pawn.IsHashIntervalTick(150) && !GeneUtility.HasCriticalLifeForce(this.pawn))
|
||||
{
|
||||
Pawn_JobTracker jobs = this.pawn.jobs;
|
||||
if (!(((jobs != null) ? jobs.curDriver : null) is JobDriver_Sex))
|
||||
{
|
||||
base.RecoverFromState();
|
||||
return;
|
||||
}
|
||||
}
|
||||
base.MentalStateTick();
|
||||
}
|
||||
}
|
||||
}
|
15
Source/Genes/Life_Force/LifeForceMentalStateWorker.cs
Normal file
15
Source/Genes/Life_Force/LifeForceMentalStateWorker.cs
Normal file
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using Verse;
|
||||
using Verse.AI;
|
||||
using rjw;
|
||||
namespace RJW_Genes
|
||||
{
|
||||
// Token: 0x020000FB RID: 251
|
||||
public class LifeForceMentalStateWorker : MentalStateWorker
|
||||
{
|
||||
public override bool StateCanOccur(Pawn pawn)
|
||||
{
|
||||
return base.StateCanOccur(pawn) && (xxx.is_human(pawn) && JobGiver_LifeForce_RandomRape.can_rape(pawn));
|
||||
}
|
||||
}
|
||||
}
|
36
Source/Genes/Life_Force/Patch_LifeForce.cs
Normal file
36
Source/Genes/Life_Force/Patch_LifeForce.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using HarmonyLib;
|
||||
using rjw;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using RimWorld;
|
||||
using Verse;
|
||||
|
||||
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)
|
||||
if (props.pawn == null || !props.hasPartner())
|
||||
return;
|
||||
|
||||
if (GeneUtility.HasLifeForce(props.pawn))
|
||||
{
|
||||
if (props.sexType == xxx.rjwSextype.Oral || props.sexType == xxx.rjwSextype.Fellatio || props.sexType == xxx.rjwSextype.Sixtynine)
|
||||
{
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
56
Source/Interactions/GenesPartKindUsageRule.cs
Normal file
56
Source/Interactions/GenesPartKindUsageRule.cs
Normal file
|
@ -0,0 +1,56 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using rjw;
|
||||
using rjw.Modules.Interactions.Contexts;
|
||||
using rjw.Modules.Interactions.Enums;
|
||||
using rjw.Modules.Interactions.Rules.PartKindUsageRules;
|
||||
using rjw.Modules.Shared;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes.Interactions
|
||||
{
|
||||
public class GenesPartKindUsageRule : IPartPreferenceRule
|
||||
{
|
||||
public IEnumerable<Weighted<LewdablePartKind>> ModifiersForDominant(InteractionContext context)
|
||||
{
|
||||
Pawn pawn = context.Internals.Dominant.Pawn;
|
||||
if (GeneUtility.HasCriticalLifeForce(pawn))
|
||||
{
|
||||
Log.Message("Critical");
|
||||
yield return new Weighted<LewdablePartKind>(50f, LewdablePartKind.Mouth);
|
||||
}
|
||||
else if (GeneUtility.HasLowLifeForce(pawn))
|
||||
{
|
||||
Log.Message("Low");
|
||||
yield return new Weighted<LewdablePartKind>(10f, LewdablePartKind.Mouth);
|
||||
}
|
||||
else if (GeneUtility.HasLifeForce(pawn))
|
||||
{
|
||||
Log.Message("normal");
|
||||
yield return new Weighted<LewdablePartKind>(2f, LewdablePartKind.Mouth);
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
|
||||
public IEnumerable<Weighted<LewdablePartKind>> ModifiersForSubmissive(InteractionContext context)
|
||||
{
|
||||
Pawn pawn = context.Internals.Submissive.Pawn;
|
||||
if (GeneUtility.HasCriticalLifeForce(pawn))
|
||||
{
|
||||
Log.Message("Critical");
|
||||
yield return new Weighted<LewdablePartKind>(50f, LewdablePartKind.Mouth);
|
||||
}
|
||||
else if (GeneUtility.HasLowLifeForce(pawn))
|
||||
{
|
||||
Log.Message("Low");
|
||||
yield return new Weighted<LewdablePartKind>(10f, LewdablePartKind.Mouth);
|
||||
}
|
||||
else if (GeneUtility.HasLifeForce(pawn))
|
||||
{
|
||||
Log.Message("normal");
|
||||
yield return new Weighted<LewdablePartKind>(2f, LewdablePartKind.Mouth);
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
15
Source/JobDefOf.cs
Normal file
15
Source/JobDefOf.cs
Normal file
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
namespace RJW_Genes
|
||||
{
|
||||
[DefOf]
|
||||
public static class JobDefOf
|
||||
{
|
||||
public static readonly JobDef rjw_genes_lifeforce_randomrape;
|
||||
}
|
||||
}
|
|
@ -60,7 +60,7 @@
|
|||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Animal_Inheritance\First.cs" />
|
||||
<Compile Include="First.cs" />
|
||||
<Compile Include="Animal_Inheritance\Harmony_Init.cs" />
|
||||
<Compile Include="Animal_Inheritance\InheritanceUtility.cs" />
|
||||
<Compile Include="Animal_Inheritance\PatchRJWBestialityPregnancyUtility.cs" />
|
||||
|
@ -114,12 +114,21 @@
|
|||
<Compile Include="Genes\Genitalia\Gene_DemonicGenitalia.cs" />
|
||||
<Compile Include="Genes\Genitalia\Gene_EquineGenitalia.cs" />
|
||||
<Compile Include="Genes\Genitalia\GenitaliaChanger.cs" />
|
||||
<Compile Include="Genes\Life_Force\GeneGizmo_ResourceLifeForce.cs" />
|
||||
<Compile Include="Genes\Life_Force\LifeForceMentalState.cs" />
|
||||
<Compile Include="Genes\Life_Force\LifeForceMentalStateWorker.cs" />
|
||||
<Compile Include="Genes\Life_Force\JobGiver_LifeForce_RandomRape.cs" />
|
||||
<Compile Include="Genes\Life_Force\LifeForceMentalBreakWorker.cs" />
|
||||
<Compile Include="Genes\Life_Force\Gene_LifeForce.cs" />
|
||||
<Compile Include="Genes\RJW_Gene.cs" />
|
||||
<Compile Include="Genes\Genitalia\GenitaliaUtility.cs" />
|
||||
<Compile Include="Genes\Special\Gene_Aphrodisiac_Pheromones_.cs" />
|
||||
<Compile Include="Genes\Life_Force\Patch_LifeForce.cs" />
|
||||
<Compile Include="Genes\Special\Patch_OrgasmRush.cs" />
|
||||
<Compile Include="HarmonyInit.cs" />
|
||||
<Compile Include="HediffDefOf.cs" />
|
||||
<Compile Include="Interactions\GenesPartKindUsageRule.cs" />
|
||||
<Compile Include="JobDefOf.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RJW_Genes.cs" />
|
||||
</ItemGroup>
|
||||
|
|
Loading…
Reference in a new issue