void checkCollision(Entity e, DifficultyControllerComponent difficulty) { CollisionScript collision = e.gameObject.gameObject.GetComponent<CollisionScript>(); int damageTaken = collision.DamageTaken; if (damageTaken == 0) { return; } e.AddDamage(damageTaken); collision.DamageTaken = 0; }
void checkCollision(Entity e, DifficultyControllerComponent difficulty) { CollisionScript collision = e.gameObject.gameObject.GetComponent<CollisionScript>(); Queue<string> queue = collision.queue; if (queue.Count == 0) { return; } HealthComponent health = e.health; int damage = getDamageDone(collision.queue, health.health); if (!e.hasPlayer) { damage = damage * (difficulty.dmgBoostPercent + 100) / 100; } if (damage > 0) { e.AddDamage(damage); } else { //throw new Exception("Sth is f****d up, and is unnecessary calculating damage"); } }