00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00034 #include <global.h>
00035 #ifndef __CEXTRACT__
00036 #include <sproto.h>
00037 #endif
00038 #include <skills.h>
00039
00052 static int move_internal(object *op, char *params, int dir) {
00053 if (params) {
00054 if (params[0] == 'f') {
00055 if (!op->contr->fire_on) {
00056 op->contr->fire_on = 1;
00057 move_player(op, dir);
00058 op->contr->fire_on = 0;
00059 return 0;
00060 }
00061 } else if (params[0] == 'r' && !op->contr->run_on)
00062 op->contr->run_on = 1;
00063 }
00064 move_player(op, dir);
00065 return 0;
00066 }
00067
00077 int command_east(object *op, char *params) {
00078 return move_internal(op, params, 3);
00079 }
00080
00090 int command_north(object *op, char *params) {
00091 return move_internal(op, params, 1);
00092 }
00093
00103 int command_northeast(object *op, char *params) {
00104 return move_internal(op, params, 2);
00105 }
00106
00116 int command_northwest(object *op, char *params) {
00117 return move_internal(op, params, 8);
00118 }
00119
00129 int command_south(object *op, char *params) {
00130 return move_internal(op, params, 5);
00131 }
00132
00142 int command_southeast(object *op, char *params) {
00143 return move_internal(op, params, 4);
00144 }
00145
00155 int command_southwest(object *op, char *params) {
00156 return move_internal(op, params, 6);
00157 }
00158
00168 int command_west(object *op, char *params) {
00169 return move_internal(op, params, 7);
00170 }
00171
00181 int command_stay(object *op, char *params) {
00182 if (!op->contr->fire_on && (!params || params[0] != 'f'))
00183 return 0;
00184 fire(op, 0);
00185 return 0;
00186 }