Ejemplo n.º 1
0
    public override void Activate()
    {
        base.Activate();

        buffImage.sprite = icon.sprite;
        timerRef.timer   = timerRef.tempTimer;

        skillCD = tempSkillCD;

        int value = 8;

        for (int i = 0; i < PlayerStats.buffs.Length; i++)
        {
            if (PlayerStats.buffs[i] == buff)
            {
                value = i;
            }
        }

        if (value < 8)
        {
            PlayerStats.buffs[value].currDuration = PlayerStats.buffs[value].duration;
        }
        else
        {
            if (PlayerStats.findNextFree() < 8)
            {
                buff.currDuration = buff.duration;
                buff.Activate();
                PlayerStats.buffs[PlayerStats.findNextFree()] = buff;
            }
        }
    }
Ejemplo n.º 2
0
    public override void Use()
    {
        int value = 8;

        for (int i = 0; i < PlayerStats.buffs.Length; i++)
        {
            if (PlayerStats.buffs[i] == buff)
            {
                value = i;
            }
        }

        if (value < 8)
        {
            PlayerStats.buffs[value].currDuration = PlayerStats.buffs[value].duration;
        }
        else
        {
            if (PlayerStats.findNextFree() < 8)
            {
                buff.currDuration = buff.duration;
                buff.Activate();
                PlayerStats.buffs[PlayerStats.findNextFree()] = buff;
            }
        }

        Inventory.equipConsume = Inventory.emptyItem;
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (!collision.CompareTag("Enemy") && collision.isTrigger != true)
        {
            if (collision.isTrigger != true && collision.CompareTag("Player"))
            {
                int value = 8;
                for (int i = 0; i < PlayerStats.buffs.Length; i++)
                {
                    if (PlayerStats.buffs[i] == burning)
                    {
                        value = i;
                    }
                }

                if (value < 8)
                {
                    PlayerStats.buffs[value].currDuration = PlayerStats.buffs[value].duration;
                }
                else
                {
                    if (PlayerStats.findNextFree() < 8)
                    {
                        burning.currDuration = burning.duration;
                        burning.Activate();
                        PlayerStats.buffs[PlayerStats.findNextFree()] = burning;
                    }
                }
            }

            if (damage - PlayerStats.RES < 0)
            {
                if (collision.isTrigger != true && collision.CompareTag("Player"))
                {
                    collision.SendMessageUpwards("Damage", 1);
                }
            }
            else if (collision.isTrigger != true && collision.CompareTag("Player"))
            {
                if (flames)
                {
                    collision.SendMessageUpwards("Damage", (damage / 2) - PlayerStats.RES);
                }
                else
                {
                    collision.SendMessageUpwards("Damage", damage - PlayerStats.RES);
                }
            }
        }
    }
Ejemplo n.º 4
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (!collision.CompareTag("Enemy") && collision.isTrigger != true)
        {
            if (collision.isTrigger != true && collision.CompareTag("Player"))
            {
                int value = 8;
                for (int i = 0; i < PlayerStats.buffs.Length; i++)
                {
                    if (PlayerStats.buffs[i] == infection)
                    {
                        value = i;
                    }
                }

                if (value < 8)
                {
                    PlayerStats.buffs[value].currDuration = PlayerStats.buffs[value].duration;
                }
                else
                {
                    if (PlayerStats.findNextFree() < 8)
                    {
                        infection.currDuration = infection.duration;
                        infection.Activate();
                        PlayerStats.buffs[PlayerStats.findNextFree()] = infection;
                    }
                }
            }

            Destroy(this.gameObject);

            if (damage - PlayerStats.RES < 0)
            {
                if (collision.isTrigger != true && collision.CompareTag("Player"))
                {
                    collision.SendMessageUpwards("Damage", 1);
                }
            }
            else if (collision.isTrigger != true && collision.CompareTag("Player"))
            {
                collision.SendMessageUpwards("Damage", damage - PlayerStats.RES);
            }
        }
    }
Ejemplo n.º 5
0
    // Handle hitbox collision with player hurtbox
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (STR - PlayerStats.DEF < 0)
        {
            if (collision.isTrigger != true && collision.CompareTag("Player"))
            {
                collision.SendMessageUpwards("Damage", 1);
            }
        }
        else if (collision.isTrigger != true && collision.CompareTag("Player"))
        {
            collision.SendMessageUpwards("Damage", STR - PlayerStats.DEF);
        }

        if (collision.isTrigger != true && collision.CompareTag("Player"))
        {
            int value = 8;
            for (int i = 0; i < PlayerStats.buffs.Length; i++)
            {
                if (PlayerStats.buffs[i] == wet)
                {
                    value = i;
                }
            }

            if (value < 8)
            {
                PlayerStats.buffs[value].currDuration = PlayerStats.buffs[value].duration;
            }
            else
            {
                if (PlayerStats.findNextFree() < 8)
                {
                    wet.currDuration = wet.duration;
                    wet.Activate();
                    PlayerStats.buffs[PlayerStats.findNextFree()] = wet;
                }
            }
        }
    }