Ejemplo n.º 1
0
    private void ApplyDamage(GenericCharacter aDamagerReceiver, GenericCharacter aAttacker, Action aAction)
    {
        Debug.Log("Action: " + aAction.GetActionName() + " - is being used against Target: " + aDamagerReceiver.GetCharacterName());

        int actionDamageValue = 0;

        Debug.Log("DEBUG - Type: " + aAction.GetType());

        if (aAction.GetType().IsSubclassOf(typeof(GenericAffixModel)) ||
            aAction.GetType() == typeof(GenericAffixModel))
        {
            Debug.Log("Action is GenericAffixModel type, attempting to stack.");

            GenericAffixModel affixAction = (GenericAffixModel)aAction;
            if (affixAction.GetIsStackable())
            {
                Debug.Log("Affix is stackable. Multiplying damage by " + affixAction.GetStackAmount() + " .");
                actionDamageValue = affixAction.GetDamageAmount() * affixAction.GetStackAmount();
            }
        }
        else
        {
            actionDamageValue = ComputeAttackValue(aAttacker, aAction);
        }

        ProcessDamageTaken(aDamagerReceiver, actionDamageValue);
    }
Ejemplo n.º 2
0
    private void ApplyHeal(GenericCharacter aHealReceiver, GenericCharacter aAttacker, Action aAction)
    {
        Debug.Log("Action: " + aAction.GetActionName() + " - is being used on Target: " + aHealReceiver.GetCharacterName());

        int actionHealValue = 0;

        if (aAction.GetType() == typeof(GenericAffixModel))
        {
            Debug.Log("Action is GenericAffixModel type, attempting to stack.");

            GenericAffixModel affixAction = (GenericAffixModel)aAction;
            if (affixAction.GetIsStackable())
            {
                Debug.Log("Affix is stackable. Multiplying healing by " + affixAction.GetStackAmount() + " .");
                actionHealValue = affixAction.GetHealAmount() * affixAction.GetStackAmount();
            }
        }
        else
        {
            actionHealValue = ComputeHealValue(aAttacker, aAction);
        }

        ProcessHealingTaken(aHealReceiver, actionHealValue);
    }