Ejemplo n.º 1
0
    // Token: 0x0600111F RID: 4383 RVA: 0x00068354 File Offset: 0x00066554
    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))
        {
            ExplosiveGrenadeQuickItem explosiveGrenadeQuickItem = this.Throw(raycastHit.point, Vector3.zero) as ExplosiveGrenadeQuickItem;
            explosiveGrenadeQuickItem.machine.PopAllStates();
            ExplosiveGrenadeQuickItem explosiveGrenadeQuickItem2 = explosiveGrenadeQuickItem;
            explosiveGrenadeQuickItem2.OnProjectileExploded = (Action <IGrenadeProjectile>) Delegate.Combine(explosiveGrenadeQuickItem2.OnProjectileExploded, new Action <IGrenadeProjectile>(delegate(IGrenadeProjectile p)
            {
                ProjectileDetonator.Explode(p.Position, p.ID, (float)this._config.Damage, Vector3.up, (float)this._config.SplashRadius, 5, 5, this.Configuration.ID, UberstrikeItemClass.WeaponLauncher, DamageEffectType.None, 0f);
            }));
            Singleton <ProjectileManager> .Instance.RemoveProjectile(explosiveGrenadeQuickItem.ID, true);

            GameState.Current.Actions.RemoveProjectile(explosiveGrenadeQuickItem.ID, true);
        }
        else
        {
            IGrenadeProjectile grenadeProjectile = this.Throw(position, velocity);
            grenadeProjectile.OnProjectileExploded += delegate(IGrenadeProjectile p)
            {
                ProjectileDetonator.Explode(p.Position, p.ID, (float)this._config.Damage, Vector3.up, (float)this._config.SplashRadius, 5, 5, this.Configuration.ID, UberstrikeItemClass.WeaponLauncher, DamageEffectType.None, 0f);
            };
        }
    }
Ejemplo n.º 2
0
        // Token: 0x06001131 RID: 4401 RVA: 0x00068790 File Offset: 0x00066990
        public void OnEnter()
        {
            this._timeOut = Time.time + (float)this.behaviour._config.LifeTime;
            ExplosiveGrenadeQuickItem explosiveGrenadeQuickItem = this.behaviour;

            explosiveGrenadeQuickItem.OnCollisionEnterEvent = (Action <Collision>)Delegate.Combine(explosiveGrenadeQuickItem.OnCollisionEnterEvent, new Action <Collision>(this.OnCollisionEnterEvent));
            if (!this.behaviour._config.IsSticky)
            {
                ExplosiveGrenadeQuickItem explosiveGrenadeQuickItem2 = this.behaviour;
                explosiveGrenadeQuickItem2.OnTriggerEnterEvent = (Action <Collider>)Delegate.Combine(explosiveGrenadeQuickItem2.OnTriggerEnterEvent, new Action <Collider>(this.OnTriggerEnterEvent));
            }
            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.activeSelf && characterHitArea.gameObject.activeSelf)
                    {
                        Physics.IgnoreCollision(collider, characterHitArea.collider);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        // Token: 0x06001132 RID: 4402 RVA: 0x000688C0 File Offset: 0x00066AC0
        public void OnExit()
        {
            ExplosiveGrenadeQuickItem explosiveGrenadeQuickItem = this.behaviour;

            explosiveGrenadeQuickItem.OnCollisionEnterEvent = (Action <Collision>)Delegate.Remove(explosiveGrenadeQuickItem.OnCollisionEnterEvent, new Action <Collision>(this.OnCollisionEnterEvent));
            if (!this.behaviour._config.IsSticky)
            {
                ExplosiveGrenadeQuickItem explosiveGrenadeQuickItem2 = this.behaviour;
                explosiveGrenadeQuickItem2.OnTriggerEnterEvent = (Action <Collider>)Delegate.Remove(explosiveGrenadeQuickItem2.OnTriggerEnterEvent, new Action <Collider>(this.OnTriggerEnterEvent));
            }
        }
Ejemplo n.º 4
0
        // Token: 0x06001139 RID: 4409 RVA: 0x00068B04 File Offset: 0x00066D04
        public void OnEnter()
        {
            this._timeOut = Time.time + (float)this.behaviour._config.LifeTime;
            ExplosiveGrenadeQuickItem explosiveGrenadeQuickItem = this.behaviour;

            explosiveGrenadeQuickItem.OnTriggerEnterEvent = (Action <Collider>)Delegate.Combine(explosiveGrenadeQuickItem.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;
            }
        }
Ejemplo n.º 5
0
    // Token: 0x06001120 RID: 4384 RVA: 0x00068494 File Offset: 0x00066694
    public IGrenadeProjectile Throw(Vector3 position, Vector3 velocity)
    {
        ExplosiveGrenadeQuickItem explosiveGrenadeQuickItem = UnityEngine.Object.Instantiate(this) as ExplosiveGrenadeQuickItem;

        if (explosiveGrenadeQuickItem)
        {
            explosiveGrenadeQuickItem.gameObject.SetActive(true);
            for (int i = 0; i < explosiveGrenadeQuickItem.transform.childCount; i++)
            {
                explosiveGrenadeQuickItem.transform.GetChild(i).gameObject.SetActive(true);
            }
            explosiveGrenadeQuickItem.Position = position;
            explosiveGrenadeQuickItem.Velocity = velocity;
            explosiveGrenadeQuickItem.collider.material.bounciness = this._config.Bounciness;
            explosiveGrenadeQuickItem.machine.RegisterState(1, new ExplosiveGrenadeQuickItem.FlyingState(explosiveGrenadeQuickItem));
            explosiveGrenadeQuickItem.machine.RegisterState(2, new ExplosiveGrenadeQuickItem.DeployedState(explosiveGrenadeQuickItem));
            explosiveGrenadeQuickItem.machine.PushState(1);
        }
        if (this.OnProjectileEmitted != null)
        {
            this.OnProjectileEmitted(explosiveGrenadeQuickItem);
        }
        return(explosiveGrenadeQuickItem);
    }
Ejemplo n.º 6
0
        // Token: 0x0600113B RID: 4411 RVA: 0x0000BF68 File Offset: 0x0000A168
        public void OnExit()
        {
            ExplosiveGrenadeQuickItem explosiveGrenadeQuickItem = this.behaviour;

            explosiveGrenadeQuickItem.OnTriggerEnterEvent = (Action <Collider>)Delegate.Remove(explosiveGrenadeQuickItem.OnTriggerEnterEvent, new Action <Collider>(this.OnTriggerEnterEvent));
        }
Ejemplo n.º 7
0
 // Token: 0x06001138 RID: 4408 RVA: 0x0000BF59 File Offset: 0x0000A159
 public DeployedState(ExplosiveGrenadeQuickItem behaviour)
 {
     this.behaviour = behaviour;
 }
Ejemplo n.º 8
0
 // Token: 0x06001130 RID: 4400 RVA: 0x0000BF11 File Offset: 0x0000A111
 public FlyingState(ExplosiveGrenadeQuickItem behaviour)
 {
     this.behaviour = behaviour;
 }