1 /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
2 
3 #ifndef BOMB_DROPPER_H
4 #define BOMB_DROPPER_H
5 
6 #include "Weapon.h"
7 
8 class CBombDropper: public CWeapon
9 {
10 	CR_DECLARE(CBombDropper)
11 public:
12 	CBombDropper(CUnit* owner, const WeaponDef* def, bool useTorps);
13 
14 	void Init();
15 	void Update();
16 	void SlowUpdate();
17 
18 private:
19 	bool CanFire(bool ignoreAngleGood, bool ignoreTargetType, bool ignoreRequestedDir) const;
20 
21 	bool TestTarget(const float3& pos, bool userTarget, const CUnit* unit) const;
22 	bool TestRange(const float3& pos, bool userTarget, const CUnit* unit) const;
23 	bool HaveFreeLineOfFire(const float3& pos, bool userTarget, const CUnit* unit) const;
24 	void FireImpl(bool scriptCall);
25 
26 	float GetPredictedImpactTime(const float3& impactPos) const;
27 
28 private:
29 	/// if we should drop torpedoes
30 	bool dropTorpedoes;
31 	/// range of bombs (torpedoes) after they hit ground/water
32 	float torpMoveRange;
33 	float tracking;
34 };
35 
36 #endif /* BOMB_DROPPER_H */
37