10typedef struct Pilot_
Pilot;
12#define MIN_DIR_ERR 5.0 * M_PI / 180.
13#define MIN_VEL_ERR 5.0
16#define MAX_AI_TIMERS 2
39typedef struct AI_Profile_ {
59typedef struct AIMemory_ {
74int nlua_loadAI( nlua_env env );
99 const Pilot *attacker );
Task * ai_newtask(lua_State *L, Pilot *p, const char *func, int subtask, int pos)
Creates a new AI task.
void ai_unsetPilot(AIMemory oldmem)
Finishes setting up a pilot.
void ai_thinkApply(Pilot *p)
Applies the result of thinking.
Task * ai_curTask(Pilot *pilot)
Gets the current running task.
void ai_refuel(Pilot *refueler, unsigned int target)
Has a pilot attempt to refuel the other.
void ai_cleartasks(Pilot *p)
Clears the pilot's tasks.
void ai_freetask(Task *t)
Frees an AI task.
void ai_think(Pilot *pilot, double dt, int dotask)
Heart of the AI, brains of the pilot.
void ai_thinkSetup(double dt)
Sets up the pilot for thinking.
void ai_getDistress(const Pilot *p, const Pilot *distressed, const Pilot *attacker)
Sends a distress signal to a pilot.
AIMemory ai_setPilot(Pilot *p)
Sets the pilot for further AI calls.
void ai_attacked(Pilot *attacked, const unsigned int attacker, double dmg)
Triggers the attacked() function in the pilot's AI.
void ai_destroy(Pilot *p)
Destroys the ai part of the pilot.
void ai_hail(Pilot *recipient)
Triggers the hail() function in the pilot's AI.
void ai_discovered(Pilot *discovered)
Triggers the discovered() function in the pilot's AI.
void ai_exit(void)
Cleans up global AI.
void ai_init(Pilot *p)
Initializes the AI.
int ai_pinit(Pilot *p, const char *ai)
Initializes the pilot in the ai.
int ai_load(void)
Initializes the AI stuff which is basically Lua.
AI_Profile * ai_getProfile(const char *name)
Gets the AI_Profile by name.
Represents a temporary pilot memory. For use with ai_setPilot and ai_unsetPilot.
The representation of an in-game pilot.