… | |
… | |
400 | { |
400 | { |
401 | LOG (llevError, "Cannot write bugs file %s: %s\n", BUG_LOG, strerror (errno)); |
401 | LOG (llevError, "Cannot write bugs file %s: %s\n", BUG_LOG, strerror (errno)); |
402 | } |
402 | } |
403 | } |
403 | } |
404 | |
404 | |
405 | int |
|
|
406 | command_output_sync (object *op, char *params) |
|
|
407 | { |
|
|
408 | int val; |
|
|
409 | |
|
|
410 | if (!params) |
|
|
411 | { |
|
|
412 | new_draw_info_format (NDI_UNIQUE, 0, op, "Output sync time is presently %d", op->contr->outputs_sync); |
|
|
413 | return 1; |
|
|
414 | } |
|
|
415 | val = atoi (params); |
|
|
416 | if (val > 0) |
|
|
417 | { |
|
|
418 | op->contr->outputs_sync = val; |
|
|
419 | new_draw_info_format (NDI_UNIQUE, 0, op, "Output sync time now set to %d", op->contr->outputs_sync); |
|
|
420 | } |
|
|
421 | else |
|
|
422 | new_draw_info (NDI_UNIQUE, 0, op, "Invalid value for output_sync."); |
|
|
423 | |
|
|
424 | return 1; |
|
|
425 | } |
|
|
426 | |
|
|
427 | int |
|
|
428 | command_output_count (object *op, char *params) |
|
|
429 | { |
|
|
430 | int val; |
|
|
431 | |
|
|
432 | if (!params) |
|
|
433 | { |
|
|
434 | new_draw_info_format (NDI_UNIQUE, 0, op, "Output count is presently %d", op->contr->outputs_count); |
|
|
435 | return 1; |
|
|
436 | } |
|
|
437 | val = atoi (params); |
|
|
438 | if (val > 0) |
|
|
439 | { |
|
|
440 | op->contr->outputs_count = val; |
|
|
441 | new_draw_info_format (NDI_UNIQUE, 0, op, "Output count now set to %d", op->contr->outputs_count); |
|
|
442 | } |
|
|
443 | else |
|
|
444 | new_draw_info (NDI_UNIQUE, 0, op, "Invalid value for output_count."); |
|
|
445 | |
|
|
446 | return 1; |
|
|
447 | } |
|
|
448 | |
|
|
449 | /* Prints out some useful information for the character. Everything we print |
405 | /* Prints out some useful information for the character. Everything we print |
450 | * out can be determined by the docs, so we aren't revealing anything extra - |
406 | * out can be determined by the docs, so we aren't revealing anything extra - |
451 | * rather, we are making it convenient to find the values. params have |
407 | * rather, we are making it convenient to find the values. params have |
452 | * no meaning here. |
408 | * no meaning here. |
453 | */ |
409 | */ |
… | |
… | |
483 | int |
439 | int |
484 | command_fix_me (object *op, char *params) |
440 | command_fix_me (object *op, char *params) |
485 | { |
441 | { |
486 | sum_weight (op); |
442 | sum_weight (op); |
487 | op->update_stats (); |
443 | op->update_stats (); |
|
|
444 | new_draw_info (NDI_UNIQUE, 0, op, "Your character was fixed."); |
|
|
445 | |
488 | return 1; |
446 | return 1; |
489 | } |
447 | } |
490 | |
448 | |
491 | int |
449 | int |
492 | command_logs (object *op, char *params) |
450 | command_logs (object *op, char *params) |
493 | { |
451 | { |
494 | new_draw_info (NDI_UNIQUE, 0, op, "Nobody is currently logging kills."); |
452 | new_draw_info (NDI_UNIQUE, 0, op, "Nobody is currently logging kills."); |
495 | |
453 | |
496 | return 1; |
|
|
497 | } |
|
|
498 | |
|
|
499 | int |
|
|
500 | command_applymode (object *op, char *params) |
|
|
501 | { |
|
|
502 | unapplymode unapply = op->contr->unapply; |
|
|
503 | static const char *const types[] = { "nochoice", "never", "always" }; |
|
|
504 | |
|
|
505 | if (!params) |
|
|
506 | { |
|
|
507 | new_draw_info_format (NDI_UNIQUE, 0, op, "applymode is set to %s", types[op->contr->unapply]); |
|
|
508 | return 1; |
|
|
509 | } |
|
|
510 | |
|
|
511 | if (!strcmp (params, "nochoice")) |
|
|
512 | op->contr->unapply = unapply_nochoice; |
|
|
513 | else if (!strcmp (params, "never")) |
|
|
514 | op->contr->unapply = unapply_never; |
|
|
515 | else if (!strcmp (params, "always")) |
|
|
516 | op->contr->unapply = unapply_always; |
|
|
517 | else |
|
|
518 | { |
|
|
519 | new_draw_info_format (NDI_UNIQUE, 0, op, "applymode: Unknown options %s, valid options are nochoice, never, always", params); |
|
|
520 | return 0; |
|
|
521 | } |
|
|
522 | |
|
|
523 | new_draw_info_format (NDI_UNIQUE, 0, op, "Applymode %s set to %s", |
|
|
524 | (unapply == op->contr->unapply ? "" : " now"), types[op->contr->unapply]); |
|
|
525 | return 1; |
454 | return 1; |
526 | } |
455 | } |
527 | |
456 | |
528 | int |
457 | int |
529 | command_bowmode (object *op, char *params) |
458 | command_bowmode (object *op, char *params) |
… | |
… | |
567 | new_draw_info_format (NDI_UNIQUE, 0, op, buf); |
496 | new_draw_info_format (NDI_UNIQUE, 0, op, buf); |
568 | return 0; |
497 | return 0; |
569 | } |
498 | } |
570 | |
499 | |
571 | new_draw_info_format (NDI_UNIQUE, 0, op, "bowmode %s set to %s", (oldtype == op->contr->bowtype ? "" : "now"), types[op->contr->bowtype]); |
500 | new_draw_info_format (NDI_UNIQUE, 0, op, "bowmode %s set to %s", (oldtype == op->contr->bowtype ? "" : "now"), types[op->contr->bowtype]); |
572 | return 1; |
|
|
573 | } |
|
|
574 | |
|
|
575 | int |
|
|
576 | command_petmode (object *op, char *params) |
|
|
577 | { |
|
|
578 | petmode_t oldtype = op->contr->petmode; |
|
|
579 | static const char *const types[] = { "normal", "sad", "defend", "arena" }; |
|
|
580 | |
|
|
581 | if (!params) |
|
|
582 | { |
|
|
583 | new_draw_info_format (NDI_UNIQUE, 0, op, "petmode is set to %s", types[op->contr->petmode]); |
|
|
584 | return 1; |
|
|
585 | } |
|
|
586 | |
|
|
587 | if (!strcmp (params, "normal")) |
|
|
588 | op->contr->petmode = pet_normal; |
|
|
589 | else if (!strcmp (params, "sad")) |
|
|
590 | op->contr->petmode = pet_sad; |
|
|
591 | else if (!strcmp (params, "defend")) |
|
|
592 | op->contr->petmode = pet_defend; |
|
|
593 | else if (!strcmp (params, "arena")) |
|
|
594 | op->contr->petmode = pet_arena; |
|
|
595 | else |
|
|
596 | { |
|
|
597 | new_draw_info_format (NDI_UNIQUE, 0, op, |
|
|
598 | "petmode: Unknown options %s, valid options are normal," "sad (seek and destroy), defend, arena", params); |
|
|
599 | return 0; |
|
|
600 | } |
|
|
601 | new_draw_info_format (NDI_UNIQUE, 0, op, "petmode %s set to %s", (oldtype == op->contr->petmode ? "" : "now"), types[op->contr->petmode]); |
|
|
602 | return 1; |
501 | return 1; |
603 | } |
502 | } |
604 | |
503 | |
605 | int |
504 | int |
606 | command_showpets (object *op, char *params) |
505 | command_showpets (object *op, char *params) |
… | |
… | |
647 | new_draw_info (NDI_UNIQUE, 0, op, "no such pet."); |
546 | new_draw_info (NDI_UNIQUE, 0, op, "no such pet."); |
648 | return 0; |
547 | return 0; |
649 | } |
548 | } |
650 | |
549 | |
651 | int |
550 | int |
652 | command_usekeys (object *op, char *params) |
|
|
653 | { |
|
|
654 | usekeytype oldtype = op->contr->usekeys; |
|
|
655 | static const char *const types[] = { "inventory", "keyrings", "containers" }; |
|
|
656 | |
|
|
657 | if (!params) |
|
|
658 | { |
|
|
659 | new_draw_info_format (NDI_UNIQUE, 0, op, "usekeys is set to %s", types[op->contr->usekeys]); |
|
|
660 | return 1; |
|
|
661 | } |
|
|
662 | |
|
|
663 | if (!strcmp (params, "inventory")) |
|
|
664 | op->contr->usekeys = key_inventory; |
|
|
665 | else if (!strcmp (params, "keyrings")) |
|
|
666 | op->contr->usekeys = keyrings; |
|
|
667 | else if (!strcmp (params, "containers")) |
|
|
668 | op->contr->usekeys = containers; |
|
|
669 | else |
|
|
670 | { |
|
|
671 | new_draw_info_format (NDI_UNIQUE, 0, op, "usekeys: Unknown options %s, valid options are inventory, keyrings, containers", params); |
|
|
672 | return 0; |
|
|
673 | } |
|
|
674 | new_draw_info_format (NDI_UNIQUE, 0, op, "usekeys %s set to %s", (oldtype == op->contr->usekeys ? "" : "now"), types[op->contr->usekeys]); |
|
|
675 | return 1; |
|
|
676 | } |
|
|
677 | |
|
|
678 | int |
|
|
679 | command_resistances (object *op, char *params) |
551 | command_resistances (object *op, char *params) |
680 | { |
552 | { |
681 | int i; |
553 | int i; |
682 | |
554 | |
683 | if (!op) |
555 | if (!op) |
… | |
… | |
966 | return 0; |
838 | return 0; |
967 | } |
839 | } |
968 | } |
840 | } |
969 | |
841 | |
970 | int |
842 | int |
971 | command_sound (object *op, char *params) |
|
|
972 | { |
|
|
973 | if (op->contr->ns->sound) |
|
|
974 | { |
|
|
975 | op->contr->ns->sound = 0; |
|
|
976 | new_draw_info (NDI_UNIQUE, 0, op, "Silence is golden..."); |
|
|
977 | } |
|
|
978 | else |
|
|
979 | { |
|
|
980 | op->contr->ns->sound = 1; |
|
|
981 | new_draw_info (NDI_UNIQUE, 0, op, "The sounds are enabled."); |
|
|
982 | } |
|
|
983 | |
|
|
984 | return 1; |
|
|
985 | } |
|
|
986 | |
|
|
987 | int |
|
|
988 | command_title (object *op, char *params) |
843 | command_title (object *op, char *params) |
989 | { |
844 | { |
990 | char buf[MAX_BUF]; |
845 | char buf[MAX_BUF]; |
991 | |
846 | |
992 | if (settings.set_title == FALSE) |
847 | if (settings.set_title == FALSE) |