Skip to content

Commit

Permalink
make the random part of H reaction group configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye-e committed Feb 5, 2023
1 parent fafb3e8 commit 4d3f420
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
17 changes: 16 additions & 1 deletion RG_HSceneCrowdReaction/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ internal class Config
internal static bool SexExpPrerequisite { get { return _sexExpPrerequisite.Value; } }
private static ConfigEntry<bool> _sexExpPrerequisite;

internal static bool RandomChangeAnimation { get { return _randomChangeAnimation.Value; } }
private static ConfigEntry<bool> _randomChangeAnimation;

internal static int AnimationChangeInterval { get { return _animationChangeInterval.Value; } }
private static ConfigEntry<int> _animationChangeInterval;

internal static bool EnableSeriousAwkward { get { return _enableSeriousAwkward.Value; } }
private static ConfigEntry<bool> _enableSeriousAwkward;

Expand Down Expand Up @@ -68,7 +74,8 @@ internal static void Init(BasePlugin plugin)
_enableStandardMasturbation = plugin.Config.Bind(STANDARD_REACTION, "Enable Masturbation reaction", true,
"If false, Masturbation reaction will not be included in the possible reaction list");
_masturbationLibidoThreshold = plugin.Config.Bind(STANDARD_REACTION, "Masturbation Libido Threshold", Settings.DefaultLibidoThreshold,
"Range: 0 to 100. The lower the value it is, the easier for masturbation reaction to be included");
new ConfigDescription("Range: 0 to 100. The lower the value it is, the easier for masturbation reaction to be included", new AcceptableValueRange<int>(0, 100))
);
_enableStandardCry = plugin.Config.Bind(STANDARD_REACTION, "Enable Cry reaction", true,
"If false, Cry reaction will not be included in the possible reaction list");
_standardCryPrerequisite = plugin.Config.Bind(STANDARD_REACTION, "Cry reaction requirement", true,
Expand All @@ -84,6 +91,14 @@ internal static void Init(BasePlugin plugin)
+ "For MMF, the male character need to have sex with both female beforehand\n"
+ "For FFM, the female character need to have sex with both male beforehand"
);
_randomChangeAnimation = plugin.Config.Bind(H_REACTION, "Random Animation Change", false,
"If true, the pair/group will change their sex animation over time (requires H scene restart)\n"
);

_animationChangeInterval = plugin.Config.Bind(H_REACTION, "Animation Change Interval", Settings.DefaultHActionMinSecond,
new ConfigDescription("The minimum time in seconds needed for the pair/group to switch to another sex animation or change the speed (requires H scene restart)", new AcceptableValueRange<int>(10, 100))
);

}

internal enum HAnimMatchingType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ internal static void InitHScene(HScene hScene)
StateManager.Instance.MainSceneAnimationInfo = null;
StateManager.Instance.MotionChangeSelectedCategory = -1;
StateManager.Instance.MainSceneHEventID = -1;

StateManager.Instance.ConfigRandomAnimationChange = Config.RandomChangeAnimation;
StateManager.Instance.ConfigAnimationChangeInterval = Config.AnimationChangeInterval * 1000;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ internal static void UpdateHAnimation(Actor actor)
{
System.Random rnd = new System.Random();
int rndSexPositionResult = rnd.Next(StateManager.Instance.ActorHAnimationList[actor.GetInstanceID()].changePositionFactor);
if (rndSexPositionResult > Settings.HChangePositionThreshold)
if (rndSexPositionResult > Settings.HChangePositionThreshold && StateManager.Instance.ConfigRandomAnimationChange)
{
StartHAnimation(StateManager.Instance.ActorHGroupDictionary[actor.GetInstanceID()], false);
}
Expand Down Expand Up @@ -975,7 +975,7 @@ private static void AddOrUpdateHAnimNextUpdateTime(Actor actor)
{
System.Random rnd = new System.Random();
int rndResult = rnd.Next(Settings.HActionRandomMilliSecond);
long nextUpdateTime = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) + (rndResult + Settings.HActionMinMilliSecond);
long nextUpdateTime = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) + (rndResult + StateManager.Instance.ConfigAnimationChangeInterval);

if (StateManager.Instance.ActorHAnimNextUpdateTimeDictionary.ContainsKey(actor.GetInstanceID()))
StateManager.Instance.ActorHAnimNextUpdateTimeDictionary[actor.GetInstanceID()] = nextUpdateTime;
Expand Down
4 changes: 2 additions & 2 deletions RG_HSceneCrowdReaction/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ internal class Settings
{
internal const int DefaultLibidoThreshold = 50;

internal const int HActionMinMilliSecond = 10000;
internal const int HActionRandomMilliSecond = 10000;
internal const int DefaultHActionMinSecond = 30;
internal const int HActionRandomMilliSecond = 30000;

internal const int HVoiceMaxDistance = 200;

Expand Down
3 changes: 3 additions & 0 deletions RG_HSceneCrowdReaction/StateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public StateManager()
internal int MotionChangeSelectedCategory = -1;
internal int MainSceneHEventID = -1;

internal bool ConfigRandomAnimationChange = false;
internal int ConfigAnimationChangeInterval = Settings.DefaultHActionMinSecond * 1000;

internal class HotKeyData
{
public HotKeyData()
Expand Down

0 comments on commit 4d3f420

Please sign in to comment.