Пример #1
0
    IEnumerator Trapped()
    {
        trapTaken = true;
        playerTrapped.Slow(trapSlow, trapSlow, archer.timerTrapped, true);
        playerTrapped.canDodge = false;
        totalDamageDealt       = archer.damageSpell2 * archer.damageMultiplier;
        playerTrapped.GetDamage(totalDamageDealt, false);
        //archer.GetComponent<Player>().AddAttackInTab(totalDamageDealt);

        if (!playerTrapped.GetComponent <Player>().isShielded)
        {
            archer.GetComponent <Player>().damageDeals   += totalDamageDealt;
            archer.GetComponent <Player>().totalDmgDealt += totalDamageDealt;
        }

        yield return(new WaitForSeconds(archer.timerTrapped));

        trapTaken = false;
        playerTrapped.canDodge = true;
        if (DataManager.instance.isMulti)
        {
            RpcTrapDecrease();
            archer.nbTrapPlaced--;
            NetDestroy(gameObject);
        }
        else
        {
            archer.nbTrapPlaced--;
            Destroy(gameObject);
        }
    }
Пример #2
0
    protected override void OnTriggerEnter(Collider other)
    {
        base.OnTriggerEnter(other);

        if (other != null && other.tag.Equals("Player") && other.gameObject != caster.gameObject)
        {
            if (other.gameObject.GetComponent <Player>().isShielded)
            {
                other.gameObject.GetComponent <Player>().isShielded = false;
                archer.tp_arrow_instantiated = null;
                Destroy(gameObject);
            }
            else
            {
                if (!other.GetComponent <Player>().isShielded)
                {
                    archer.GetComponent <Player>().damageDeals   += archer.damageSpell3 * archer.damageMultiplier;
                    archer.GetComponent <Player>().totalDmgDealt += archer.damageSpell3 * archer.damageMultiplier;
                }

                totalDamageDealt += archer.damageSpell3 * archer.damageMultiplier;
                other.GetComponent <Player>().GetDamage(totalDamageDealt, false);
                Debug.Log("Name : " + other.name + " /// Health : " + other.GetComponent <Player>().currentHealth);

                hit = true;
            }
        }
    }
Пример #3
0
    protected override void OnTriggerEnter(Collider other)
    {
        base.OnTriggerEnter(other);


        if (archer.dmgArrow)
        {
            if (other != null && other.gameObject != archer.gameObject && other.tag.Equals("Player"))
            {
                if (!other.GetComponent <Player>().isShielded)
                {
                    archer.GetComponent <Player>().damageDeals   += archer.damageSpell1_charged * archer.damageMultiplier;
                    archer.GetComponent <Player>().totalDmgDealt += archer.damageSpell1_charged * archer.damageMultiplier;
                }

                totalDamageDealt = archer.damageSpell1_charged * archer.damageMultiplier;
                other.GetComponent <Player>().GetDamage(totalDamageDealt, false);
                Debug.Log("Name : " + other.name + " /// Health : " + other.GetComponent <Player>().currentHealth);

                Destroy(gameObject);
            }
        }
        else
        {
            if (other != null && other.gameObject != archer.gameObject && other.tag.Equals("Player"))
            {
                if (other.gameObject.GetComponent <Player>().isShielded)
                {
                    other.gameObject.GetComponent <Player>().isShielded = false;
                }
                else
                {
                    if (!other.GetComponent <Player>().isShielded)
                    {
                        archer.GetComponent <Player>().damageDeals   += archer.damageSpell1 * archer.damageMultiplier;
                        archer.GetComponent <Player>().totalDmgDealt += archer.damageSpell1_charged * archer.damageMultiplier;
                    }

                    totalDamageDealt = archer.damageSpell1 * archer.damageMultiplier;
                    other.GetComponent <Player>().GetDamage(totalDamageDealt, false);
                    other.GetComponent <Player>().opponent = archer.transform;
                    other.GetComponent <Player>().KnockBack(0.1f);


                    Debug.Log("Name : " + other.name + " /// Health : " + other.GetComponent <Player>().currentHealth);
                }

                Destroy(gameObject);
            }
        }

        Tile tile = other.gameObject.GetComponentInParent <Tile>();

        if (tile != null)
        {
            if (other.gameObject.layer == LayerMask.NameToLayer("Hexagon") || tile.Type == Tile.TileType.Baril || tile.Type == Tile.TileType.Turret)
            {
                Destroy(gameObject);
            }
        }
    }
Пример #4
0
    protected override void OnTriggerEnter(Collider other)
    {
        base.OnTriggerEnter(other);

        if (archer.shadowActive)
        {
            if (other != null && other.gameObject != archer.gameObject && other.tag.Equals("Player"))
            {
                archer.arrowHit += 1;
                totalDamageDealt = archer.damageAA * archer.damageMultiplier;
                other.GetComponent <Player>().GetDamage(totalDamageDealt, true);
                //Debug.Log("Name : " + other.name + " /// Health : " + other.GetComponent<Player>().currentHealth);
                archer.GetComponent <Player>().damageDeals   += totalDamageDealt;
                archer.GetComponent <Player>().totalDmgDealt += totalDamageDealt;


                Destroy(gameObject);
            }
        }
        else
        {
            if (other.gameObject.tag.Equals("Player"))
            {
                archer.arrowHit += 1;
                totalDamageDealt = archer.damageAA * archer.damageMultiplier;
                other.GetComponent <Player>().GetDamage(totalDamageDealt, true);
                //Debug.Log("Name : " + other.name + " /// Health : " + other.GetComponent<Player>().currentHealth);
                archer.GetComponent <Player>().damageDeals   += totalDamageDealt;
                archer.GetComponent <Player>().totalDmgDealt += totalDamageDealt;

                Destroy(gameObject);
            }
        }


        Tile tile = other.gameObject.GetComponentInParent <Tile>();

        if (tile != null)
        {
            if (other.gameObject.layer == LayerMask.NameToLayer("Hexagon") || tile.Type == Tile.TileType.Baril || tile.Type == Tile.TileType.Turret)
            {
                Destroy(gameObject);
            }
        }

        if (other != null && other.gameObject != archer.gameObject && other.tag.Equals("Player"))
        {
            GiftBonused(other);
        }
    }