Penoplasty

This commit is contained in:
Stardust3D 2022-01-15 23:43:57 +01:00
parent 1a268705dd
commit 41274bc679
8 changed files with 158 additions and 4 deletions

View file

@ -2,5 +2,5 @@
<Manifest>
<identifier>RJW PlasticSurgeries</identifier>
<version>4943.0.1.3</version>
<version>4943.0.1.4</version>
</Manifest>

Binary file not shown.

View file

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<RecipeDef Name="Surgery_Penoplasty_X" Abstract="True">
<defName>Surgery_Penoplasty</defName>
<label>Penoplasty</label>
<description>Surgically enlarges the pawn's Penis by 25%.</description>
<!--<workerClass>RJW_PlasticSurgeries.Recipe_Surgery_Penoplasty</workerClass>-->
<jobString>enlarging Penis</jobString>
<effectWorking>Surgery</effectWorking>
<soundWorking>Recipe_Surgery</soundWorking>
<workSpeedStat>MedicalOperationSpeed</workSpeedStat>
<workSkill>Medicine</workSkill>
<workSkillLearnFactor>0.2</workSkillLearnFactor>
<workAmount>400</workAmount>
<anesthetize>true</anesthetize>
<recipeUsers>
<li>Human</li>
</recipeUsers>
<surgerySuccessChanceFactor>95</surgerySuccessChanceFactor>
<ingredients>
<li>
<filter>
<categories>
<li>Medicine</li>
</categories>
</filter>
<count>1</count>
</li>
</ingredients>
<fixedIngredientFilter>
<categories>
<li>Medicine</li>
</categories>
</fixedIngredientFilter>
</RecipeDef>
<RecipeDef ParentName="Surgery_Penoplasty_X">
<defName>Surgery_Penoplasty_Micro</defName>
<label>Penoplasty (micro)</label>
<description>Surgically gives the pawn an micro Penis.</description>
<workerClass>RJW_PlasticSurgeries.Recipe_Surgery_Penoplasty_Micro</workerClass>
<jobString>alter Penis size to micro</jobString>
</RecipeDef>
<RecipeDef ParentName="Surgery_Penoplasty_X">
<defName>Surgery_Penoplasty_Small</defName>
<label>Penoplasty (small)</label>
<description>Surgically gives the pawn an small Penis.</description>
<workerClass>RJW_PlasticSurgeries.Recipe_Surgery_Penoplasty_Small</workerClass>
<jobString>alter Penis size to small</jobString>
</RecipeDef>
<RecipeDef ParentName="Surgery_Penoplasty_X">
<defName>Surgery_Penoplasty_Average</defName>
<label>Penoplasty (average)</label>
<description>Surgically gives the pawn an average Penis.</description>
<workerClass>RJW_PlasticSurgeries.Recipe_Surgery_Penoplasty_Average</workerClass>
<jobString>alter Penis size to average</jobString>
</RecipeDef>
<RecipeDef ParentName="Surgery_Penoplasty_X">
<defName>Surgery_Penoplasty_Large</defName>
<label>Penoplasty (large)</label>
<description>Surgically gives the pawn an accomodating Penis.</description>
<workerClass>RJW_PlasticSurgeries.Recipe_Surgery_Penoplasty_Large</workerClass>
<jobString>alter Penis size to large</jobString>
</RecipeDef>
<RecipeDef ParentName="Surgery_Penoplasty_X">
<defName>Surgery_Penoplasty_Huge</defName>
<label>Penoplasty (huge)</label>
<description>Surgically gives the pawn an huge Penis.</description>
<workerClass>RJW_PlasticSurgeries.Recipe_Surgery_Penoplasty_Huge</workerClass>
<jobString>alter Penis size to huge</jobString>
</RecipeDef>
</Defs>

View file

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4943.0.1.3")]
[assembly: AssemblyFileVersion("4943.0.1.3")]
[assembly: AssemblyVersion("4943.0.1.4")]
[assembly: AssemblyFileVersion("4943.0.1.4")]

View file

@ -72,6 +72,7 @@
<Compile Include="Mod.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Recipe_Surgery_Mammoplasty.cs" />
<Compile Include="Recipe_Surgery_Penoplasty.cs" />
<Compile Include="Recipe_Surgery_Sphinctoplasty.cs" />
<Compile Include="Recipe_Surgery_Beautify.cs" />
<Compile Include="Recipe_Surgery_Vaginoplasty.cs" />
@ -89,6 +90,9 @@
<Content Include="..\..\Defs\Recipe_Surgery\Recipes_Surgery_Mammoplasty.xml">
<Link>Defs\Recipe_Surgery\Recipes_Surgery_Mammoplasty.xml</Link>
</Content>
<Content Include="..\..\Defs\Recipe_Surgery\Recipes_Surgery_Penoplasty.xml">
<Link>Defs\Recipe_Surgery\Recipes_Surgery_Penoplasty.xml</Link>
</Content>
<Content Include="..\..\Defs\Recipe_Surgery\Recipes_Surgery_Sphinctoplasty.xml">
<Link>Defs\Recipe_Surgery\Recipes_Surgery_Sphinctoplasty.xml</Link>
</Content>

View file

@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using Dyspareunia;
using RimWorld;
using rjw;
using Verse;
using DamageDefOf = Dyspareunia.DamageDefOf;
namespace RJW_PlasticSurgeries
{
public abstract class Recipe_Surgery_Penoplasty : Recipe_Surgery
{
public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
{
var part = Genital_Helper.get_genitalsBPR(pawn);
if (part != null)
{
var hediffs = Genital_Helper.get_PartsHediffList(pawn, part);
if (Genital_Helper.has_penis_fertile(pawn, hediffs) ||
Genital_Helper.has_penis_infertile(pawn, hediffs)) yield return part;
}
}
/// <inheritdoc />
public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients,
Bill bill)
{
if (billDoer != null)
{
TaleRecorder.RecordTale(TaleDefOf.DidSurgery, billDoer, pawn);
SurgeryResult(pawn);
}
}
public abstract void SurgeryResult(Pawn pawn);
protected void SurgeryX(Pawn pawn, float severity)
{
pawn.GetGenitalsList().FindAll(Genital_Helper.is_penis).ForEach(hed =>
{
hed.Severity = severity;
try
{
PenetrationUtility.AddDamageHediff(DamageDefOf.SexStretch, 0.5f, hed, null);
}
catch (Exception e)
{
Log.Error("Try enabling Dyspareunia for sore genitals");
}
});
}
}
public class Recipe_Surgery_Penoplasty_Micro : Recipe_Surgery_Penoplasty
{
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.1f);
}
public class Recipe_Surgery_Penoplasty_Small : Recipe_Surgery_Penoplasty
{
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.3f);
}
public class Recipe_Surgery_Penoplasty_Average : Recipe_Surgery_Penoplasty
{
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.5f);
}
public class Recipe_Surgery_Penoplasty_Large : Recipe_Surgery_Penoplasty
{
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.7f);
}
public class Recipe_Surgery_Penoplasty_Huge : Recipe_Surgery_Penoplasty
{
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.9f);
}
}

View file

@ -11,7 +11,7 @@ plugins {
//id("com.ullink.nunit") version "1.12"
}
version = "4943.0.1.3"
version = "4943.0.1.4"
val friendlyName = "rjw-plasticsurgeries"
tasks.register<com.ullink.Msbuild>("buildC#") {