This commit is contained in:
moreoreganostodump 2021-06-16 21:53:52 +09:00
parent df1e3c9b23
commit 11d8ae4863
20 changed files with 444 additions and 122 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>RJW Menstruation</identifier>
<version>1.0.3.1</version>
<version>1.0.3.2</version>
<dependencies>
</dependencies>
<incompatibleWith />
@ -9,6 +9,6 @@
</loadAfter>
<suggests>
</suggests>
<manifestUri>https://github.com/moreoreganostodump/RJW_Menstruation/blob/master/About/Manifest.xml</manifestUri>
<manifestUri>https://raw.githubusercontent.com/moreoreganostodump/RJW_Menstruation/master/About/Manifest.xml</manifestUri>
<downloadUri>https://github.com/moreoreganostodump/RJW_Menstruation</downloadUri>
</Manifest>

Binary file not shown.

View file

@ -2,7 +2,7 @@
<Defs>
<JobDef>
<defName>LactateSelf</defName>
<driverClass>MilkModule.JobDriver_HumanMilkSelf</driverClass>
<driverClass>RJW_Menstruation.JobDriver_MilkSelf</driverClass>
<reportString>lactating self</reportString>
<allowOpportunisticPrefix>true</allowOpportunisticPrefix>
</JobDef>

View file

@ -18,7 +18,7 @@
<ThoughtDef>
<defName>CameInsideF</defName>
<thoughtClass>Thought_Memory</thoughtClass>
<thoughtClass>Thought_MemorySocial</thoughtClass>
<durationDays>7.0</durationDays>
<stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier>
@ -35,8 +35,8 @@
<ThoughtDef>
<defName>CameInsideFLowFert</defName>
<thoughtClass>Thought_Memory</thoughtClass>
<durationDays>7.0</durationDays>
<thoughtClass>Thought_MemorySocial</thoughtClass>
<durationDays>3.0</durationDays>
<stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier>
<stackLimitForSameOtherPawn>1</stackLimitForSameOtherPawn>
@ -51,7 +51,7 @@
<ThoughtDef>
<defName>CameInsideFFetish</defName>
<thoughtClass>Thought_Memory</thoughtClass>
<thoughtClass>Thought_MemorySocial</thoughtClass>
<durationDays>3.0</durationDays>
<stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier>
@ -68,7 +68,7 @@
<ThoughtDef>
<defName>CameInsideFFetishSafe</defName>
<thoughtClass>Thought_Memory</thoughtClass>
<thoughtClass>Thought_MemorySocial</thoughtClass>
<durationDays>3.0</durationDays>
<stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier>
@ -85,7 +85,7 @@
<ThoughtDef>
<defName>CameInsideM</defName>
<thoughtClass>Thought_Memory</thoughtClass>
<thoughtClass>Thought_MemorySocial</thoughtClass>
<durationDays>1.0</durationDays>
<stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.4</stackedEffectMultiplier>
@ -94,13 +94,14 @@
<label>came inside of {0}</label>
<description>Feel so good.</description>
<baseMoodEffect>2</baseMoodEffect>
<baseOpinionOffset>1</baseOpinionOffset>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>HaterCameInsideFSafe</defName>
<thoughtClass>Thought_Memory</thoughtClass>
<thoughtClass>Thought_MemorySocial</thoughtClass>
<durationDays>3.0</durationDays>
<stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier>
@ -109,7 +110,7 @@
<li>
<label>{0} came inside</label>
<description>The chance is low. But i don't like it.</description>
<baseMoodEffect>-3</baseMoodEffect>
<baseMoodEffect>-2</baseMoodEffect>
<baseOpinionOffset>-5</baseOpinionOffset>
</li>
</stages>
@ -117,7 +118,7 @@
<ThoughtDef>
<defName>HaterCameInsideF</defName>
<thoughtClass>Thought_Memory</thoughtClass>
<thoughtClass>Thought_MemorySocial</thoughtClass>
<durationDays>7.0</durationDays>
<stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier>
@ -134,7 +135,7 @@
<ThoughtDef>
<defName>HaterCameInsideM</defName>
<thoughtClass>Thought_Memory</thoughtClass>
<thoughtClass>Thought_MemorySocial</thoughtClass>
<durationDays>1.0</durationDays>
<stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.4</stackedEffectMultiplier>
@ -143,6 +144,7 @@
<label>came inside of {0}</label>
<description>i came inside of that bitch</description>
<baseMoodEffect>5</baseMoodEffect>
<baseOpinionOffset>1</baseOpinionOffset>
</li>
</stages>
</ThoughtDef>
@ -157,10 +159,56 @@
<li>
<label>unwanted pregnancy</label>
<description>How do i...</description>
<baseMoodEffect>-15</baseMoodEffect>
<baseMoodEffect>-10</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>UnwantedPregnancyMild</defName>
<thoughtClass>Thought_Memory</thoughtClass>
<durationDays>14.0</durationDays>
<stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier>
<stages>
<li>
<label>unwanted pregnancy</label>
<description>How do i...</description>
<baseMoodEffect>-3</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>TookContraptivePill</defName>
<thoughtClass>Thought_Memory</thoughtClass>
<durationDays>7.0</durationDays>
<stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier>
<stages>
<li>
<label>took contraptive pill</label>
<description>It will be okay.</description>
<baseMoodEffect>1</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>HateTookContraptivePill</defName>
<thoughtClass>Thought_Memory</thoughtClass>
<durationDays>7.0</durationDays>
<stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier>
<stages>
<li>
<label>took contraptive pill</label>
<description>I want to get pregnant.</description>
<baseMoodEffect>-3</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
</Defs>

View file

@ -17,7 +17,13 @@
<HaterCameInsideFSafe.stages.0.label>{0}에게 질내사정당함</HaterCameInsideFSafe.stages.0.label>
<HaterCameInsideFSafe.stages.0.description>안전일이였지만 기분나빠</HaterCameInsideFSafe.stages.0.description>
<HaterCameInsideM.stages.0.label>{0}에게 질내사정함</HaterCameInsideM.stages.0.label>
<HaterCameInsideM.stages.0.description>년한테 질싸를했어</HaterCameInsideM.stages.0.description>
<HaterCameInsideM.stages.0.description>그년한테 질싸를했어</HaterCameInsideM.stages.0.description>
<UnwantedPregnancy.stages.0.label>원치않은 임신</UnwantedPregnancy.stages.0.label>
<UnwantedPregnancy.stages.0.description>어떻게 해야하지?...</UnwantedPregnancy.stages.0.description>
<UnwantedPregnancy.stages.0.description>어떻게 해야하지?...</UnwantedPregnancy.stages.0.description> <HaterCameInsideM.stages.0.description>그년한테 질싸를했어</HaterCameInsideM.stages.0.description>
<UexpectedPregnancyMild.stages.0.label>원치않은 임신</UexpectedPregnancyMild.stages.0.label>
<UexpectedPregnancyMild.stages.0.description>어떻게 해야하지?...</UexpectedPregnancyMild.stages.0.description>
<TookContraptivePill.stages.0.label>피임약 복용</TookContraptivePill.stages.0.label>
<TookContraptivePill.stages.0.description>괜찮을거야</TookContraptivePill.stages.0.description>
<HateTookContraptivePill.stages.0.label>피임약 복용</HateTookContraptivePill.stages.0.label>
<HateTookContraptivePill.stages.0.description>임신하고싶어</HateTookContraptivePill.stages.0.description>
</LanguageData>

Binary file not shown.

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<JobDef>
<defName>LactateSelf_MC</defName>
<driverClass>MilkModule.JobDriver_MilkSelf_MC</driverClass>
<reportString>lactating self</reportString>
<allowOpportunisticPrefix>true</allowOpportunisticPrefix>
</JobDef>
</Defs>

View file

@ -7,4 +7,11 @@
<li Class="RJW_Menstruation.FertPillOutcomDoer"/>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="RJW_Contraceptive"]/ingestible/outcomeDoers</xpath>
<value>
<li Class="RJW_Menstruation.ContraptiveOutcomDoer"/>
</value>
</Operation>
</Patch>

View file

@ -38,6 +38,4 @@
</li>
</value>
</Operation>
</Patch>

View file

@ -1,4 +1,11 @@
Version 1.0.3.2
- fixed self-lactating not work properly
- pawns having impregnation fetish or lover get less mood penalty on pregnancy
- minor bug fixes
- contraptive pills decreases mood debuffs from creampie (breeders will get reversed effect)
Version 1.0.3.1
*Note* Remove previous version before installing
- fixed problems that pawns get climacteric stage after pregnancy even the menopause setting is off
- now implantation chance is independent with rjw pregnancy settings
- fixed broken vagina support

View file

@ -11,47 +11,37 @@ using RJW_Menstruation;
namespace MilkModule
{
public class JobDriver_HumanMilkSelf : JobDriver
public class JobDriver_MilkSelf_MC : JobDriver_MilkSelf
{
const float milkingTime = 250f;//ticks - 120 = 2 real seconds, 3 in-game minutes
HumanCompHasGatherableBodyResource comp;
HediffComp_Breast breastcomp;
public override bool TryMakePreToilReservations(bool errorOnFailed)
protected override float Fullness
{
return pawn.Reserve(pawn, job, 1, -1, null, errorOnFailed);
get
{
return comp.Fullness;
}
}
protected override IEnumerable<Toil> MakeNewToils()
protected override void PreMakeNewToils()
{
comp = GetMilkComp(pawn);
breastcomp = pawn.GetBreastComp();
}
HumanCompHasGatherableBodyResource Comp = GetMilkComp(pawn);
HediffComp_Breast breastcomp = pawn.GetBreastComp();
this.FailOn(delegate
protected override void Gathered()
{
return !(Comp.Fullness > 0.01f);
});
Toil milking = Toils_General.Wait((int)(50 + milkingTime * Comp.Fullness), TargetIndex.None);//duration of
comp.Gathered(pawn);
}
milking.WithProgressBarToilDelay(TargetIndex.A);
milking.tickAction = delegate ()
protected override void PostTickAction()
{
if (breastcomp != null)
{
breastcomp.AdjustAreolaSize(Rand.Range(0.0f, 0.0001f * Configurations.NipplePermanentTransitionVariance));
breastcomp.AdjustNippleSize(Rand.Range(0.0f, 0.0001f * Configurations.NipplePermanentTransitionVariance));
}
};
yield return milking;
yield return new Toil()
{
initAction = delegate ()
{
Comp.Gathered(pawn);
}
};
//yield return excreting;
yield break;
}
@ -61,6 +51,7 @@ namespace MilkModule
if (pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Heavy_Lactating_Permanent))
{
result = pawn.TryGetComp<CompHyperMilkableHuman>();
}
else
{
@ -70,7 +61,70 @@ namespace MilkModule
}
}
//public class JobDriver_HumanMilkSelf : JobDriver
//{
// const float milkingTime = 250f;//ticks - 120 = 2 real seconds, 3 in-game minutes
//
// public override bool TryMakePreToilReservations(bool errorOnFailed)
// {
// return pawn.Reserve(pawn, job, 1, -1, null, errorOnFailed);
// }
//
// protected override IEnumerable<Toil> MakeNewToils()
// {
//
// HumanCompHasGatherableBodyResource Comp = GetMilkComp(pawn);
// HediffComp_Breast breastcomp = pawn.GetBreastComp();
// this.FailOn(delegate
// {
// return !(Comp.Fullness > 0.01f);
// });
// Toil milking = Toils_General.Wait((int)(50 + milkingTime * Comp.Fullness), TargetIndex.None);//duration of
//
// milking.WithProgressBarToilDelay(TargetIndex.A);
// milking.tickAction = delegate ()
// {
// if (breastcomp != null)
// {
// breastcomp.AdjustAreolaSize(Rand.Range(0.0f,0.0001f * Configurations.NipplePermanentTransitionVariance));
// breastcomp.AdjustNippleSize(Rand.Range(0.0f,0.0001f * Configurations.NipplePermanentTransitionVariance));
// }
//
// };
// yield return milking;
// yield return new Toil()
// {
// initAction = delegate ()
// {
// Comp.Gathered(pawn);
// }
// };
// //yield return excreting;
// yield break;
//
// }
//
//
// public static HumanCompHasGatherableBodyResource GetMilkComp(Pawn pawn)
// {
// HumanCompHasGatherableBodyResource result;
// if (pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Heavy_Lactating_Permanent))
// {
// result = pawn.TryGetComp<CompHyperMilkableHuman>();
// }
// else
// {
// result = pawn.TryGetComp<CompMilkableHuman>();
// }
// return result;
// }
//
//
//}
}

View file

@ -1,5 +1,7 @@
using RimWorld;
using System.Collections.Generic;
using RimWorld;
using Verse;
using rjw;
namespace RJW_Menstruation
{
@ -53,6 +55,31 @@ namespace RJW_Menstruation
}
}
public class ContraptiveOutcomDoer : IngestionOutcomeDoer
{
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
{
List<Thought_Memory> memories = pawn.needs?.mood?.thoughts?.memories?.Memories.FindAll(
x =>
x.def == VariousDefOf.CameInsideF
|| x.def == VariousDefOf.CameInsideFFetish
|| x.def == VariousDefOf.HaterCameInsideF);
if (!memories.NullOrEmpty())
{
foreach (Thought_Memory m in memories)
{
if (m.def == VariousDefOf.HaterCameInsideF) m.moodPowerFactor = 0.5f;
else m.moodPowerFactor = 0.3f;
}
if (pawn.Has(Quirk.Breeder)) pawn.needs.mood.thoughts.memories.TryGainMemoryFast(VariousDefOf.HateTookContraptivePill);
else pawn.needs.mood.thoughts.memories.TryGainMemoryFast(VariousDefOf.TookContraptivePill);
}
}
}
}

View file

@ -56,6 +56,7 @@ namespace RJW_Menstruation
protected float originareola = -1f;
protected float originnipple = -1f;
protected Color cachedcolor;
protected bool loaded = false;
public Action action;
@ -134,6 +135,18 @@ namespace RJW_Menstruation
public override void CompPostTick(ref float severityAdjustment) { }
public override void CompPostPostAdd(DamageInfo? dinfo)
{
if (!loaded) Initialize();
}
public override void CompPostPostRemoved()
{
HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(action);
ModLog.Message(parent.pawn.Label + "breast tick scheduler removed");
base.CompPostPostRemoved();
}
public void Initialize()
{
Props = (CompProperties_Breast)props;
@ -160,9 +173,12 @@ namespace RJW_Menstruation
nippleSizeCurrent = nippleSizePermanent;
}
UpdateColor();
loaded = true;
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(action, tickinterval, parent.pawn);
}
public void Transition()
{
alphaCurrent = Mathf.Lerp(alphaCurrent, alpha, Configurations.NippleTransitionRatio);
@ -223,6 +239,7 @@ namespace RJW_Menstruation
float variance = breastSizeIncreased * Math.Min(ratio, 1.0f);
breastSizeIncreased -= variance;
parent.Severity -= variance;
}
public void UpdateColor()

View file

@ -596,48 +596,8 @@ namespace RJW_Menstruation
public virtual void AfterCumIn(Pawn cummer)
{
if (xxx.is_human(parent.pawn) && xxx.is_human(cummer))
{
if (parent.pawn.GetStatValue(StatDefOf.PawnBeauty) >= 0 || cummer.Has(Quirk.ImpregnationFetish) || cummer.Has(Quirk.Breeder))
{
if (cummer.relations.OpinionOf(parent.pawn) <= -25)
{
cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideM, parent.pawn);
}
else
{
cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideM, parent.pawn);
}
}
ThoughtCumInside(cummer);
if (IsDangerDay)
{
if (parent.pawn.Has(Quirk.Breeder) || parent.pawn.Has(Quirk.ImpregnationFetish))
{
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetish, cummer);
}
else if (!parent.pawn.relations.DirectRelationExists(PawnRelationDefOf.Spouse, cummer) && !parent.pawn.relations.DirectRelationExists(PawnRelationDefOf.Fiance, cummer))
{
if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) < 0.50f) parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFLowFert, cummer);
else parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideF, cummer);
}
else if (parent.pawn.relations.OpinionOf(cummer) <= -5)
{
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer);
}
}
else
{
if (parent.pawn.Has(Quirk.Breeder) || parent.pawn.Has(Quirk.ImpregnationFetish))
{
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetishSafe, cummer);
}
else if (parent.pawn.relations.OpinionOf(cummer) <= -5)
{
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFSafe, cummer);
}
}
}
}
public virtual void AfterNotCumIn()
@ -671,7 +631,7 @@ namespace RJW_Menstruation
/// </summary>
public virtual void AfterCumOut()
{
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.LeakingFluids);
parent.pawn.needs?.mood?.thoughts?.memories?.TryGainMemory(VariousDefOf.LeakingFluids);
}
/// <summary>
@ -1321,6 +1281,57 @@ namespace RJW_Menstruation
}
}
protected virtual void ThoughtCumInside(Pawn cummer)
{
if (xxx.is_human(parent.pawn) && xxx.is_human(cummer))
{
if (parent.pawn.GetStatValue(StatDefOf.PawnBeauty) >= 0 || cummer.Has(Quirk.ImpregnationFetish) || cummer.Has(Quirk.Breeder))
{
if (cummer.relations.OpinionOf(parent.pawn) <= -25)
{
cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideM, parent.pawn);
}
else
{
cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideM, parent.pawn);
}
}
if (IsDangerDay)
{
if (parent.pawn.Has(Quirk.Breeder) || parent.pawn.Has(Quirk.ImpregnationFetish))
{
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetish, cummer);
}
else if (!parent.pawn.relations.DirectRelationExists(PawnRelationDefOf.Spouse, cummer) && !parent.pawn.relations.DirectRelationExists(PawnRelationDefOf.Fiance, cummer))
{
if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) < 0.50f) parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFLowFert, cummer);
else parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideF, cummer);
}
else if (parent.pawn.relations.OpinionOf(cummer) <= -5)
{
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer);
}
}
else
{
if (parent.pawn.Has(Quirk.Breeder) || parent.pawn.Has(Quirk.ImpregnationFetish))
{
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetishSafe, cummer);
}
else if (parent.pawn.relations.OpinionOf(cummer) <= -5)
{
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFSafe, cummer);
}
}
}
}
protected virtual void ThoughtCummer()
{
}
private Action PeriodSimulator(Stage targetstage)
{

View file

@ -11,13 +11,28 @@ namespace RJW_Menstruation
{
public override void DiscoverPregnancy()
{
if (!is_discovered && xxx.is_human(pawn) && !pawn.Has(Quirk.Breeder) && pawn.relations?.DirectRelations?.Find(x => x.def.Equals(PawnRelationDefOf.Spouse) || x.def.Equals(PawnRelationDefOf.Fiance)) == null)
{
pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.UnwantedPregnancy);
}
PregnancyThought();
base.DiscoverPregnancy();
}
protected void PregnancyThought()
{
if (!is_discovered && xxx.is_human(pawn))
{
if (!pawn.Has(Quirk.Breeder) && pawn.relations?.DirectRelations?.Find(x => x.def.Equals(PawnRelationDefOf.Spouse) || x.def.Equals(PawnRelationDefOf.Fiance)) == null)
{
if (pawn.Has(Quirk.ImpregnationFetish) || pawn.relations?.DirectRelations?.Find(x => x.def.Equals(PawnRelationDefOf.Lover)) != null)
{
pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.UnwantedPregnancyMild);
}
else
{
pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.UnwantedPregnancy);
}
}
}
}
public override void GiveBirth()
{

View file

@ -39,7 +39,84 @@ namespace RJW_Menstruation
}
}
public class JobDriver_MilkSelf : JobDriver
{
protected float progress = 0;
protected float MilkingTime
{
get
{
return 250f * Fullness + 50f;
}
}
protected virtual float Fullness
{
get
{
return comp?.Fullness ?? 0;
}
}
private CompMilkable comp;
public override bool TryMakePreToilReservations(bool errorOnFailed)
{
return pawn.Reserve(pawn, job, 1, -1, null, errorOnFailed);
}
protected virtual void PreMakeNewToils()
{
comp = pawn.GetComp<CompMilkable>();
}
protected override IEnumerable<Toil> MakeNewToils()
{
PreMakeNewToils();
this.FailOnDespawnedNullOrForbidden(TargetIndex.A);
this.FailOnNotCasualInterruptible(TargetIndex.A);
Toil milking = new Toil();
milking.initAction = delegate ()
{
pawn.pather.StopDead();
};
milking.tickAction = MilkingTick;
milking.AddFinishAction(Finish);
milking.defaultCompleteMode = ToilCompleteMode.Never;
milking.WithProgressBar(TargetIndex.A, () => progress / MilkingTime);
yield return milking;
yield break;
}
protected void MilkingTick()
{
progress += pawn.GetStatValue(StatDefOf.AnimalGatherSpeed);
if (progress > MilkingTime)
{
Gathered();
pawn.jobs.EndCurrentJob(JobCondition.Succeeded);
}
PostTickAction();
}
protected virtual void Gathered()
{
pawn.GetComp<CompMilkable>().Gathered(pawn);
}
protected virtual void Finish()
{
if(pawn.CurJobDef == JobDefOf.Wait_MaintainPosture)
{
pawn.jobs.EndCurrentJob(JobCondition.InterruptForced);
}
}
protected virtual void PostTickAction()
{
}
}
}

View file

@ -111,12 +111,14 @@ namespace RJW_Menstruation
}
//Merged to RJW
[HarmonyPatch(typeof(PawnColumnWorker_Pregnant), "GetIconFor")]
public class PawnColumnWorker_Patch_Icon
{
public static void Postfix(Pawn pawn, ref Texture2D __result)
{
if (pawn.IsPregnant()) __result = ContentFinder<Texture2D>.Get("UI/Icons/Animal/Pregnant", true);
if (pawn.IsVisiblyPregnant()) __result = ContentFinder<Texture2D>.Get("UI/Icons/Animal/Pregnant", true);
}
}
@ -135,6 +137,25 @@ namespace RJW_Menstruation
}
[HarmonyPatch(typeof(TransferableUIUtility), "DoExtraAnimalIcons")]
public class TransferableUIUtility_Patch_Icon
{
private static readonly Texture2D PregnantIcon = ContentFinder<Texture2D>.Get("UI/Icons/Animal/Pregnant", true);
public static void Postfix(Transferable trad, Rect rect, ref float curX)
{
Pawn pawn = trad.AnyThing as Pawn;
if (pawn.IsVisiblyPregnant())
{
Rect rect3 = new Rect(curX - 24f, (rect.height - 24f) / 2f, 24f, 24f);
curX -= 24f;
if (Mouse.IsOver(rect3))
{
TooltipHandler.TipRegion(rect3, PawnColumnWorker_Pregnant.GetTooltipText(pawn));
}
GUI.DrawTexture(rect3, PregnantIcon);
}
}
}
//[HarmonyPatch(typeof(JobGiver_OptimizeApparel), "ApparelScoreGain_NewTmp")]

View file

@ -19,6 +19,20 @@ namespace RJW_Menstruation
return fieldInfo?.GetValue(obj);
}
public static object GetPropertyValue(this Type type, string name)
{
BindingFlags flags = BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
PropertyInfo propertyInfo = type?.GetProperty(name,flags);
return propertyInfo?.GetValue(null);
}
public static object GetPropertyValue(this object obj, string name)
{
BindingFlags flags = BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
PropertyInfo propertyInfo = obj?.GetType().GetProperty(name,flags);
return propertyInfo?.GetValue(obj);
}
public static void SetMemberValue(this Type type, string name, object value)
{
BindingFlags flags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

View file

@ -413,19 +413,26 @@ namespace RJW_Menstruation
if (milkcomp != null)
{
if (milkcomp is CompMilkable)
{
bool active = (bool)milkcomp.GetPropertyValue("Active");
if (active)
{
CompMilkable m = (CompMilkable)milkcomp;
res = Math.Max(m.Fullness, res);
Widgets.FillableBar(rect, Math.Min(res, 1.0f), TextureCache.milkTexture, Texture2D.blackTexture, true);
DrawMilkBottle(rect, pawn, JobDefOf.Milk, m.Fullness);
DrawMilkBottle(rect, pawn, VariousDefOf.Job_LactateSelf, m.Fullness);
}
}
else
{
bool active = (bool)milkcomp.GetPropertyValue("Active");
if (active)
{
float fullness = (float)milkcomp.GetMemberValue("fullness");
res = Math.Max(fullness, res);
Widgets.FillableBar(rect, Math.Min(res, 1.0f), TextureCache.milkTexture, Texture2D.blackTexture, true);
DrawMilkBottle(rect, pawn, VariousDefOf.Job_LactateSelf,fullness);
DrawMilkBottle(rect, pawn, VariousDefOf.Job_LactateSelf_MC, fullness);
}
}
}
}

View file

@ -23,6 +23,7 @@ namespace RJW_Menstruation
public static readonly PawnRelationDef Relation_spawn = DefDatabase<PawnRelationDef>.AllDefs.FirstOrDefault(d => d.defName == "RJW_Pup");
public static readonly NeedDef SexNeed = DefDatabase<NeedDef>.GetNamed("Sex");
public static readonly JobDef VaginaWashing = DefDatabase<JobDef>.GetNamed("VaginaWashing");
public static readonly JobDef Job_LactateSelf = DefDatabase<JobDef>.GetNamed("LactateSelf");
public static readonly ThoughtDef LeakingFluids = DefDatabase<ThoughtDef>.GetNamed("LeakingFluids");
public static readonly ThoughtDef CameInsideF = DefDatabase<ThoughtDef>.GetNamed("CameInsideF");
public static readonly ThoughtDef CameInsideFLowFert = DefDatabase<ThoughtDef>.GetNamed("CameInsideFLowFert");
@ -33,6 +34,9 @@ namespace RJW_Menstruation
public static readonly ThoughtDef CameInsideM = DefDatabase<ThoughtDef>.GetNamed("CameInsideM");
public static readonly ThoughtDef HaterCameInsideM = DefDatabase<ThoughtDef>.GetNamed("HaterCameInsideM");
public static readonly ThoughtDef UnwantedPregnancy = DefDatabase<ThoughtDef>.GetNamed("UnwantedPregnancy");
public static readonly ThoughtDef UnwantedPregnancyMild = DefDatabase<ThoughtDef>.GetNamed("UnwantedPregnancyMild");
public static readonly ThoughtDef TookContraptivePill = DefDatabase<ThoughtDef>.GetNamed("TookContraptivePill");
public static readonly ThoughtDef HateTookContraptivePill = DefDatabase<ThoughtDef>.GetNamed("HateTookContraptivePill");
public static readonly HediffDef_PartBase Vagina = DefDatabase<HediffDef_PartBase>.GetNamed("Vagina");
public static readonly CompProperties_Menstruation VaginaCompProperties = (CompProperties_Menstruation)Vagina.comps.FirstOrDefault(x => x is CompProperties_Menstruation);
public static readonly KeyBindingDef OpenStatusWindowKey = DefDatabase<KeyBindingDef>.GetNamed("OpenStatusWindow");
@ -43,7 +47,7 @@ namespace RJW_Menstruation
public static readonly HediffDef Hediff_Lactating_Natural = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Natural");
public static readonly HediffDef Hediff_Lactating_Permanent = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Permanent");
public static readonly HediffDef Hediff_Heavy_Lactating_Permanent = DefDatabase<HediffDef>.GetNamedSilentFail("Heavy_Lactating_Permanent");
public static readonly JobDef Job_LactateSelf = DefDatabase<JobDef>.GetNamed("LactateSelf");
public static readonly JobDef Job_LactateSelf_MC = DefDatabase<JobDef>.GetNamed("LactateSelf_MC");