Esempio n. 1
0
 public static void JustCheckingDifficulty(UiCellphoneAppNew __instance)
 {
     if (HP2SR.lastChosenCategory < RunTimer.categories.Length)
     {
         HP2SR.ShowTooltip(RunTimer.GetAll(HP2SR.lastChosenCategory, HP2SR.lastChosenDifficulty), 3000, 0, 50);
     }
 }
Esempio n. 2
0
        public static void Update()
        {
            if (!HP2SR.InGameTimer.Value || HP2SR.run == null)
            {
                return;
            }
            RunTimer run = HP2SR.run;

            if (initialTimerDelay.IsRunning && initialTimerDelay.ElapsedMilliseconds > 1000)
            {
                initialTimerDelay.Reset();
                justFinishedDate = true;
            }
            if (undoTimer.IsRunning && undoTimer.ElapsedMilliseconds > 6000)
            {
                undoTimer.Reset();
                itsRewindTime = true;
            }
            if (shoeTimer.IsRunning && shoeTimer.ElapsedMilliseconds > 4000)
            {
                shoeTimer.Reset();
                noMoreShoe = true;
            }
            if (savePBDelay.IsRunning && savePBDelay.ElapsedMilliseconds > 5000)
            {
                savePBDelay.Reset();
                run.save();
            }

            //checking criterias for non-Wing categories
            if (run.goal == 100 && Game.Persistence.playerFile.CalculateCompletePercent() == 100)
            {
                run.split();
                string newSplit = "100%\n      " + run.splitText + "\n";
                run.push(newSplit);
                run.save();
                HP2SR.ShowThreeNotif("100% completed at " + run.splitText);
            }
            else if (run.goal == 48 && Game.Persistence.playerFile.GetStyleLevelExp() > shoesProgress)
            {
                shoesProgress = Game.Persistence.playerFile.GetStyleLevelExp();
                //split every style level
                if (shoesProgress % 6 == 0)
                {
                    run.split();
                    justGaveShoe = true;
                    shoeTimer.Start();

                    string newSplit = "Shoe #" + shoesProgress + "\n      " + run.splitText + "\n";
                    run.push(newSplit);
                    if (shoesProgress == 48)
                    {
                        run.save();
                        //let you bask in the glory
                        shoeTimer.Reset();
                    }
                }
            }
        }
Esempio n. 3
0
        public static void DefaultCategory(UiCellphoneAppNew __instance, ref int ____newSaveFileIndex, ref UiAppFileIconSlot ____selectedFileIconSlot)
        {
            if (HP2SR.cheatsEnabled || HP2SR.AllPairsEnabled.Value)
            {
                return;
            }

            //default girl head to the last chosen category, show their details on the mouse
            if (____selectedFileIconSlot != null)
            {
                ____selectedFileIconSlot.button.Enable();
            }
            ____selectedFileIconSlot = __instance.fileIconSlots[HP2SR.lastChosenCategory];
            ____selectedFileIconSlot.button.Disable();
            HP2SR.ShowTooltip(RunTimer.GetAll(HP2SR.lastChosenCategory, HP2SR.lastChosenDifficulty), 3000, 0, 50);

            __instance.Refresh();
        }
Esempio n. 4
0
 public static void PostReturnNotification(LocationManager __instance)
 {
     if (HP2SR.cheatsEnabled)
     {
         HP2SR.ShowThreeNotif("CHEATS ARE ENABLED");
     }
     else if (HP2SR.hasReturned)
     {
         HP2SR.ShowThreeNotif("This is for practice purposes only");
     }
     //only display the warning on the Your Apartment location
     else if (Game.Persistence.playerData.unlockedCodes.Contains(Game.Data.Codes.Get(HP2SR.QUICKTRANSITIONS)))
     {
         HP2SR.ShowThreeNotif("Quick Transitions are on, somehow");
     }
     else if (HP2SR.AllPairsEnabled.Value && __instance.currentLocation == Game.Data.Locations.Get(22))
     {
         HP2SR.ShowThreeNotif("ALL PAIRS MODE IS ON");
     }
 }
Esempio n. 5
0
        public static bool CategoryNameDisplay(UiAppFileIconSlot __instance, ref UiTooltipSimple ____tooltip)
        {
            if (HP2SR.cheatsEnabled || HP2SR.AllPairsEnabled.Value || !Game.Manager.Ui.currentCanvas.titleCanvas)
            {
                return(true);
            }
            int cat  = __instance.girlDefinition.id - 1;
            int diff = HP2SR.lastChosenDifficulty;

            if (cat < RunTimer.categories.Length)
            {
                HP2SR.ShowTooltip(RunTimer.GetAll(cat, diff), 3000, 0, 50);
                return(false);
            }
            else
            {
                HP2SR.tooltip = null;
                HP2SR.tooltipTimer.Reset();
                return(true);
            }
        }
Esempio n. 6
0
        public static void NewGameMenuFixer(UiCellphoneAppNew __instance, ref int ____newSaveFileIndex, ref UiAppFileIconSlot ____selectedFileIconSlot)
        {
            //no save file was available, so use last file (or user's preference)
            if (____newSaveFileIndex < 0)
            {
                __instance.cellphone.phoneErrorMsg.ClearMessage();
                int fileToDelete = HP2SR.AutoDeleteFile.Value - 1;
                int lastFile     = Game.Persistence.playerData.files.Count - 1;
                if (fileToDelete >= 0 && fileToDelete < lastFile)
                {
                    ____newSaveFileIndex = fileToDelete;
                }
                else
                {
                    ____newSaveFileIndex = lastFile;
                }
                HP2SR.ShowTooltip("File #" + (____newSaveFileIndex + 1) + " will be deleted!", 3000, 0, 30);
            }
            //all girl heads available
            for (int j = 0; j < __instance.fileIconSlots.Count; j++)
            {
                __instance.fileIconSlots[j].Populate(false);
                __instance.fileIconSlots[j].canvasGroup.blocksRaycasts = true;
            }

            System.Random rand = new System.Random();
            int           r    = rand.Next(__instance.fileIconSlots.Count);

            ____selectedFileIconSlot = __instance.fileIconSlots[r];
            ____selectedFileIconSlot.button.Disable();

            //default Easy difficulty
            __instance.settingSelectorDifficulty.Populate(Game.Manager.Settings.GetSettingValueNames("difficulty", MathUtils.IntToBool(__instance.settingSelectorGender.selectedIndex), 0), HP2SR.lastChosenDifficulty, false);
            __instance.settingSelectorDifficulty.PopDescriptions(Game.Manager.Settings.GetSettingValueDescs("difficulty", MathUtils.IntToBool(__instance.settingSelectorGender.selectedIndex), 0));

            __instance.Refresh();
        }
Esempio n. 7
0
        public bool split(bool bonus = false)
        {
            long tickDiff = DateTime.UtcNow.Ticks - runTimer;

            //I hope this code never runs
            if (tickDiff < 0)
            {
                reset(false);
                HP2SR.ShowThreeNotif("Timer somehow became negative; run quit! Please report this!");
                return(false);
            }
            splits.Add(new TimeSpan(tickDiff));
            isBonus.Add(bonus);
            splitColor = SplitColors.WHITE; prevColor = SplitColors.WHITE; goldColor = SplitColors.WHITE;
            splitText  = ""; prevText = ""; goldText = "";

            TimeSpan s   = splits[splits.Count - 1];
            string   val = convert(s);

            int numDates = 0, numBonuses = 0;

            foreach (bool b in isBonus)
            {
                if (b)
                {
                    numBonuses++;
                }
                else
                {
                    numDates++;
                }
            }

            if (category != "")
            {
                //create the affection meter replacement text
                //time [+/-]
                if (comparisonDates.Count >= numDates && comparisonBonuses.Count >= numBonuses)
                {
                    TimeSpan elapsedC = GetTimeAt(numDates, numBonuses);
                    val += " [";
                    TimeSpan diff = s - elapsedC;
                    if (diff.TotalSeconds > 0)
                    {
                        val       += "+";
                        splitColor = SplitColors.RED;
                    }
                    else
                    {
                        val       += "-";
                        splitColor = SplitColors.BLUE;
                    }

                    val += convert(diff) + "]";

                    //create the this split text, which is just this split's diff minus the last split's diff
                    TimeSpan diff2;
                    if (splits.Count != 1)
                    {
                        TimeSpan s2 = splits[splits.Count - 2];
                        TimeSpan prevElapsedC;
                        if (bonus)
                        {
                            prevElapsedC = GetTimeAt(numDates, numBonuses - 1);
                        }
                        else
                        {
                            prevElapsedC = GetTimeAt(numDates - 1, numBonuses);
                        }
                        diff2 = s2 - prevElapsedC;
                        diff2 = diff - diff2;
                    }
                    else
                    {
                        diff2 = diff;
                    }
                    if (diff2.TotalSeconds > 0)
                    {
                        prevText += "+";
                        prevColor = SplitColors.RED;
                    }
                    else
                    {
                        prevText += "-";
                        prevColor = SplitColors.BLUE;
                    }
                    prevText += convert(diff2);
                }

                //create the gold diff text
                if (goldDates.Count >= numDates && goldBonuses.Count >= numBonuses)
                {
                    //get segment length
                    if (splits.Count > 1)
                    {
                        s = s - splits[splits.Count - 2];
                    }
                    TimeSpan diff;
                    if (bonus)
                    {
                        diff = s - goldBonuses[numBonuses - 1];
                    }
                    else
                    {
                        diff = s - goldDates[numDates - 1];
                    }
                    if (diff.TotalSeconds < 0)
                    {
                        //new gold
                        goldText  += "-";
                        splitColor = SplitColors.GOLD;
                        goldColor  = SplitColors.GOLD;
                        if (bonus)
                        {
                            goldBonuses[numBonuses - 1] = s;
                        }
                        else
                        {
                            goldDates[numDates - 1] = s;
                        }
                    }
                    else
                    {
                        goldText += "+";
                    }
                    goldText += convert(diff);
                }
                //no gold to compare with, or no category defined
                else
                {
                    if (splits.Count > 1)
                    {
                        s = s - splits[splits.Count - 2];
                    }
                    if (bonus)
                    {
                        goldBonuses.Add(s);
                    }
                    else
                    {
                        goldDates.Add(s);
                    }
                }
            }
            else if (category == "" && finishedRun == false)
            {
                //reset the timer for each split if we aren't in a category
                runTimer = DateTime.UtcNow.Ticks;
            }

            splitText = val;
            //Logger.LogMessage(splitText + " " + goldText);
            return(true);
        }
Esempio n. 8
0
        public static void Update()
        {
            if (!HP2SR.cheatsEnabled)
            {
                return;
            }
            //add the quick transitions code if cheat mode is on
            if (!Game.Persistence.playerData.unlockedCodes.Contains(Game.Data.Codes.Get(HP2SR.QUICKTRANSITIONS)))
            {
                Game.Persistence.playerData.unlockedCodes.Add(Game.Data.Codes.Get(HP2SR.QUICKTRANSITIONS));
            }

            if (Input.GetKeyDown(KeyCode.F1))
            {
                if (Game.Session.Location.currentLocation.locationType == LocationType.DATE)
                {
                    HP2SR.ShowNotif("Affection Filled!", 2);
                    Game.Session.Puzzle.puzzleStatus.AddResourceValue(PuzzleResourceType.AFFECTION, 999999, false);
                    Game.Session.Puzzle.puzzleStatus.AddResourceValue(PuzzleResourceType.AFFECTION, -1, false);
                    Game.Session.Puzzle.puzzleStatus.CheckChanges();
                }
                else
                {
                    HP2SR.ShowNotif("Fruit Given!", 2);
                    Game.Persistence.playerFile.AddFruitCount(PuzzleAffectionType.FLIRTATION, 100);
                    Game.Persistence.playerFile.AddFruitCount(PuzzleAffectionType.ROMANCE, 100);
                    Game.Persistence.playerFile.AddFruitCount(PuzzleAffectionType.SEXUALITY, 100);
                    Game.Persistence.playerFile.AddFruitCount(PuzzleAffectionType.TALENT, 100);
                }
            }

            if (Input.GetKeyDown(KeyCode.F2))
            {
                if (!Game.Manager.Ui.currentCanvas.titleCanvas)
                {
                    HP2SR.ShowNotif("Stamina Gained!", 2);
                    Game.Session.Puzzle.puzzleStatus.AddResourceValue(PuzzleResourceType.STAMINA, 6, false);
                    Game.Session.Puzzle.puzzleStatus.AddResourceValue(PuzzleResourceType.STAMINA, 6, true);
                    Game.Session.Puzzle.puzzleStatus.CheckChanges();
                }
            }

            if (Input.GetKeyDown(KeyCode.F5))
            {
                if (!Game.Manager.Ui.currentCanvas.titleCanvas)
                {
                    HP2SR.ShowNotif("Girl Finder Refreshed!", 2);
                    Game.Persistence.playerFile.PopulateFinderSlots();
                    Game.Session.gameCanvas.cellphone.LoadOpenApp();
                }
            }

            if (Input.GetKeyDown(KeyCode.F6))
            {
                if (!Game.Manager.Ui.currentCanvas.titleCanvas)
                {
                    HP2SR.ShowNotif("Store Refreshed!", 2);
                    Game.Persistence.playerFile.PopulateStoreProducts();
                    Game.Session.gameCanvas.cellphone.LoadOpenApp();
                }
            }

            if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))
            {
                if (Input.GetKeyDown(KeyCode.A) && !Game.Manager.Ui.currentCanvas.titleCanvas)
                {
                    CodeDefinition abiaHair = Game.Data.Codes.Get(HP2SR.ABIAHAIR);
                    if (!Game.Persistence.playerData.unlockedCodes.Contains(abiaHair))
                    {
                        Game.Persistence.playerData.unlockedCodes.Add(abiaHair);
                        HP2SR.ShowNotif("Abia's hair enabled!", 0);
                    }
                    else
                    {
                        Game.Persistence.playerData.unlockedCodes.Remove(abiaHair);
                        HP2SR.ShowNotif("Abia's hair disabled!", 0);
                    }
                    foreach (UiDoll doll in Game.Session.gameCanvas.dolls)
                    {
                        if (doll.girlDefinition && doll.girlDefinition.girlName == "Abia")
                        {
                            doll.ChangeHairstyle(doll.currentHairstyleIndex);
                        }
                    }
                }

                for (int i = (int)KeyCode.Alpha0; i <= (int)KeyCode.Alpha9; i++)
                {
                    //Alpha0 = 48, Keypad0 = 256
                    int num = i - 48;

                    if (!Game.Manager.Ui.currentCanvas.titleCanvas && (Input.GetKeyDown((KeyCode)i) || Input.GetKeyDown((KeyCode)(i + 208))))
                    {
                        foreach (UiDoll doll in Game.Session.gameCanvas.dolls)
                        {
                            HP2SR.ShowThreeNotif("Changed to Outfit #" + num);
                            doll.ChangeHairstyle(num);
                            doll.ChangeOutfit(num);
                        }
                    }
                }

                if (Input.GetKeyDown(KeyCode.N))
                {
                    HP2SR.nudePatch = !HP2SR.nudePatch;
                    if (HP2SR.nudePatch)
                    {
                        HP2SR.ShowNotif("AWOOOOOOOOOOGA", 2);
                        foreach (UiDoll doll in Game.Session.gameCanvas.dolls)
                        {
                            doll.partNipples.Show();
                            doll.partOutfit.Hide();
                        }
                    }
                    else
                    {
                        foreach (UiDoll doll in Game.Session.gameCanvas.dolls)
                        {
                            doll.partNipples.Hide();
                            doll.partOutfit.Show();
                        }
                    }
                }

                if (Input.GetKeyDown(KeyCode.M))
                {
                    if (!InputPatches.mashCheat)
                    {
                        HP2SR.ShowThreeNotif("MASH POWER ACTIVATED");
                    }
                    else
                    {
                        HP2SR.ShowThreeNotif("Mash power deactivated");
                    }
                    InputPatches.mashCheat = !InputPatches.mashCheat;
                }

                if (Input.GetKeyDown(KeyCode.L))
                {
                    //Datamining.LocationInfo();
                    CodeDefinition codeDefinition = Game.Data.Codes.Get(16);
                    if (!Game.Persistence.playerData.unlockedCodes.Contains(codeDefinition))
                    {
                        Game.Persistence.playerData.unlockedCodes.Add(codeDefinition);
                        HP2SR.ShowTooltip("Letterbox Code Enabled! (not that it does anything yet)", 2000);
                    }
                    else
                    {
                        Game.Persistence.playerData.unlockedCodes.Remove(codeDefinition);
                        HP2SR.ShowTooltip("Letterbox Code Disabled!", 2000);
                    }
                }

                //percent sign
                if (Input.GetKeyDown(KeyCode.Alpha5))
                {
                    Datamining.CheckPercentage();
                }

                if (Input.GetKeyDown(KeyCode.G))
                {
                    Datamining.GetGirlData();
                }

                if (Input.GetKeyDown(KeyCode.D))
                {
                    Datamining.GetAllDialogTriggers();
                    Datamining.GetAllCutsceneLines();
                }

                if (Input.GetKeyDown(KeyCode.R))
                {
                    PlayerFileGirlPair thePair = Game.Persistence.playerFile.GetPlayerFileGirlPair(Game.Persistence.playerFile.girlPairDefinition);
                    if (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt))
                    {
                        if (thePair.relationshipType != GirlPairRelationshipType.UNKNOWN)
                        {
                            thePair.relationshipType--;
                            HP2SR.ShowThreeNotif("Relationship Leveled Down to " + thePair.relationshipType + "!");
                            UiCellphoneAppStatus status = (UiCellphoneAppStatus)AccessTools.Field(typeof(UiCellphone), "_currentApp").GetValue(Game.Session.gameCanvas.cellphone);
                            status.Refresh();
                        }
                    }
                    else
                    {
                        if (thePair.relationshipType != GirlPairRelationshipType.LOVERS)
                        {
                            thePair.relationshipType++;
                            HP2SR.ShowThreeNotif("Relationship Leveled Up to " + thePair.relationshipType + "!");
                            UiCellphoneAppStatus status = (UiCellphoneAppStatus)AccessTools.Field(typeof(UiCellphone), "_currentApp").GetValue(Game.Session.gameCanvas.cellphone);
                            status.Refresh();
                        }
                    }
                }
            }

            /*if (Input.GetKey(KeyCode.F9))
             * {
             *  Game.Persistence.playerFile.alphaDateCount -= 100;
             *
             *  float num = 200f;
             *  float num2 = 25f;
             *  int num3 = Mathf.Min(Game.Persistence.playerFile.relationshipUpCount, 47);
             *  if (Game.Persistence.playerFile.storyProgress >= 14 && !Game.Persistence.playerData.unlockedCodes.Contains(Game.Session.Puzzle.noAlphaModeCode))
             *  {
             *      num3 += Game.Persistence.playerFile.alphaDateCount + 1;
             *  }
             *  for (int k = 0; k < num3; k++)
             *  {
             *      num += num2;
             *      num2 += 3.3525f;
             *  }
             *
             *  Datamining.Logger.LogDebug((Mathf.RoundToInt(num / 5f) * 5));
             * }
             *
             * if (Input.GetKey(KeyCode.F11))
             * {
             *  Game.Persistence.playerFile.alphaDateCount += 1000;
             *
             *  float num = 200f;
             *  float num2 = 25f;
             *  int num3 = Mathf.Min(Game.Persistence.playerFile.relationshipUpCount, 47);
             *  if (Game.Persistence.playerFile.storyProgress >= 14 && !Game.Persistence.playerData.unlockedCodes.Contains(Game.Session.Puzzle.noAlphaModeCode))
             *  {
             *      num3 += Game.Persistence.playerFile.alphaDateCount + 1;
             *  }
             *  for (int k = 0; k < num3; k++)
             *  {
             *      num += num2;
             *      num2 += 3.3525f;
             *  }
             *
             *  Datamining.Logger.LogDebug((Mathf.RoundToInt(num / 5f) * 5));
             * }
             *
             * if (Input.GetKeyDown(KeyCode.F10))
             * {
             *  Game.Persistence.playerFile.alphaDateCount = 35000;
             * }*/

            /*
             * i should still make a save toggle, on F3?
             * if (cheatsEnabled)
             * {
             *
             *  if (Input.GetKeyDown(KeyCode.F2))
             *  {
             *      if (savingDisabled)
             *      {
             *          savingDisabled = false;
             *          GameUtil.ShowNotification(CellNotificationType.MESSAGE, "Saving has been enabled");
             *      }
             *      else
             *      {
             *          savingDisabled = true;
             *          GameUtil.ShowNotification(CellNotificationType.MESSAGE, "Saving has been disabled");
             *      }
             *  }
             *
             * }
             */
        }