… | |
… | |
1142 | return 0; |
1142 | return 0; |
1143 | } |
1143 | } |
1144 | } |
1144 | } |
1145 | |
1145 | |
1146 | int |
1146 | int |
1147 | command_quit (object *op, char *params) |
|
|
1148 | { |
|
|
1149 | new_draw_info (NDI_UNIQUE, 0, op, |
|
|
1150 | "Quitting will delete your character PERMANENTLY. If you are sure you want to do this, then use the quit_character command instead of quit."); |
|
|
1151 | return 1; |
|
|
1152 | } |
|
|
1153 | |
|
|
1154 | int |
|
|
1155 | command_real_quit (object *op, char *params) |
|
|
1156 | { |
|
|
1157 | send_query (op->contr->ns, CS_QUERY_SINGLECHAR, "Quitting will delete your character.\nAre you sure you want to quit (y/n):"); |
|
|
1158 | |
|
|
1159 | op->contr->ns->state = ST_CONFIRM_QUIT; |
|
|
1160 | return 1; |
|
|
1161 | } |
|
|
1162 | |
|
|
1163 | /* |
|
|
1164 | * don't allow people to exit explore mode. It otherwise becomes |
|
|
1165 | * really easy to abuse this. |
|
|
1166 | */ |
|
|
1167 | int |
|
|
1168 | command_explore (object *op, char *params) |
|
|
1169 | { |
|
|
1170 | if (settings.explore_mode == FALSE) |
|
|
1171 | return 1; |
|
|
1172 | /* |
|
|
1173 | * I guess this is the best way to see if we are solo or not. Actually, |
|
|
1174 | * are there any cases when first_player->next==NULL and we are not solo? |
|
|
1175 | */ |
|
|
1176 | if ((first_player != op->contr) || (first_player->next != NULL)) |
|
|
1177 | { |
|
|
1178 | new_draw_info (NDI_UNIQUE, 0, op, "You can not enter explore mode if you are in a party"); |
|
|
1179 | } |
|
|
1180 | else if (op->contr->explore) |
|
|
1181 | new_draw_info (NDI_UNIQUE, 0, op, "There is no return from explore mode"); |
|
|
1182 | else |
|
|
1183 | { |
|
|
1184 | op->contr->explore = 1; |
|
|
1185 | new_draw_info (NDI_UNIQUE, 0, op, "You are now in explore mode"); |
|
|
1186 | } |
|
|
1187 | return 1; |
|
|
1188 | } |
|
|
1189 | |
|
|
1190 | int |
|
|
1191 | command_sound (object *op, char *params) |
1147 | command_sound (object *op, char *params) |
1192 | { |
1148 | { |
1193 | if (op->contr->ns->sound) |
1149 | if (op->contr->ns->sound) |
1194 | { |
1150 | { |
1195 | op->contr->ns->sound = 0; |
1151 | op->contr->ns->sound = 0; |
… | |
… | |
1200 | op->contr->ns->sound = 1; |
1156 | op->contr->ns->sound = 1; |
1201 | new_draw_info (NDI_UNIQUE, 0, op, "The sounds are enabled."); |
1157 | new_draw_info (NDI_UNIQUE, 0, op, "The sounds are enabled."); |
1202 | } |
1158 | } |
1203 | |
1159 | |
1204 | return 1; |
1160 | return 1; |
1205 | } |
|
|
1206 | |
|
|
1207 | int |
|
|
1208 | explore_mode (void) |
|
|
1209 | { |
|
|
1210 | player *pl; |
|
|
1211 | |
|
|
1212 | if (settings.explore_mode == TRUE) |
|
|
1213 | { |
|
|
1214 | for (pl = first_player; pl != (player *) NULL; pl = pl->next) |
|
|
1215 | if (pl->explore) |
|
|
1216 | return 1; |
|
|
1217 | } |
|
|
1218 | return 0; |
|
|
1219 | } |
1161 | } |
1220 | |
1162 | |
1221 | int |
1163 | int |
1222 | command_title (object *op, char *params) |
1164 | command_title (object *op, char *params) |
1223 | { |
1165 | { |
… | |
… | |
1259 | { |
1201 | { |
1260 | new_draw_info (NDI_UNIQUE, 0, op, "Title too long."); |
1202 | new_draw_info (NDI_UNIQUE, 0, op, "Title too long."); |
1261 | return 1; |
1203 | return 1; |
1262 | } |
1204 | } |
1263 | strcpy (op->contr->own_title, params); |
1205 | strcpy (op->contr->own_title, params); |
1264 | return 1; |
|
|
1265 | } |
|
|
1266 | |
|
|
1267 | int |
|
|
1268 | command_save (object *op, char *params) |
|
|
1269 | { |
|
|
1270 | if (!op->stats.exp) |
|
|
1271 | new_draw_info (NDI_UNIQUE, 0, op, "You don't deserve to save yet."); |
|
|
1272 | else |
|
|
1273 | { |
|
|
1274 | op->contr->save (); |
|
|
1275 | new_draw_info (NDI_UNIQUE, 0, op, "You have been saved."); |
|
|
1276 | } |
|
|
1277 | |
|
|
1278 | return 1; |
1206 | return 1; |
1279 | } |
1207 | } |
1280 | |
1208 | |
1281 | int |
1209 | int |
1282 | command_peaceful (object *op, char *params) |
1210 | command_peaceful (object *op, char *params) |