示例#1
0
    protected virtual void OnCollisionStay(Collision other)
    {
        if (ReplayManager.Instance.isReplaying)
        {
            return;
        }

        if (playerState == PlayerState.Startup || rewiredPlayer == null)
        {
            return;
        }

        if (other.collider.tag != "HoldMovable" && other.gameObject.tag == "Player")
        {
            PlayersGameplay playerScript = other.gameObject.GetComponent <PlayersGameplay>();

            if (playerScript.playerState != PlayerState.Stunned && dashState == DashState.Dashing && !playersHit.Contains(other.gameObject))
            {
                playersHit.Add(other.gameObject);
                playerScript.StunVoid(false);
                playerScript.playerThatHit = this;

                GlobalVariables.Instance.screenShakeCamera.CameraShaking(FeedbackType.DashStun);
                GlobalVariables.Instance.zoomCamera.Zoom(FeedbackType.DashStun);
            }
        }
    }
示例#2
0
    protected override void OnCollisionStay(Collision other)
    {
        if (ReplayManager.Instance.isReplaying)
        {
            return;
        }

        if (playerState == PlayerState.Startup)
        {
            return;
        }

        if (other.gameObject.tag == "DeadZone" && gameObject.layer != LayerMask.NameToLayer("Safe"))
        {
            if (playerState != PlayerState.Dead && GlobalVariables.Instance.GameState == GameStateEnum.Playing)
            {
                Death(DeathFX.All, other.contacts[0].point);
            }
        }

        if (other.collider.tag != "HoldMovable" && other.gameObject.tag == "Player")
        {
            PlayersGameplay playerScript = other.gameObject.GetComponent <PlayersGameplay> ();

            if (playerScript.playerState != PlayerState.Stunned && dashState == DashState.Dashing && !playersHit.Contains(other.gameObject))
            {
                playersHit.Add(other.gameObject);
                playerScript.StunVoid(false);
                playerScript.playerThatHit = this;

                GlobalVariables.Instance.screenShakeCamera.CameraShaking(FeedbackType.DashStun);
                GlobalVariables.Instance.zoomCamera.Zoom(FeedbackType.DashStun);
            }
        }
    }
示例#3
0
    protected override void HitPlayer(Collision other)
    {
        if (other.collider.tag == "Player")
        {
            PlayersGameplay playerScript = other.collider.GetComponent <PlayersGameplay>();

            if (playerScript.playerState == PlayerState.Stunned)
            {
                return;
            }

            if (tag == "ThrownMovable")
            {
                if (playerThatThrew == null || other.gameObject.name != playerThatThrew.name)
                {
                    playerScript.StunVoid(true);

                    InstantiateParticles(other.contacts[0], GlobalVariables.Instance.HitParticles, GlobalVariables.Instance.playersColors[(int)playerScript.playerName]);

                    if (playerThatThrew != null)
                    {
                        StatsManager.Instance.PlayersHits(playerThatThrew, other.gameObject);
                    }
                }
            }
        }

        if (other.collider.tag == "Player")
        {
            PlayersGameplay playerScript = other.collider.GetComponent <PlayersGameplay>();

            if (playerScript.playerState == PlayerState.Dead)
            {
                return;
            }

            if (tag == "DeadCube")
            {
                playerScript.Death(DeathFX.All, other.contacts[0].point, playerThatThrew);

                PlayerKilled();

                if (playerThatThrew != null)
                {
                    StatsManager.Instance.PlayersHits(playerThatThrew, other.gameObject);

                    if (!SteamAchievements.Instance.Achieved(AchievementID.ACH_STANDOFF) && Vector3.Distance(other.transform.position, shooterPosition) > 30f)
                    {
                        SteamAchievements.Instance.UnlockAchievement(AchievementID.ACH_STANDOFF);
                    }
                }

                GlobalMethods.Instance.Explosion(transform.position);
            }
        }
    }
示例#4
0
    protected override void HitPlayer(Collision other)
    {
        if (other.collider.tag == "Player" && tag == "ThrownMovable")
        {
            PlayersGameplay playerScript = other.collider.GetComponent <PlayersGameplay> ();

            if (playerScript.playerState == PlayerState.Stunned)
            {
                return;
            }

            if (playerThatThrew == null || other.gameObject.name != playerThatThrew.name)
            {
                //StartCoroutine (DeadlyTransition ());

                playerScript.StunVoid(true);

                InstantiateParticles(other.contacts [0], GlobalVariables.Instance.HitParticles, GlobalVariables.Instance.playersColors [(int)playerScript.playerName]);

                if (playerThatThrew != null)
                {
                    StatsManager.Instance.PlayersHits(playerThatThrew, other.gameObject);
                }
            }
        }

        if (other.collider.tag == "Player" && tag == "DeadCube")
        {
            PlayersGameplay playerScript = other.collider.GetComponent <PlayersGameplay> ();

            if (playerScript.playerState == PlayerState.Dead)
            {
                return;
            }

            playerScript.Death(DeathFX.All, other.contacts [0].point, playerThatThrew);

            PlayerKilled();

            if (playerThatThrew != null)
            {
                StatsManager.Instance.PlayersHits(playerThatThrew, other.gameObject);
            }

            InstantiateParticles(other.contacts [0], GlobalVariables.Instance.HitParticles, GlobalVariables.Instance.playersColors [(int)playerScript.playerName]);

            GlobalMethods.Instance.Explosion(transform.position);
        }
    }
示例#5
0
    protected virtual void HitPlayer(Collision other)
    {
        if (other.collider.tag == "Player" && gameObject.tag == "ThrownMovable")
        {
            PlayersGameplay playerScript = other.collider.GetComponent <PlayersGameplay>();

            if (playerScript.playerState == PlayerState.Stunned)
            {
                return;
            }

            if (playerThatThrew == null || other.gameObject.name != playerThatThrew.name)
            {
                playerScript.StunVoid(true);

                InstantiateParticles(other.contacts[0], GlobalVariables.Instance.HitParticles, GlobalVariables.Instance.playersColors[(int)playerScript.playerName]);

                if (playerThatThrew != null)
                {
                    StatsManager.Instance.PlayersHits(playerThatThrew, other.gameObject);
                }
            }
        }
    }