Exemplo n.º 1
0
    public override void ApplyToActor(CombatActor aTargetActor)
    {
        int defense      = aTargetActor.GetAttributeValue(AttributeType.Defense);
        int finalDamages = (int)Mathf.Ceil(myDamageAmount - defense / 2);

        // TODO: damage type
        aTargetActor.TakeDamage(mySourceActor, finalDamages, myDamageType);
    }
    private void OnTriggerEnter(Collider collider)
    {
        CombatActor actor = collider.gameObject.GetComponent <CombatActor>();

        if (actor)
        {
            // Damage the actor
            actor.TakeDamage(Damage);

            // Destroy this object on collision
            Destroy(gameObject);
        }
    }