예제 #1
0
        private void Start()
        {
            if (!KoikatuAPI.CheckRequiredPlugin(this, KoikatuAPI.GUID, new Version(KoikatuAPI.VersionConst)) || StudioAPI.InsideStudio)
            {
                enabled = false;
                return;
            }

            ForceInsert          = new ConfigWrapper <bool>("ForceInsert", this, true);
            ForceInsertAnger     = new ConfigWrapper <bool>("ForceInsertAnger", this, true);
            DecreaseLewd         = new ConfigWrapper <bool>("DecreaseLewd", this, false);
            DisableTrapVagInsert = new ConfigWrapper <bool>("DisableTrapVagInsert", this, true);

            ResetNoCondom = new ConfigWrapper <bool>("ResetNoCondom", this, true);

            FastTravelTimePenalty    = new ConfigWrapper <int>("FastTravelTimePenalty", this, 50);
            StatDecay                = new ConfigWrapper <bool>("StatDecay", this, true);
            LewdDecay                = new ConfigWrapper <bool>("LewdDecay", this, false);
            AdjustBreastSizeQuestion = new ConfigWrapper <bool>("AdjustBreastSizeQuestion", this, true);

            var i = HarmonyInstance.Create(GUID);

            Utilities.ApplyHooks(i);
            Utilities.HSceneEndClicked += UpdateGirlLewdness;

            // H Scene functions
            ForceInsertHooks.ApplyHooks(i);
            ExitFirstHHooks.ApplyHooks(i);
            if (DisableTrapVagInsert.Value)
            {
                TrapNoVagInsertHooks.ApplyHooks(i);
            }

            // Main game functions
            ClassCharaLimitUnlockHooks.ApplyHooks(i);
            FastTravelCostHooks.ApplyHooks(i);
            if (AdjustBreastSizeQuestion.Value)
            {
                BustSizeQuestionHooks.ApplyHooks(i);
            }

            _gameMgr  = Game.Instance;
            _sceneMgr = Scene.Instance;

            // todo replace with scene load?
            InvokeRepeating(nameof(SlowUpdate), 2f, 0.5f);
        }
        private void Start()
        {
            var i = new Harmony(GUID);

            Utilities.ApplyHooks(i);

            var hScene = "H Scene tweaks";

            ForceInsert                 = Config.Bind(hScene, "Allow force insert", true, "Can insert raw even if it's denied.\nTo force insert - click on the blue insert button right after being denied, after coming outside, or after making her come multiple times. Other contitions might apply.");
            ForceInsertAnger            = Config.Bind(hScene, "Force insert causes anger", true, "If you cum inside on or force insert too many times the heroine will get angry with you.\nWhen enabled heroine's expression changes during H (if forced).");
            ChangeLewdAfterH            = Config.Bind(hScene, "Change lewdness after H", false, "Decreases heroine's H bar after an H scene if satisfied, increases the bar if not.");
            DisableTrapVagInsert        = Config.Bind(hScene, "Disable vaginal insert for traps/men", true, "Only works if you use UncensorSelector to give a female card a penis but no v****a in maker. Some positions don't have the anal option so you won't be able to insert at all in them.\nChanges take effect after game restart.");
            DontHidePlayerWhenTouching  = Config.Bind(hScene, "Do not hide player when touching", true, "Prevent hiding of the player model when touching in H scenes.");
            ResetNoCondom               = Config.Bind(hScene, "Make experienced girls ask for condom", true, "If enabled, sometimes a heroine will refuse raw insert on dangerous day until the second insert (once per day).\nIf disabled the default game logic is used (girl will never refuse if you did raw 5 times or more in total.)");
            AdjustExperiencedStateLogic = Config.Bind(hScene, "Can be experienced from only one hole", true, "Make it so you only need to max the girls' either vaginal caress/piston or anal caress/piston to achieve experienced state. By default you have to max out both front and rear to get the experienced status.\nChanges take effect after game restart.");

            // H Scene functions
            ForceInsertHooks.ApplyHooks(i);
            HSceneHooks.ApplyHooks(i);
            if (DisableTrapVagInsert.Value)
            {
                TrapNoVagInsertHooks.ApplyHooks(i);
            }
            if (AdjustExperiencedStateLogic.Value)
            {
                ExperienceLogicHooks.ApplyHooks(i);
            }

            if (!IsInsideVR)
            {
                Utilities.HSceneEndClicked += UpdateLewdAfterH;

                var mainGame = "Main game";
                FastTravelTimePenalty    = Config.Bind(mainGame, "Fast travel (F3) time cost", 50, new ConfigDescription("Value is in seconds. One period has 500 seconds.", new AcceptableValueRange <int>(0, 100)));
                StatDecay                = Config.Bind(mainGame, "Player stats slowly decay overnight", true, "Player's stats slowly decrease every day to keep the training points relevant.");
                ChangeLewdDaily          = Config.Bind(mainGame, "Change lewdness overnight", false, "H bar of all heroines either increases or decreases overnight depending on their status.");
                AdjustBreastSizeQuestion = Config.Bind(mainGame, "Adjust preferred breast size question", true, "Lowers the breast size needed for 'Average' and 'Large' breast options when a heroine asks you what size you prefer.\nChanges take effect after game restart.");

                // Main game functions
                ClassCharaLimitUnlockHooks.ApplyHooks(i);
                FastTravelCostHooks.ApplyHooks(i);
                if (AdjustBreastSizeQuestion.Value)
                {
                    BustSizeQuestionHooks.ApplyHooks(i);
                }

                SceneManager.sceneLoaded += (arg0, mode) =>
                {
                    if (arg0.name != "MyRoom" || Singleton <Scene> .Instance.LoadSceneName == "H")
                    {
                        _inNightMenu = false;
                    }
                    else
                    {
                        if (!_inNightMenu && !_firstNightMenu)
                        {
                            try { OnNightStarted(); }
                            catch (Exception ex) { UnityEngine.Debug.LogException(ex); }
                        }

                        _inNightMenu    = true;
                        _firstNightMenu = false;
                    }
                };
            }
        }