private void OnEnemyDamageRequested(EnemyDamageRequestEvent obj) { obj.enemy.Damage(obj.damageAmount); float slowAmount = ElementUtility.Slow(obj.elements.ToArray()); if (slowAmount > 0) { obj.enemy.SlowEnemy(1f - slowAmount, 5); } }
private void SetupTexts() { mainElement.text = tower.elements.Peek().ToString(); fireRate.text = string.Format("{0}/s", ElementUtility.FireRate(elementsArray).ToString()); fireRange.text = ElementUtility.TowerRange(elementsArray).ToString(); bounces.text = ElementUtility.Bounces(elementsArray).ToString(); chain.text = ElementUtility.ChainLength(elementsArray).ToString(); slow.text = ElementUtility.Slow(elementsArray).ToString(); aoe.text = ElementUtility.AoE(elementsArray).ToString(); damage.text = ElementUtility.ProjectileDamage(elementsArray).ToString(); sellButtonText.text = string.Format("Sell for: {0}", ElementUtility.SaleValue(elementsArray).ToString()); ClearUpgradeTexts(); }