Remove the originsize system. Nobody used it

This commit is contained in:
lutepickle 2024-02-16 18:50:01 -08:00
parent d483e22ac2
commit f79050483d
5 changed files with 29 additions and 89 deletions

Binary file not shown.

View File

@ -145,10 +145,4 @@
</comps>
</value>
</Operation>
</Patch>

View File

@ -127,7 +127,6 @@ namespace RJW_Menstruation
protected float implantationChanceCache = -1.0f;
protected int opcache = -1;
protected float antisperm = 0.0f;
protected float? originvagsize = null;
// RJW pregnancy, or Biotech pregnancy/labor/laborpushing
protected Hediff pregnancy = null;
@ -179,7 +178,8 @@ namespace RJW_Menstruation
public float HoursBetweenSimulations => (float)TickInterval / GenDate.TicksPerHour;
public Hediff Pregnancy {
public Hediff Pregnancy
{
get
{
if (pregnancy == null) return null;
@ -564,19 +564,6 @@ namespace RJW_Menstruation
}
}
public float OriginVagSize
{
get
{
if (originvagsize == null)
{
originvagsize = parent.Severity;
}
return originvagsize ?? 0.1f;
}
set => originvagsize = value;
}
public int CurStageIntervalTicks
{
get => currentIntervalTicks;
@ -657,7 +644,6 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref ovarypower, "ovarypower", ovarypower, true);
Scribe_Values.Look(ref eggstack, "eggstack", 0);
Scribe_Values.Look(ref estrusflag, "estrusflag", false);
Scribe_Values.Look(ref originvagsize, "originvagsize", originvagsize, true);
Scribe_Values.Look(ref DoCleanWomb, "DoCleanWomb", false);
Scribe_References.Look(ref pregnancy, "pregnancy");
if (Scribe.mode == LoadSaveMode.PostLoadInit)
@ -816,7 +802,7 @@ namespace RJW_Menstruation
tip.Append(": ");
tip.Append(GetCurStageLabel);
string fertInfo = GetFertilizingInfo;
if(CurrentVisibleStage == Stage.Luteal && fertInfo.Length > 0)
if (CurrentVisibleStage == Stage.Luteal && fertInfo.Length > 0)
{
tip.AppendLine();
tip.Append(fertInfo);
@ -827,7 +813,7 @@ namespace RJW_Menstruation
protected virtual int TicksToNextStage()
{
return Math.Max(0,(currentIntervalTicks - curStageTicks) / Configurations.CycleAcceleration);
return Math.Max(0, (currentIntervalTicks - curStageTicks) / Configurations.CycleAcceleration);
}
public override string CompDebugString()
@ -1490,7 +1476,7 @@ namespace RJW_Menstruation
float interspeciesFactor = InterspeciesImplantFactor(egg.fertilizer);
float implantChance = Configurations.ImplantationChance * ImplantChance * interspeciesFactor;
Log.Message($"Fertilized egg of {Pawn} failed to implant (chance {implantChance.ToStringPercent()}, " +
(interspeciesFactor < 1.0f ? $"interspecies factor {interspeciesFactor.ToStringPercent()}, " : "" ) +
(interspeciesFactor < 1.0f ? $"interspecies factor {interspeciesFactor.ToStringPercent()}, " : "") +
$"father {egg.fertilizer})");
}
deadeggs.Add(egg);
@ -1576,9 +1562,6 @@ namespace RJW_Menstruation
return amount;
}
protected void EggDecay()
{
HashSet<Egg> deadeggs = new HashSet<Egg>();
@ -2034,28 +2017,6 @@ namespace RJW_Menstruation
public class HediffComp_Anus : HediffComp
{
protected float? originanussize;
public float OriginAnusSize
{
get
{
if (originanussize == null)
{
originanussize = parent.Severity;
}
return originanussize ?? 0.1f;
}
}
public override void CompExposeData()
{
base.CompExposeData();
Scribe_Values.Look(ref originanussize, "originanussize", originanussize, true);
}
public override void CompPostTick(ref float severityAdjustment)
{
}
public CompProperties_Anus Props => (CompProperties_Anus)props;
}
}

View File

@ -306,15 +306,13 @@ namespace RJW_Menstruation
}
public static Texture2D GetGenitalIcon(this Pawn pawn, HediffComp_Menstruation comp, bool drawOrigin = false)
public static Texture2D GetGenitalIcon(this Pawn pawn, HediffComp_Menstruation comp)
{
Hediff hediff = comp?.parent;
if (hediff == null) return ContentFinder<Texture2D>.Get("Genitals/Vagina00", true);
//HediffComp_Menstruation comp = hediff.GetMenstruationComp();
string icon;
float severity;
if (drawOrigin) severity = comp.OriginVagSize;
else severity = hediff.Severity;
float severity = hediff.Severity;
if (comp != null) icon = comp.VagTex;
else icon = "Genitals/Vagina";
@ -334,27 +332,15 @@ namespace RJW_Menstruation
return ContentFinder<Texture2D>.Get(icon, true);
}
public static Texture2D GetAnalIcon(this Pawn pawn, bool drawOrigin = false)
public static Texture2D GetAnalIcon(this Pawn pawn)
{
Hediff hediff = pawn.health.hediffSet.hediffs.FirstOrDefault(h => VariousDefOf.AllAnuses.Contains(h.def)) ??
pawn.health.hediffSet.hediffs.FirstOrDefault(h => h.def.defName.ToLower().Contains("anus"));
if (hediff == null) return ContentFinder<Texture2D>.Get("Genitals/Anal00", true);
string icon;
float severity;
HediffComp_Anus comp = hediff.GetAnusComp();
if (comp != null)
{
CompProperties_Anus Props = (CompProperties_Anus)comp.props;
icon = Props.analTex ?? "Genitals/Anal";
if (drawOrigin) severity = comp.OriginAnusSize;
else severity = hediff.Severity;
}
else
{
icon = "Genitals/Anal";
severity = hediff.Severity;
}
string icon = ((CompProperties_Anus)hediff.GetAnusComp()?.props)?.analTex ?? "Genitals/Anal";
float severity = hediff.Severity;
if (severity < 0.20f) icon += "00"; //micro
else if (severity < 0.40f) icon += "01"; //tight
else if (severity < 0.60f) icon += "02"; //average

View File

@ -388,10 +388,9 @@ namespace RJW_Menstruation
Rect genitalIconRect = new Rect(rect.x, rect.y + fontheight, genitalRectWidth, genitalRectHeight);
Rect genitalVaginaLabelRect = new Rect(rect.x, rect.y + 10f, genitalRectWidth, fontheight);
Rect genitalAnusLabelRect = new Rect(rect.x, rect.y + fontheight + genitalRectHeight, genitalRectWidth, fontheight);
bool showOrigin = Mouse.IsOver(genitalIconRect) && Input.GetMouseButton(0);
vagina = pawn.GetGenitalIcon(comp, showOrigin);
anal = pawn.GetAnalIcon(showOrigin);
vagina = pawn.GetGenitalIcon(comp);
anal = pawn.GetAnalIcon();
GUI.color = new Color(1.00f, 0.47f, 0.47f, 1);
GUI.Box(rect, "", boxstyle);
GUI.color = Utility.SafeSkinColor(pawn);