… | |
… | |
610 | |
610 | |
611 | int |
611 | int |
612 | command_fix_me (object *op, char *params) |
612 | command_fix_me (object *op, char *params) |
613 | { |
613 | { |
614 | sum_weight (op); |
614 | sum_weight (op); |
615 | fix_player (op); |
615 | op->update_stats (); |
616 | return 1; |
616 | return 1; |
617 | } |
617 | } |
618 | |
618 | |
619 | int |
619 | int |
620 | command_players (object *op, char *paramss) |
620 | command_players (object *op, char *paramss) |
… | |
… | |
1197 | } |
1197 | } |
1198 | |
1198 | |
1199 | return 1; |
1199 | return 1; |
1200 | } |
1200 | } |
1201 | |
1201 | |
1202 | /* Perhaps these should be in player.c, but that file is |
|
|
1203 | * already a bit big. |
|
|
1204 | */ |
|
|
1205 | |
|
|
1206 | void |
|
|
1207 | receive_player_name (object *op, char k) |
|
|
1208 | { |
|
|
1209 | |
|
|
1210 | if (!check_name (op->contr, op->contr->write_buf + 1)) |
|
|
1211 | { |
|
|
1212 | get_name (op); |
|
|
1213 | return; |
|
|
1214 | } |
|
|
1215 | op->name = op->contr->write_buf + 1; |
|
|
1216 | op->name_pl = op->contr->write_buf + 1; |
|
|
1217 | new_draw_info (NDI_UNIQUE, 0, op, op->contr->write_buf); |
|
|
1218 | op->contr->name_changed = 1; |
|
|
1219 | get_password (op); |
|
|
1220 | } |
|
|
1221 | |
|
|
1222 | void |
|
|
1223 | receive_player_password (object *op, char k) |
|
|
1224 | { |
|
|
1225 | |
|
|
1226 | unsigned int pwd_len = strlen (op->contr->write_buf); |
|
|
1227 | |
|
|
1228 | if (pwd_len <= 1 || pwd_len > 17) |
|
|
1229 | { |
|
|
1230 | get_name (op); |
|
|
1231 | return; |
|
|
1232 | } |
|
|
1233 | new_draw_info (NDI_UNIQUE, 0, op, " "); /* To hide the password better */ |
|
|
1234 | |
|
|
1235 | if (checkbanned (op->name, op->contr->ns->host)) |
|
|
1236 | { |
|
|
1237 | LOG (llevInfo, "Banned player tried to add: [%s@%s]\n", &op->name, op->contr->ns->host); |
|
|
1238 | new_draw_info (NDI_UNIQUE | NDI_RED, 0, op, "You are not allowed to play."); |
|
|
1239 | get_name (op); |
|
|
1240 | return; |
|
|
1241 | } |
|
|
1242 | |
|
|
1243 | if (op->contr->ns->state == ST_CONFIRM_PASSWORD) |
|
|
1244 | { |
|
|
1245 | if (!check_password (op->contr->write_buf + 1, op->contr->password)) |
|
|
1246 | { |
|
|
1247 | new_draw_info (NDI_UNIQUE, 0, op, "The passwords did not match."); |
|
|
1248 | get_name (op); |
|
|
1249 | return; |
|
|
1250 | } |
|
|
1251 | clear_win_info (op); |
|
|
1252 | display_motd (op); |
|
|
1253 | new_draw_info (NDI_UNIQUE, 0, op, " "); |
|
|
1254 | new_draw_info (NDI_UNIQUE, 0, op, "Welcome, Brave New Warrior!"); |
|
|
1255 | new_draw_info (NDI_UNIQUE, 0, op, " "); |
|
|
1256 | Roll_Again (op); |
|
|
1257 | op->contr->ns->state = ST_ROLL_STAT; |
|
|
1258 | return; |
|
|
1259 | } |
|
|
1260 | strcpy (op->contr->password, crypt_string (op->contr->write_buf + 1, NULL)); |
|
|
1261 | op->contr->ns->state = ST_ROLL_STAT; |
|
|
1262 | check_login (op); |
|
|
1263 | return; |
|
|
1264 | } |
|
|
1265 | |
|
|
1266 | |
|
|
1267 | int |
1202 | int |
1268 | explore_mode (void) |
1203 | explore_mode (void) |
1269 | { |
1204 | { |
1270 | player *pl; |
1205 | player *pl; |
1271 | |
1206 | |
… | |
… | |
1275 | if (pl->explore) |
1210 | if (pl->explore) |
1276 | return 1; |
1211 | return 1; |
1277 | } |
1212 | } |
1278 | return 0; |
1213 | return 0; |
1279 | } |
1214 | } |
1280 | |
|
|
1281 | |
1215 | |
1282 | int |
1216 | int |
1283 | command_title (object *op, char *params) |
1217 | command_title (object *op, char *params) |
1284 | { |
1218 | { |
1285 | char buf[MAX_BUF]; |
1219 | char buf[MAX_BUF]; |
… | |
… | |
1326 | } |
1260 | } |
1327 | |
1261 | |
1328 | int |
1262 | int |
1329 | command_save (object *op, char *params) |
1263 | command_save (object *op, char *params) |
1330 | { |
1264 | { |
1331 | // if (get_map_flags(op->map, NULL, op->x, op->y, NULL, NULL) & P_NO_CLERIC) { |
|
|
1332 | // new_draw_info(NDI_UNIQUE, 0, op, "You can not save on unholy ground"); |
|
|
1333 | // } else |
|
|
1334 | if (!op->stats.exp) |
1265 | if (!op->stats.exp) |
1335 | { |
|
|
1336 | new_draw_info (NDI_UNIQUE, 0, op, "You don't deserve to save yet."); |
1266 | new_draw_info (NDI_UNIQUE, 0, op, "You don't deserve to save yet."); |
|
|
1267 | else |
1337 | } |
1268 | { |
1338 | else |
1269 | op->contr->save (); |
1339 | { |
|
|
1340 | if (save_player (op, 1)) |
|
|
1341 | new_draw_info (NDI_UNIQUE, 0, op, "You have been saved."); |
1270 | new_draw_info (NDI_UNIQUE, 0, op, "You have been saved."); |
1342 | else |
|
|
1343 | new_draw_info (NDI_UNIQUE, 0, op, "SAVE FAILED!"); |
|
|
1344 | } |
1271 | } |
1345 | return 1; |
|
|
1346 | } |
|
|
1347 | |
1272 | |
|
|
1273 | return 1; |
|
|
1274 | } |
1348 | |
1275 | |
1349 | int |
1276 | int |
1350 | command_peaceful (object *op, char *params) |
1277 | command_peaceful (object *op, char *params) |
1351 | { |
1278 | { |
1352 | new_draw_info (NDI_UNIQUE, 0, op, |
1279 | new_draw_info (NDI_UNIQUE, 0, op, |
… | |
… | |
1361 | new_draw_info(NDI_UNIQUE, 0,op,"You will attack other players."); |
1288 | new_draw_info(NDI_UNIQUE, 0,op,"You will attack other players."); |
1362 | */ |
1289 | */ |
1363 | return 1; |
1290 | return 1; |
1364 | } |
1291 | } |
1365 | |
1292 | |
1366 | |
|
|
1367 | |
|
|
1368 | int |
1293 | int |
1369 | command_wimpy (object *op, char *params) |
1294 | command_wimpy (object *op, char *params) |
1370 | { |
1295 | { |
1371 | int i; |
1296 | int i; |
1372 | char buf[MAX_BUF]; |
1297 | char buf[MAX_BUF]; |
… | |
… | |
1381 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
1306 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
1382 | op->run_away = i; |
1307 | op->run_away = i; |
1383 | return 1; |
1308 | return 1; |
1384 | } |
1309 | } |
1385 | |
1310 | |
1386 | |
|
|
1387 | int |
1311 | int |
1388 | command_brace (object *op, char *params) |
1312 | command_brace (object *op, char *params) |
1389 | { |
1313 | { |
1390 | if (!params) |
1314 | if (!params) |
1391 | op->contr->braced = !op->contr->braced; |
1315 | op->contr->braced = !op->contr->braced; |
… | |
… | |
1395 | if (op->contr->braced) |
1319 | if (op->contr->braced) |
1396 | new_draw_info (NDI_UNIQUE, 0, op, "You are braced."); |
1320 | new_draw_info (NDI_UNIQUE, 0, op, "You are braced."); |
1397 | else |
1321 | else |
1398 | new_draw_info (NDI_UNIQUE, 0, op, "Not braced."); |
1322 | new_draw_info (NDI_UNIQUE, 0, op, "Not braced."); |
1399 | |
1323 | |
1400 | fix_player (op); |
1324 | op->update_stats (); |
1401 | return 0; |
1325 | return 0; |
1402 | } |
1326 | } |
1403 | |
1327 | |
1404 | int |
1328 | int |
1405 | command_style_map_info (object *op, char *params) |
1329 | command_style_map_info (object *op, char *params) |