static void MultiPlay_F2M1SpeedGambit(MultiPlay_F2M1 __instance)
        {
            if (!HS2TakeChargePlugin.Instance.AnimationOverrideActive() && HS2TakeChargePlugin.Instance.ManualSpeedAdder == 0f)
            {
                return;
            }

            ChaControl[] chaFemales = (ChaControl[])chaFemalesFieldInfo.GetValue(__instance);
            ChaControl[] chaMales   = (ChaControl[])chaMalesFieldInfo.GetValue(__instance);
            HItemCtrl    item       = (HItemCtrl)itemFieldInfo.GetValue(__instance);

            if (HS2TakeChargePlugin.Instance.AnimationOverrideActive())
            {
                for (int j = 0; j < chaFemales.Length; j++)
                {
                    if (chaFemales[j].visibleAll && !(chaFemales[j].objTop == null))
                    {
                        chaFemales[j].setAnimatorParamFloat("speed", AnimationStatus.FemaleSpeed);
                        if (AnimationStatus.FemaleOffset != 0)
                        {
                            chaFemales[j].animBody.Play(AnimationStatus.PlayingAnimation, 0, (chaMales[0].animBody.GetCurrentAnimatorStateInfo(0).normalizedTime + AnimationStatus.FemaleOffset));
                        }
                    }
                }
                if (chaMales[0].objBodyBone != null)
                {
                    chaMales[0].setAnimatorParamFloat("speed", AnimationStatus.MaleSpeed);
                }
                if (item.GetItem() != null)
                {
                    item.setAnimatorParamFloat("speed", AnimationStatus.FemaleSpeed);
                }
            }
            else
            {
                float originalSpeed = (float)speedField.GetValue(animParType.GetValue(__instance));
                for (int j = 0; j < chaFemales.Length; j++)
                {
                    if (chaFemales[j].visibleAll && !(chaFemales[j].objTop == null))
                    {
                        chaFemales[j].setAnimatorParamFloat("speed", originalSpeed + HS2TakeChargePlugin.Instance.ManualSpeedAdder);
                    }
                }
                if (chaMales[0].objBodyBone != null)
                {
                    chaMales[0].setAnimatorParamFloat("speed", originalSpeed + HS2TakeChargePlugin.Instance.ManualSpeedAdder);
                }
                if (item.GetItem() != null)
                {
                    item.setAnimatorParamFloat("speed", originalSpeed + HS2TakeChargePlugin.Instance.ManualSpeedAdder);
                }
            }
        }
示例#2
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();
         }
     }));
 }
        static void MultiPlay_F2M1AnimOffset(MultiPlay_F2M1 __instance, string _playAnimation)
        {
            AnimationStatus.PlayingAnimation = _playAnimation;
            ChaControl[] chaFemales = (ChaControl[])chaFemalesFieldInfo.GetValue(__instance);
            ChaControl[] chaMales   = (ChaControl[])chaMalesFieldInfo.GetValue(__instance);
            HItemCtrl    item       = (HItemCtrl)itemFieldInfo.GetValue(__instance);

            if (AnimationStatus.FemaleSpeedTween != null)
            {
                AnimationStatus.AnimSequence.Kill();
                for (int j = 0; j < chaFemales.Length; j++)
                {
                    if (chaFemales[j].visibleAll && !(chaFemales[j].objTop == null))
                    {
                        chaFemales[j].setAnimatorParamFloat("speed", 0f);
                    }
                }
                if (chaMales[0].objBodyBone != null)
                {
                    chaMales[0].setAnimatorParamFloat("speed", 0f);
                }
                if (item.GetItem() != null)
                {
                    item.setAnimatorParamFloat("speed", 0f);
                }
                //            HS2TakeChargePlugin.Instance.Log.LogInfo(string.Format("Status: {0} {1} Female Sp: {2} Time: {3} Male Time: {4}", AnimationStatus.AnimSequence.IsPlaying(), AnimationStatus.PlayingAnimation, AnimationStatus.FemaleSpeed, chaFemales[0].animBody.GetCurrentAnimatorStateInfo(0).normalizedTime, chaMales[0].animBody.GetCurrentAnimatorStateInfo(0).normalizedTime));
            }

            TCAnimationTiming timing = HS2TakeChargePlugin.Instance.RuleSet.Timing(Singleton <HSceneFlagCtrl> .Instance.nowAnimationInfo.nameAnimation, PositionCategories.MULTI_F2M1.ToString(), MultiPlay_F2M1StageSwitch());

            AnimationStatus.FemaleSpeed  = timing.minSpeed;
            AnimationStatus.MaleSpeed    = timing.minSpeed;
            AnimationStatus.FemaleOffset = timing.minFemaleOffset;

            AnimationStatus.FemaleSpeedTween  = DOTween.To(() => AnimationStatus.FemaleSpeed, newSpeed => AnimationStatus.FemaleSpeed = newSpeed, timing.maxSpeed, timing.speedLoopTime).SetEase(timing.SpeedEaseEnum());
            AnimationStatus.MaleSpeedTween    = DOTween.To(() => AnimationStatus.MaleSpeed, newSpeed => AnimationStatus.MaleSpeed = newSpeed, timing.maxSpeed, timing.speedLoopTime).SetEase(timing.SpeedEaseEnum());
            AnimationStatus.FemaleOffsetTween = DOTween.To(() => AnimationStatus.FemaleOffset, newOffset => AnimationStatus.FemaleOffset = newOffset, timing.maxFemaleOffset, timing.femaleOffsetLoopTime).SetEase(timing.FemaleOffsetEaseEnum());
            AnimationStatus.AnimSequence      = DOTween.Sequence();
            AnimationStatus.AnimSequence.Insert(0, AnimationStatus.FemaleSpeedTween);
            AnimationStatus.AnimSequence.Insert(0, AnimationStatus.MaleSpeedTween);
            AnimationStatus.AnimSequence.Insert(0, AnimationStatus.FemaleOffsetTween);
            AnimationStatus.AnimSequence.SetLoops(-1, timing.LoopTypeEnum());
        }
        public static void SwitchAnimations(string playAnimation)
        {
            HItemCtrl ctrlItem = hSceneTrav?.Field("ctrlItem").GetValue <HItemCtrl>();

            YureCtrl[] ctrlYures = hSceneTrav?.Field("ctrlYures").GetValue <YureCtrl[]>();

            if (femaleCharacters == null || femaleCharacters[0] == null)
            {
                return;
            }

            femaleCharacters[0].setPlay(playAnimation, 0);
            MotionIKDataBinder ikBinder = femaleCharacters[0].GetComponent <MotionIKDataBinder>();

            if (ikBinder != null)
            {
                ikBinder.motionIK.Calc(playAnimation);
            }

            if (hProcMode != (int)ProcMode.Peeping && hScene.RootmotionOffsetF != null && hScene.RootmotionOffsetF[0] != null)
            {
                hScene.RootmotionOffsetF[0].Set(playAnimation);
            }

            if (hProcMode == (int)ProcMode.MultiPlay_F2M1 || hProcMode == (int)ProcMode.Les)
            {
                if (femaleCharacters[1] != null && femaleCharacters[1].visibleAll && femaleCharacters[1].objTop != null)
                {
                    femaleCharacters[1].animBody.Play(playAnimation, 0, 0f);
                    hScene.RootmotionOffsetF[1].Set(playAnimation);
                    ikBinder = femaleCharacters[1].GetComponent <MotionIKDataBinder>();
                    if (ikBinder != null)
                    {
                        ikBinder.motionIK.Calc(playAnimation);
                    }
                }
            }

            if (maleCharacters != null && maleCharacters[0] != null)
            {
                if (hProcMode == (int)ProcMode.Masturbation)
                {
                    if (!hFlagCtrl.nowAnimationInfo.fileMale.IsNullOrEmpty() && maleCharacters[0].objBodyBone != null && maleCharacters[0].animBody.runtimeAnimatorController != null)
                    {
                        maleCharacters[0].setPlay(playAnimation, 0);
                        ikBinder = maleCharacters[0].GetComponent <MotionIKDataBinder>();
                        if (ikBinder != null)
                        {
                            ikBinder.motionIK.Calc(playAnimation);
                        }
                    }
                }
                else if (hProcMode == (int)ProcMode.MultiPlay_F1M2)
                {
                    for (int i = 0; i < maleCharacters.Count; i++)
                    {
                        if (!(maleCharacters[i] == null || maleCharacters[i].objTop == null))
                        {
                            maleCharacters[i].setPlay(playAnimation, 0);
                            hScene.RootmotionOffsetM[i].Set(playAnimation);
                            ikBinder = maleCharacters[i].GetComponent <MotionIKDataBinder>();
                            if (ikBinder != null)
                            {
                                ikBinder.motionIK.Calc(playAnimation);
                            }
                        }
                    }
                }
                else if (hProcMode != (int)ProcMode.Peeping && hProcMode != (int)ProcMode.Les)
                {
                    if (maleCharacters[0].objTop != null && maleCharacters[0].visibleAll)
                    {
                        maleCharacters[0].setPlay(playAnimation, 0);
                        hScene.RootmotionOffsetM[0].Set(playAnimation);
                        ikBinder = maleCharacters[0].GetComponent <MotionIKDataBinder>();
                        if (ikBinder != null)
                        {
                            ikBinder.motionIK.Calc(playAnimation);
                        }
                    }
                }
            }

            if (ctrlItem != null)
            {
                ctrlItem.setPlay(playAnimation);
            }

            if (ctrlYures != null && ctrlYures[0] != null)
            {
                ctrlYures[0].Proc(playAnimation);
            }

            if (hProcMode == (int)ProcMode.Les && hProcMode == (int)ProcMode.MultiPlay_F2M1)
            {
                if (ctrlYures[1] != null && femaleCharacters[1].visibleAll && femaleCharacters[1].objTop != null)
                {
                    ctrlYures[1].Proc(playAnimation);
                }
            }

            if (hFlagCtrl.voice.changeTaii)
            {
                hFlagCtrl.voice.changeTaii = false;
            }
        }