Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fire.h
Go to the documentation of this file.
1 #ifndef _CMD_TARGET_AI_H_
2 #define _CMD_TARGET_AI_H_
3 #include "comm_ai.h"
4 #include "event_xml.h"
5 //all unified AI's should inherit from FireAt, so they can choose targets together.
6 bool RequestClearence( class Unit*parent, class Unit*targ, unsigned char sex );
7 Unit * getAtmospheric( Unit *targ );
8 namespace Orders
9 {
10 class FireAt : public CommunicatingAI
11 {
12 protected:
13  bool ShouldFire( Unit *targ, bool &missilelock );
16  float delay;
17  float agg;
18  float distance;
20  bool had_target;
21  void FireWeapons( bool shouldfire, bool lockmissile );
22  virtual void ChooseTargets( int num, bool force = false ); //chooses n targets and puts the best to attack in unit's target container
23  bool isJumpablePlanet( Unit* );
24  void ReInit( float agglevel );
25  virtual void SignalChosenTarget();
26 public:
27 //Other new Order functions that can be called from Python.
28  virtual void ChooseTarget()
29  {
30  ChooseTargets( 1, true );
31  }
32  void PossiblySwitchTarget( bool istargetjumpableplanet );
33  virtual bool PursueTarget( Unit*, bool leader );
34  void AddReplaceLastOrder( bool replace );
35  void ExecuteLastScriptFor( float time );
36  void FaceTarget( bool end );
37  void FaceTargetITTS( bool end );
38  void MatchLinearVelocity( bool terminate, Vector vec, bool afterburn, bool local );
39  void MatchAngularVelocity( bool terminate, Vector vec, bool local );
40  void ChangeHeading( QVector vec );
41  void ChangeLocalDirection( Vector vec );
42  void MoveTo( QVector, bool afterburn );
43  void MatchVelocity( bool terminate, Vector vec, Vector angvel, bool afterburn, bool local );
44  void Cloak( bool enable, float seconds );
45  void FormUp( QVector pos );
46  void FormUpToOwner( QVector pos );
47  void FaceDirection( float distToMatchFacing, bool finish );
48  void XMLScript( std::string script );
49  void LastPythonScript();
50 
51  virtual void SetParent( Unit *parent )
52  {
54  }
56  {
58  }
59  FireAt( float aggressivitylevel ); //weapon prefs?
60  FireAt();
61  virtual void Execute();
62  virtual std::string Pickle()
63  {
64  return std::string();
65  } //these are to serialize this AI
66  virtual void UnPickle( std::string ) {}
67  virtual ~FireAt();
68 };
69 }
70 #endif
71