Пример #1
0
    public void CreateCharacterInformationDisplay(GenericCharacter genericCharacter)
    {
        GameObject textManager = new GameObject("TextManager Charno: " + CharCount);

        textManager.transform.SetParent(m_Canvas.transform);
        Text nameHealthMana = textManager.AddComponent <Text>();

        nameHealthMana.font = m_Font;
        nameHealthMana.text = "Name: " + genericCharacter.GetCharacterName() +
                              " Health: " + genericCharacter.GetCharacterHealth() +
                              " Mana: " + genericCharacter.GetCharacterMana();

        if (GameManager.GetCombatManager.m_ActionUsersWithAffixes.ContainsKey(genericCharacter))
        {
            if (GameManager.GetCombatManager.m_ActionUsersWithAffixes[genericCharacter] != null)
            {
                nameHealthMana.text += " Affixes: " + GameManager.GetCombatManager.m_ActionUsersWithAffixes[genericCharacter][0];
            }
        }

        if (CharCount == 0)
        {
            nameHealthMana.rectTransform.localPosition = new Vector3(-400, 300, 0);
            CharCount++;
        }
        else
        {
            nameHealthMana.rectTransform.localPosition = new Vector3(400, 300, 0);
            CharCount--;
        }
    }
Пример #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);
        }
    }
Пример #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);
        }
    }
Пример #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);
    }
Пример #5
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);
    }