mirror of
https://gitgud.io/Stardust3D/rjw-plasticsurgeries.git
synced 2024-08-14 23:57:25 +00:00
relative vaginoplasty and absolute mammoplasty working
This commit is contained in:
parent
9c5e39738c
commit
defb76bb95
18 changed files with 776 additions and 0 deletions
222
Source/RJW_PlasticSurgeries/Recipe_Surgery_Mammoplasty.cs
Normal file
222
Source/RJW_PlasticSurgeries/Recipe_Surgery_Mammoplasty.cs
Normal file
|
@ -0,0 +1,222 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_PlasticSurgeries
|
||||
{
|
||||
public abstract class Recipe_Surgery_Mammoplasty : Recipe_Surgery
|
||||
{
|
||||
public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
|
||||
{
|
||||
if (pawn.gender != Gender.Female) yield break;
|
||||
|
||||
var part = Genital_Helper.get_genitalsBPR(pawn);
|
||||
if (part != null)
|
||||
{
|
||||
var hediffs = Genital_Helper.get_PartsHediffList(pawn, part);
|
||||
if (Genital_Helper.has_breasts(pawn, hediffs)) 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, billDoer, pawn);
|
||||
SurgeryResult(pawn);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void SurgeryResult(Pawn pawn);
|
||||
/*{
|
||||
pawn.GetBreastList().ForEach(hed => hed.Severity = Math.Min(1.0f, hed.Severity * 1.25f));
|
||||
//Log.Message($"Cup sizes: {pawn.GetBreastList().SelectMany(hed => hed.def.GetModExtension<PartSizeExtension>().cupSizes.Join()).Join(delimiter: ";")}");
|
||||
float val = 0;
|
||||
PartSizeExtension.TryGetCupSize(pawn.GetBreastList().First(), out val);
|
||||
pawn.GetBreastList().First().def.stages.First();
|
||||
Log.Message($"Cup size: {val}");
|
||||
}*/
|
||||
|
||||
protected void SurgeryCupX(Pawn pawn, int stage)
|
||||
{
|
||||
pawn.GetBreastList().ForEach(hed =>
|
||||
{
|
||||
float severity;
|
||||
if (TryGetSeverityFromSize(hed, stage, out severity))
|
||||
{
|
||||
hed.Severity = severity;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static bool TryGetSeverityFromSize(Hediff hediff, float cupSize, out float severity)
|
||||
{
|
||||
if (!hediff.def.HasModExtension<PartSizeExtension>())
|
||||
{
|
||||
severity = 0f;
|
||||
return false;
|
||||
}
|
||||
|
||||
var extension = hediff.def.GetModExtension<PartSizeExtension>();
|
||||
var list = extension.cupSizes;
|
||||
|
||||
if (list == null)
|
||||
{
|
||||
severity = 0f;
|
||||
return false;
|
||||
}
|
||||
|
||||
var curve = new SimpleCurve(hediff.def.stages.Zip(list,
|
||||
(stage, s) => new CurvePoint(s, stage.minSeverity)));
|
||||
severity = curve.Evaluate(cupSize);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_A : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_B : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 2);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_C : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 3);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_D : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 4);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_E : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 6);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_F : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 7);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_G : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 9);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_H : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 11);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_J : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 13);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_K : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 15);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_L : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 17);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_M : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 19);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_N : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 21);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_O : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 23);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_P : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 25);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_Q : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 27);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_R : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 29);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Mammoplasty_Unknown : Recipe_Surgery_Mammoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
this.SurgeryCupX(pawn, 31);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue