Esempio n. 1
0
            internal static void DisplayHSubtitle(LoadAudioBase voice)
            {
                List <HActionBase> lstProc = (List <HActionBase>)AccessTools.Field(HSceneType, "lstProc").GetValue(HSceneInstance);
                HFlag       flags          = (HFlag)Traverse.Create(HSceneInstance).Field("flags").GetValue();
                HActionBase mode           = lstProc[(int)flags.mode];
                HVoiceCtrl  voicectrl      = (HVoiceCtrl)AccessTools.Field(typeof(HActionBase), "voice").GetValue(mode);

                //At the start of the H scene, all the text was loaded. Look through the loaded stuff and find the text for the current spoken voice.
                foreach (var a in voicectrl.dicVoiceIntos)
                {
                    foreach (var b in a)
                    {
                        foreach (var c in b.Value)
                        {
                            var text = c.Value.Where(x => x.Value.pathAsset == voice.assetBundleName && x.Value.nameFile == voice.assetName).Select(x => x.Value.word).FirstOrDefault();
                            if (!text.IsNullOrEmpty())
                            {
                                if (HSceneType == typeof(HSceneProc))
                                {
                                    DisplaySubtitle(voice.gameObject, text);
                                }
                                else
                                {
                                    DisplayVRSubtitle(voice.gameObject, text);
                                }
                                return;
                            }
                        }
                    }
                }
            }
Esempio n. 2
0
        internal static void DisplayHSubtitle(LoadVoice voice)
        {
            List <HActionBase> lstProc   = (List <HActionBase>)AccessTools.Field(typeof(HSceneProc), "lstProc").GetValue(KK_Subtitles.HSceneProcInstance);
            HActionBase        mode      = lstProc[(int)KK_Subtitles.HSceneProcInstance.flags.mode];
            HVoiceCtrl         voicectrl = (HVoiceCtrl)AccessTools.Field(typeof(HActionBase), "voice").GetValue(mode);

            //At the start of the H scene, all the text was loaded. Look through the loaded stuff and find the text for the current spoken voice.
            string text = "";

            FindText();
            void FindText()
            {
                foreach (var a in voicectrl.dicVoiceIntos)
                {
                    foreach (var b in a)
                    {
                        foreach (var c in b.Value)
                        {
                            text = c.Value.Where(x => x.Value.pathAsset == voice.assetBundleName && x.Value.nameFile == voice.assetName).Select(x => x.Value.word).FirstOrDefault();
                            if (!text.IsNullOrEmpty())
                            {
                                return;
                            }
                        }
                    }
                }
            }

            if (text.IsNullOrEmpty())
            {
                return;
            }

            DisplaySubtitle(voice, text);
        }
Esempio n. 3
0
            internal static void DisplayHSubtitle(string asset, string bundle, GameObject voiceObject)
            {
                List <HActionBase> lstProc = (List <HActionBase>)AccessTools.Field(typeof(HSceneProc), "lstProc").GetValue(HSceneInstance);
                HFlag       flags          = (HFlag)Traverse.Create(HSceneInstance).Field("flags").GetValue();
                HActionBase mode           = lstProc[(int)flags.mode];
                HVoiceCtrl  voicectrl      = (HVoiceCtrl)AccessTools.Field(typeof(HActionBase), "voice").GetValue(mode);

                //At the start of the H scene, all the text was loaded. Look through the loaded stuff and find the text for the current spoken voice.
                foreach (var a in voicectrl.dicVoiceIntos)
                {
                    foreach (var b in a)
                    {
                        foreach (var c in b.Value)
                        {
                            var text = c.Value.Where(x => x.Value.pathAsset == bundle && x.Value.nameFile == asset).Select(x => x.Value.word).FirstOrDefault();
                            if (!text.IsNullOrEmpty())
                            {
                                // try to replace name tags in subtitle ([P], etc.) before displaying
                                DisplaySubtitle(voiceObject, PrepareSubtitle(text));
                                return;
                            }
                        }
                    }
                }
            }
Esempio n. 4
0
 public ProcBase(DeliveryMember _delivery)
 {
     this.ctrlFlag        = _delivery.ctrlFlag;
     this.chaMales        = _delivery.chaMales;
     this.chaFemales      = _delivery.chaFemales;
     this.fade            = _delivery.fade;
     this.ctrlMeta        = _delivery.ctrlMeta;
     this.sprite          = _delivery.sprite;
     this.item            = _delivery.item;
     this.feelHit         = _delivery.feelHit;
     this.auto            = _delivery.auto;
     this.voice           = _delivery.voice;
     this.particle        = _delivery.particle;
     this.se              = _delivery.se;
     this.lstMotionIK     = _delivery.lstMotionIK;
     this.AtariEffect     = _delivery.AtariEffect;
     this.FeelHitEffect3D = _delivery.FeelHitEffect3D;
     this.Hitem           = (HSceneSpriteHitem)this.sprite.objHItem.GetComponent <HSceneSpriteHitem>();
     if (Object.op_Equality((Object)ProcBase.hSceneManager, (Object)null))
     {
         ProcBase.hSceneManager = Singleton <HSceneManager> .Instance;
     }
     for (int index = 0; index < 2; ++index)
     {
         this.randVoicePlays[index] = new ShuffleRand(-1);
         this.randVoicePlays[index].Init(index != 0 ? 2 : 3);
     }
     ObservableExtensions.Subscribe <bool>(Observable.Where <bool>((IObservable <M0>) this.isAtariHit, (Func <M0, bool>)(x => this.isAtariHitOld != x && this.CatID != 1)), (Action <M0>)(x =>
     {
         if (this.CatID == 7 && Singleton <HSceneFlagCtrl> .Instance.nowAnimationInfo.ActionCtrl.Item2 == 1 || Singleton <HSceneFlagCtrl> .Instance.nowAnimationInfo.ActionCtrl.Item2 == 2)
         {
             return;
         }
         this.isAtariHitOld = x;
         if (x)
         {
             this.AtariEffect.Play();
             if (!Singleton <HSceneManager> .Instance.isParticle)
             {
                 return;
             }
             this.FeelHitEffect3D.Play();
         }
         else
         {
             this.AtariEffect.Stop();
             this.FeelHitEffect3D.Stop();
         }
     }));
 }
        internal static void DisplayHSubtitle(LoadVoice voice)
        {
            List <HActionBase> lstProc   = (List <HActionBase>)AccessTools.Field(typeof(HSceneProc), "lstProc").GetValue(KK_Subtitles.HSceneProcInstance);
            HActionBase        mode      = lstProc[(int)KK_Subtitles.HSceneProcInstance.flags.mode];
            HVoiceCtrl         voicectrl = (HVoiceCtrl)AccessTools.Field(typeof(HActionBase), "voice").GetValue(mode);

            //At the start of the H scene, all the text was loaded. Look through the loaded stuff and find the text for the current spoken voice.
            string text = "";

            FindText();
            void FindText()
            {
                foreach (var a in voicectrl.dicVoiceIntos)
                {
                    foreach (var b in a)
                    {
                        foreach (var c in b.Value)
                        {
                            text = c.Value.Where(x => x.Value.pathAsset == voice.assetBundleName && x.Value.nameFile == voice.assetName).Select(x => x.Value.word).FirstOrDefault();
                            if (!text.IsNullOrEmpty())
                            {
                                return;
                            }
                        }
                    }
                }
            }

            if (text.IsNullOrEmpty())
            {
                return;
            }

            if (KK_Subtitles.showUntranslated.Value == false)
            {
                foreach (var x in text.ToList())
                {
                    if (JPChars.Contains(x))
                    {
                        return;
                    }
                }
            }

            //string speaker = voice.voiceTrans.gameObject.GetComponentInParent<ChaControl>().chaFile.parameter.firstname;

            DisplaySubtitle(voice, text);
        }
Esempio n. 6
0
        private void Update()
        {
            if (voiceCtrl == null)
            {
                voiceCtrl = FindObjectOfType <HVoiceCtrl>();
                if (voiceCtrl == null)
                {
                    return;
                }
            }

            if (bvs.Count() == 0)
            {
                ReloadBlendValues();
            }

            float curDistance = Vector3.Distance(myMouth.transform.position, tang.transform.position);
            float threshold;

            if (flags.mode == HFlag.EMode.aibu)
            {
                threshold = CyuLoaderVR.KissDistanceAibu.Value;

                if (((VRHandCtrl[])hands).Any((VRHandCtrl h) => h.IsAction()))
                {
                    isAibuTouching = true;
                }
                else
                {
                    isAibuTouching = false;
                }
            }
            else
            {
                threshold = CyuLoaderVR.KissDistance.Value;
            }


            if (flags.click == HFlag.ClickKind.inside || flags.click == HFlag.ClickKind.outside)
            {
                isInOrgasm = true;
            }

            //If currently in o****m, stop kissing immediately without disengaging transition to prevent interferring with o****m animation or voice
            if (isInOrgasm)
            {
                Kiss(false, immediateStop: true);
            }
            else if (curDistance < threshold)
            {
                if (flags.mode != HFlag.EMode.aibu || (!kissing && !IsSiruActive()))
                {
                    Kiss(true);
                }
                //Continue kissing if currently transitioning into kiss, or if within distance threshold
                //The distance threshold is larger when groping to allow some eye candy
                else if (curDistance < (isAibuTouching ? (ExitKissDistance + 0.04f) : ExitKissDistance) || kissPhase == Phase.Engaging)
                {
                    Kiss(true);
                }
                else
                {
                    Kiss(false);
                }
            }
            else
            {
                Kiss(false);
            }

            //Stop girl from speaking lines and manually proc breath/moan sounds
            //when she is not in o****m and is still kissing or saliva string still visible
            if (!isInOrgasm && (kissing || IsSiruActive()))
            {
                voiceCtrl.isPrcoStop = true;

                //Manually proc breath sound every frame causes eyes flickering when initiating kissing during transition of releasing a body part in caress mode
                //This makes sure breath proc is not run when approaching to kiss in caress mode
                if (flags.mode == HFlag.EMode.aibu ? kissPhase > Phase.Engaging : true)
                {
                    breathProcDelegate.Invoke(voiceCtrl, female.animBody.GetCurrentAnimatorStateInfo(0), female, 0);
                }
            }
            else
            {
                voiceCtrl.isPrcoStop = false;
            }

            if (kissing)
            {
                if (flags.mode == HFlag.EMode.aibu)
                {
                    //Use configured value (KissMotionSpeed) to control animation speed during kissing in caress mode
                    //Increase animation speed further if GropeOverride is set to true and groping motion is larger than KissMotionSpeed
                    if (CyuLoaderVR.GropeOverride.Value && kissPhase == Phase.InAction && isAibuTouching)
                    {
                        //Use the higher value between dragSpeed(value based on controller movement) and speedItem(game calculated value) to set kissing animation speed
                        //Then make sure the speed value used for calculating animation speed is reset to a minimum
                        //so that it doesn't get stuck at a high value, causing kissing animation speed to also be stuck at a high value.
                        flags.SpeedUpClickAibu(flags.rateDragSpeedUp, Mathf.Clamp(Mathf.Max(dragSpeed, flags.speedItem), CyuLoaderVR.KissMotionSpeed.Value, 1.5f), true);

                        dragSpeed = 0.0001f;
                    }
                    else
                    {
                        flags.SpeedUpClickAibu(flags.rateDragSpeedUp, CyuLoaderVR.KissMotionSpeed.Value, true);
                    }
                }

                //While kissing, assigns HFlag.finish to none to prevent o****m, while storing the finish flag in origFinishFlag to be assigned back to the game after kissing
                if (flags.finish != HFlag.FinishKind.none)
                {
                    origFinishFlag = flags.finish;
                    flags.finish   = HFlag.FinishKind.none;
                }

                flags.DragStart();
            }
            else
            {
                //Outside of kissing, restore finish flag from origFinishFlag to resume o****m
                if (origFinishFlag != HFlag.FinishKind.none)
                {
                    flags.finish   = origFinishFlag;
                    origFinishFlag = HFlag.FinishKind.none;
                }

                female.ChangeEyesBlinkFlag(true);
            }
        }
Esempio n. 7
0
        static bool SpankingAutoProc(int _state, Spnking __instance)
        {
            HSceneFlagCtrl ctrlFlag = Singleton <HSceneFlagCtrl> .Instance;

            if (ctrlFlag.initiative == 0)
            {
                return(true);
            }
            HVoiceCtrl   voice  = (HVoiceCtrl)voiceFieldInfo.GetValue(__instance);
            HSceneSprite sprite = (HSceneSprite)spriteFieldInfo.GetValue(__instance);

            ChaControl[]  chaFemales     = (ChaControl[])chaFemalesFieldInfo.GetValue(__instance);
            ShuffleRand[] randVoicePlays = (ShuffleRand[])randVoicePlaysFieldInfo.GetValue(__instance);

            if (!ctrlFlag.stopFeelFemale)
            {
                ctrlFlag.feel_f = Mathf.Clamp01(ctrlFlag.feel_f - ctrlFlag.guageDecreaseRate * Time.deltaTime);
            }
            if (_state == 1 && ctrlFlag.feel_f < 0.5f)
            {
                playMethodInfo.Invoke(__instance, new object[] { "WIdle", false });
                voice.HouchiTime = 0f;
                return(true);
            }
            if (!GeneralHooks.SpankTimer.IsTime())
            {
                return(false);
            }
            else
            {
                GeneralHooks.SpankTimer.Reset();
            }
            if (voice.nowVoices[0].state == HVoiceCtrl.VoiceKind.voice || voice.nowVoices[0].state == HVoiceCtrl.VoiceKind.startVoice)
            {
                Voice.Stop(ctrlFlag.voice.voiceTrs[0]);
                voice.ResetVoice();
            }

            string scene = "D_Action";

            switch (_state)
            {
            case 1:
                scene = "SAction";
                break;

            case 0:
                scene = "WAction";
                break;
            }

            playMethodInfo.Invoke(__instance, new object[] { scene, false });

            upFeelFieldInfo.SetValue(__instance, true);
            float value = Mathf.Clamp01(chaFemales[0].siriAkaRate + ctrlFlag.siriakaAddRate);

            chaFemales[0].ChangeSiriAkaRate(value);
            timeFeelUpFieldInfo.SetValue(__instance, 0f);
            backupFieldInfo.SetValue(__instance, ctrlFlag.feel_f);
            backupFeelFieldInfo.SetValue(__instance, ctrlFlag.feelPain);
            ctrlFlag.isNotCtrl = false;
            if (randVoicePlays[0].Get() == 0)
            {
                ctrlFlag.voice.playVoices[0] = true;
            }
            ctrlFlag.voice.playShorts[0] = 0;

            bool isAddFeel = (bool)isAddFieldInfo.GetValue(__instance);

            if (!isAddFeel && ctrlFlag.feel_f >= 0.70f)
            {
                SpankingAfterWaitingAnimationAutoSelector();
            }

            return(false);
        }
Esempio n. 8
0
        public static bool IsBreathPtnConditionsHook(
            ref bool __result,
            HVoiceCtrl __instance,
            List <int> _lstConditions,
            int _main)
        {
            if (!CyuLoaderVR.lstFemale[_main].GetComponent <Cyu>().IsKiss)
            {
                return(true);
            }
            bool flag = false;

            foreach (int lstCondition in _lstConditions)
            {
                if (lstCondition >= 90)
                {
                    __result = false;
                    return(false);
                }
                switch (lstCondition)
                {
                case 0:
                    if (__instance.flags.gaugeFemale < 50f)
                    {
                        __result = false;
                        return(false);
                    }
                    break;

                case 1:
                    if (__instance.flags.gaugeFemale >= 50f)
                    {
                        __result = false;
                        return(false);
                    }
                    break;

                case 2:
                    __result = false;
                    return(false);

                case 3:
                    if (__instance.flags.mode == HFlag.EMode.aibu)
                    {
                        flag = true;
                    }
                    break;

                case 4:
                    if (__instance.flags.voice.speedMotion)
                    {
                        __result = false;
                        return(false);
                    }
                    break;

                case 5:
                    if (__instance.flags.mode != 0 && !__instance.flags.voice.speedMotion)
                    {
                        __result = false;
                        return(false);
                    }
                    break;

                case 6:
                    if (__instance.flags.voice.speedItem)
                    {
                        __result = false;
                        return(false);
                    }
                    break;

                case 7:
                    if (!__instance.flags.voice.speedItem)
                    {
                        __result = false;
                        return(false);
                    }
                    break;

                case 8:
                    flag = true;
                    break;

                case 9:
                    __result = false;
                    return(false);

                case 12:
                    if (__instance.flags.mode == HFlag.EMode.aibu)
                    {
                        if (__instance.flags.speed < 0.01f)
                        {
                            __result = false;
                            return(false);
                        }
                    }
                    else if (__instance.flags.speedCalc < 0.01f)
                    {
                        __result = false;
                        return(false);
                    }
                    break;

                case 13:
                    if (__instance.flags.mode == HFlag.EMode.aibu)
                    {
                        if (__instance.flags.speed >= 0.01f)
                        {
                            __result = false;
                            return(false);
                        }
                    }
                    else if (__instance.flags.speedCalc >= 0.01f)
                    {
                        __result = false;
                        return(false);
                    }
                    break;

                case 14:
                    if (__instance.flags.mode == HFlag.EMode.aibu)
                    {
                        flag = true;
                    }
                    if (!__instance.hands.Any((VRHandCtrl h) => h.IsAction()))
                    {
                        __result = false;
                        return(false);
                    }
                    break;

                case 15:
                    if (__instance.flags.mode == HFlag.EMode.aibu)
                    {
                        flag = true;
                    }
                    if (__instance.hands.Any((VRHandCtrl h) => h.IsAction()))
                    {
                        __result = false;
                        return(false);
                    }
                    break;
                }
            }
            if (flag)
            {
                __result = true;
                return(false);
            }
            __result = false;
            return(false);
        }