// Token: 0x0600114E RID: 4430
 private SpiritGrenade SpawnGrenade(Vector2 velocity)
 {
     this.RefreshListOfQuickSpiritGrenades();
     if (this.m_spiritGrenades.Count >= this.MaxSpamGrenades)
     {
         this.m_spiritGrenades[0].Explode();
         this.m_spiritGrenades.RemoveAt(0);
     }
     SpiritGrenade component = ((GameObject)InstantiateUtility.Instantiate((!this.HasGrenadeUpgrade()) ? this.Grenade : this.GrenadeUpgraded, this.GrenadeSpawnPosition, Quaternion.identity)).GetComponent<SpiritGrenade>();
     component.SetTrajectory(velocity);
     this.m_spiritGrenades.Add(component);
     if (this.m_autoTarget as Component != null)
     {
         component.Duration = this.TimeToTarget(velocity, this.m_autoTarget) + 0.2f;
         this.m_autoTarget = null;
     }
     return component;
 }
Exemplo n.º 2
0
 // Token: 0x0600115A RID: 4442 RVA: 0x00065B64 File Offset: 0x00063D64
 public void UpdateNormal()
 {
     this.m_lockPressingInputTime -= Time.deltaTime;
     this.m_autoTarget             = null;
     if (Core.Input.LeftShoulder.OnPressed && this.m_lockPressingInputTime <= 0f)
     {
         this.m_inputPressed = true;
     }
     if (Core.Input.LeftShoulder.Released)
     {
         this.m_inputPressed = false;
     }
     this.RefreshListOfQuickSpiritGrenades();
     if (Core.Input.LeftShoulder.Pressed && this.m_lockPressingInputTime <= 0f && this.HasEnoughEnergy && this.CanAim)
     {
         this.m_inputPressed = false;
         this.SpendEnergy();
         this.BeginAiming();
         this.UpdateTrajectory();
         this.Trajectory.ShowTrajectory();
     }
     if (this.m_inputPressed)
     {
         if (!this.HasEnoughEnergy)
         {
             this.m_inputPressed = false;
             UI.SeinUI.ShakeEnergyOrbBar();
             if (this.NotEnoughEnergySound)
             {
                 Sound.Play(this.NotEnoughEnergySound.GetSound(null), base.transform.position, null);
             }
             this.m_sein.Animation.Play(this.PickAnimation((!this.IsGrabbingWall) ? this.NotEnoughEnergyThrowAnimations : this.NotEnoughEnergyWallThrowAnimations), 154, new Func <bool>(this.KeepPlayingNotEnoughEnergyAnimation));
             if (this.CanAim)
             {
                 Vector3 b = (!this.IsGrabbingWall) ? new Vector2(-0.5f, 0.1f) : new Vector2(-0.8f, -0.13f);
                 if (this.m_sein.FaceLeft)
                 {
                     b.x *= -1f;
                 }
                 InstantiateUtility.Instantiate(this.GrenadeFailEffect, this.m_sein.Position + b, Quaternion.identity);
             }
             this.m_lockPressingInputTime = 0.2f;
         }
         else if (!this.CanAim)
         {
             this.m_autoTarget = this.FindAutoAttackable;
             if (this.m_autoTarget != null)
             {
                 this.m_inputPressed          = false;
                 this.m_lockPressingInputTime = 0.2f;
                 SpiritGrenade spiritGrenade = this.SpawnGrenade(this.VelocityToAimAtTarget(this.m_autoTarget));
                 spiritGrenade.Bashable = false;
                 this.SpendEnergy();
                 this.PlayFastThrowAnimation();
                 this.PlayThrowSound();
                 this.ResetAimToDefault();
             }
             else
             {
                 this.m_inputPressed          = false;
                 this.m_lockPressingInputTime = 0.2f;
                 Vector2 quickThrowSpeed = this.QuickThrowSpeed;
                 if (this.m_sein.FaceLeft)
                 {
                     quickThrowSpeed.x *= -1f;
                 }
                 SpiritGrenade spiritGrenade2 = this.SpawnGrenade(quickThrowSpeed);
                 spiritGrenade2.Bashable = false;
                 this.SpendEnergy();
                 this.PlayFastThrowAnimation();
                 this.PlayThrowSound();
                 this.ResetAimToDefault();
             }
             if (this.m_sein.Abilities.Glide)
             {
                 this.m_sein.Abilities.Glide.LockGliding(0.2f);
                 this.m_sein.Abilities.Glide.IsGliding = false;
             }
         }
     }
 }