Skip to content

Commit

Permalink
Merge pull request #147 from Sauceke/hc
Browse files Browse the repository at this point in the history
[HC] Add HoneyCome
  • Loading branch information
Sauceke authored Sep 9, 2023
2 parents af0d2ed + 0997b08 commit f2cc7e8
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:

env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
INNO_SETUP_URL: https://web.archive.org/web/20220519201547if_/https://files.jrsoftware.org/is/6/innosetup-6.2.1.exe
INNO_SETUP_URL: https://files.jrsoftware.org/is/6/innosetup-6.2.1.exe
BEPINEX_32_URL: https://github.com/BepInEx/BepInEx/releases/download/v5.4.18/BepInEx_x86_5.4.18.0.zip
BEPINEX_64_URL: https://github.com/BepInEx/BepInEx/releases/download/v5.4.18/BepInEx_x64_5.4.18.0.zip
BEPINEX_IL2CPP_64_URL: https://builds.bepinex.dev/projects/bepinex_be/660/BepInEx-Unity.IL2CPP-win-x64-6.0.0-be.660%2B40bf261.zip
BEPINEX_IL2CPP_64_URL: https://builds.bepinex.dev/projects/bepinex_be/673/BepInEx-Unity.IL2CPP-win-x64-6.0.0-be.673%2B06a7278.zip
BEPINEX_CONF_MGR_URL: https://github.com/BepInEx/BepInEx.ConfigurationManager/releases/download/v16.4/BepInEx.ConfigurationManager_v16.4.zip

defaults:
Expand Down
90 changes: 90 additions & 0 deletions src/LoveMachine.HC/HoneyComeGame.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
using System.Collections;
using System.Reflection;
using HarmonyLib;
using LoveMachine.Core.Common;
using LoveMachine.Core.Game;
using UnityEngine;

namespace LoveMachine.HC;

public class HoneyComeGame: GameAdapter
{
private Traverse ctrlFlag;
private GameObject[] females;
private Transform[] penises;
private Traverse<int> loopType;
private Traverse<bool> nowOrgasm;

private Traverse AnimationInfo => ctrlFlag.Property("NowAnimationInfo");

private int AnimationId => AnimationInfo.Property<int>("ID").Value;

private string AnimationName => AnimationInfo.Property<string>("NameAnimation").Value;

protected override MethodInfo[] StartHMethods =>
new[] { AccessTools.Method("H.HScene, Assembly-CSharp:Start") };

protected override MethodInfo[] EndHMethods =>
new[] { AccessTools.Method("H.HScene, Assembly-CSharp:OnDestroy") };

protected override Dictionary<Bone, string> FemaleBoneNames => new Dictionary<Bone, string>
{
{ Bone.LeftBreast, "k_f_munenipL_00" },
{ Bone.RightBreast, "k_f_munenipR_00" },
{ Bone.Vagina, "cf_n_pee" },
{ Bone.Anus, "k_f_ana_00" },
{ Bone.LeftButt, "k_f_siriL_00" },
{ Bone.RightButt, "k_f_siriR_00" },
{ Bone.Mouth, "cf_J_MouthCavity" },
{ Bone.LeftHand, "cf_j_index03_L" },
{ Bone.RightHand, "cf_j_index03_R" },
{ Bone.LeftFoot, "k_f_toeL_00" },
{ Bone.RightFoot, "k_f_toeR_00" },
};

protected override Transform PenisBase => throw new NotImplementedException();

protected override Transform[] PenisBases => penises;

protected override int AnimationLayer => 0;

protected override int HeroineCount => females.Length;

protected override int MaxHeroineCount => 2;

protected override bool IsHardSex => false;

protected override Animator GetFemaleAnimator(int girlIndex) =>
females[girlIndex].GetComponent<Animator>();

protected override GameObject GetFemaleRoot(int girlIndex) => females[girlIndex];

protected override string GetPose(int girlIndex) =>
$"{AnimationName}.{AnimationId}.{GetAnimatorStateInfo(girlIndex).fullPathHash}";

protected override bool IsIdle(int girlIndex) => loopType.Value == -1;

protected override bool IsOrgasming(int girlIndex) => nowOrgasm.Value;

protected override void SetStartHInstance(object hscene)
{
ctrlFlag = Traverse.Create(hscene).Property("CtrlFlag");
loopType = ctrlFlag.Property<int>("LoopType");
nowOrgasm = ctrlFlag.Property<bool>("NowOrgasm");
}

protected override IEnumerator UntilReady()
{
yield return new WaitForSeconds(10f);
females = new[] { "chaF_00", "chaF_01" }
.Select(GameObject.Find)
.Where(go => go != null && go.active)
.Select(chara => chara.transform.Find("BodyTop/p_cf_jm_body_bone_00").gameObject)
.ToArray();
penises = new[] { "chaM_00", "chaM_01" }
.Select(GameObject.Find)
.Where(go => go != null && go.active)
.Select(chara => FindDeepChildrenByName(chara, "k_f_tamaC_00").First())
.ToArray();
}
}
62 changes: 62 additions & 0 deletions src/LoveMachine.HC/LoveMachine.HC.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<OutputPath>..\bin\LoveMachine.HC\BepInEx\plugins\HC_LoveMachine\</OutputPath>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\LoveMachine.Core.IL2CPP\LoveMachine.Core.IL2CPP.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\LoveMachine.Core.IL2CPP\Lib\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="BepInEx.Core">
<HintPath>..\LoveMachine.Core.IL2CPP\Lib\BepInEx.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="BepInEx.Unity.Common">
<HintPath>..\LoveMachine.Core.IL2CPP\Lib\BepInEx.Unity.Common.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="BepInEx.Unity.IL2CPP">
<HintPath>..\LoveMachine.Core.IL2CPP\Lib\BepInEx.Unity.IL2CPP.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Il2CppInterop.Common">
<HintPath>..\LoveMachine.Core.IL2CPP\Lib\Il2CppInterop.Common.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Il2CppInterop.Generator">
<HintPath>..\LoveMachine.Core.IL2CPP\Lib\Il2CppInterop.Generator.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Il2CppInterop.HarmonySupport">
<HintPath>..\LoveMachine.Core.IL2CPP\Lib\Il2CppInterop.HarmonySupport.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Il2CppInterop.Runtime">
<HintPath>..\LoveMachine.Core.IL2CPP\Lib\Il2CppInterop.Runtime.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Il2Cppmscorlib">
<HintPath>..\LoveMachine.Core.IL2CPP\Lib\Il2Cppmscorlib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>..\LoveMachine.Core.IL2CPP\Lib\UnityEngine.AnimationModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\LoveMachine.Core.IL2CPP\Lib\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\LoveMachine.Core.IL2CPP\Lib\UnityEngine.IMGUIModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
</Project>
9 changes: 9 additions & 0 deletions src/LoveMachine.HC/Plugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using BepInEx;
using LoveMachine.Core;
using LoveMachine.Core.PlatformSpecific;

namespace LoveMachine.HC;

[BepInPlugin(Globals.GUID, Globals.PluginName, Globals.Version)]
internal class Plugin : LoveMachinePlugin<HoneyComeGame>
{ }
Binary file added src/LoveMachine.HC/PluginInfo.ini
Binary file not shown.
10 changes: 10 additions & 0 deletions src/LoveMachine.sln
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoveMachine.AI", "LoveMachi
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoveMachine.HS", "LoveMachine.HS\LoveMachine.HS.csproj", "{356DC42A-82EF-4D66-930E-F092ED3E7590}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoveMachine.HC", "LoveMachine.HC\LoveMachine.HC.csproj", "{5502A264-E13A-40AE-9476-46FB8413BBAD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -224,6 +226,13 @@ Global
{356DC42A-82EF-4D66-930E-F092ED3E7590}.Release-net6|Any CPU.ActiveCfg = Release|Any CPU
{356DC42A-82EF-4D66-930E-F092ED3E7590}.Release-netfx3|Any CPU.ActiveCfg = Release|Any CPU
{356DC42A-82EF-4D66-930E-F092ED3E7590}.Release-netfx3|Any CPU.Build.0 = Release|Any CPU
{5502A264-E13A-40AE-9476-46FB8413BBAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5502A264-E13A-40AE-9476-46FB8413BBAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5502A264-E13A-40AE-9476-46FB8413BBAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5502A264-E13A-40AE-9476-46FB8413BBAD}.Release|Any CPU.Build.0 = Release|Any CPU
{5502A264-E13A-40AE-9476-46FB8413BBAD}.Release-netfx3|Any CPU.ActiveCfg = Debug|Any CPU
{5502A264-E13A-40AE-9476-46FB8413BBAD}.Release-net6|Any CPU.ActiveCfg = Release|Any CPU
{5502A264-E13A-40AE-9476-46FB8413BBAD}.Release-net6|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -251,6 +260,7 @@ Global
{8032C929-0C88-4E91-A11D-B8B32ED0658D} = {C9AD8132-2D49-41BF-8AFB-E7AE8870880C}
{DAB043BB-2B90-4226-B41F-28C590F343D2} = {C9AD8132-2D49-41BF-8AFB-E7AE8870880C}
{356DC42A-82EF-4D66-930E-F092ED3E7590} = {C9AD8132-2D49-41BF-8AFB-E7AE8870880C}
{5502A264-E13A-40AE-9476-46FB8413BBAD} = {C9AD8132-2D49-41BF-8AFB-E7AE8870880C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {446d456d-8d87-438a-9dac-1b76093e0305}
Expand Down

0 comments on commit f2cc7e8

Please sign in to comment.