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); } }
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); } }
//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)."); }