Ejemplo n.º 1
0
 public override void Unload()
 {
     CloneSpawner.Unload();
     WaterDrowningController.Unload();
     TimeField.Unload();
     MarioClearPipe.Unload();
     DreamDashController.Unload();
 }
Ejemplo n.º 2
0
        private Boolean PlayerInside()
        {
            TimeField field  = GetValueOrNull(lingeringTarget);
            Player    player = GetValueOrNull(targetPlayer);

            if (player == null)
            {
                return(false);
            }

            if (lingering)
            {
                return(this == field || this.CollideCheck(player));
            }
            else
            {
                return(this.CollideCheck(player));
            }
        }
Ejemplo n.º 3
0
        private void UpdateTimeRate()
        {
            TimeField field  = GetValueOrNull(lingeringTarget);
            Player    player = GetValueOrNull(targetPlayer);

            bool playerInside = PlayerInside();

            if (field?.respectOtherTimeRates == true && (Engine.TimeRate != ourLastTimeRate) && Engine.TimeRate > 0f)
            {
                baseTimeRate = Engine.TimeRate;
            }

            if (field == this && !playerInside)
            {
                Engine.TimeRate = baseTimeRate;
            }

            if (field == this && playerInside && targetPlayer != null && !player.Dead)
            {
                // The lerp updates should be in realtime, not ingame time
                float dt    = Engine.RawDeltaTime * baseTimeRate;
                float delta = PlayerMoving() ? dt / startTime : -dt / stopTime;

                lerp            = Calc.Clamp(lerp + delta, 0, 1);
                Engine.TimeRate = (stop + (start - stop) * lerp);

                if (field.playerAffected)
                {
                    playerTimeRate = Engine.TimeRate;
                }
            }

            if (player != null && player.Dead)
            {
                Engine.TimeRate = baseTimeRate;
            }

            ourLastTimeRate = Engine.TimeRate;
        }