mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Orgasm Rush now adds a hediff
This commit is contained in:
parent
be36025325
commit
aad8efa04e
4 changed files with 119 additions and 9 deletions
78
Common/Defs/HediffDefs/Hediffs_OrgasmRush.xml
Normal file
78
Common/Defs/HediffDefs/Hediffs_OrgasmRush.xml
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
|
||||
<HediffDef>
|
||||
<defName>rjw_genes_orgasm_rush_hediff</defName>
|
||||
<hediffClass>HediffWithComps</hediffClass>
|
||||
<label>Orgasm Rush</label>
|
||||
<description>Xenotypes with this Gene are pushed beyond normal limits when they have an orgasm.</description>
|
||||
<defaultLabelColor>(240,200,110)</defaultLabelColor>
|
||||
<scenarioCanAdd>false</scenarioCanAdd>
|
||||
<maxSeverity>1.0</maxSeverity>
|
||||
<isBad>false</isBad>
|
||||
<tendable>false</tendable>
|
||||
<comps>
|
||||
<li Class="HediffCompProperties_SeverityPerDay">
|
||||
<severityPerDay>-0.75</severityPerDay>
|
||||
</li>
|
||||
</comps>
|
||||
<stages>
|
||||
<li>
|
||||
<label>pumped</label>
|
||||
<statOffsets>
|
||||
<MeleeDodgeChance>4</MeleeDodgeChance>
|
||||
<ShootingAccuracyPawn>4</ShootingAccuracyPawn>
|
||||
</statOffsets>
|
||||
<capMods>
|
||||
<li>
|
||||
<capacity>Consciousness</capacity>
|
||||
<offset>0.05</offset>
|
||||
</li>
|
||||
</capMods>
|
||||
</li>
|
||||
<li>
|
||||
<label>charged</label>
|
||||
<minSeverity>0.4</minSeverity>
|
||||
<statOffsets>
|
||||
<MeleeDodgeChance>8</MeleeDodgeChance>
|
||||
<ShootingAccuracyPawn>8</ShootingAccuracyPawn>
|
||||
</statOffsets>
|
||||
<capMods>
|
||||
<li>
|
||||
<capacity>Moving</capacity>
|
||||
<offset>0.08</offset>
|
||||
</li>
|
||||
<li>
|
||||
<capacity>Consciousness</capacity>
|
||||
<offset>0.08</offset>
|
||||
</li>
|
||||
</capMods>
|
||||
</li>
|
||||
<li>
|
||||
<label>super-charged</label>
|
||||
<minSeverity>0.7</minSeverity>
|
||||
<statOffsets>
|
||||
<MeleeDodgeChance>10</MeleeDodgeChance>
|
||||
<ShootingAccuracyPawn>10</ShootingAccuracyPawn>
|
||||
</statOffsets>
|
||||
<capMods>
|
||||
<li>
|
||||
<capacity>Moving</capacity>
|
||||
<offset>0.1</offset>
|
||||
</li>
|
||||
<li>
|
||||
<capacity>Consciousness</capacity>
|
||||
<offset>0.1</offset>
|
||||
</li>
|
||||
<li>
|
||||
<capacity>BloodPumping</capacity>
|
||||
<offset>0.1</offset>
|
||||
</li>
|
||||
</capMods>
|
||||
</li>
|
||||
|
||||
</stages>
|
||||
</HediffDef>
|
||||
|
||||
</Defs>
|
||||
|
|
@ -71,5 +71,7 @@ namespace RJW_Genes
|
|||
// Special
|
||||
public static readonly GeneDef rjw_genes_orgasm_rush;
|
||||
|
||||
|
||||
public static readonly HediffDef rjw_genes_orgasm_rush_hediff;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
|
@ -14,6 +15,7 @@ namespace RJW_Genes
|
|||
{
|
||||
|
||||
private const float REST_INCREASE = 0.05f;
|
||||
private const float ORGASMS_NEEDED_FOR_SUPERCHARGE = 3.0f;
|
||||
|
||||
public static void Postfix(SexProps props)
|
||||
{
|
||||
|
@ -23,9 +25,37 @@ namespace RJW_Genes
|
|||
|
||||
if (props.pawn.genes != null && props.pawn.genes.HasGene(GeneDefOf.rjw_genes_orgasm_rush))
|
||||
{
|
||||
props.pawn.needs.rest.CurLevel += REST_INCREASE;
|
||||
}
|
||||
|
||||
// Pump up Wake-Ness
|
||||
if (props.pawn.needs.rest != null)
|
||||
props.pawn.needs.rest.CurLevel += REST_INCREASE;
|
||||
|
||||
// Add or Update Hediff for Orgasm Rush
|
||||
Hediff rush = GetOrgasmRushHediff(props.pawn);
|
||||
float added_severity = props.orgasms / ORGASMS_NEEDED_FOR_SUPERCHARGE;
|
||||
rush.Severity += added_severity;
|
||||
// Severity should be capped to 1 by the XML logic
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helps to get the Orgasm Rush Hediff of a Pawn. If it does not exist, one is added.
|
||||
/// </summary>
|
||||
/// <param name="orgasmed">The pawn that had the orgasm, for which a hediff is looked up or created.</param>
|
||||
/// <returns></returns>
|
||||
public static Hediff GetOrgasmRushHediff(Pawn orgasmed)
|
||||
{
|
||||
Hediff orgasmRushHediff = orgasmed.health.hediffSet.GetFirstHediffOfDef(GeneDefOf.rjw_genes_orgasm_rush_hediff);
|
||||
if (orgasmRushHediff == null)
|
||||
{
|
||||
orgasmRushHediff = HediffMaker.MakeHediff(GeneDefOf.rjw_genes_orgasm_rush_hediff, orgasmed);
|
||||
orgasmRushHediff.Severity = 0;
|
||||
orgasmed.health.AddHediff(orgasmRushHediff);
|
||||
}
|
||||
return orgasmRushHediff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -27,16 +27,14 @@
|
|||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="LicentiaLabs">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\licentia-labs-master\Assemblies\LicentiaLabs.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="RJW">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\rjw-master\1.4\Assemblies\RJW.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\..\rjw\1.4\Assemblies\RJW.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
@ -51,12 +49,14 @@
|
|||
<None Include="..\Common\Languages\**" />
|
||||
<None Include="..\Common\Patches\**" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
|
||||
<HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.IMGUIModule">
|
||||
<HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
Loading…
Reference in a new issue