protected override IEnumerable <Toil> MakeNewToils() { HediffComp_Menstruation Comp = pawn.GetMenstruationComp(); this.FailOn(delegate { return(!(Comp.TotalCumPercent > 0.001)); }); Toil excreting = Toils_General.Wait(excretingTime, TargetIndex.None);//duration of excreting.WithProgressBarToilDelay(TargetIndex.A); yield return(excreting); yield return(new Toil() { initAction = delegate() { Comp.CumOut(null, 0.5f); if (Comp.TotalCumPercent > 0.001) { JumpToToil(excreting); } } }); //yield return excreting; yield break; }
public static void DrawEggOverlay(this HediffComp_Menstruation comp, Rect wombRect) { Rect rect = new Rect(wombRect.xMax - wombRect.width / 3, wombRect.y, wombRect.width / 3, wombRect.width / 3); GUI.color = Color.white; GUI.DrawTexture(rect, comp.GetEggIcon(), ScaleMode.ScaleToFit); }
public static void ToggleWindow(Pawn pawn, HediffComp_Menstruation comp) { Dialog_WombStatus window = (Dialog_WombStatus)Find.WindowStack.Windows.FirstOrDefault(x => x.GetType().Equals(typeof(Dialog_WombStatus))); if (window != null) { List <Pawn> pawns = Find.Selector.SelectedPawns.FindAll(x => x.ShouldShowWombGizmo()); if (Input.GetKey(VariousDefOf.OpenStatusWindowKey.MainKey) && !pawns.NullOrEmpty() && pawns.Count > 1) { int index = pawns.IndexOf(window.pawn); SoundDefOf.TabOpen.PlayOneShotOnCamera(); Pawn newpawn = pawns[(index + 1) % pawns.Count]; window.ChangePawn(newpawn, newpawn.GetMenstruationComp()); } else if (window.pawn != pawn) { SoundDefOf.TabOpen.PlayOneShotOnCamera(); window.ChangePawn(pawn, comp); } else { Find.WindowStack.TryRemove(typeof(Dialog_WombStatus), true); } } else { SoundDefOf.InfoCard_Open.PlayOneShotOnCamera(); Find.WindowStack.Add(new Dialog_WombStatus(pawn, comp)); } }
protected override IEnumerable <Toil> MakeNewToils() { HediffComp_Menstruation Comp = pawn.GetMenstruationComp(); //this.FailOn(delegate //{ // return !(Comp.TotalCumPercent > 0.001); //}); yield return(Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch)); Toil excreting = Toils_General.Wait(excretingTime, TargetIndex.None);//duration of excreting.WithProgressBarToilDelay(TargetIndex.A); yield return(excreting); yield return(new Toil() { initAction = delegate() { if (Comp.TotalCumPercent > 0.001) { CumMixture mixture = Comp.MixtureOut(RJWSexperience.VariousDefOf.GatheredCum, 0.5f); float amount = mixture.Volume; if (mixture.ispurecum) { Bucket.AddCum(amount); } else { GatheredCumMixture cummixture = (GatheredCumMixture)ThingMaker.MakeThing(VariousDefOf.GatheredCumMixture); cummixture.InitwithCum(mixture); Bucket.AddCum(amount, cummixture); } } else { ReadyForNextToil(); } if (Comp.TotalCumPercent > 0.001) { JumpToToil(excreting); } } }); Toil cleaning = new Toil(); cleaning.initAction = CleaningInit; cleaning.tickAction = CleaningTick; cleaning.AddFinishAction(Finish); cleaning.defaultCompleteMode = ToilCompleteMode.Never; cleaning.WithProgressBar(TargetIndex.A, () => progress / CleaningTime); yield return(cleaning); //yield return excreting; yield break; }
private static void AddWombGizmos(Pawn __instance, ref List <Gizmo> gizmoList) { HediffComp_Menstruation comp = __instance.GetMenstruationComp(); if (comp != null) { gizmoList.Add(CreateGizmo_WombStatus(__instance, comp)); } }
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested) { HediffComp_Menstruation comp = pawn.GetMenstruationComp(); if (Configurations.EnableMenopause && comp != null) { comp.RecoverOvary(1 + effectOffset); } }
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested) { HediffComp_Menstruation comp = pawn.GetMenstruationComp(); if (comp != null) { comp.eggstack += Rand.Range(1, 4); } }
public static bool HasJobOnThing(Pawn pawn, Thing t, bool forced, ref bool __result) { HediffComp_Menstruation comp = pawn.GetMenstruationComp(); if (comp != null && comp.DoCleanWomb && comp.TotalCumPercent > 0.001f) { __result = true; return(false); } return(true); }
public void ChangePawn(Pawn pawn, HediffComp_Menstruation comp) { if (this.pawn.IsAnimal() && !pawn.IsAnimal()) { windowRect.width += 150f; } else if (!this.pawn.IsAnimal() && pawn.IsAnimal()) { windowRect.width -= 150f; } this.pawn = pawn; this.comp = comp; }
public static void JobOnThing(Pawn pawn, Thing t, bool forced, ref Job __result) { HediffComp_Menstruation comp = pawn.GetMenstruationComp(); if (comp != null && comp.DoCleanWomb && comp.TotalCumPercent > 0.001f) { Building_CumBucket bucket = pawn.FindClosestBucket(); if (bucket != null) { __result = JobMaker.MakeJob(VariousDefOf.VaginaWashingwithBucket, null, bucket, bucket.Position); } } }
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested) { HediffComp_Menstruation comp = pawn.GetMenstruationComp(); if (comp != null && (comp.curStage.Equals(HediffComp_Menstruation.Stage.Follicular) || comp.curStage.Equals(HediffComp_Menstruation.Stage.ClimactericFollicular) || comp.curStage.Equals(HediffComp_Menstruation.Stage.Anestrus) )) { comp.SetEstrus(comp.Props.eggLifespanDays); comp.curStage = HediffComp_Menstruation.Stage.Ovulatory; comp.eggstack += ingested.stackCount - 1; } }
public static void Prefix(Rect rect, Pawn pawn, IEnumerable <Hediff> diffs, ref float curY) { if (Configurations.EnableButtonInHT && pawn.ShowStatus()) { HediffComp_Menstruation comp = diffs.First().GetMenstruationComp(); if (comp != null) { Rect buttonrect = new Rect((rect.xMax) / 2 - 5f, curY + 2f, buttonWidth, buttonHeight); if (Widgets.ButtonText(buttonrect, Translations.Button_HealthTab)) { Dialog_WombStatus.ToggleWindow(pawn, comp); } } } }
public static Texture2D GetEggIcon(this HediffComp_Menstruation comp) { if (comp.parent.pawn.IsPregnant()) { if (comp.parent.pawn.GetPregnancyProgress() < 0.2f) { return(ContentFinder <Texture2D> .Get("Eggs/Egg_Implanted00", true)); } else { return(ContentFinder <Texture2D> .Get("Womb/Empty", true)); } } else if (!comp.IsEggExist) { return(ContentFinder <Texture2D> .Get("Womb/Empty", true)); } else { int fertstage = comp.IsFertilized; if (fertstage >= 0) { if (fertstage < 1) { return(ContentFinder <Texture2D> .Get("Eggs/Egg_Fertilized00", true)); } else if (fertstage < 24) { return(ContentFinder <Texture2D> .Get("Eggs/Egg_Fertilized01", true)); } else { return(ContentFinder <Texture2D> .Get("Eggs/Egg_Fertilized02", true)); } } else if (comp.IsEggFertilizing) { return(ContentFinder <Texture2D> .Get("Eggs/Egg_Fertilizing01", true)); } else { return(ContentFinder <Texture2D> .Get("Eggs/Egg", true)); } } }
public static void Postfix(Map map, bool respawningAfterLoad, Pawn __instance) { //Log.Message("Initialize on spawnsetup"); HediffComp_Menstruation comp = __instance.GetMenstruationComp(); if (comp != null) { HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(comp.actionref); comp.Initialize(); } HediffComp_Breast bcomp = __instance.GetBreastComp(); if (bcomp != null) { HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(bcomp.action); bcomp.Initialize(); } }
public static Texture2D GetWombIcon(this HediffComp_Menstruation comp) { if (comp.Pawn.health.hediffSet.GetHediffs <Hediff_InsectEgg>().FirstOrDefault() != null) { return(ContentFinder <Texture2D> .Get(("Womb/Womb_Egged"), true)); } string icon = comp.wombTex; HediffComp_Menstruation.Stage stage = comp.curStage; if (stage == HediffComp_Menstruation.Stage.Bleeding) { icon += "_Bleeding"; } Texture2D wombtex = ContentFinder <Texture2D> .Get((icon), true); return(wombtex); }
private static Gizmo CreateGizmo_GatherCum(Pawn pawn, HediffComp_Menstruation comp) { Texture2D icon = TextureCache.GatherCum_Bucket; string label = Keyed.RS_GatherCum; string description = Keyed.RS_GatherCum; Gizmo gizmo = new Command_Toggle { defaultLabel = label, defaultDesc = description, icon = icon, isActive = delegate() { return(comp.DoCleanWomb); }, toggleAction = delegate { comp.DoCleanWomb = !comp.DoCleanWomb; } }; return(gizmo); }
public static void Postfix(Vector3 clickPos, Pawn pawn, List <FloatMenuOption> opts) { var targets = GenUI.TargetsAt(clickPos, TargetingParameters.ForBuilding()); HediffComp_Menstruation comp = pawn.GetMenstruationComp(); if (comp != null && comp.TotalCumPercent > 0.001f) { foreach (LocalTargetInfo t in targets) { Building building = t.Thing as Building; if (building != null) { if (building is Building_CumBucket) { opts.AddDistinct(MakeMenu(pawn, building)); break; } } } } }
public static void ToggleWindow(Pawn pawn, HediffComp_Menstruation comp) { Dialog_WombStatus window = (Dialog_WombStatus)Find.WindowStack.Windows.FirstOrDefault(x => x.GetType().Equals(typeof(Dialog_WombStatus))); if (window != null) { if (window.pawn != pawn) { SoundDefOf.TabOpen.PlayOneShotOnCamera(); window.ChangePawn(pawn, comp); } else { Find.WindowStack.TryRemove(typeof(Dialog_WombStatus), true); } } else { SoundDefOf.InfoCard_Open.PlayOneShotOnCamera(); Find.WindowStack.Add(new Dialog_WombStatus(pawn, comp)); } }
public static bool Prefix(Pawn pawn, Pawn partner) // partner has v****a { if (partner.IsAnimal() && !Configurations.EnableAnimalCycle) { return(true); } HediffComp_Menstruation comp = partner.GetMenstruationComp(); if (comp != null) { if (AndroidsCompatibility.IsAndroid(pawn) && !AndroidsCompatibility.AndroidPenisFertility(pawn)) { comp.CumIn(pawn, pawn.GetCumVolume(), 0); return(false); } else { comp.CumIn(pawn, pawn.GetCumVolume(), pawn.health.capacities.GetLevel(xxx.reproduction)); } return(false); } ModLog.Message("used original rjw method: Comp missing"); return(true); }
public static Texture2D GetPregnancyIcon(this HediffComp_Menstruation comp, Hediff hediff) { string icon = ""; Texture2D result = null; int babycount = 1; if (hediff is Hediff_MechanoidPregnancy) { return(ContentFinder <Texture2D> .Get(("Womb/Mechanoid_Fluid"), true)); } else if (hediff is Hediff_BasePregnancy) { Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; babycount = h.babies.Count; string fetustex = h.babies?.FirstOrDefault()?.def.GetModExtension <PawnDNAModExtension>()?.fetusTexPath ?? "Fetus/Fetus_Default"; if (h.GestationProgress < 0.2f) { icon = comp.wombTex + "_Implanted"; } else if (h.GestationProgress < 0.3f) { if (h.babies?.First()?.def?.race?.FleshType == FleshTypeDefOf.Insectoid) { icon += "Fetus/Insects/Insect_Early00"; } else { icon += "Fetus/Fetus_Early00"; } } else if (h.GestationProgress < 0.4f) { icon += fetustex + "00"; } else if (h.GestationProgress < 0.5f) { icon += fetustex + "01"; } else if (h.GestationProgress < 0.6f) { icon += fetustex + "02"; } else if (h.GestationProgress < 0.7f) { icon += fetustex + "03"; } else if (h.GestationProgress < 0.8f) { icon += fetustex + "04"; } else { icon += fetustex + "05"; } } else { icon = "Fetus/Slime_Abomi02"; } result = TryGetTwinsIcon(icon, babycount); if (result == null) { result = ContentFinder <Texture2D> .Get((icon), true); } return(result); }
public static float GetFertilityChance(this HediffComp_Menstruation comp) { return(comp.TotalFertCum * Configurations.FertilizeChance); }
public Dialog_WombStatus(Pawn pawn, HediffComp_Menstruation comp) { this.pawn = pawn; this.comp = comp; }
public static bool Prefix(SexProps props) { xxx.rjwSextype sextype = props.sexType; Pawn pawn = props.pawn; Pawn partner = props.partner; if (sextype == xxx.rjwSextype.Vaginal) { var pawnpartBPR = Genital_Helper.get_genitalsBPR(pawn); var maleparts = Genital_Helper.get_PartsHediffList(pawn, pawnpartBPR); var partnerpartBPR = Genital_Helper.get_genitalsBPR(partner); var femaleparts = Genital_Helper.get_PartsHediffList(partner, partnerpartBPR); Pawn female = null, male = null; if (Genital_Helper.has_vagina(partner, femaleparts)) { female = partner; male = pawn; } else if (Genital_Helper.has_vagina(pawn, maleparts)) { female = pawn; femaleparts = maleparts; male = partner; maleparts = Genital_Helper.get_PartsHediffList(partner, partnerpartBPR); } else { return(true); } if (female.IsAnimal() && !Configurations.EnableAnimalCycle) { return(true); } HediffComp_Menstruation comp = female.GetMenstruationComp(); if (comp != null) { if (Genital_Helper.has_penis_fertile(male, maleparts) && PregnancyHelper.CanImpregnate(male, female, sextype)) { PregnancyHelper.Doimpregnate(male, female); return(false); } else if (Genital_Helper.has_ovipositorM(male, maleparts)) { comp.CumIn(male, Rand.Range(0.5f, 3.0f) * RJWSettings.cum_on_body_amount_adjust * male.BodySize, 1.0f); } else { comp.CumIn(male, male.GetCumVolume(maleparts), 0); } } //if (Genital_Helper.has_vagina(partner, partnerparts)) //{ // if (partner.IsAnimal() && !Configurations.EnableAnimalCycle) return true; // HediffComp_Menstruation comp = Utility.GetMenstruationComp(partner); // if (comp != null) // { // if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype)) // { // PregnancyHelper.Doimpregnate(pawn, partner); // return false; // } // else comp.CumIn(pawn, pawn.GetCumVolume(), 0); // } //} //else if (Genital_Helper.has_vagina(pawn, pawnparts)) //{ // if (pawn.IsAnimal() && !Configurations.EnableAnimalCycle) return true; // HediffComp_Menstruation comp = Utility.GetMenstruationComp(pawn); // if (comp != null) // { // if (Genital_Helper.has_penis_fertile(partner, partnerparts) && PregnancyHelper.CanImpregnate(partner, pawn, sextype)) // { // PregnancyHelper.Doimpregnate(partner, pawn); // return false; // } // else comp.CumIn(partner, partner.GetCumVolume(), 0); // } //} } return(true); }
public static Texture2D GetCumIcon(this HediffComp_Menstruation comp) { string icon = comp.wombTex; float cumpercent = comp.TotalCumPercent; if (cumpercent < 0.001f) { return(ContentFinder <Texture2D> .Get("Womb/Empty", true)); } else if (cumpercent < 0.01f) { icon += "_Cum_00"; } else if (cumpercent < 0.05f) { icon += "_Cum_01"; } else if (cumpercent < 0.11f) { icon += "_Cum_02"; } else if (cumpercent < 0.17f) { icon += "_Cum_03"; } else if (cumpercent < 0.23f) { icon += "_Cum_04"; } else if (cumpercent < 0.29f) { icon += "_Cum_05"; } else if (cumpercent < 0.35f) { icon += "_Cum_06"; } else if (cumpercent < 0.41f) { icon += "_Cum_07"; } else if (cumpercent < 0.47f) { icon += "_Cum_08"; } else if (cumpercent < 0.53f) { icon += "_Cum_09"; } else if (cumpercent < 0.59f) { icon += "_Cum_10"; } else if (cumpercent < 0.65f) { icon += "_Cum_11"; } else if (cumpercent < 0.71f) { icon += "_Cum_12"; } else if (cumpercent < 0.77f) { icon += "_Cum_13"; } else if (cumpercent < 0.83f) { icon += "_Cum_14"; } else if (cumpercent < 0.89f) { icon += "_Cum_15"; } else if (cumpercent < 0.95f) { icon += "_Cum_16"; } else { icon += "_Cum_17"; } Texture2D cumtex = ContentFinder <Texture2D> .Get((icon), true); return(cumtex); }
private static void AddMenstruationGizmos(Pawn pawn, HediffComp_Menstruation comp, ref List<Gizmo> gizmolist) { gizmolist.Add(CreateGizmo_WombStatus(pawn, comp)); }
private static void AddWombGizmos(Pawn __instance, ref List<Gizmo> gizmoList) { HediffComp_Menstruation comp = __instance.GetMenstruationComp(); if (comp != null) AddMenstruationGizmos(__instance, comp, ref gizmoList); }
public static Texture2D GetGenitalIcon(this Pawn pawn, HediffComp_Menstruation comp, bool drawOrigin = false) { var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn))?.Find((Hediff h) => h.def.defName.ToLower().Contains("v****a")); 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; } if (comp != null) { icon = comp.vagTex; } else { icon = "Genitals/V****a"; } if (severity < 0.20f) { icon += "00"; //micro } else if (severity < 0.30f) { icon += "01"; //tight } else if (severity < 0.40f) { icon += "02"; //tight } else if (severity < 0.47f) { icon += "03"; //average } else if (severity < 0.53f) { icon += "04"; //average } else if (severity < 0.60f) { icon += "05"; //average } else if (severity < 0.70f) { icon += "06"; //accomodating } else if (severity < 0.80f) { icon += "07"; //accomodating } else if (severity < 0.87f) { icon += "08"; //cavernous } else if (severity < 0.94f) { icon += "09"; //cavernous } else if (severity < 1.01f) { icon += "10"; //cavernous } else { icon += "11"; //abyssal } return(ContentFinder <Texture2D> .Get((icon), true)); }
private static Gizmo CreateGizmo_WombStatus(Pawn pawn, HediffComp_Menstruation comp) { Texture2D icon, icon_overay; string description = ""; if (Configurations.Debug) { description += comp.curStage + ": " + comp.curStageHrs + "\n" + "fertcums: " + comp.TotalFertCum + "\n" + "ovarypower: " + comp.ovarypower + "\n" + "eggs: " + comp.GetNumofEggs + "\n"; } else { description += comp.GetCurStageLabel + "\n"; } if (pawn.IsPregnant()) { Hediff hediff = PregnancyHelper.GetPregnancy(pawn); if (Utility.ShowFetusImage((Hediff_BasePregnancy)hediff)) { icon = comp.GetPregnancyIcon(hediff); if (hediff is Hediff_BasePregnancy) { Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; if (h.GestationProgress < 0.2f) { icon_overay = comp.GetCumIcon(); } else { icon_overay = ContentFinder <Texture2D> .Get(("Womb/Empty"), true); } } else { icon_overay = ContentFinder <Texture2D> .Get(("Womb/Empty"), true); } } else { icon = comp.GetWombIcon(); icon_overay = comp.GetCumIcon(); } } else { Hediff hediff = pawn.health.hediffSet.GetHediffs <Hediff_InsectEgg>().FirstOrDefault(); if (hediff != null) { icon = ContentFinder <Texture2D> .Get(("Womb/Womb_Egged"), true); icon_overay = ContentFinder <Texture2D> .Get(("Womb/Empty"), true); } else { icon = comp.GetWombIcon(); icon_overay = comp.GetCumIcon(); } } foreach (string s in comp.GetCumsInfo) { description += s + "\n"; } Color c = comp.GetCumMixtureColor; Gizmo gizmo = new Gizmo_Womb { defaultLabel = pawn.LabelShort, defaultDesc = description, icon = icon, icon_overay = icon_overay, shrinkable = Configurations.AllowShrinkIcon, cumcolor = c, comp = comp, order = 100, hotKey = VariousDefOf.OpenStatusWindowKey, action = delegate { Dialog_WombStatus.ToggleWindow(pawn, comp); } }; return(gizmo); }
public static void Postfix(Pawn pawn, HediffComp_Menstruation comp, ref List <Gizmo> gizmolist) { gizmolist.Add(CreateGizmo_GatherCum(pawn, comp)); }