public static void Postfix(PawnGraphicSet __instance)
            {
                if (__instance?.pawn?.RaceProps == null ||
                    !__instance.pawn.RaceProps.Humanlike ||
                    __instance.nakedGraphic == null ||
                    !SettingHelper.latest.alicesRenderingMode ||
                    ChildrenCrossMod.isChildrenModOn()
                    )
                {
                    return;
                }

                float scale = __instance?.pawn?.ageTracker?.CurLifeStage?.bodySizeFactor ?? 1f;

                float racePropsBaseBodySize = (float)Math.Abs(Math.Log(Math.Sqrt(__instance.pawn.RaceProps.baseBodySize) + 1.22474487139, 2));

                scale *= racePropsBaseBodySize * 1.5f;

                var vector2 = new Vector2(scale, scale);

                //Not sure iff ill need to do this .Scale(new Vector2(1.5f,1.5f));


                __instance.nakedGraphic = GraphicDatabase.Get <Graphic_Multi>(
                    __instance.pawn.story.bodyType.bodyNakedGraphicPath, ShaderDatabase.CutoutSkin, vector2,
                    __instance.pawn.story.SkinColor);
                __instance.rottingGraphic = GraphicDatabase.Get <Graphic_Multi>(
                    __instance.pawn.story.bodyType.bodyNakedGraphicPath, ShaderDatabase.CutoutSkin, vector2,
                    PawnGraphicSet.RottingColor);

                __instance.ClearCache();


                //Log.Message("Scaling Size of [" + __instance.pawn + "] by [" + scale + "] Updated.");
            }
Exemplo n.º 2
0
 public static void Mated(Pawn donor, Pawn hasWomb)
 {
     if (ChildrenCrossMod.isChildrenModOn())
     {
         //We gotta side load some fun
         ChildrenCrossMod.Mated(donor, hasWomb);
     }
     else
     {
         DefaultMate(donor, hasWomb);
     }
 }
            static IEnumerable <CodeInstruction> Transpiler(IEnumerable <CodeInstruction> instructions)
            {
                if (!SettingHelper.latest.alicesRenderingMode || ChildrenCrossMod.isChildrenModOn())
                {
                    return(instructions);
                }
                FieldInfo humanlikeBodyInfo = AccessTools.Field(type: typeof(MeshPool), name: nameof(MeshPool.humanlikeBodySet));

                int startIndex = -1, endIndex = -1;

                var codes = new List <CodeInstruction>(instructions);

                for (int i = 0; i < codes.Count; i++)
                {
                    var codeInstruction = codes[i];
                    if (endIndex > 0)
                    {
                        break;
                    }
                    else if (startIndex > 0)
                    {
                        if (codeInstruction.opcode == OpCodes.Br)
                        {
                            endIndex = i;
                            break;
                        }
                    }
                    else if (codeInstruction.opcode == OpCodes.Ldsfld)
                    {
                        var value = codeInstruction.operand?.ToString();
                        if (codeInstruction.operand == humanlikeBodyInfo)
                        {
                            startIndex = i; //get that br
                        }
                    }
                }

                if (startIndex > 0 && endIndex > 0)
                {
                    codes[endIndex].opcode  = OpCodes.Nop;
                    codes[endIndex].operand = null;
                    codes[endIndex].labels  = new List <Label>();

                    Log.Message("Age Matters2 : Op Codes Altered for Child Size");
                }
                else
                {
                    Log.Error("AgeMatters2: Unable to alter op codes to render by body size. sorry, going to default.");
                }

                return(codes.AsEnumerable());
            }
Exemplo n.º 4
0
        public static void L1(this SettingsUIMod that, Rect inRect)
        {
            that.Settings.woohooChildChance = Widgets.HorizontalSlider(
                inRect.TopHalf().TopHalf().TopHalf().ContractedBy(4f),
                that.Settings.woohooChildChance, 0f, 1f, true,
                "Risky Lovin Factor " + that.Settings.woohooChildChance * 100f
                , "0%", "100%");

            that.Settings.IntersexChance = Widgets.HorizontalSlider(
                inRect.TopHalf().TopHalf().BottomHalf().LeftHalf().ContractedBy(4f),
                that.Settings.IntersexChance, 0f, 1f, true,
                "Intersex chance : " +
                that.Settings.IntersexChance * 100f + "\n(Functional Ovotestes)",
                "0%", "100%");

            that.Settings.IntersexInfertileChance = Widgets.HorizontalSlider(
                inRect.TopHalf().TopHalf().BottomHalf().RightHalf().ContractedBy(4f),
                that.Settings.IntersexInfertileChance, 0f, 1f, true,
                "Genetic Infertility chance : " +
                that.Settings.IntersexInfertileChance * 100f + "\n(Intersex; AIS, Swyer Syndrome, et. al.)",
                "0%", "100%");

            that.Settings.TransgenderChance = Widgets.HorizontalSlider(
                inRect.TopHalf().BottomHalf().TopHalf().ContractedBy(4f),
                that.Settings.TransgenderChance, 0f, 1f, true,
                "Transgendered chance : " +
                that.Settings.TransgenderChance * 100f,
                "0%", "100%");


            that.Settings.maleHairGrowthRate = Widgets.HorizontalSlider(
                inRect.TopHalf().BottomHalf().BottomHalf().LeftHalf().ContractedBy(4f),
                that.Settings.maleHairGrowthRate, 0f, 1f, true,
                "Testosterone powered hair growth rate : " +
                that.Settings.maleHairGrowthRate * 100f,
                "0%", "100%");

            that.Settings.otherHairGrowthRate = Widgets.HorizontalSlider(
                inRect.TopHalf().BottomHalf().BottomHalf().RightHalf().ContractedBy(4f),
                that.Settings.otherHairGrowthRate, 0f, 1f, true,
                "Hair growth rate for the rest : " +
                that.Settings.otherHairGrowthRate * 100f,
                "0%", "100%");


            that.Settings.EarlyPubertyChance = Widgets.HorizontalSlider(
                inRect.BottomHalf().TopHalf().TopHalf().LeftHalf().ContractedBy(4f),
                that.Settings.EarlyPubertyChance, 0f, .90f, true,
                (that.Settings.PubertyDelay < 0.001
                    ? "No Puberty Delay"
                    : "Early puberty chance " + that.Settings.EarlyPubertyChance * 100)
                , "0%", "90%");

            that.Settings.PubertyDelay = Widgets.HorizontalSlider(
                inRect.BottomHalf().TopHalf().TopHalf().RightHalf().ContractedBy(4f),
                that.Settings.PubertyDelay, 0f, .95f, true,
                "Standard Puberty Delay " + that.Settings.PubertyDelay * 100 +
                "\n(Lower increases hair prevalence on average)"
                , "0%", "100%");

            that.Settings.PubertyOnset = Widgets.HorizontalSlider(inRect.BottomHalf().TopHalf().BottomHalf(),
                                                                  that.Settings.PubertyOnset, 1, 18, true,
                                                                  "Age of Earliest Puberty " + that.Settings.PubertyOnset + " years."
                                                                  , "1", "18");

            that.ThirdGendered(inRect);

            var leftHalf = inRect.BottomHalf().BottomHalf().BottomHalf().BottomHalf().LeftHalf();

            if (!ChildrenCrossMod.isChildrenModOn())
            {
                Widgets.CheckboxLabeled(leftHalf.TopHalf().ContractedBy(2f), "Child-Size Renderer (unsafe)",
                                        ref that.Settings.alicesRenderingMode);

                leftHalf = leftHalf.BottomHalf();
            }

            var clicked = Widgets.ButtonText(
                leftHalf,
                "Aliens Configurations"
                );

            Widgets.Label(inRect.BottomHalf().BottomHalf().BottomHalf().RightHalf(),
                          "That's all, thanks for playing. -Alice.\nSource Code Available at https://github.com/alycecil");

            if (clicked)
            {
                that.Page = Page.aliens;
            }
        }