Move Recipe_HymenSurgery

This commit is contained in:
amevarashi 2022-06-12 09:21:22 +05:00
parent 518e683dd4
commit 7e3034a300
4 changed files with 53 additions and 64 deletions

View File

@ -4,7 +4,7 @@
<defName>Surgery_RestoreHymen</defName>
<label>hymenoplasty</label>
<description>Disguises as virgin.</description>
<workerClass>RJWSexperience.Recipe_HymenSurgery</workerClass>
<workerClass>RJWSexperience.Virginity.Recipe_HymenSurgery</workerClass>
<jobString>restoring hymen</jobString>
<effectWorking>Surgery</effectWorking>
<soundWorking>Recipe_Surgery</soundWorking>
@ -12,10 +12,10 @@
<workSkill>Medicine</workSkill>
<workSkillLearnFactor>0.2</workSkillLearnFactor>
<workAmount>400</workAmount>
<anesthetize>false</anesthetize>
<recipeUsers>
<li>Human</li>
</recipeUsers>
<anesthetize>false</anesthetize>
<recipeUsers>
<li>Human</li>
</recipeUsers>
<surgerySuccessChanceFactor>100</surgerySuccessChanceFactor>
<ingredients>
<li>
@ -33,6 +33,4 @@
</categories>
</fixedIngredientFilter>
</RecipeDef>
</Defs>

View File

@ -62,7 +62,7 @@
<Compile Include="LustUtility.cs" />
<Compile Include="Patches\DefInjection.cs" />
<Compile Include="Patches\GetGizmos.cs" />
<Compile Include="Recipe_HymenSurgery.cs" />
<Compile Include="Virginity\Recipe_HymenSurgery.cs" />
<Compile Include="Settings\SettingsTabHistory.cs" />
<Compile Include="Settings\SettingsTabDebug.cs" />
<Compile Include="Settings\IResettable.cs" />
@ -92,6 +92,7 @@
<Compile Include="UI\SexStatus.cs" />
<Compile Include="Utility.cs" />
<Compile Include="VariousDefOf.cs" />
<Compile Include="Virginity\TraitDegree.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Krafs.Rimworld.Ref">

View File

@ -1,56 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;
using rjw;
using RJWSexperience.ExtensionMethods;
namespace RJWSexperience
{
public class Recipe_HymenSurgery : Recipe_Surgery
{
public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
{
if (pawn.gender != Gender.Female)
{
yield break;
}
BodyPartRecord part = Genital_Helper.get_genitalsBPR(pawn);
if (part != null)
{
List<Hediff> hediffs = Genital_Helper.get_PartsHediffList(pawn, part);
if (Genital_Helper.has_vagina(pawn, hediffs) && !pawn.HasHymen())
{
yield return part;
}
}
}
public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients, Bill bill)
{
if (billDoer != null)
{
TaleRecorder.RecordTale(TaleDefOf.DidSurgery, new object[]
{
billDoer,
pawn
});
SurgeryResult(pawn);
}
}
protected void SurgeryResult(Pawn pawn)
{
int degree = 1;
if (pawn.IsVirgin()) degree = 2;
Trait virgin = new Trait(VariousDefOf.Virgin, degree, true);
pawn.story.traits.GainTrait(virgin);
}
}
}

View File

@ -0,0 +1,46 @@
using RimWorld;
using rjw;
using System.Collections.Generic;
using Verse;
namespace RJWSexperience.Virginity
{
public class Recipe_HymenSurgery : Recipe_Surgery
{
public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
{
if (pawn.gender != Gender.Female)
yield break;
BodyPartRecord part = Genital_Helper.get_genitalsBPR(pawn);
if (part == null)
yield break;
List<Hediff> hediffs = Genital_Helper.get_PartsHediffList(pawn, part);
if (Genital_Helper.has_vagina(pawn, hediffs) && !pawn.HasHymen())
yield return part;
}
public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients, Bill bill)
{
if (billDoer == null)
return;
TaleRecorder.RecordTale(TaleDefOf.DidSurgery, new object[]
{
billDoer,
pawn
});
SurgeryResult(pawn);
}
protected void SurgeryResult(Pawn pawn)
{
TraitDegree degree = TraitDegree.FemaleAfterSurgery;
if (pawn.IsVirgin())
degree = TraitDegree.FemaleVirgin;
Trait virgin = new Trait(VariousDefOf.Virgin, (int)degree, true);
pawn.story.traits.GainTrait(virgin);
}
}
}