private void OnTriggerStay(Collider other)
    {
        //if (NetworkServer.active) {
        if (character == null || faction == "" || ability == null || timeLeft == -100)
        {
            return;
        }
        var otherCharacter = other.gameObject.GetComponent <Character>();

        if (otherCharacter != null && !otherCharacter.CompareTag(faction))
        {
            otherCharacter.GetComponent <Health>().TakeDamageFromDot(ability.CalculateDotDamage(character) * Time.deltaTime, ability.element, character, silent: true);
        }
        else if (other.gameObject.GetComponent <LockedDoor>() != null)
        {
            other.gameObject.GetComponent <LockedDoor>().TakeDamage(ability.CalculateDotDamage(character) * Time.deltaTime, other.gameObject);
        }
        else if (other.gameObject.GetComponent <LockedChest>() != null)
        {
            other.gameObject.GetComponent <LockedChest>().TakeDamage(ability.CalculateDotDamage(character) * Time.deltaTime, other.gameObject);
        }
        //}
    }
Beispiel #2
0
    private void OnTriggerStay(Collider other)
    {
        //if (NetworkServer.active) {
        if (character == null || faction == "" || ability == null || timeLeft == -100)
        {
            return;
        }
        var otherCharacter = other.gameObject.GetComponent <Character>();

        if (otherCharacter != null && otherCharacter.CompareTag(faction))
        {
            otherCharacter.GetComponent <Health>().Heal(ability.CalculateDotDamage(character) * Time.deltaTime, silent: true, noEffect: true);
        }
        //}
    }
Beispiel #3
0
    public void ApplyEffectsFromAttack(Character attacker, AttackAbility ability, float damage, Transform projectileTransform)
    {
        Dictionary <string, Effect> effects = SetUpEffectDictionary(attacker, ability, damage, projectileTransform);
        int count = 0;

        foreach (var attribute in ability.attributes)
        {
            if (effects.ContainsKey(attribute.type) && attribute.priority >= 50 && count < 4)
            {
                effects[attribute.type](attribute);
            }
            count++;
        }
        if (attacker != null && attacker.GetComponent <AbilityUser>().HasPassive("knockback"))
        {
            AbilityEffects.KnockbackDefault(attacker, GetComponent <Character>());
        }
        if (attacker != null && attacker.GetComponent <AbilityUser>().HasPassive("pullEnemies"))
        {
            AbilityEffects.PullTowardsDefault(attacker, GetComponent <Character>());
        }
        if (ability.FindAttribute("createDamageZone") == null && ability.dotDamage > 0)
        {
            GetComponent <StatusEffectHost>().AddStatusEffect("dot", ability.dotTime, degree: ability.CalculateDotDamage(attacker), inflicter: attacker, ability: ability);
        }
    }