mirror of
https://github.com/amevarashi/RJW-Sexperience.git
synced 2024-08-14 23:54:08 +00:00
Fix second stage of AteCum thought and refactor ThoughtDefs
This commit is contained in:
parent
ad76a1857b
commit
a7a0d3f6cf
11 changed files with 176 additions and 122 deletions
|
@ -1,18 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<Defs>
|
||||
<RJWSexperience.ThoughtDef_Recordbased>
|
||||
<ThoughtDef>
|
||||
<defName>AteCum</defName>
|
||||
<durationDays>0.5</durationDays>
|
||||
<stackLimit>1</stackLimit>
|
||||
<stackedEffectMultiplier>0.4</stackedEffectMultiplier>
|
||||
<recordDef>NumofEatenCum</recordDef>
|
||||
<thoughtClass>RJWSexperience.Thought_AteCum</thoughtClass>
|
||||
<minimumValueforStage>
|
||||
<li>10</li>
|
||||
<li>60</li>
|
||||
<li>120</li>
|
||||
</minimumValueforStage>
|
||||
<stages>
|
||||
<li>
|
||||
<label>ate cum</label>
|
||||
|
@ -35,7 +29,16 @@
|
|||
<baseMoodEffect>3</baseMoodEffect>
|
||||
</li>
|
||||
</stages>
|
||||
</RJWSexperience.ThoughtDef_Recordbased>
|
||||
|
||||
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.ThoughtDefExtension_StageFromRecord">
|
||||
<recordDef>NumofEatenCum</recordDef>
|
||||
<minimumValueforStage>
|
||||
<li>0</li>
|
||||
<li>10</li>
|
||||
<li>60</li>
|
||||
<li>120</li>
|
||||
</minimumValueforStage>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</ThoughtDef>
|
||||
</Defs>
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
using RimWorld;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Verse;
|
||||
|
||||
namespace RJWSexperience
|
||||
{
|
||||
public class ThoughtDefExtension_IncreaseRecord : DefModExtension
|
||||
{
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public RecordDef recordDef;
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public float increment;
|
||||
}
|
||||
}
|
|
@ -1,13 +1,10 @@
|
|||
using RimWorld;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Verse;
|
||||
|
||||
namespace RJWSexperience
|
||||
{
|
||||
/// <summary>
|
||||
/// ThoughtDef using opinion
|
||||
/// </summary>
|
||||
public class ThoughtDef_Opinionbased : ThoughtDef
|
||||
public class ThoughtDefExtension_StageFromOpinion : DefModExtension
|
||||
{
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public List<float> minimumValueforStage = new List<float>();
|
|
@ -1,19 +1,15 @@
|
|||
using RimWorld;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Verse;
|
||||
|
||||
namespace RJWSexperience
|
||||
{
|
||||
/// <summary>
|
||||
/// ThoughtDef using record
|
||||
/// </summary>
|
||||
public class ThoughtDef_Recordbased : ThoughtDef
|
||||
public class ThoughtDefExtension_StageFromRecord : DefModExtension
|
||||
{
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public RecordDef recordDef;
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public List<float> minimumValueforStage = new List<float>();
|
||||
[SuppressMessage("Minor Code Smell", "S1104:Fields should not have public accessibility", Justification = "Field value loaded from XML")]
|
||||
public float increment;
|
||||
}
|
||||
}
|
|
@ -3,8 +3,23 @@ using Verse;
|
|||
|
||||
namespace RJWSexperience
|
||||
{
|
||||
public class Thought_IncreaseRecord : Thought_Recordbased
|
||||
public class Thought_IncreaseRecord : Thought_Memory
|
||||
{
|
||||
private ThoughtDefExtension_IncreaseRecord extension;
|
||||
|
||||
protected ThoughtDefExtension_IncreaseRecord Extension
|
||||
{
|
||||
get
|
||||
{
|
||||
if (extension == null)
|
||||
extension = def.GetModExtension<ThoughtDefExtension_IncreaseRecord>();
|
||||
return extension;
|
||||
}
|
||||
}
|
||||
|
||||
protected RecordDef RecordDef => Extension.recordDef;
|
||||
protected float Increment => Extension.increment;
|
||||
|
||||
protected float recordIncrement;
|
||||
|
||||
public override void ExposeData()
|
||||
|
@ -21,7 +36,6 @@ namespace RJWSexperience
|
|||
pawn.records.AddTo(RecordDef, recordIncrement);
|
||||
recordIncrement = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override bool TryMergeWithExistingMemory(out bool showBubble)
|
||||
|
@ -46,6 +60,7 @@ namespace RJWSexperience
|
|||
base.Init();
|
||||
recordIncrement = Increment;
|
||||
}
|
||||
|
||||
protected virtual void Merged()
|
||||
{
|
||||
age = 0;
|
||||
|
|
|
@ -8,8 +8,19 @@ namespace RJWSexperience
|
|||
/// </summary>
|
||||
public class Thought_Opinionbased : Thought_Memory
|
||||
{
|
||||
protected ThoughtDef_Opinionbased Def => (ThoughtDef_Opinionbased)def;
|
||||
protected List<float> MinimumValueforStage => Def.minimumValueforStage;
|
||||
private ThoughtDefExtension_StageFromOpinion extension;
|
||||
|
||||
protected ThoughtDefExtension_StageFromOpinion Extension
|
||||
{
|
||||
get
|
||||
{
|
||||
if (extension == null)
|
||||
extension = def.GetModExtension<ThoughtDefExtension_StageFromOpinion>();
|
||||
return extension;
|
||||
}
|
||||
}
|
||||
|
||||
protected List<float> MinimumValueforStage => Extension.minimumValueforStage;
|
||||
|
||||
public override int CurStageIndex
|
||||
{
|
||||
|
|
|
@ -8,10 +8,20 @@ namespace RJWSexperience
|
|||
/// </summary>
|
||||
public class Thought_Recordbased : Thought_Memory
|
||||
{
|
||||
protected ThoughtDef_Recordbased Def => (ThoughtDef_Recordbased)def;
|
||||
protected RecordDef RecordDef => Def.recordDef;
|
||||
protected List<float> MinimumValueforStage => Def.minimumValueforStage;
|
||||
protected float Increment => Def.increment;
|
||||
private ThoughtDefExtension_StageFromRecord extension;
|
||||
|
||||
protected ThoughtDefExtension_StageFromRecord Extension
|
||||
{
|
||||
get
|
||||
{
|
||||
if (extension == null)
|
||||
extension = def.GetModExtension<ThoughtDefExtension_StageFromRecord>();
|
||||
return extension;
|
||||
}
|
||||
}
|
||||
|
||||
protected RecordDef RecordDef => Extension.recordDef;
|
||||
protected List<float> MinimumValueforStage => Extension.minimumValueforStage;
|
||||
|
||||
public override int CurStageIndex
|
||||
{
|
||||
|
@ -20,7 +30,7 @@ namespace RJWSexperience
|
|||
float value = pawn?.records?.GetValue(RecordDef) ?? 0f;
|
||||
for (int i = MinimumValueforStage.Count - 1; i > 0; i--)
|
||||
{
|
||||
if (MinimumValueforStage[i] < value) return i + 1;
|
||||
if (MinimumValueforStage[i] < value) return i;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RimWorld;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
|
||||
namespace RJWSexperience
|
||||
{
|
||||
|
@ -26,7 +22,7 @@ namespace RJWSexperience
|
|||
public static readonly RecordDef SexPartnerCount = DefDatabase<RecordDef>.GetNamed("SexPartnerCount");
|
||||
public static readonly RecordDef OrgasmCount = DefDatabase<RecordDef>.GetNamed("OrgasmCount");
|
||||
public static readonly SkillDef SexSkill = DefDatabase<SkillDef>.GetNamed("Sex");
|
||||
public static readonly ThoughtDef_Recordbased AteCum = DefDatabase<ThoughtDef_Recordbased>.GetNamed("AteCum");
|
||||
public static readonly ThoughtDef AteCum = DefDatabase<ThoughtDef>.GetNamed("AteCum");
|
||||
public static readonly PawnRelationDef Bastard = DefDatabase<PawnRelationDef>.GetNamed("Bastard");
|
||||
public static readonly ThingDef GatheredCum = DefDatabase<ThingDef>.GetNamed("GatheredCum");
|
||||
public static readonly ThingDef FilthCum = ThingDef.Named("FilthCum");
|
||||
|
@ -52,6 +48,7 @@ namespace RJWSexperience
|
|||
return cumneedLevelOffsetcache ?? 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
public static float CumexistingAddictionSeverityOffset
|
||||
{
|
||||
get
|
||||
|
@ -71,7 +68,6 @@ namespace RJWSexperience
|
|||
cumexistingAddictionSeverityOffsetcache = comp.existingAddictionSeverityOffset;
|
||||
}
|
||||
|
||||
|
||||
private static float? cumneedLevelOffsetcache = null;
|
||||
private static float? cumexistingAddictionSeverityOffsetcache = null;
|
||||
}
|
||||
|
|
|
@ -236,13 +236,11 @@
|
|||
<!-- Thoughts -->
|
||||
|
||||
|
||||
<RJWSexperience.ThoughtDef_Recordbased>
|
||||
<ThoughtDef>
|
||||
<defName>Sex_Promiscuous</defName>
|
||||
<durationDays>1</durationDays>
|
||||
<stackLimit>1</stackLimit>
|
||||
<thoughtClass>RJWSexperience.Thought_IncreaseRecord</thoughtClass>
|
||||
<recordDef>Lust</recordDef>
|
||||
<increment>3.0</increment>
|
||||
<stages>
|
||||
<li>
|
||||
<label>promiscuous sex</label>
|
||||
|
@ -250,7 +248,13 @@
|
|||
<baseMoodEffect>5</baseMoodEffect>
|
||||
</li>
|
||||
</stages>
|
||||
</RJWSexperience.ThoughtDef_Recordbased>
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.ThoughtDefExtension_IncreaseRecord">
|
||||
<recordDef>Lust</recordDef>
|
||||
<increment>3.0</increment>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</ThoughtDef>
|
||||
|
||||
<ThoughtDef>
|
||||
<defName>Sex_NonPromiscuous</defName>
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
<!-- Thoughts -->
|
||||
|
||||
|
||||
<RJWSexperience.ThoughtDef_Recordbased>
|
||||
<ThoughtDef>
|
||||
<defName>BeenRaped_Submissive</defName>
|
||||
<durationDays>10</durationDays>
|
||||
<stackLimit>100</stackLimit>
|
||||
|
@ -166,9 +166,9 @@
|
|||
<baseMoodEffect>-3</baseMoodEffect>
|
||||
</li>
|
||||
</stages>
|
||||
</RJWSexperience.ThoughtDef_Recordbased>
|
||||
</ThoughtDef>
|
||||
|
||||
<RJWSexperience.ThoughtDef_Recordbased>
|
||||
<ThoughtDef>
|
||||
<defName>BeenRaped_NotSubmissive</defName>
|
||||
<durationDays>15</durationDays>
|
||||
<stackLimit>100</stackLimit>
|
||||
|
@ -185,7 +185,7 @@
|
|||
<baseOpinionOffset>-200</baseOpinionOffset>
|
||||
</li>
|
||||
</stages>
|
||||
</RJWSexperience.ThoughtDef_Recordbased>
|
||||
</ThoughtDef>
|
||||
|
||||
<ThoughtDef>
|
||||
<defName>Raped_Know_NotBeingSubmissive</defName>
|
||||
|
|
|
@ -258,17 +258,11 @@
|
|||
</stages>
|
||||
</ThoughtDef>
|
||||
|
||||
<RJWSexperience.ThoughtDef_Opinionbased>
|
||||
<ThoughtDef>
|
||||
<defName>Virgin_Precious_Taken</defName>
|
||||
<thoughtClass>RJWSexperience.Thought_Opinionbased</thoughtClass>
|
||||
<durationDays>7</durationDays>
|
||||
<stackLimit>1</stackLimit>
|
||||
<minimumValueforStage>
|
||||
<li>-100</li>
|
||||
<li>-50</li>
|
||||
<li>0</li>
|
||||
<li>75</li>
|
||||
</minimumValueforStage>
|
||||
<stages>
|
||||
<li>
|
||||
<label>Lost virginity by {0}</label>
|
||||
|
@ -291,18 +285,23 @@
|
|||
<baseMoodEffect>5</baseMoodEffect>
|
||||
</li>
|
||||
</stages>
|
||||
</RJWSexperience.ThoughtDef_Opinionbased>
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.ThoughtDefExtension_StageFromOpinion">
|
||||
<minimumValueforStage>
|
||||
<li>-100</li>
|
||||
<li>-50</li>
|
||||
<li>0</li>
|
||||
<li>75</li>
|
||||
</minimumValueforStage>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</ThoughtDef>
|
||||
|
||||
<RJWSexperience.ThoughtDef_Opinionbased>
|
||||
<ThoughtDef>
|
||||
<defName>Virgin_Shameful_Taken</defName>
|
||||
<thoughtClass>RJWSexperience.Thought_Opinionbased</thoughtClass>
|
||||
<durationDays>7</durationDays>
|
||||
<stackLimit>1</stackLimit>
|
||||
<minimumValueforStage>
|
||||
<li>-100</li>
|
||||
<li>0</li>
|
||||
<li>75</li>
|
||||
</minimumValueforStage>
|
||||
<stages>
|
||||
<li>
|
||||
<label>Lost virginity by {0}</label>
|
||||
|
@ -320,7 +319,16 @@
|
|||
<baseMoodEffect>20</baseMoodEffect>
|
||||
</li>
|
||||
</stages>
|
||||
</RJWSexperience.ThoughtDef_Opinionbased>
|
||||
<modExtensions>
|
||||
<li Class="RJWSexperience.ThoughtDefExtension_StageFromOpinion">
|
||||
<minimumValueforStage>
|
||||
<li>-100</li>
|
||||
<li>0</li>
|
||||
<li>75</li>
|
||||
</minimumValueforStage>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</ThoughtDef>
|
||||
|
||||
|
||||
<ThoughtDef>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue