-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OA] Upgrade to Our Apartment v0.5.3
- Loading branch information
Showing
4 changed files
with
65 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net45</TargetFramework> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> | ||
<OutputPath>..\bin\LoveMachine.OA\BepInEx\plugins\OA_LoveMachine\</OutputPath> | ||
<RuntimeIdentifier>none</RuntimeIdentifier> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\LoveMachine.Core\LoveMachine.Core.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="UnityEngine.Core" Version="5.6.0" ExcludeAssets="runtime" /> | ||
<ProjectReference Include="..\LoveMachine.Core.IL2CPP\LoveMachine.Core.IL2CPP.csproj"/> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,80 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using HarmonyLib; | ||
using LoveMachine.Core.Game; | ||
using LoveMachine.Core.Common; | ||
using LoveMachine.Core.Game; | ||
using UnityEngine; | ||
|
||
namespace LoveMachine.OA | ||
namespace LoveMachine.OA; | ||
|
||
internal sealed class OurApartmentGame : GameAdapter | ||
{ | ||
internal sealed class OurApartmentGame : GameAdapter | ||
{ | ||
private static readonly string[] layerNames = | ||
{ "Base SexSim", "From Behind SexSim", "Couch Missionary SexSim" }; | ||
private static readonly string[] layerNames = | ||
{ "Base SexSim", "From Behind SexSim", "Couch Missionary SexSim" }; | ||
|
||
private Traverse<bool> isSex; | ||
private Animator naomiAnimator; | ||
private IEnumerable<int> animationLayers; | ||
private Traverse<bool> isSex; | ||
private Animator naomiAnimator; | ||
private IEnumerable<int> animationLayers; | ||
|
||
protected override Dictionary<Bone, string> FemaleBoneNames => new Dictionary<Bone, string> | ||
{ | ||
{ Bone.Vagina, "cc_pussy_clit" }, | ||
{ Bone.LeftBreast, "cc_boob.l" }, | ||
{ Bone.RightBreast, "cc_boob.r" }, | ||
{ Bone.Mouth, "c_teeth_top.x" }, | ||
{ Bone.LeftFoot, "c_toes_thumb1.l" }, | ||
{ Bone.RightFoot, "c_toes_thumb1.r" }, | ||
{ Bone.LeftHand, "index1.l" }, | ||
{ Bone.RightHand, "index1.r" } | ||
}; | ||
protected override Dictionary<Bone, string> FemaleBoneNames => new Dictionary<Bone, string> | ||
{ | ||
{ Bone.Vagina, "cc_pussy_clit" }, | ||
{ Bone.LeftBreast, "cc_boob.l" }, | ||
{ Bone.RightBreast, "cc_boob.r" }, | ||
{ Bone.Mouth, "c_teeth_top.x" }, | ||
{ Bone.LeftFoot, "c_toes_thumb1.l" }, | ||
{ Bone.RightFoot, "c_toes_thumb1.r" }, | ||
{ Bone.LeftHand, "index1.l" }, | ||
{ Bone.RightHand, "index1.r" } | ||
}; | ||
|
||
protected override int HeroineCount => 1; // Just Naomi | ||
protected override int HeroineCount => 1; // Just Naomi | ||
|
||
protected override int MaxHeroineCount => 1; | ||
protected override int MaxHeroineCount => 1; | ||
|
||
protected override bool IsHardSex => GetPose(0).Contains("Pump2"); | ||
protected override bool IsHardSex => GetPose(0).Contains("Pump2"); | ||
|
||
protected override int AnimationLayer => animationLayers | ||
.Where(i => naomiAnimator.GetLayerWeight(i) == 1f) | ||
.DefaultIfEmpty(-1) | ||
.First(); | ||
protected override int AnimationLayer => animationLayers | ||
.Where(i => naomiAnimator.GetLayerWeight(i) == 1f) | ||
.DefaultIfEmpty(-1) | ||
.First(); | ||
|
||
protected override float PenisSize => 0.2f; | ||
protected override float PenisSize => 0.2f; | ||
|
||
protected override MethodInfo[] StartHMethods => | ||
new[] { AccessTools.Method("SexSimControl, Assembly-CSharp:InitializeAsync") }; | ||
protected override MethodInfo[] StartHMethods => new[] | ||
{ | ||
AccessTools.Method("Momoirosoft.Managers.SexSimControl, Assembly-CSharp:InitializeAsync") | ||
}; | ||
|
||
protected override MethodInfo[] EndHMethods => | ||
new[] { AccessTools.Method("SexSimControl, Assembly-CSharp:RunSexConclusion") }; | ||
protected override MethodInfo[] EndHMethods => new[] | ||
{ | ||
AccessTools.Method("Momoirosoft.Managers.SexSimControl, Assembly-CSharp:RunSexConclusion") | ||
}; | ||
|
||
protected override Animator GetFemaleAnimator(int girlIndex) => naomiAnimator; | ||
protected override Animator GetFemaleAnimator(int girlIndex) => naomiAnimator; | ||
|
||
protected override GameObject GetFemaleRoot(int girlIndex) => null; | ||
protected override GameObject GetFemaleRoot(int girlIndex) => null; | ||
|
||
protected override Transform PenisBase => | ||
GameObject.Find("cc_balls1.l")?.transform ?? transform; | ||
protected override Transform PenisBase => | ||
GameObject.Find("cc_balls1.l")?.transform ?? transform; | ||
|
||
protected override string GetPose(int girlIndex) => | ||
naomiAnimator.GetCurrentAnimatorClipInfo(AnimationLayer).FirstOrDefault().clip?.name | ||
?? "unknown_pose"; | ||
protected override string GetPose(int girlIndex) => | ||
naomiAnimator.GetCurrentAnimatorClipInfo(AnimationLayer).FirstOrDefault().clip?.name | ||
?? "unknown_pose"; | ||
|
||
protected override bool IsIdle(int girlIndex) => !isSex.Value; | ||
protected override bool IsIdle(int girlIndex) => !isSex.Value; | ||
|
||
protected override bool IsOrgasming(int girlIndex) => GetPose(0).Contains("Cum"); | ||
|
||
protected override IEnumerator UntilReady(object sexSimControl) | ||
protected override bool IsOrgasming(int girlIndex) => GetPose(0).Contains("Cum"); | ||
|
||
protected override IEnumerator UntilReady(object sexSimControl) | ||
{ | ||
while (naomiAnimator == null) | ||
{ | ||
yield return new WaitWhile(() => | ||
(naomiAnimator = GameObject.Find("NaomiRig").GetComponent<Animator>()) == null); | ||
isSex = Traverse.Create(sexSimControl).Field<bool>("_sexActive"); | ||
animationLayers = Enumerable.Range(0, naomiAnimator.layerCount) | ||
.Where(i => layerNames.Contains(naomiAnimator.GetLayerName(i))); | ||
yield return new WaitForSeconds(1f); | ||
naomiAnimator = GameObject.Find("NaomiRig")?.GetComponent<Animator>(); | ||
} | ||
isSex = Traverse.Create(sexSimControl).Property<bool>("_sexActive"); | ||
animationLayers = Enumerable.Range(0, naomiAnimator.layerCount) | ||
.Where(i => layerNames.Contains(naomiAnimator.GetLayerName(i))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.