Esempio n. 1
0
    //Used mostly for 1 on 1 actions
    //TODO: Refactor the if statment in these functions and put it into a single function
    //TODO: Change this to use the perform action model for parameters
    public void PerformActionSingle(GenericActionModel aAction, GenericCharacter aAttacker, GenericCharacter aDefender)
    {
        Debug.Log("Performing 1 on 1 action");
        Debug.Log("Action name from dictionary: " + aAction.GetActionName());

        if (aAction.GetDoesActionDamage())
        {
            ApplyDamage(aDefender, aAttacker, aAction);
        }

        if (aAction.GetDoesActionHeal())
        {
            ApplyHeal(aDefender, aAttacker, aAction);
        }

        if (aAction.GetDoesActionHaveAffix())
        {
            List <ActionData.AFFIX_LIST_ID> affixList = aAction.GetListOfAffixes();

            if (affixList.Count != 0)
            {
                for (int i = 0; i < affixList.Count; i++)
                {
                    ApplyAffix(aDefender, ActionData.AFFIX_DICTIONARY[affixList[i]]);
                }
            }
        }
    }
Esempio n. 2
0
    public void PerformMultiDefensiveAction(GenericActionModel aAction, GenericCharacter aDefender)
    {
        Debug.Log("Performing multi defensive action");
        Debug.Log("Action name from dictionary: " + aAction.GetActionName());

        int hitTracking = 0;

        for (int i = 0; i < GameManager.GetPlayerManager.GetCharacterList().Count; i++)
        {
            GenericCharacter genericCharacter = GameManager.GetPlayerManager.GetCharacterList()[i];

            if (genericCharacter.IsPlayerControlled() == true)
            {
                if (aAction.GetDoesActionDamage())
                {
                    ApplyDamage(genericCharacter, aDefender, aAction);
                    hitTracking++;
                }

                if (aAction.GetDoesActionHeal())
                {
                    ApplyHeal(genericCharacter, aDefender, aAction);
                    hitTracking++;
                }

                if (aAction.GetDoesActionHaveAffix())
                {
                    List <ActionData.AFFIX_LIST_ID> affixList = aAction.GetListOfAffixes();

                    if (affixList.Count != 0)
                    {
                        for (int j = 0; j < affixList.Count; j++)
                        {
                            ApplyAffix(genericCharacter, ActionData.AFFIX_DICTIONARY[affixList[j]]);
                        }
                    }
                }
            }
        }

        Debug.Log("Action hit " + hitTracking + " times");
    }