void aiProcess(worm *tmpWorm);
void initAI();
void freeAI();
int visible(worm *src, int eX, int eY);

int getBestWeap(worm *tmpWorm, int reload);
int aiNeedReload(worm *tmpWorm);
float weapDmg(int i);

void traceLine(int sX, int sY, int eX, int eY, int weap);
void traceWalk(int sX, int sY, int eX, int eY, int weap);
void traceRope(int sX, int sY, int eX, int eY);
void traceLight(int sX, int sY, int eX, int eY);
extern int traceX, traceY, trace, traceStep;

void ai_process_st_enemy(worm *tmpWorm);
void ai_process_st_none(worm *tmpWorm);
void ai_process_st_run(worm *tmpWorm);


#define AI_WEAP_HAS_AMMO 1000
#define AI_WEAP_CAN_KILL 100
#define AI_WEAP_CURRENT 100

#define AI_WALK_DIST 20
#define AI_JUMP_DIST 15

#define TRACE_HIT 1
#define TRACE_WORM 2

#define AI_STATE_NONE 0
#define AI_STATE_ENEMY 1
#define AI_STATE_RUN 2
#define AI_STATE_WANDER 3

