private void AssignDamageToDefenders(List <DamagePhoton> damages, Dictionary <string, int> heroDamage) { int i = 0; foreach (Transform t in GameManager.Instance.GetActiveMinionZone(false)) { CardVisual cv = t.GetComponent <CardVisual>(); DamagePhoton damage = damages[i]; foreach (KeyValuePair <string, int> entry in damage.DamageAbsorbed) { if (entry.Value != 0) { if (entry.Key.Equals("poisonTouch") && (cv.Sd || cv.Md.EffectId1 != 9)) { cv.AdjustHealth(cv.CurrentHealth, false); } else { cv.AdjustHealth(entry.Value, false); } } } if (cv.CurrentHealth > 0) { cv.DmgAbsorbed.ResetDamageAbsorbed(); cv.ResetDamageObjectsUI(); } i++; } foreach (KeyValuePair <string, int> entry in heroDamage) { if (entry.Value != 0) { GameManager.Instance.ActiveHero(false).AdjustHealth(entry.Value, false); if (entry.Key.Equals("lifesteal")) { GameManager.Instance.ActiveHero(true).AdjustHealth(entry.Value, true); EffectCommand.Instance.EffectQueue.Enqueue(EVENT_TYPE.POWER_LIFESTEAL); } else if (entry.Key.Equals("poisonTouch")) { EffectCommand.Instance.EffectQueue.Enqueue(EVENT_TYPE.POWER_POISON_TOUCH); } else if (entry.Key.Equals("stealth")) { EffectCommand.Instance.EffectQueue.Enqueue(EVENT_TYPE.POWER_STEALTH); } } } }