Ejemplo n.º 1
0
    protected override void HitPlayer(Collision other)
    {
        if (other.collider.tag == "Player")
        {
            PlayersGameplay playerScript = other.collider.GetComponent <PlayersGameplay> ();

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

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

            if (hasKilled && GlobalVariables.Instance.CurrentModeLoaded == WhichMode.Pool)
            {
                SteamAchievements.Instance.UnlockAchievement(AchievementID.ACH_POOL);
            }

            if (!hasKilled)
            {
                hasKilled = true;
            }

            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);
        }
    }
Ejemplo n.º 2
0
    protected override void HitPlayer(Collision other)
    {
        if (other.collider.tag == "Player")
        {
            PlayersGameplay playerScript = other.collider.GetComponent <PlayersGameplay> ();

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

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

            PlayerKilled();

            foreach (GameObject g in attracedBy)
            {
                StatsManager.Instance.PlayerKills(g.GetComponent <PlayersGameplay> ());
            }

            foreach (GameObject g in repulsedBy)
            {
                StatsManager.Instance.PlayerKills(g.GetComponent <PlayersGameplay> ());
            }

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

            GlobalMethods.Instance.Explosion(transform.position);
        }
    }
Ejemplo n.º 3
0
    protected override void HitPlayer(Collision other)
    {
        if (tag != "Suggestible" && tag != "DeadCube")
        {
            base.HitPlayer(other);
        }
        else
        {
            if (other.collider.tag == "Player")
            {
                PlayersGameplay playerScript = other.collider.GetComponent <PlayersGameplay>();

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

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

                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);
            }
        }
    }
Ejemplo n.º 4
0
    protected override void HitPlayer(Collision other)
    {
        base.HitPlayer(other);

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

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

            if (playerScript.dashState != DashState.Dashing)
            {
                return;
            }

            if (!SteamAchievements.Instance.Achieved(AchievementID.ACH_PUSH))
            {
                StartCoroutine(DashingPlayerCoroutine(playerScript));
            }

            playerThatThrew     = other.gameObject;
            playerThatThrewTemp = other.gameObject;

            DOTween.Kill("PushNull" + gameObject.GetInstanceID());
            DOVirtual.DelayedCall(0.5f, () => playerThatThrewTemp = null).SetId("PushNull" + gameObject.GetInstanceID());

            DeadlyTransition();

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

        if (other.collider.tag == "Player" && tag == "DeadCube" && other.gameObject != playerThatThrewTemp)
        {
            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);
        }
    }
Ejemplo n.º 5
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);
            }
        }
    }
Ejemplo n.º 6
0
    protected override void HitPlayer(Collision other)
    {
        if (other.collider.tag == "Player")
        {
            PlayersGameplay playerScript = other.collider.GetComponent <PlayersGameplay> ();

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

            if (other.gameObject == targetPlayer)
            {
                playerScript.Death(DeathFX.All, other.contacts [0].point);
                InstantiateParticles(other.contacts [0], GlobalVariables.Instance.HitParticles, GlobalVariables.Instance.playersColors [(int)playerScript.playerName]);
                Explode();
                StopTrackingPlayer();

                PlayerKilled();

                SteamAchievements.Instance.UnlockAchievement(AchievementID.ACH_BURDEN);
            }

            else
            {
                playerScript.Death(DeathFX.All, other.contacts [0].point);
                InstantiateParticles(other.contacts [0], GlobalVariables.Instance.HitParticles, GlobalVariables.Instance.playersColors [(int)playerScript.playerName]);
                Explode();

                PlayerKilled();


                for (int i = 0; i < otherMovables.Count; i++)
                {
                    if (otherMovables [i].targetPlayer == other.gameObject)
                    {
                        otherMovables [i].StopTrackingPlayer();
                    }
                }
            }
        }
    }
Ejemplo n.º 7
0
    protected override void HitPlayer(Collision other)
    {
        PlayersGameplay playerScript = null;

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

        if (tag == "Movable" && other.gameObject.tag == "Player" ||
            tag == "ThrownMovable" && other.gameObject.tag == "Player" && !trackingPlayer)
        {
            if (playerThatThrew == null || playerThatThrew != other.gameObject)
            {
                if (!trackingPlayer && playerThatThrew != null)
                {
                    StatsManager.Instance.PlayersHits(playerThatThrew, other.gameObject);
                }

                BombManager manager = (BombManager)GlobalVariables.Instance.lastManManager;

                if (manager.timer < 1 && !trackingPlayer && playerThatThrew != null)
                {
                    SteamAchievements.Instance.UnlockAchievement(AchievementID.ACH_BOMB);
                }

                playerScript.OnHoldMovable(gameObject, true);
                playerHolding = other.gameObject;

                mainCamera.GetComponent <ScreenShakeCamera>().CameraShaking(FeedbackType.Stun);
                mainCamera.GetComponent <ZoomCamera>().Zoom(FeedbackType.Stun);

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

        if (tag == "DeadCube" && other.gameObject.tag == "Player" && trackingPlayer && playerScript.playerState != PlayerState.Dead)
        {
            hold          = true;
            playerHolding = other.gameObject;

            playerScript.OnDeath -= PlayerSuicide;
            playerScript.Death(DeathFX.All, other.contacts [0].point);

            mainCamera.GetComponent <ScreenShakeCamera>().CameraShaking(FeedbackType.Stun);
            mainCamera.GetComponent <ZoomCamera>().Zoom(FeedbackType.Stun);

            InstantiateParticles(other.contacts [0], GlobalVariables.Instance.HitParticles, GlobalVariables.Instance.playersColors [(int)playerScript.playerName]);
        }
    }
Ejemplo n.º 8
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);
        }
    }