public CShell(int x, int y, int direction, int range, CTank owner) { m_x = x; m_y = y; m_direction = direction; m_range = range; m_owner = owner; FBattleScreen.PlaySound("shot"); }
private void ExplosionDamage(double x, double y, CTank tank, CShell shell) { if (tank != null && !tank.IsDead()) { if (tank.CheckCollision(x, y, CConstants.tankSize / 2)) //прямое попадание { tank.SetDamage(10); } if (tank.CheckCollision(x, y, CConstants.tankSize)) //в половине корпуса от танка { tank.SetDamage(5); } if (tank.CheckCollision(x, y, 3 * CConstants.tankSize / 2)) //в корпусе от танка { tank.SetDamage(5); shell.SuccessfulyHits(); } if (tank.IsDead()) { tank.SetDeadPlace(deadPlace); deadPlace++; } } }