public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List <Thing> ingredients, Bill bill) { HediffComp_Breast breast = pawn.GetBreastComp(); if (billDoer != null && breast != null) { TaleRecorder.RecordTale(TaleDefOf.DidSurgery, new object[] { billDoer, pawn }); SurgeryResult(breast); } }
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 void DrawBreastIcon(this Pawn pawn, Rect rect, bool drawOrigin = false) { var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_breastsBPR(pawn)).FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("breast")); Texture2D breast, nipple, areola; if (hediff != null) { HediffComp_Breast comp = hediff.TryGetComp <HediffComp_Breast>(); string icon; if (comp != null) { icon = comp.Props.BreastTex ?? "Breasts/Breast_Breast"; } else { breast = ContentFinder <Texture2D> .Get("Breasts/Breast_Breast00", false); nipple = ContentFinder <Texture2D> .Get("Breasts/Breast_Breast00_Nipple00", false); areola = ContentFinder <Texture2D> .Get("Breasts/Breast_Breast00_Areola00", false); GUI.color = pawn.story?.SkinColor ?? Color.white; GUI.DrawTexture(rect, breast, ScaleMode.ScaleToFit); GUI.color = Color.white; GUI.DrawTexture(rect, areola, ScaleMode.ScaleToFit); GUI.DrawTexture(rect, nipple, ScaleMode.ScaleToFit); return; } if (hediff.Severity < 0.20f) { icon += "_Breast00"; } else if (hediff.Severity < 0.40f) { icon += "_Breast01"; } else if (hediff.Severity < 0.60f) { icon += "_Breast02"; } else if (hediff.Severity < 0.80f) { icon += "_Breast03"; } else if (hediff.Severity < 1.00f) { icon += "_Breast04"; } else { icon += "_Breast05"; } string nippleicon, areolaicon; float nipplesize, areolasize; if (drawOrigin) { nipplesize = comp.OriginNipple; areolasize = comp.OriginAreola; } else { nipplesize = comp.NippleSize; areolasize = comp.AreolaSize; } nippleicon = icon + "_Nipple0" + GetNippleIndex(nipplesize); areolaicon = icon + "_Areola0" + GetAreolaIndex(areolasize); breast = ContentFinder <Texture2D> .Get(icon, false); areola = ContentFinder <Texture2D> .Get(areolaicon, false); nipple = ContentFinder <Texture2D> .Get(nippleicon, false); GUI.color = pawn.story.SkinColor; GUI.DrawTexture(rect, breast, ScaleMode.ScaleToFit); if (drawOrigin) { GUI.color = comp.OriginColor; } else { GUI.color = comp.NippleColor; } GUI.DrawTexture(rect, areola, ScaleMode.ScaleToFit); GUI.DrawTexture(rect, nipple, ScaleMode.ScaleToFit); if (Configurations.Debug) { TooltipHandler.TipRegion(rect, comp.DebugInfo()); } } else { breast = ContentFinder <Texture2D> .Get("Breasts/Breast_Breast00", false); nipple = ContentFinder <Texture2D> .Get("Breasts/Breast_Breast00_Nipple00", false); areola = ContentFinder <Texture2D> .Get("Breasts/Breast_Breast00_Areola00", false); GUI.color = pawn.story.SkinColor; GUI.DrawTexture(rect, breast, ScaleMode.ScaleToFit); GUI.color = Color.white; GUI.DrawTexture(rect, areola, ScaleMode.ScaleToFit); GUI.DrawTexture(rect, nipple, ScaleMode.ScaleToFit); } }
protected override void SurgeryResult(HediffComp_Breast breast) { breast.AdjustNippleSizeImmidiately(-0.1f); }
protected override void SurgeryResult(HediffComp_Breast breast) { breast.AdjustAreolaSizeImmidiately(0.1f); }
protected virtual void SurgeryResult(HediffComp_Breast breast) { }