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); }
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); } }
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); }