Esempio n. 1
0
    // Token: 0x0600118D RID: 4493 RVA: 0x000693EC File Offset: 0x000675EC
    protected override void OnActivated()
    {
        Vector3    vector   = GameState.Current.PlayerData.ShootingPoint + GameState.Current.Player.EyePosition;
        Vector3    position = vector + GameState.Current.PlayerData.ShootingDirection * 2f;
        Vector3    velocity = GameState.Current.PlayerData.ShootingDirection * (float)this._config.Speed;
        float      distance = 2f;
        RaycastHit raycastHit;

        if (Physics.Raycast(vector, GameState.Current.PlayerData.ShootingDirection * 2f, out raycastHit, distance, UberstrikeLayerMasks.LocalRocketMask))
        {
            SpringGrenadeQuickItem springGrenadeQuickItem = this.Throw(raycastHit.point, Vector3.zero) as SpringGrenadeQuickItem;
            springGrenadeQuickItem.machine.PopAllStates();
            GameState.Current.Player.MoveController.ApplyForce(this._config.JumpDirection.normalized * (float)this._config.Force, CharacterMoveController.ForceType.Additive);
            AutoMonoBehaviour <SfxManager> .Instance.PlayInGameAudioClip(this.JumpSound, 0UL);

            base.StartCoroutine(this.DestroyDelayed(springGrenadeQuickItem.ID));
        }
        else
        {
            IGrenadeProjectile grenadeProjectile = this.Throw(position, velocity);
            grenadeProjectile.OnProjectileExploded += delegate(IGrenadeProjectile p)
            {
                Collider[] array = Physics.OverlapSphere(p.Position, 2f, UberstrikeLayerMasks.ExplosionMask);
                foreach (Collider collider in array)
                {
                    CharacterHitArea component = collider.gameObject.GetComponent <CharacterHitArea>();
                    if (component != null && component.RecieveProjectileDamage)
                    {
                        component.Shootable.ApplyForce(component.transform.position, this._config.JumpDirection.normalized * (float)this._config.Force);
                    }
                }
            };
        }
    }
Esempio n. 2
0
        // Token: 0x060011A5 RID: 4517 RVA: 0x00069994 File Offset: 0x00067B94
        public void OnEnter()
        {
            this._timeOut = Time.time + (float)this.behaviour._config.LifeTime;
            SpringGrenadeQuickItem springGrenadeQuickItem = this.behaviour;

            springGrenadeQuickItem.OnTriggerEnterEvent = (Action <Collider>)Delegate.Combine(springGrenadeQuickItem.OnTriggerEnterEvent, new Action <Collider>(this.OnTriggerEnterEvent));
            if (this.behaviour.rigidbody)
            {
                this.behaviour.rigidbody.isKinematic = true;
            }
            if (this.behaviour.collider)
            {
                UnityEngine.Object.Destroy(this.behaviour.collider);
            }
            this.behaviour.gameObject.layer = 2;
            if (this.behaviour.DeployedEffect)
            {
                this.behaviour.DeployedEffect.emit = true;
            }
        }
Esempio n. 3
0
        // Token: 0x0600119E RID: 4510 RVA: 0x0006975C File Offset: 0x0006795C
        public void OnEnter()
        {
            this._timeOut = Time.time + (float)this.behaviour._config.LifeTime;
            SpringGrenadeQuickItem springGrenadeQuickItem = this.behaviour;

            springGrenadeQuickItem.OnCollisionEnterEvent = (Action <Collision>)Delegate.Combine(springGrenadeQuickItem.OnCollisionEnterEvent, new Action <Collision>(this.OnCollisionEnterEvent));
            GameObject gameObject = this.behaviour.gameObject;

            if (gameObject && GameState.Current.Avatar.Decorator && gameObject.collider)
            {
                Collider collider = gameObject.collider;
                foreach (CharacterHitArea characterHitArea in GameState.Current.Avatar.Decorator.HitAreas)
                {
                    if (gameObject.activeInHierarchy && characterHitArea.gameObject.activeInHierarchy)
                    {
                        Physics.IgnoreCollision(collider, characterHitArea.collider);
                    }
                }
            }
        }
Esempio n. 4
0
    // Token: 0x0600118F RID: 4495 RVA: 0x00069560 File Offset: 0x00067760
    public IGrenadeProjectile Throw(Vector3 position, Vector3 velocity)
    {
        SpringGrenadeQuickItem springGrenadeQuickItem = UnityEngine.Object.Instantiate(this) as SpringGrenadeQuickItem;

        springGrenadeQuickItem.gameObject.SetActive(true);
        for (int i = 0; i < springGrenadeQuickItem.gameObject.transform.childCount; i++)
        {
            springGrenadeQuickItem.gameObject.transform.GetChild(i).gameObject.SetActive(true);
        }
        if (springGrenadeQuickItem.rigidbody)
        {
            springGrenadeQuickItem.rigidbody.isKinematic = false;
        }
        springGrenadeQuickItem.Position = position;
        springGrenadeQuickItem.Velocity = velocity;
        springGrenadeQuickItem.machine.RegisterState(SpringGrenadeQuickItem.SpringGrenadeState.Flying, new SpringGrenadeQuickItem.FlyingState(springGrenadeQuickItem));
        springGrenadeQuickItem.machine.RegisterState(SpringGrenadeQuickItem.SpringGrenadeState.Deployed, new SpringGrenadeQuickItem.DeployedState(springGrenadeQuickItem));
        springGrenadeQuickItem.machine.PushState(SpringGrenadeQuickItem.SpringGrenadeState.Flying);
        if (this.OnProjectileEmitted != null)
        {
            this.OnProjectileEmitted(springGrenadeQuickItem);
        }
        return(springGrenadeQuickItem);
    }
Esempio n. 5
0
        // Token: 0x060011A7 RID: 4519 RVA: 0x0000C350 File Offset: 0x0000A550
        public void OnExit()
        {
            SpringGrenadeQuickItem springGrenadeQuickItem = this.behaviour;

            springGrenadeQuickItem.OnTriggerEnterEvent = (Action <Collider>)Delegate.Remove(springGrenadeQuickItem.OnTriggerEnterEvent, new Action <Collider>(this.OnTriggerEnterEvent));
        }
Esempio n. 6
0
 // Token: 0x060011A4 RID: 4516 RVA: 0x0000C33A File Offset: 0x0000A53A
 public DeployedState(SpringGrenadeQuickItem behaviour)
 {
     this.behaviour = behaviour;
     behaviour.OnProjectileExploded = null;
 }
Esempio n. 7
0
 // Token: 0x0600119D RID: 4509 RVA: 0x0000C2C9 File Offset: 0x0000A4C9
 public FlyingState(SpringGrenadeQuickItem behaviour)
 {
     this.behaviour = behaviour;
 }