Example #1
0
 // Token: 0x06001B82 RID: 7042
 public override void UpdateState()
 {
     if (base.CurrentStateTime >= this.m_shootDelay && !this.m_hasShot)
     {
         this.m_hasShot = true;
         if (this.m_shootEffect)
         {
             this.m_shootEffect.Spawn(null);
         }
         if (this.m_shootSound)
         {
             this.m_shootSound.Play();
         }
         Projectile projectile = this.m_projectileSpawner.SpawnProjectile();
         Vector3    b          = RandomizerBonusSkill.TimeScale(projectile.Direction * projectile.Speed * this.m_shootDelay + Vector3.down * projectile.Gravity * this.m_shootDelay * this.m_shootDelay * 0.5f);
         projectile.Position    += b;
         projectile.SpeedVector += Vector3.down * projectile.Gravity * this.m_shootDelay;
         projectile.GetComponent <DamageDealer>().Damage = this.m_projectileDamage;
         Vector3 vector = this.m_projectileAnimationPosition - projectile.Position;
         vector.z                = 0f;
         projectile.Position    += vector;
         projectile.Displacement = vector;
     }
     base.UpdateState();
 }
    // Token: 0x060031DD RID: 12765 RVA: 0x000D060C File Offset: 0x000CE80C
    public void UpdateVelocity()
    {
        Vector3 vector = -Vector3.ClampMagnitude(this.Displacement / Time.deltaTime, 10f);

        this.Displacement      += vector * Time.deltaTime;
        this.Rigidbody.velocity = RandomizerBonusSkill.TimeScale(this.Direction * this.Speed + vector);
    }
 // Token: 0x06001922 RID: 6434
 public new void FixedUpdate()
 {
     base.FixedUpdate();
     if (base.IsSuspended)
     {
         return;
     }
     this.PlatformMovement.LocalSpeedY -= RandomizerBonusSkill.TimeScale(Time.deltaTime) * this.Settings.Gravity;
     if (this.PlatformMovement.LocalSpeedY < -this.Settings.MaxFallSpeed)
     {
         this.PlatformMovement.LocalSpeedY = -this.Settings.MaxFallSpeed;
     }
     if (this.PlatformMovement.IsOnCeiling)
     {
         this.PlatformMovement.LocalSpeedY = Mathf.Min(0f, this.PlatformMovement.LocalSpeedY);
     }
     this.UpdateRotation();
     if (Characters.Sein)
     {
         this.m_playerSmoothSpeed = Vector3.Lerp(this.m_playerSmoothSpeed, Characters.Sein.Speed, 0.1f);
     }
     if (base.IsInWater)
     {
         base.Drown();
     }
 }
    // Token: 0x06001AA8 RID: 6824
    public new void FixedUpdate()
    {
        base.FixedUpdate();
        if (base.IsSuspended)
        {
            return;
        }
        bool flag;

        if (this.PlatformMovement.MovingHorizontally && EnemyStopper.InsideEnemyStopper(base.Position, (!base.FaceLeft) ? Vector3.right : Vector3.left, out flag))
        {
            base.FaceLeft = !base.FaceLeft;
            if (this.Controller.StateMachine.CurrentState == this.State.RunBack)
            {
                this.Controller.StateMachine.ChangeState(this.State.SpitterEnemyCharging);
            }
        }
        if (!this.PlatformMovement.IsSuspended && this.PlatformMovement.IsInAir)
        {
            this.PlatformMovement.LocalSpeedY -= this.Settings.Gravity * RandomizerBonusSkill.TimeScale(Time.deltaTime);
        }
        this.UpdateRotation();
        if (base.IsInWater)
        {
            base.Drown();
        }
        if (this.WilhelmScreamZoneRectanglesContain(base.transform.position) && !this.m_hasEnteredZone && this.EnterZoneAction)
        {
            this.m_hasEnteredZone = true;
            BingoController.OnScream();
            this.EnterZoneAction.Perform(null);
        }
    }
    // Token: 0x060019CD RID: 6605
    public override void UpdateState()
    {
        float          accelerationDuration           = this.RammingEnemy.Settings.AccelerationDuration;
        AnimationCurve runningSpeedMultipliedOverTime = this.RammingEnemy.Settings.RunningSpeedMultipliedOverTime;
        float          runSpeed = this.RammingEnemy.Settings.RunSpeed;

        this.GroundEnemy.PlatformMovement.LocalSpeedX = RandomizerBonusSkill.TimeScale((float)((!this.GroundEnemy.FaceLeft) ? 1 : -1) * runSpeed * runningSpeedMultipliedOverTime.Evaluate(base.CurrentStateTime / accelerationDuration));
    }
    // Token: 0x06001697 RID: 5783
    public override void UpdateState()
    {
        this.DashOwl.FlyMovement.Kickback.Stop();
        Vector3 a = this.m_dashTargetOffset * (this.DashOwl.Settings.DashCurve.Evaluate(base.CurrentStateTime + RandomizerBonusSkill.TimeScale(Time.deltaTime)) - this.DashOwl.Settings.DashCurve.Evaluate(base.CurrentStateTime));

        this.DashOwl.FlyMovement.Velocity = ((Time.deltaTime != 0f) ? (a / RandomizerBonusSkill.TimeScale(Time.deltaTime)) : Vector3.zero);
        base.UpdateState();
    }
Example #7
0
 // Token: 0x06001A54 RID: 6740
 public new void FixedUpdate()
 {
     base.FixedUpdate();
     if (!base.IsSuspended)
     {
         this.Rigidbody.velocity = RandomizerBonusSkill.TimeScale(this.SpeedOverTimeCurve.Evaluate(this.CurrentTime) * base.Direction * base.Speed);
     }
 }
Example #8
0
 // Token: 0x060018C9 RID: 6345
 public void FixedUpdate()
 {
     if (this.IsSuspended)
     {
         this.m_rigidbody.velocity = Vector3.zero;
         return;
     }
     this.Kickback.AdvanceTime();
     this.m_rigidbody.velocity = RandomizerBonusSkill.TimeScale(this.Velocity + ((!this.HasKickback) ? Vector2.zero : this.Kickback.KickbackVector));
 }
 // Token: 0x0600177C RID: 6012
 public void FixedUpdate()
 {
     if (this is Enemy)
     {
         (this as Enemy).Animation.Animator.TextureAnimator.SpeedMultiplier = RandomizerBonusSkill.TimeScale(1f);
     }
     if (this.FrustrumOptimized && !this.m_insideFrustum && this.CanBeOptimized())
     {
         base.gameObject.SetActive(false);
     }
 }
 // Token: 0x06002097 RID: 8343
 public void FixedUpdate()
 {
     this.Ground.Update();
     this.WallLeft.Update();
     this.WallRight.Update();
     this.GroundNormal                 = ((this.m_groundNormal.magnitude != 0f) ? this.m_groundNormal.normalized : Vector3.up);
     this.IsOnGround                   = (this.m_groundNormal.magnitude != 0f);
     this.m_groundNormal               = Vector3.zero;
     this.Speed.z                      = 0f;
     this.m_rigidbody.velocity         = ((!this.IsSuspended) ? RandomizerBonusSkill.TimeScale(this.Speed) : Vector3.zero);
     this.m_rigidbody.detectCollisions = true;
 }
 // Token: 0x060031D9 RID: 12761 RVA: 0x000D03CC File Offset: 0x000CE5CC
 public virtual void FixedUpdate()
 {
     if (this.IsSuspended)
     {
         this.Rigidbody.velocity = Vector3.zero;
         return;
     }
     if (this.EnableCollisionGracePeriod && this.CurrentTime > this.CollisionGracePeriod)
     {
         this.m_collider.enabled = true;
     }
     if (this.m_lastLoop == null && this.ProjectileLoop != null)
     {
         this.m_lastLoop = Sound.Play(this.ProjectileLoop.GetSound(null), base.transform.position, this.m_nullify);
         if (this.m_lastLoop)
         {
             this.m_lastLoop.AttachTo = base.transform;
         }
     }
     this.CurrentTime += Time.deltaTime;
     if (this.CurrentTime > this.MaximumLiveTime)
     {
         this.m_explode = true;
     }
     if (WaterZone.PositionInWater(this.Position))
     {
         this.m_explode = true;
     }
     if (this.Gravity > 0f)
     {
         this.SpeedVector += RandomizerBonusSkill.TimeScale(Vector3.down * this.Gravity * Time.fixedDeltaTime);
     }
     this.UpdateVelocity();
     if (this.RotateSpriteToDirection)
     {
         float num = base.transform.eulerAngles.z;
         num = Mathf.MoveTowardsAngle(num, MoonMath.Angle.AngleFromDirection(this.Direction), this.SpriteTurnSpeed * Time.deltaTime);
         base.transform.eulerAngles = new Vector3(0f, 0f, num);
     }
     if (this.m_explode)
     {
         this.ExplodeProjectile();
     }
     if (this.m_explodeLater)
     {
         this.m_explode      = true;
         this.m_explodeLater = false;
     }
 }
Example #12
0
    // Token: 0x060018E7 RID: 6375
    public void FixedUpdate()
    {
        this.m_movingGround.Update();
        this.Kickback.AdvanceTime();
        if (this.IsSuspended)
        {
            this.m_rigidbody.velocity = Vector3.zero;
            return;
        }
        float num = this.Speed;

        num += this.Kickback.CurrentKickbackSpeed;
        this.m_rigidbody.velocity = RandomizerBonusSkill.TimeScale(this.Right * num);
        Vector3 eulerAngles = base.transform.eulerAngles;

        eulerAngles = new Vector3(0f, 0f, Mathf.LerpAngle(eulerAngles.z, MoonMath.Angle.AngleFromVector(this.Right), 0.2f));
        base.transform.eulerAngles = eulerAngles;
        Vector3 vector  = base.transform.position;
        Vector2 vector2 = this.m_movingGround.CalculateDelta(base.transform);

        vector.x += RandomizerBonusSkill.TimeScale(vector2.x);
        vector.y += RandomizerBonusSkill.TimeScale(vector2.y);
        float z = eulerAngles.z;
        float b = Mathf.DeltaAngle(z, this.m_lastAngle) / Time.deltaTime;

        this.m_lastAngle            = z;
        this.CurrentAngularVelocity = Mathf.Lerp(this.CurrentAngularVelocity, b, 0.5f);
        if (Vector3.Distance(this.m_lastPosition, vector) > 0.03f)
        {
            this.m_lastPosition = vector;
            vector -= this.Down * 0.05f;
            base.transform.position = vector;
            RaycastHit raycastHit;
            if (this.m_rigidbody.SweepTest(this.Down, out raycastHit, 1f))
            {
                vector += RandomizerBonusSkill.TimeScale(this.Down * raycastHit.distance);
            }
        }
        base.transform.position = vector;
    }
Example #13
0
    // Token: 0x060017AC RID: 6060
    public void FixedUpdate()
    {
        if (this.Entity.IsSuspended)
        {
            return;
        }
        if (this.m_transManager == null)
        {
            this.m_transManager = this.StateMachine.GetTransistionManager <OnFixedUpdate>();
        }
        if (this.m_transManager == null)
        {
            return;
        }
        float deltaTime = Time.deltaTime;

        if (this.Entity is Enemy)
        {
            deltaTime = RandomizerBonusSkill.TimeScale(deltaTime);
        }
        this.StateMachine.UpdateState(deltaTime);
        this.StateMachine.CurrentTrigger = null;
        this.m_transManager.Process(this.StateMachine);
    }
 // Token: 0x060031F0 RID: 12784
 public void FixedUpdate()
 {
     if (this.IsSuspended)
     {
         return;
     }
     if (this.trueTimedDuration != null)
     {
         this.m_timedTrigger.Duration = this.trueTimedDuration.Value / RandomizerBonusSkill.TimeScale(1f);
     }
     if (InstantiateUtility.IsDestroyed(this.m_lastProjectile))
     {
         this.m_lastProjectile = null;
     }
     if (this.WaitForProjectileToBeDestroyed && !this.TimerPaused && this.m_lastProjectile != null)
     {
         this.TimerPaused = true;
     }
     if (this.WaitForProjectileToBeDestroyed && this.TimerPaused && this.m_lastProjectile == null)
     {
         this.TimerPaused = false;
     }
     this.TimeSinceLastShot += Time.deltaTime;
 }
Example #15
0
    // Token: 0x060019E9 RID: 6633
    public void UpdateLaserDirection()
    {
        if (this.Controller.NearSein)
        {
            this.m_laserRotationSpeed = Mathf.MoveTowards(this.m_laserRotationSpeed, this.DesiredLaserRotationDirection, Time.deltaTime * 4f);
        }
        float num  = this.LaserAngleOverTimeCurve.Evaluate(this.Controller.StateMachine.CurrentStateTime / this.Settings.LaserDuration);
        float num2 = this.Laser.CurrentLaserLength / this.Settings.LaserChaseSpeedDistance;
        float num3 = (!Mathf.Approximately(num2, 0f)) ? (num * this.Settings.LaserChaseSpeed / num2) : 0f;
        float num4 = MoonMath.Angle.AngleFromVector(this.m_laserDirection) + this.m_laserRotationSpeed * RandomizerBonusSkill.TimeScale(Time.deltaTime) * num3;

        this.m_laserDirection            = MoonMath.Angle.VectorFromAngle(num4);
        this.Laser.transform.eulerAngles = new Vector3(0f, 0f, num4 - 90f);
    }
 // Token: 0x06001810 RID: 6160
 public void AdvanceTime()
 {
     this.m_kickbackTimeRemaining -= RandomizerBonusSkill.TimeScale(Time.deltaTime);
 }
 // Token: 0x060031E0 RID: 12768 RVA: 0x000D0678 File Offset: 0x000CE878
 public void UpdateSpeedAndDirection()
 {
     this.Direction = this.Rigidbody.velocity.normalized;
     this.Speed     = RandomizerBonusSkill.TimeScale(this.Rigidbody.velocity.magnitude);
 }
 // Token: 0x0600207E RID: 8318
 public void FixedUpdate()
 {
     if (this.IsSuspended)
     {
         this.m_rigidbody.velocity = Vector3.zero;
         if (this.m_rigidbody.detectCollisions)
         {
             this.m_rigidbody.detectCollisions = false;
             return;
         }
     }
     else
     {
         if (!this.m_rigidbody.detectCollisions)
         {
             this.m_rigidbody.detectCollisions = true;
         }
         base.PreFixedUpdate();
         if (this.m_groundContactNormal.magnitude == 0f)
         {
             this.GroundNormal = Vector3.up;
         }
         else
         {
             this.GroundNormal = this.m_groundContactNormal.normalized;
         }
         this.m_groundContactNormal = Vector3.zero;
         if (base.IsOnGround && !Physics.Raycast(new Ray(base.Position + base.WorldOffsetToBottomSphereOfCapsuleCollider, base.GravityDirection), base.CapsuleCollider.radius * base.transform.lossyScale.y + 0.5f))
         {
             this.Ground.IsOn = false;
         }
         if (base.IsOnGround)
         {
             base.LocalSpeedY = 0f;
             Vector3 position = base.transform.position;
             base.transform.position += base.GroundBinormal * base.LocalSpeedX * Time.deltaTime;
             base.transform.position += this.GroundNormal * 0.02f;
             Vector3    vector = (0.04f + Mathf.Abs(base.LocalSpeedX) * Time.deltaTime) * -this.GroundNormal;
             RaycastHit raycastHit;
             if (this.m_rigidbody.SweepTest(vector.normalized, out raycastHit, vector.magnitude))
             {
                 base.transform.position += vector.normalized * (raycastHit.distance + 0.02f);
             }
             else
             {
                 base.transform.position -= this.GroundNormal * 0.02f;
             }
             if (Time.deltaTime == 0f)
             {
                 this.m_rigidbody.velocity = Vector3.zero;
             }
             else
             {
                 this.m_rigidbody.velocity = (base.transform.position - position) / Time.deltaTime;
             }
             this.m_rigidbody.position = position;
         }
         else
         {
             this.m_rigidbody.velocity = RandomizerBonusSkill.TimeScale(this.WorldSpeed);
         }
         base.PostFixedUpdate();
     }
 }