Exemple #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);
                    }
                }
            };
        }
    }
    // Token: 0x060018C7 RID: 6343 RVA: 0x00085284 File Offset: 0x00083484
    private IEnumerator StartPlayerIdentification()
    {
        for (;;)
        {
            yield return(new WaitForSeconds(0.3f));

            if (!GameState.Current.IsPlayerPaused)
            {
                Vector3    start = GameState.Current.PlayerData.ShootingPoint + GameState.Current.Player.EyePosition;
                Vector3    end   = start + GameState.Current.PlayerData.ShootingDirection * 1000f;
                RaycastHit hit;
                if (Physics.Linecast(start, end, out hit, UberstrikeLayerMasks.IdentificationMask))
                {
                    CharacterHitArea hitArea = hit.collider.GetComponent <CharacterHitArea>();
                    if (hitArea && hitArea.Shootable != null && !hitArea.Shootable.IsLocal)
                    {
                        CharacterConfig character = (CharacterConfig)hitArea.Shootable;
                        character.AimTrigger.HudInfo.Show();
                        GameState.Current.PlayerData.FocusedPlayerTeam.Value = character.Team;
                        if (!this._didPlayTargetSound)
                        {
                            AutoMonoBehaviour <SfxManager> .Instance.Play2dAudioClip(GameAudio.FocusEnemy, 0UL, 1f, 1f);

                            this._didPlayTargetSound = true;
                        }
                    }
                    else
                    {
                        GameState.Current.PlayerData.FocusedPlayerTeam.Value = TeamID.NONE;
                        this._didPlayTargetSound = false;
                    }
                }
                else
                {
                    GameState.Current.PlayerData.FocusedPlayerTeam.Value = TeamID.NONE;
                    this._didPlayTargetSound = false;
                }
            }
        }
        yield break;
    }