diff --git a/1.3/Assemblies/RJW_PlasticSurgeries.dll b/1.3/Assemblies/RJW_PlasticSurgeries.dll
index 11c6633..9f2000d 100644
Binary files a/1.3/Assemblies/RJW_PlasticSurgeries.dll and b/1.3/Assemblies/RJW_PlasticSurgeries.dll differ
diff --git a/Assemblies/RJW_PlasticSurgeries.dll b/Assemblies/RJW_PlasticSurgeries.dll
index 11c6633..9f2000d 100644
Binary files a/Assemblies/RJW_PlasticSurgeries.dll and b/Assemblies/RJW_PlasticSurgeries.dll differ
diff --git a/Defs/Recipe_Surgery/Recipes_Surgery_Beautify.xml b/Defs/Recipe_Surgery/Recipes_Surgery_Beautify.xml
index 6ee08dd..f48a7eb 100644
--- a/Defs/Recipe_Surgery/Recipes_Surgery_Beautify.xml
+++ b/Defs/Recipe_Surgery/Recipes_Surgery_Beautify.xml
@@ -34,10 +34,10 @@
- Surgery_Beautify_Base
-
+ Surgery_Beautify_Beautiful
+
Surgically beautifies the pawn.
- RJW_PlasticSurgeries.Recipe_Surgery_Beautify_Base
+ RJW_PlasticSurgeries.Recipe_Surgery_Beautify_Beautiful
beautify the pawn.
\ No newline at end of file
diff --git a/Source/RJW_PlasticSurgeries/Recipe_Surgery_Beautify.cs b/Source/RJW_PlasticSurgeries/Recipe_Surgery_Beautify.cs
index e828739..7a93545 100644
--- a/Source/RJW_PlasticSurgeries/Recipe_Surgery_Beautify.cs
+++ b/Source/RJW_PlasticSurgeries/Recipe_Surgery_Beautify.cs
@@ -1,22 +1,19 @@
-using System;
+using System.Collections.Generic;
using RimWorld;
-using rjw;
-using System.Collections.Generic;
-using Dyspareunia;
using Verse;
+using static RimWorld.TraitDefOf;
namespace RJW_PlasticSurgeries
{
+ ///
public abstract class Recipe_Surgery_Beautify : Recipe_Surgery
{
+ ///
public override IEnumerable 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_vagina(pawn, hediffs)) yield return part;
- }
+ if (!pawn.story.traits.HasTrait(Beauty) ||
+ pawn.story.traits.HasTrait(Beauty) && pawn.story.traits.GetTrait(Beauty).Degree < 2)
+ yield return pawn.RaceProps.body.corePart;
}
///
@@ -30,20 +27,34 @@ namespace RJW_PlasticSurgeries
}
}
+ ///
+ ///
+ ///
+ ///
public abstract void SurgeryResult(Pawn pawn);
- protected void SurgeryX(Pawn pawn, float severity)
+ ///
+ /// Setts the severity of the Beautiful trait for the selected pawn.
+ /// If the trait doesn't exist in the pawns traits, it will be added.
+ ///
+ /// the pawn to modify
+ /// the new severity of the pawn's Beautiful trait
+ protected void SurgeryX(Pawn pawn, int severity)
{
- // pawn.story.traits.HasTrait(Beautiful)
- // pawn.random_pick_a_trait()
+ if (pawn.story.traits.HasTrait(Beauty))
+ {
+ pawn.story.traits.allTraits.FindAll(t => Beauty.ConflictsWith(t))
+ .ForEach(t => pawn.story.traits.RemoveTrait(t));
+ pawn.story.traits.RemoveTrait(pawn.story.traits.allTraits.Find(t => t.def == Beauty));
+ }
+ pawn.story.traits.GainTrait(new Trait(Beauty, severity));
}
}
- public class Recipe_Surgery_Beautify_Base : Recipe_Surgery_Beautify
+ ///
+ public class Recipe_Surgery_Beautify_Beautiful : Recipe_Surgery_Beautify
{
- public override void SurgeryResult(Pawn pawn)
- {
- this.SurgeryX(pawn, 0.1f);
- }
+ ///
+ public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 2);
}
}
\ No newline at end of file