Skip to content

Commit

Permalink
[HC] Add Digital Craft plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Sauceke committed Dec 28, 2024
1 parent 5efc082 commit 708fe2e
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 0 deletions.
67 changes: 67 additions & 0 deletions src/LoveMachine.HC.DigitalCraft/DigitalCraftGame.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using System.Collections;
using System.Reflection;
using HarmonyLib;
using LoveMachine.Core.Common;
using LoveMachine.Core.Game;
using UnityEngine;

namespace LoveMachine.HC.DigitalCraft;

public class DigitalCraftGame : GameAdapter
{
private GameObject[] females;
private Transform[] penises;

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

protected override MethodInfo[] EndHMethods => new MethodInfo[] { };

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 float PenisSize => 0.07f;
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) => "scene";

protected override bool IsIdle(int girlIndex) => females.Length == 0 || penises.Length == 0;

protected override IEnumerator UntilReady(object instance)
{
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")
?? chara.transform.Find("BodyTop/p_cf_jm_body_bone_00(Clone)")).gameObject)
.ToArray();
penises = new[] { "chaM_00", "chaM_01" }
.Select(GameObject.Find)
.Where(go => go != null && go.active)
.Select(chara => FindDeepChildrenByPath(chara, "k_f_tamaC_00").First())
.ToArray();
}
}
13 changes: 13 additions & 0 deletions src/LoveMachine.HC.DigitalCraft/LoveMachine.HC.DigitalCraft.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<OutputPath>..\bin\LoveMachine.HC.DigitalCraft\BepInEx\plugins\HC.DigitalCraft_LoveMachine\</OutputPath>
<RuntimeIdentifier>none</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\LoveMachine.Core.IL2CPP\LoveMachine.Core.IL2CPP.csproj" />
</ItemGroup>
</Project>
9 changes: 9 additions & 0 deletions src/LoveMachine.HC.DigitalCraft/Plugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using BepInEx;
using LoveMachine.Core;
using LoveMachine.Core.NonPortable;

namespace LoveMachine.HC.DigitalCraft;

[BepInPlugin(Globals.GUID, Globals.PluginName, Globals.Version)]
internal class Plugin : LoveMachinePlugin<DigitalCraftGame>
{ }
Binary file added src/LoveMachine.HC.DigitalCraft/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 @@ -70,6 +70,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoveMachine.EC", "LoveMachi
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoveMachine.AIDR", "LoveMachine.AIDR\LoveMachine.AIDR.csproj", "{A8BE23F5-48A7-4210-B118-DD83F19E90E4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoveMachine.HC.DigitalCraft", "LoveMachine.HC.DigitalCraft\LoveMachine.HC.DigitalCraft.csproj", "{31F7D87C-DD6A-4B4A-9370-1A79DD1952C8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -287,6 +289,13 @@ Global
{A8BE23F5-48A7-4210-B118-DD83F19E90E4}.Release-net6|Any CPU.ActiveCfg = Release|Any CPU
{A8BE23F5-48A7-4210-B118-DD83F19E90E4}.Release-net6|Any CPU.Build.0 = Release|Any CPU
{A8BE23F5-48A7-4210-B118-DD83F19E90E4}.Release-netfx3|Any CPU.ActiveCfg = Release|Any CPU
{31F7D87C-DD6A-4B4A-9370-1A79DD1952C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{31F7D87C-DD6A-4B4A-9370-1A79DD1952C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31F7D87C-DD6A-4B4A-9370-1A79DD1952C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31F7D87C-DD6A-4B4A-9370-1A79DD1952C8}.Release|Any CPU.Build.0 = Release|Any CPU
{31F7D87C-DD6A-4B4A-9370-1A79DD1952C8}.Release-net6|Any CPU.ActiveCfg = Debug|Any CPU
{31F7D87C-DD6A-4B4A-9370-1A79DD1952C8}.Release-net6|Any CPU.Build.0 = Debug|Any CPU
{31F7D87C-DD6A-4B4A-9370-1A79DD1952C8}.Release-netfx3|Any CPU.ActiveCfg = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -321,6 +330,7 @@ Global
{6610D6B2-93E2-43FA-8BFB-982A020FAB49} = {C9AD8132-2D49-41BF-8AFB-E7AE8870880C}
{901137A5-D874-4DFF-9F8D-F1273BA0AC5F} = {C9AD8132-2D49-41BF-8AFB-E7AE8870880C}
{A8BE23F5-48A7-4210-B118-DD83F19E90E4} = {C9AD8132-2D49-41BF-8AFB-E7AE8870880C}
{31F7D87C-DD6A-4B4A-9370-1A79DD1952C8} = {C9AD8132-2D49-41BF-8AFB-E7AE8870880C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {446d456d-8d87-438a-9dac-1b76093e0305}
Expand Down

0 comments on commit 708fe2e

Please sign in to comment.