Skip to content

Commit

Permalink
Added wedding and h position unlocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Mar 29, 2019
1 parent ee4b079 commit 606a4a2
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 47 deletions.
7 changes: 3 additions & 4 deletions KKCheatTools/CheatTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\..\..\..\Games\Koikatsu\BepInEx\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -26,7 +26,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\..\..\..\Games\Koikatsu\BepInEx\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -46,8 +46,7 @@
</Reference>
<Reference Include="RuntimeUnityEditor, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\RuntimeUnityEditor\bin\Release\RuntimeUnityEditor.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\Games\Koikatsu\BepInEx\RuntimeUnityEditor.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="UnityEngine">
Expand Down
126 changes: 83 additions & 43 deletions KKCheatTools/CheatWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private void CheatWindowContents(int id)
{
_cheatsScrollPos = GUILayout.BeginScrollView(_cheatsScrollPos);
{
if (_gameMgr != null && !_gameMgr.saveData.isOpening)
if (_gameMgr != null)
DrawPlayerCheats();
else
GUILayout.Label("Start the game to see player cheats");
Expand Down Expand Up @@ -199,6 +199,39 @@ private void CheatWindowContents(int id)
AssetBundleManager.UnloadAssetBundle(bundle.Key, true, pair.Key);
}
}

GUILayout.Space(8);

if (_gameMgr != null)
{
GUILayout.BeginVertical(GUI.skin.box);
{
GUILayout.Label("Global unlocks");

if (GUILayout.Button("Unlock all wedding personalities"))
{
foreach (var personalityId in Singleton<Voice>.Instance.voiceInfoList.Select(x => x.No).Where(x => x >= 0))
_gameMgr.weddingData.personality.Add(personalityId);
}
if (GUILayout.Button("Unlock all H positions"))
{
// Safe enough to add up to 100, vanilla positions don't seem to go above 60
// 8 buckets might change in the future if game is updated with more h modes, check HSceneProc.lstAnimInfo for how many are needed
for (int i = 0; i < 8; i++)
_gameMgr.glSaveData.playHList[i] = new HashSet<int>(Enumerable.Range(0, 100));
}
/* Doesn't work, need a list of items to put into glSaveData.clubContents from somewhere
if (GUILayout.Button("Unlock all free H toys/extras"))
{
var go = new GameObject("CheatTools Temp");
var handCtrl = go.AddComponent<HandCtrl>();
var dicItem = (Dictionary<int, HandCtrl.AibuItem>)Traverse.Create(typeof(HandCtrl)).Field("dicItem").GetValue(handCtrl);
_gameMgr.glSaveData.clubContents[0] = new HashSet<int>(dicItem.Select(x => x.Value.saveID).Where(x => x >= 0));
go.Destroy();
}*/
}
GUILayout.EndVertical();
}
}
GUILayout.EndVertical();
}
Expand Down Expand Up @@ -325,62 +358,69 @@ private void DrawPlayerCheats()
{
GUILayout.BeginVertical(GUI.skin.box);
{
GUILayout.Label("Player stats");

GUILayout.BeginHorizontal();
if (_gameMgr.saveData.isOpening)
{
GUILayout.Label("STR: " + _gameMgr.Player.physical, GUILayout.Width(60));
_gameMgr.Player.physical = (int)GUILayout.HorizontalSlider(_gameMgr.Player.physical, 0, 100);
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
{
GUILayout.Label("INT: " + _gameMgr.Player.intellect, GUILayout.Width(60));
_gameMgr.Player.intellect = (int)GUILayout.HorizontalSlider(_gameMgr.Player.intellect, 0, 100);
}
GUILayout.EndHorizontal();
GUILayout.Label("Start the game to see player cheats");
}
else
{
GUILayout.Label("Player stats");

GUILayout.BeginHorizontal();
{
GUILayout.Label("H: " + _gameMgr.Player.hentai, GUILayout.Width(60));
_gameMgr.Player.hentai = (int)GUILayout.HorizontalSlider(_gameMgr.Player.hentai, 0, 100);
}
GUILayout.EndHorizontal();
GUILayout.Label("STR: " + _gameMgr.Player.physical, GUILayout.Width(60));
_gameMgr.Player.physical = (int)GUILayout.HorizontalSlider(_gameMgr.Player.physical, 0, 100);
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
{
GUILayout.Label("INT: " + _gameMgr.Player.intellect, GUILayout.Width(60));
_gameMgr.Player.intellect = (int)GUILayout.HorizontalSlider(_gameMgr.Player.intellect, 0, 100);
}
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
{
GUILayout.Label("H: " + _gameMgr.Player.hentai, GUILayout.Width(60));
_gameMgr.Player.hentai = (int)GUILayout.HorizontalSlider(_gameMgr.Player.hentai, 0, 100);
}
GUILayout.EndHorizontal();

var cycle = Object.FindObjectsOfType<Cycle>().FirstOrDefault();
if (cycle != null)
{
if (cycle.timerVisible)
var cycle = Object.FindObjectsOfType<Cycle>().FirstOrDefault();
if (cycle != null)
{
GUILayout.BeginHorizontal();
if (cycle.timerVisible)
{
GUILayout.Label("Time: " + cycle.timer.ToString("N1"), GUILayout.Width(65));
var newVal = GUILayout.HorizontalSlider(cycle.timer, 0, Cycle.TIME_LIMIT);
if (Math.Abs(newVal - cycle.timer) > 0.09)
GUILayout.BeginHorizontal();
{
typeof(Cycle)
.GetField("_timer", BindingFlags.Instance | BindingFlags.NonPublic)
?.SetValue(cycle, newVal);
GUILayout.Label("Time: " + cycle.timer.ToString("N1"), GUILayout.Width(65));
var newVal = GUILayout.HorizontalSlider(cycle.timer, 0, Cycle.TIME_LIMIT);
if (Math.Abs(newVal - cycle.timer) > 0.09)
{
typeof(Cycle)
.GetField("_timer", BindingFlags.Instance | BindingFlags.NonPublic)
?.SetValue(cycle, newVal);
}
}
GUILayout.EndHorizontal();
}
GUILayout.EndHorizontal();
}

GUILayout.BeginHorizontal();
{
GUILayout.Label("Day of the week: " + cycle.nowWeek);
if (GUILayout.Button("Next"))
cycle.Change(cycle.nowWeek.Next());
GUILayout.BeginHorizontal();
{
GUILayout.Label("Day of the week: " + cycle.nowWeek);
if (GUILayout.Button("Next"))
cycle.Change(cycle.nowWeek.Next());
}
GUILayout.EndHorizontal();
}
GUILayout.EndHorizontal();
}
}

if (GUILayout.Button("Add 10000 club points (+1 level)"))
_gameMgr.saveData.clubReport.comAdd += 10000;
if (GUILayout.Button("Add 10000 club points (+1 level)"))
_gameMgr.saveData.clubReport.comAdd += 10000;

if (GUILayout.Button("Open player data in inspector"))
{
_inspector.InspectorClear();
_inspector.InspectorPush(new InstanceStackEntry(_gameMgr.saveData.player, "Player data"));
if (GUILayout.Button("Open player data in inspector"))
{
_inspector.InspectorClear();
_inspector.InspectorPush(new InstanceStackEntry(_gameMgr.saveData.player, "Player data"));
}
}
}
GUILayout.EndVertical();
Expand Down

0 comments on commit 606a4a2

Please sign in to comment.