private static void MakeExperienced(SaveData.Heroine currentAdvGirl) { currentAdvGirl.hCount = Mathf.Max(1, currentAdvGirl.hCount); currentAdvGirl.isVirgin = false; SetGirlHExp(currentAdvGirl, 100f); currentAdvGirl.lewdness = Mathf.Min(99, currentAdvGirl.lewdness); }
private static void MakeInexperienced(SaveData.Heroine currentAdvGirl) { currentAdvGirl.hCount = Mathf.Max(1, currentAdvGirl.hCount); currentAdvGirl.isVirgin = false; currentAdvGirl.countKokanH = 50; SetGirlHExp(currentAdvGirl, 0); }
private static void MakeHorny(SaveData.Heroine currentAdvGirl) { currentAdvGirl.hCount = Mathf.Max(1, currentAdvGirl.hCount); currentAdvGirl.isVirgin = false; SetGirlHExp(currentAdvGirl, 100f); currentAdvGirl.lewdness = 100; }
/// <summary> /// Get ChaFiles that are related to this heroine. Warning: It might not return some copies. /// </summary> public static IEnumerable <ChaFileControl> GetRelatedChaFiles(this SaveData.Heroine heroine) { if (heroine == null) { throw new ArgumentNullException(nameof(heroine)); } var results = new HashSet <ChaFileControl>(); if (heroine.charFile != null) { results.Add(heroine.charFile); } if (heroine.chaCtrl != null && heroine.chaCtrl.chaFile != null) { results.Add(heroine.chaCtrl.chaFile); } var npc = heroine.GetNPC(); if (npc != null && npc.chaCtrl != null && npc.chaCtrl.chaFile != null) { results.Add(npc.chaCtrl.chaFile); } return(results); }
/// <summary> /// Get the NPC that represents this heroine in the game. Works only in the main game. /// If the heroine has not been spawned into the game it returns null. /// </summary> public static NPC GetNPC(this SaveData.Heroine heroine) { if (heroine == null) { throw new ArgumentNullException(nameof(heroine)); } if (heroine.charaBase is NPC npc) { return(npc); } if (heroine.transform == null) { return(null); } return(heroine.transform.GetComponent <NPC>()); }
private static void SetGirlHExp(SaveData.Heroine girl, float amount) { girl.houshiExp = amount; girl.countKokanH = amount; girl.countAnalH = amount; for (var i = 0; i < girl.hAreaExps.Length; i++) { girl.hAreaExps[i] = amount; } for (var i = 0; i < girl.massageExps.Length; i++) { girl.massageExps[i] = amount; } // Global exp added in KKS girl.hExp = amount; }
private static string GetHExpText(SaveData.Heroine currentAdvGirl) { return(((HExperienceKindEng)currentAdvGirl.HExperience).ToString()); }
private static void MakeVirgin(SaveData.Heroine currentAdvGirl) { currentAdvGirl.hCount = 0; currentAdvGirl.isVirgin = true; SetGirlHExp(currentAdvGirl, 0); }
private static void DrawHeroineCheats(SaveData.Heroine currentAdvGirl, CheatToolsWindow cheatToolsWindow) { GUILayout.BeginVertical(); { GUILayout.BeginHorizontal(); { GUILayout.Label("Selected girl name: "); GUILayout.Label(currentAdvGirl.Name); GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("Relationship level: "); GUILayout.Label(_relationNames[GetRelationSafe(currentAdvGirl)]); GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label("Favor: " + currentAdvGirl.favor, GUILayout.Width(70)); currentAdvGirl.favor = (int)GUILayout.HorizontalSlider(currentAdvGirl.favor, 0, currentAdvGirl.isGirlfriend ? 150 : 100); } GUILayout.EndHorizontal(); currentAdvGirl.isFriend = GUILayout.Toggle(currentAdvGirl.isFriend, "Is a friend"); currentAdvGirl.isGirlfriend = GUILayout.Toggle(currentAdvGirl.isGirlfriend, "Is a girlfriend"); currentAdvGirl.confessed = GUILayout.Toggle(currentAdvGirl.confessed, "Confessed"); currentAdvGirl.isLunch = GUILayout.Toggle(currentAdvGirl.isLunch, "Had first lunch"); currentAdvGirl.isDayH = GUILayout.Toggle(currentAdvGirl.isDayH, "Had H today (won't visit)"); GUILayout.BeginHorizontal(); { GUILayout.Label("Desire to visit: ", GUILayout.ExpandWidth(false)); GUI.changed = false; var newCount = GUILayout.TextField(currentAdvGirl.visitDesire.ToString(), GUILayout.ExpandWidth(true)); if (GUI.changed && int.TryParse(newCount, out var newCountInt)) { currentAdvGirl.visitDesire = Mathf.Max(newCountInt, 0); } } GUILayout.EndHorizontal(); GUILayout.Space(8); if (GUILayout.Button("Reset conversation time")) { currentAdvGirl.talkTime = currentAdvGirl.talkTimeMax; } if (ActionScene.instance != null && currentAdvGirl.transform != null && GUILayout.Button("Follow me")) { var npc = currentAdvGirl.transform.GetComponent <NPC>(); if (npc) { ActionScene.instance.Player.ChaserSet(npc); } else { CheatToolsPlugin.Logger.Log(LogLevel.Warning | LogLevel.Message, "Could not make heroine follow - NPC component not found"); } } if (ActionScene.initialized && ActionScene.instance != null) { var actCtrl = ActionScene.instance.actCtrl; var sortedDesires = Enum.GetValues(typeof(DesireEng)).Cast <DesireEng>() .Select(i => new { id = i, value = actCtrl.GetDesire((int)i, currentAdvGirl) }) .Where(x => x.value > 5) .OrderByDescending(x => x.value) .Take(8); var any = false; foreach (var desire in sortedDesires) { if (!any) { GUILayout.Label("Desires (and their strengths):\n"); any = true; } GUILayout.BeginHorizontal(); { GUILayout.Label((int)desire.id + " " + desire.id); GUILayout.FlexibleSpace(); GUILayout.Label(desire.value + "%"); if (GUILayout.Button("X", GUILayout.ExpandWidth(false))) { actCtrl.SetDesire((int)desire.id, currentAdvGirl, 0); } } GUILayout.EndHorizontal(); } if (!any) { GUILayout.Label("Has no desires"); } if (GUILayout.Button("Clear all desires")) { for (int i = 0; i < 31; i++) { actCtrl.SetDesire(i, currentAdvGirl, 0); } } GUILayout.BeginHorizontal(); { GUILayout.Label("Set desire ", GUILayout.ExpandWidth(false)); _setdesireId = GUILayout.TextField(_setdesireId ?? ""); GUILayout.Label(" to value ", GUILayout.ExpandWidth(false)); _setdesireValue = GUILayout.TextField(_setdesireValue ?? ""); if (GUILayout.Button("OK", GUILayout.ExpandWidth(false))) { try { actCtrl.SetDesire((int)Enum.Parse(typeof(DesireEng), _setdesireId), currentAdvGirl, int.Parse(_setdesireValue)); } catch (Exception e) { CheatToolsPlugin.Logger.LogMessage("Invalid desire ID (0-30) or value (0-100) - " + e.Message); } } } GUILayout.EndHorizontal(); var wantsMast = actCtrl.GetDesire(4, currentAdvGirl) > 80; if (!wantsMast) { if (GUILayout.Button("Make desire to m********e")) { actCtrl.SetDesire(4, currentAdvGirl, 100); } } var wantsLes = actCtrl.GetDesire(26, currentAdvGirl) > 80; if (!wantsLes) { if (GUILayout.Button("Make desire to lesbian")) { actCtrl.SetDesire(26, currentAdvGirl, 100); actCtrl.SetDesire(27, currentAdvGirl, 100); } } } GUILayout.Space(8); GUILayout.BeginHorizontal(); { GUILayout.Label("Lewd: " + currentAdvGirl.lewdness, GUILayout.Width(70)); currentAdvGirl.lewdness = (int)GUILayout.HorizontalSlider(currentAdvGirl.lewdness, 0, 100); } GUILayout.EndHorizontal(); // 危険日 is risky, 安全日 is safe. Only change when user clicks to avoid messing with the value unnecessarily GUI.changed = false; var isDangerousDay = GUILayout.Toggle(HFlag.GetMenstruation(currentAdvGirl.MenstruationDay) == HFlag.MenstruationType.危険日, "Is on a risky day"); if (GUI.changed) { HFlag.SetMenstruation(currentAdvGirl, isDangerousDay ? HFlag.MenstruationType.危険日 : HFlag.MenstruationType.安全日); } currentAdvGirl.isVirgin = GUILayout.Toggle(currentAdvGirl.isVirgin, "isVirgin"); currentAdvGirl.isAnalVirgin = GUILayout.Toggle(currentAdvGirl.isAnalVirgin, "isAnalVirgin"); GUILayout.BeginHorizontal(); { GUILayout.Label("Sex count: ", GUILayout.ExpandWidth(false)); GUI.changed = false; var newCount = GUILayout.TextField(currentAdvGirl.hCount.ToString(), GUILayout.ExpandWidth(true)); if (GUI.changed && int.TryParse(newCount, out var newCountInt)) { currentAdvGirl.hCount = Mathf.Max(newCountInt, 0); } } GUILayout.EndHorizontal(); GUILayout.Space(4); GUILayout.Label("Sex experience: " + GetHExpText(currentAdvGirl)); GUILayout.Label("Set to: (changes multiple stats)"); GUILayout.BeginHorizontal(); { if (GUILayout.Button("Virgin")) { MakeVirgin(currentAdvGirl); } if (GUILayout.Button("Inexp")) { MakeInexperienced(currentAdvGirl); } if (GUILayout.Button("Exp")) { MakeExperienced(currentAdvGirl); } if (GUILayout.Button("Horny")) { MakeHorny(currentAdvGirl); } } GUILayout.EndHorizontal(); GUILayout.Space(4); GUILayout.Label("Set all touch experience"); GUILayout.BeginHorizontal(); { if (GUILayout.Button("0%")) { SetGirlHExp(currentAdvGirl, 0f); } if (GUILayout.Button("50%")) { SetGirlHExp(currentAdvGirl, 50f); } if (GUILayout.Button("100%")) { SetGirlHExp(currentAdvGirl, 100f); } } GUILayout.EndHorizontal(); GUILayout.Space(4); currentAdvGirl.denial.kiss = GUILayout.Toggle(currentAdvGirl.denial.kiss, "Won't refuse kiss"); currentAdvGirl.denial.massage = GUILayout.Toggle(currentAdvGirl.denial.massage, "Won't refuse strong massage"); currentAdvGirl.denial.anal = GUILayout.Toggle(currentAdvGirl.denial.anal, "Won't refuse anal"); currentAdvGirl.denial.aibu = GUILayout.Toggle(currentAdvGirl.denial.aibu, "Won't refuse vibrator"); currentAdvGirl.denial.notCondom = GUILayout.Toggle(currentAdvGirl.denial.notCondom, "Insert w/o condom OK"); GUILayout.Space(4); if (GUILayout.Button("Navigate to heroine's GameObject")) { if (currentAdvGirl.transform != null) { cheatToolsWindow.Editor.TreeViewer.SelectAndShowObject(currentAdvGirl.transform); } else { CheatToolsPlugin.Logger.Log(LogLevel.Warning | LogLevel.Message, "Heroine has no body assigned"); } } if (GUILayout.Button("Open Heroine in inspector")) { cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(currentAdvGirl, "Heroine " + currentAdvGirl.Name), true); } if (GUILayout.Button("Inspect extended data")) { cheatToolsWindow.Editor.Inspector.Push(new InstanceStackEntry(ExtensibleSaveFormat.ExtendedSave.GetAllExtendedData(currentAdvGirl.charFile), "ExtData for " + currentAdvGirl.Name), true); } } GUILayout.EndVertical(); }
private static void DrawGirlCheatMenu(CheatToolsWindow cheatToolsWindow) { GUILayout.Label("Girl stats"); if (!_showSelectHeroineList) { var visibleGirls = GetCurrentVisibleGirls(); for (var index = 0; index < visibleGirls.Length; index++) { var girl = visibleGirls[index]; if (GUILayout.Button($"Select current #{index} - {girl.Name}")) { _currentVisibleGirl = girl; } } var anyHeroines = Game.HeroineList != null && Game.HeroineList.Count > 0; if (anyHeroines) { if (GUILayout.Button("Select from heroine list")) { _showSelectHeroineList = true; } } if (_currentVisibleGirl != null) { GUILayout.Space(6); DrawHeroineCheats(_currentVisibleGirl, cheatToolsWindow); } else { GUILayout.Label("Select a girl to access her stats"); } if (anyHeroines) { GUILayout.BeginVertical(GUI.skin.box); { GUILayout.Label("These affect ALL heroines"); if (GUILayout.Button("Make everyone friends")) { foreach (var h in Game.HeroineList) { h.favor = 100; h.isGirlfriend = false; } } if (GUILayout.Button("Make everyone lovers")) { foreach (var h in Game.HeroineList) { h.favor = 75; h.isGirlfriend = true; h.confessed = true; } } if (GUILayout.Button("Make everyone full lovers")) { foreach (var h in Game.HeroineList) { h.favor = 150; h.isGirlfriend = true; h.confessed = true; } } if (GUILayout.Button("Make everyone lewd")) { foreach (var h in Game.HeroineList) { h.lewdness = 100; } } if (GUILayout.Button("Make everyone virgins")) { foreach (var h in Game.HeroineList) { MakeVirgin(h); } } if (GUILayout.Button("Make everyone inexperienced")) { foreach (var h in Game.HeroineList) { MakeInexperienced(h); } } if (GUILayout.Button("Make everyone experienced")) { foreach (var h in Game.HeroineList) { MakeExperienced(h); } } if (GUILayout.Button("Make everyone perverted")) { foreach (var h in Game.HeroineList) { MakeHorny(h); } } //todo check if desires are the same as in kk if (GUILayout.Button("Clear everyone's desires")) { foreach (var h in Game.HeroineList) { for (int i = 0; i < 31; i++) { ActionScene.instance.actCtrl.SetDesire(i, h, 0); } } } if (GUILayout.Button("Everyone desires masturbation")) { foreach (var h in Game.HeroineList) { ActionScene.instance.actCtrl.SetDesire(4, h, 100); } } if (GUILayout.Button("Everyone desires lesbian")) { foreach (var h in Game.HeroineList) { ActionScene.instance.actCtrl.SetDesire(26, h, 100); ActionScene.instance.actCtrl.SetDesire(27, h, 100); } } } GUILayout.EndVertical(); } } else { if (Game.HeroineList == null || Game.HeroineList.Count == 0) { _showSelectHeroineList = false; } else { GUILayout.Label("Select one of the heroines to continue"); for (var index = 0; index < Game.HeroineList.Count; index++) { var heroine = Game.HeroineList[index]; if (GUILayout.Button($"Select #{index} - {heroine.Name}")) { _currentVisibleGirl = heroine; _showSelectHeroineList = false; } } } } }