Exemplo n.º 1
0
        protected override void OnReload(GameMode currentGameMode, bool maintainState)
        {
            danTargetsValid = false;

            PluginData data = GetExtendedData();

            float lengthSquish        = DefaultLengthSquish;
            float girthSquish         = DefaultGirthSquish;
            float squishThreshold     = DefaultSquishThreshold;
            float colliderRadiusScale = DefaultColliderRadiusScale;
            float colliderLengthScale = DefaultColliderLengthScale;

            ControllerOptions.AutoTarget autoTarget = DefaultDanAutoTarget;
            float maxPush          = DefaultMaxOralPush;
            float maxPull          = DefaultMaxOralPull;
            float pullRate         = DefaultOralPullRate;
            float returnRate       = DefaultReturnRate;
            bool  enableBellyBulge = false;
            float bellyBulgeScale  = 1.0f;

            if (data != null)
            {
                if (data.data.TryGetValue("Enabled", out var Enabled))
                {
                    enabled = (bool)Enabled;
                }

                if (data.data.TryGetValue("LengthSquish", out var LengthSquish))
                {
                    lengthSquish = (float)LengthSquish;
                }

                if (data.data.TryGetValue("GirthSquish", out var GirthSquish))
                {
                    girthSquish = (float)GirthSquish;
                }

                if (data.data.TryGetValue("SquishThreshold", out var SquishThreshold))
                {
                    squishThreshold = (float)SquishThreshold;
                }

                if (data.data.TryGetValue("ColliderRadiusScale", out var ColliderRadiusScale))
                {
                    colliderRadiusScale = (float)ColliderRadiusScale;
                }

                if (data.data.TryGetValue("ColliderLengthScale", out var ColliderLengthScale))
                {
                    colliderLengthScale = (float)ColliderLengthScale;
                }

                if (data.data.TryGetValue("DanAutoTarget", out var DanAutoTarget))
                {
                    autoTarget = (ControllerOptions.AutoTarget)DanAutoTarget;
                }

                if (data.data.TryGetValue("MaxPush", out var MaxPush))
                {
                    maxPush = (float)MaxPush;
                }

                if (data.data.TryGetValue("MaxPull", out var MaxPull))
                {
                    maxPull = (float)MaxPull;
                }

                if (data.data.TryGetValue("PullRate", out var PullRate))
                {
                    pullRate = (float)PullRate;
                }

                if (data.data.TryGetValue("ReturnRate", out var ReturnRate))
                {
                    returnRate = (float)ReturnRate;
                }

                if (data.data.TryGetValue("EnableBellyBulge", out var EnableBellyBulge))
                {
                    enableBellyBulge = (bool)EnableBellyBulge;
                }

                if (data.data.TryGetValue("BellyBulgeScale", out var BellyBulgeScale))
                {
                    bellyBulgeScale = (float)BellyBulgeScale;
                }
            }

            danOptions        = new DanOptions(colliderRadiusScale, colliderLengthScale, lengthSquish, girthSquish, squishThreshold, false, 10.0f);
            collisionOptions  = new CollisionOptions(maxPush, maxPull, pullRate, returnRate, enableBellyBulge, bellyBulgeScale);
            controllerOptions = new ControllerOptions(autoTarget);
            cardReloaded      = true;

            base.OnReload(currentGameMode, maintainState);
        }