-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3cc1f89
commit ea2c8de
Showing
4 changed files
with
210 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
using BepInEx; | ||
using Harmony; | ||
using KKAPI; | ||
using KKAPI.Chara; | ||
using System.ComponentModel; | ||
/// <summary> | ||
/// Adds shaking to a character's eye highlights when she is a virgin in an H scene | ||
/// </summary> | ||
namespace KK_EyeShaking | ||
{ | ||
[BepInPlugin(GUID, PluginName, Version)] | ||
public class KK_EyeShaking : BaseUnityPlugin | ||
{ | ||
public const string GUID = "com.deathweasel.bepinex.eyeshaking"; | ||
public const string PluginName = "Eye Shaking"; | ||
public const string PluginNameInternal = "KK_EyeShaking"; | ||
public const string Version = "1.0"; | ||
[DisplayName("Enabled")] | ||
[Category("Config")] | ||
[Description("When enabled, virgins in H scenes will appear to have shaking eye highlights")] | ||
public static ConfigWrapper<bool> Enabled { get; private set; } | ||
|
||
void Main() | ||
{ | ||
var harmony = HarmonyInstance.Create(GUID); | ||
harmony.PatchAll(typeof(KK_EyeShaking)); | ||
CharacterApi.RegisterExtraBehaviour<EyeShakingController>(GUID); | ||
Enabled = new ConfigWrapper<bool>("Enabled", PluginNameInternal, true); | ||
} | ||
|
||
private static EyeShakingController GetController(ChaControl character) => character?.gameObject?.GetComponent<EyeShakingController>(); | ||
|
||
public class EyeShakingController : CharaCustomFunctionController | ||
{ | ||
internal bool IsVirgin { get; set; } = true; | ||
internal bool IsVirginOrg { get; set; } = true; | ||
internal bool IsInit { get; set; } = false; | ||
|
||
protected override void OnCardBeingSaved(GameMode currentGameMode) { } | ||
protected override void OnReload(GameMode currentGameMode) { } | ||
|
||
internal void HSceneStart(bool virgin) | ||
{ | ||
IsVirgin = virgin; | ||
IsVirginOrg = virgin; | ||
IsInit = true; | ||
} | ||
|
||
internal void HSceneEnd() | ||
{ | ||
ChaControl.ChangeEyesShaking(false); | ||
IsInit = false; | ||
} | ||
|
||
internal void OnInsert() => IsVirgin = false; | ||
internal void AddOrgasm() => IsVirginOrg = false; | ||
|
||
protected override void Update() | ||
{ | ||
if (Enabled.Value && IsInit && (IsVirgin || IsVirginOrg)) | ||
ChaControl.ChangeEyesShaking(true); | ||
} | ||
} | ||
/// <summary> | ||
/// Insert vaginal | ||
/// </summary> | ||
[HarmonyPrefix, HarmonyPatch(typeof(HFlag), nameof(HFlag.AddSonyuKokanPlay))] | ||
public static void AddSonyuKokanPlay(HFlag __instance) => GetController(__instance.lstHeroine[0].chaCtrl).OnInsert(); | ||
/// <summary> | ||
/// Insert anal | ||
/// </summary> | ||
[HarmonyPrefix, HarmonyPatch(typeof(HFlag), nameof(HFlag.AddSonyuAnalPlay))] | ||
public static void AddSonyuAnalPlay(HFlag __instance) => GetController(__instance.lstHeroine[0].chaCtrl).OnInsert(); | ||
/// <summary> | ||
/// Something that happens at the end of H scene loading, good enough place to hook | ||
/// </summary> | ||
[HarmonyPrefix, HarmonyPatch(typeof(HSceneProc), "MapSameObjectDisable")] | ||
public static void MapSameObjectDisable(HSceneProc __instance) | ||
{ | ||
SaveData.Heroine heroine = __instance.flags.lstHeroine[0]; | ||
GetController(heroine.chaCtrl).HSceneStart(heroine.isVirgin && heroine.isAnalVirgin); | ||
} | ||
|
||
[HarmonyPrefix, HarmonyPatch(typeof(HFlag), nameof(HFlag.AddSonyuOrg))] | ||
public static void AddSonyuOrg(HFlag __instance) => GetController(__instance.lstHeroine[0].chaCtrl).AddOrgasm(); | ||
[HarmonyPrefix, HarmonyPatch(typeof(HFlag), nameof(HFlag.AddSonyuSame))] | ||
public static void AddSonyuSame(HFlag __instance) => GetController(__instance.lstHeroine[0].chaCtrl).AddOrgasm(); | ||
[HarmonyPrefix, HarmonyPatch(typeof(HFlag), nameof(HFlag.AddSonyuAnalOrg))] | ||
public static void AddSonyuAnalOrg(HFlag __instance) => GetController(__instance.lstHeroine[0].chaCtrl).AddOrgasm(); | ||
[HarmonyPrefix, HarmonyPatch(typeof(HFlag), nameof(HFlag.AddSonyuAnalSame))] | ||
public static void AddSonyuAnalSame(HFlag __instance) => GetController(__instance.lstHeroine[0].chaCtrl).AddOrgasm(); | ||
|
||
[HarmonyPrefix, HarmonyPatch(typeof(HSceneProc), "EndProc")] | ||
public static void EndProc(HSceneProc __instance) => GetController(__instance.flags.lstHeroine[0].chaCtrl).HSceneEnd(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{7B514B4E-A0BC-4DA9-B2A8-0B72515E8033}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>KK_EyeShaking</RootNamespace> | ||
<AssemblyName>KK_EyeShaking</AssemblyName> | ||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<Deterministic>true</Deterministic> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>embedded</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>..\bin\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<DebugSymbols>true</DebugSymbols> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="0Harmony"> | ||
<HintPath>..\lib\0Harmony.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="Assembly-CSharp"> | ||
<HintPath>..\lib\Assembly-CSharp.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="BepInEx"> | ||
<HintPath>..\lib\BepInEx.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="KKAPI"> | ||
<HintPath>..\lib\KKAPI.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="UnityEngine"> | ||
<HintPath>..\lib\UnityEngine.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="KK_EyeShaking.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<PropertyGroup> | ||
<PostBuildEvent>if exist C:\Illusion\Koikatu\BepInEx ( | ||
copy /y $(TargetPath) C:\illusion\Koikatu\BepInEx\$(TargetFileName) | ||
)</PostBuildEvent> | ||
</PropertyGroup> | ||
</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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("KK_EyeShaking")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("KK_EyeShaking")] | ||
[assembly: AssemblyCopyright("Copyright © 2019")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("7b514b4e-a0bc-4da9-b2a8-0b72515e8033")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion(KK_EyeShaking.KK_EyeShaking.Version)] | ||
[assembly: AssemblyFileVersion(KK_EyeShaking.KK_EyeShaking.Version)] |
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