This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions | |
void | gradually_load (MECH *mech, int loc, int percent) |
void | autopilot_load_cargo (dbref player, MECH *mech, int percent) |
void | figure_out_range_and_bearing (MECH *mech, int tx, int ty, float *range, int *bearing) |
void | auto_goto_event (MUXEVENT *e) |
void | auto_follow_event (MUXEVENT *e) |
void auto_follow_event | ( | MUXEVENT * | e | ) |
void auto_goto_event | ( | MUXEVENT * | e | ) |
Definition at line 1033 of file autopilot_commands.c.
References ai_check_path(), ai_set_speed(), AUTO_CHECKS, auto_get_command_arg(), auto_goto_event(), auto_goto_next_command(), AUTO_GSTART, AUTOEVENT, AUTOPILOT_GOTO_TICK, AUTOPILOT_NC_DELAY, my_event_type::data, EVENT_AUTOGOTO, figure_out_range_and_bearing(), IsAuto(), IsMech, MapCoordToRealCoord(), MechSpeed, MechX, MechY, AUTO::mymech, AUTO::mynum, MECH::mynum, Readnum, and slow_down_if_neccessary().
Referenced by auto_com_event(), and auto_goto_event().
01034 { 01035 01036 AUTO *autopilot = (AUTO *) e->data; 01037 int tx, ty; 01038 float dx, dy; 01039 MECH *mech = autopilot->mymech; 01040 float range; 01041 int bearing; 01042 01043 char *argument; 01044 01045 if(!IsMech(mech->mynum) || !IsAuto(autopilot->mynum)) 01046 return; 01047 01048 /* Basic Checks */ 01049 AUTO_CHECKS(autopilot); 01050 01051 /* Make sure mech is started and standing */ 01052 AUTO_GSTART(autopilot, mech); 01053 01054 /* Get the first argument - x coord */ 01055 argument = auto_get_command_arg(autopilot, 1, 1); 01056 if(Readnum(tx, argument)) { 01058 free(argument); 01059 } 01060 free(argument); 01061 01062 /* Get the second argument - y coord */ 01063 argument = auto_get_command_arg(autopilot, 1, 2); 01064 if(Readnum(ty, argument)) { 01066 free(argument); 01067 } 01068 free(argument); 01069 01070 if(MechX(mech) == tx && MechY(mech) == ty && abs(MechSpeed(mech)) < 0.5) { 01071 01072 /* We've reached this goal! Time for next one. */ 01073 ai_set_speed(mech, autopilot, 0); 01074 01075 auto_goto_next_command(autopilot, AUTOPILOT_NC_DELAY); 01076 return; 01077 } 01078 01079 MapCoordToRealCoord(tx, ty, &dx, &dy); 01080 figure_out_range_and_bearing(mech, tx, ty, &range, &bearing); 01081 if(!slow_down_if_neccessary(autopilot, mech, range, bearing, tx, ty)) { 01082 01083 /* Use the AI */ 01084 if(ai_check_path(mech, autopilot, dx, dy, 0.0, 0.0)) 01085 AUTOEVENT(autopilot, EVENT_AUTOGOTO, auto_goto_event, 01086 AUTOPILOT_GOTO_TICK, 0); 01087 01088 } else { 01089 AUTOEVENT(autopilot, EVENT_AUTOGOTO, auto_goto_event, 01090 AUTOPILOT_GOTO_TICK, 0); 01091 } 01092 01093 }
Referenced by auto_com_event().
void figure_out_range_and_bearing | ( | MECH * | mech, | |
int | tx, | |||
int | ty, | |||
float * | range, | |||
int * | bearing | |||
) |
Definition at line 1017 of file autopilot_commands.c.
References FindBearing(), FindHexRange(), MapCoordToRealCoord(), MechFX, MechFY, x, and y.
Referenced by auto_astar_follow_event(), auto_astar_goto_event(), auto_astar_roam_event(), auto_dumbfollow_event(), auto_dumbgoto_event(), and auto_goto_event().
01019 { 01020 01021 float x, y; 01022 01023 MapCoordToRealCoord(tx, ty, &x, &y); 01024 *bearing = FindBearing(MechFX(mech), MechFY(mech), x, y); 01025 *range = FindHexRange(MechFX(mech), MechFY(mech), x, y); 01026 }
void gradually_load | ( | MECH * | mech, | |
int | loc, | |||
int | percent | |||
) |