private void TryAttack(Player player) { AttackTimer.Tick(); if (AttackTimer.IsReady) { player.TakeDamage(Damage); AttackTimer.Restart(); } }
public static void TryAddCast(Map map, Dictionary <Point, Cast> casts) { SpawnCastTimer.Tick(); if (SpawnCastTimer.IsReady) { var rnd = new Random(); var cast = Casts[rnd.Next(0, Casts.Count)]; var position = map.FindFreePlace(map.CellSize / 3); if (!casts.ContainsKey(position)) { casts.Add(position, cast); } SpawnCastTimer.Interval *= 2; SpawnCastTimer.Restart(); } }