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
    public void PerformAction(GenericAffixModel aAffix, GenericCharacter aCharacter)
    {
        Debug.Log("Performing Action - Affix Type");
        Debug.Log("Affix " + aAffix.GetActionName() + " being used on " + aCharacter.GetCharacterName());

        PerformSelfAction(aAffix, aCharacter);

        aAffix.AddToAffixUses(-1);

        if (aAffix.GetAffixUses() <= 0)
        {
            AffixDepleated(aAffix);
        }
    }
Ejemplo n.º 3
0
    private void ApplyAffix(GenericCharacter aAffixReceiver, GenericAffixModel aAffix)
    {
        Debug.Log("Action: " + aAffix.GetActionName() + "is being used on Target: " + aAffixReceiver.GetCharacterName());

        Dictionary <GenericCharacter, List <GenericAffixModel> > actionUsersWithAffixes = GameManager.GetCombatManager.m_ActionUsersWithAffixes;

        if (actionUsersWithAffixes.ContainsKey(aAffixReceiver))
        {
            bool bDoesAffixExist = false;
            int  indexFound      = 0;

            for (int i = 0; i < actionUsersWithAffixes[aAffixReceiver].Count; i++)
            {
                if (actionUsersWithAffixes[aAffixReceiver][i].GetAffixID() == aAffix.GetAffixID())
                {
                    bDoesAffixExist = true;
                    indexFound      = i;
                    break;
                }
            }

            if (bDoesAffixExist == true)
            {
                if (aAffix.GetIsStackable())
                {
                    actionUsersWithAffixes[aAffixReceiver][indexFound].AddStackAmount(1);
                }
                else
                {
                    actionUsersWithAffixes[aAffixReceiver][indexFound].RefreshAffix();
                }
            }
            else
            {
                actionUsersWithAffixes[aAffixReceiver].Add(aAffix);
            }
        }
        else
        {
            List <GenericAffixModel> affixModelList = new List <GenericAffixModel>();
            affixModelList.Add(aAffix);
            actionUsersWithAffixes.Add(aAffixReceiver, affixModelList);
        }
    }
Ejemplo n.º 4
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);
    }
Ejemplo n.º 5
0
 //TODO: Get rid of affix
 public void AffixDepleated(GenericAffixModel aAffix)
 {
     //Delete the affix
     Debug.Log("Affix " + aAffix.GetActionName() + "Depleated - Deleting (Not actually at the moment).");
 }