4 * Copyright (c) 1997 Ben Harrison, and others
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Wizard commands */
17 * Roll the hitdie -- aux of do_cmd_rerate()
19 void do_cmd_rerate_aux(void)
21 /* Minimum hitpoints at highest level */
22 int min_value = p_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (p_ptr->hitdie + 1)) * 3 / 8;
24 /* Maximum hitpoints at highest level */
25 int max_value = p_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (p_ptr->hitdie + 1)) * 5 / 8;
32 /* Pre-calculate level 1 hitdice */
33 p_ptr->player_hp[0] = p_ptr->hitdie;
35 for (i = 1; i < 4; i++)
37 p_ptr->player_hp[0] += randint1(p_ptr->hitdie);
40 /* Roll the hitpoint values */
41 for (i = 1; i < PY_MAX_LEVEL; i++)
43 p_ptr->player_hp[i] = p_ptr->player_hp[i - 1] + randint1(p_ptr->hitdie);
46 /* Require "valid" hitpoints at highest level */
47 if ((p_ptr->player_hp[PY_MAX_LEVEL - 1] >= min_value) &&
48 (p_ptr->player_hp[PY_MAX_LEVEL - 1] <= max_value)) break;
54 * Hack -- Rerate Hitpoints
56 void do_cmd_rerate(bool display)
63 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
65 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
68 /* Update and redraw hitpoints */
69 p_ptr->update |= (PU_HP);
70 p_ptr->redraw |= (PR_HP);
73 p_ptr->window |= (PW_PLAYER);
82 msg_format("¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯¤Ï %d/100 ¤Ç¤¹¡£", percent);
84 msg_format("Your life rate is %d/100 now.", percent);
86 p_ptr->knowledge |= KNOW_HPRATE;
91 msg_print("ÂÎÎÏ¥é¥ó¥¯¤¬ÊѤï¤Ã¤¿¡£");
93 msg_print("Life rate is changed.");
95 p_ptr->knowledge &= ~(KNOW_HPRATE);
105 static bool wiz_dimension_door(void)
109 if (!tgt_pt(&x, &y)) return FALSE;
111 teleport_player_to(y, x, TELEPORT_NONMAGICAL);
118 * Create the artifact of the specified number -- DAN
121 static void wiz_create_named_art(void)
123 char tmp_val[10] = "";
127 if (!get_string("Artifact ID:", tmp_val, 3)) return;
130 a_idx = atoi(tmp_val);
131 if(a_idx < 0) a_idx = 0;
132 if(a_idx >= max_a_idx) a_idx = 0;
134 /* Create the artifact */
135 (void)create_named_art(a_idx, py, px);
138 msg_print("Allocated.");
143 * Hack -- quick debugging hook
145 static void do_cmd_wiz_hack_ben(void)
154 #ifdef MONSTER_HORDES
156 /* Summon a horde of monsters */
157 static void do_cmd_summon_horde(void)
159 int wy = py, wx = px;
164 scatter(&wy, &wx, py, px, 3, 0);
165 if (cave_empty_bold(wy, wx)) break;
168 (void)alloc_horde(wy, wx);
171 #endif /* MONSTER_HORDES */
175 * Output a long int in binary format.
177 static void prt_binary(u32b flags, int row, int col)
183 for (i = bitmask = 1; i <= 32; i++, bitmask *= 2)
188 Term_putch(col++, row, TERM_BLUE, '*');
191 /* Dump unset bits */
194 Term_putch(col++, row, TERM_WHITE, '-');
200 #define K_MAX_DEPTH 110
203 * Output a rarity graph for a type of object.
205 static void prt_alloc(byte tval, byte sval, int row, int col)
209 u32b maxr = 1, maxt = 1, ratio;
210 u32b rarity[K_MAX_DEPTH];
211 u32b total[K_MAX_DEPTH];
212 s32b maxd = 1, display[22];
214 cptr r = "+--common--+";
219 alloc_entry *table = alloc_kind_table;
221 /* Wipe the tables */
222 (void)C_WIPE(rarity, K_MAX_DEPTH, u32b);
223 (void)C_WIPE(total, K_MAX_DEPTH, u32b);
224 (void)C_WIPE(display, 22, s32b);
226 /* Scan all entries */
227 for (i = 0; i < K_MAX_DEPTH; i++)
230 for (j = 0; j < alloc_kind_size; j++)
234 if (table[j].level <= i)
236 prob = table[j].prob1 * GREAT_OBJ * K_MAX_DEPTH;
238 else if (table[j].level - 1 > 0)
240 prob = table[j].prob1 * i * K_MAX_DEPTH / (table[j].level - 1);
243 /* Acquire this kind */
244 k_ptr = &k_info[table[j].index];
246 /* Accumulate probabilities */
247 total[i] += prob / (GREAT_OBJ * K_MAX_DEPTH);
248 total_frac += prob % (GREAT_OBJ * K_MAX_DEPTH);
250 /* Accumulate probabilities */
251 if ((k_ptr->tval == tval) && (k_ptr->sval == sval))
257 total[i] += total_frac / (GREAT_OBJ * K_MAX_DEPTH);
261 for (i = 0; i < K_MAX_DEPTH; i++)
263 if (rarity[i] > maxr) maxr = rarity[i];
264 if (total[i] > maxt) maxt = total[i];
267 if (maxr / (GREAT_OBJ * K_MAX_DEPTH) != 0)
268 ratio = maxt / (maxr / (GREAT_OBJ * K_MAX_DEPTH));
272 /* Simulate a log graph */
289 /* Calculate probabilities for each range */
290 for (i = 0; i < 22; i++)
292 /* Shift the values into view */
295 for (j = i * K_MAX_DEPTH / 22; j < (i + 1) * K_MAX_DEPTH / 22; j++)
296 possibility += rarity[j] * (100 * maxt / total[j]);
298 possibility = possibility / maxr;
300 /* display[i] = log_{sqrt(2)}(possibility) */
305 possibility = possibility * 1000 / 1414;
309 if (display[i] > maxd) maxd = display[i];
313 if (maxd > 10) for (i = 0; i < 22; i++)
315 display[i] = display[i] - maxd + 10;
318 /* Graph the rarities */
319 for (i = 0; i < 22; i++)
321 Term_putch(col, row + i + 1, TERM_WHITE, '|');
323 prt(format("%d", (i * K_MAX_DEPTH / 220) % 10), row + i + 1, col);
329 if ((i * K_MAX_DEPTH / 22 <= home) && (home < (i + 1) * K_MAX_DEPTH / 22))
331 c_prt(TERM_RED, format("%.*s", display[i], "**********"), row + i + 1, col + 1);
335 c_prt(c, format("%.*s", display[i], "**********"), row + i + 1, col + 1);
339 /* Make it look nice */
343 static void do_cmd_wiz_reset_class(void)
350 sprintf(ppp, "Class (0-%d): ", MAX_CLASS - 1);
353 sprintf(tmp_val, "%d", p_ptr->pclass);
356 if (!get_string(ppp, tmp_val, 2)) return;
359 tmp_int = atoi(tmp_val);
362 if (tmp_int < 0 || tmp_int >= MAX_CLASS) return;
365 p_ptr->pclass = tmp_int;
367 /* Redraw inscription */
368 p_ptr->window |= (PW_PLAYER);
370 /* {.} and {$} effect p_ptr->warning and TRC_TELEPORT_SELF */
371 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
378 * Hack -- Teleport to the target
380 static void do_cmd_wiz_bamf(void)
382 /* Must have a target */
383 if (!target_who) return;
385 /* Teleport to the target */
386 teleport_player_to(target_row, target_col, TELEPORT_NONMAGICAL);
391 * Aux function for "do_cmd_wiz_change()". -RAK-
393 static void do_cmd_wiz_change_aux(void)
403 /* Query the stats */
404 for (i = 0; i < 6; i++)
407 sprintf(ppp, "%s (3-%d): ", stat_names[i], p_ptr->stat_max_max[i]);
410 sprintf(tmp_val, "%d", p_ptr->stat_max[i]);
413 if (!get_string(ppp, tmp_val, 3)) return;
416 tmp_int = atoi(tmp_val);
419 if (tmp_int > p_ptr->stat_max_max[i]) tmp_int = p_ptr->stat_max_max[i];
420 else if (tmp_int < 3) tmp_int = 3;
423 p_ptr->stat_cur[i] = p_ptr->stat_max[i] = tmp_int;
428 sprintf(tmp_val, "%d", WEAPON_EXP_MASTER);
432 if (!get_string("½ÏÎýÅÙ: ", tmp_val, 9)) return;
434 if (!get_string("Proficiency: ", tmp_val, 9)) return;
438 tmp_s16b = atoi(tmp_val);
441 if (tmp_s16b < WEAPON_EXP_UNSKILLED) tmp_s16b = WEAPON_EXP_UNSKILLED;
442 if (tmp_s16b > WEAPON_EXP_MASTER) tmp_s16b = WEAPON_EXP_MASTER;
444 for (j = 0; j <= TV_WEAPON_END - TV_WEAPON_BEGIN; j++)
446 for (i = 0;i < 64;i++)
448 p_ptr->weapon_exp[j][i] = tmp_s16b;
449 if (p_ptr->weapon_exp[j][i] > s_info[p_ptr->pclass].w_max[j][i]) p_ptr->weapon_exp[j][i] = s_info[p_ptr->pclass].w_max[j][i];
453 for (j = 0; j < 10; j++)
455 p_ptr->skill_exp[j] = tmp_s16b;
456 if (p_ptr->skill_exp[j] > s_info[p_ptr->pclass].s_max[j]) p_ptr->skill_exp[j] = s_info[p_ptr->pclass].s_max[j];
459 for (j = 0; j < 32; j++)
460 p_ptr->spell_exp[j] = (tmp_s16b > SPELL_EXP_MASTER ? SPELL_EXP_MASTER : tmp_s16b);
462 p_ptr->spell_exp[j] = (tmp_s16b > SPELL_EXP_EXPERT ? SPELL_EXP_EXPERT : tmp_s16b);
465 sprintf(tmp_val, "%ld", (long)(p_ptr->au));
468 if (!get_string("Gold: ", tmp_val, 9)) return;
471 tmp_long = atol(tmp_val);
474 if (tmp_long < 0) tmp_long = 0L;
477 p_ptr->au = tmp_long;
481 sprintf(tmp_val, "%ld", (long)(p_ptr->max_exp));
484 if (!get_string("Experience: ", tmp_val, 9)) return;
487 tmp_long = atol(tmp_val);
490 if (tmp_long < 0) tmp_long = 0L;
492 if (p_ptr->prace != RACE_ANDROID)
495 p_ptr->max_exp = tmp_long;
496 p_ptr->exp = tmp_long;
505 * Change various "permanent" player variables.
507 static void do_cmd_wiz_change(void)
510 do_cmd_wiz_change_aux();
512 /* Redraw everything */
518 * Wizard routines for creating objects -RAK-
519 * And for manipulating them! -Bernd-
521 * This has been rewritten to make the whole procedure
522 * of debugging objects much easier and more comfortable.
524 * The following functions are meant to play with objects:
525 * Create, modify, roll for them (for statistic purposes) and more.
526 * The original functions were by RAK.
527 * The function to show an item's debug information was written
528 * by David Reeve Sward <sward+@CMU.EDU>.
529 * Bernd (wiebelt@mathematik.hu-berlin.de)
531 * Here are the low-level functions
532 * - wiz_display_item()
533 * display an item's debug-info
534 * - wiz_create_itemtype()
535 * specify tval and sval (type and subtype of object)
537 * specify pval, +AC, +tohit, +todam
538 * Note that the wizard can leave this function anytime,
539 * thus accepting the default-values for the remaining values.
540 * pval comes first now, since it is most important.
541 * - wiz_reroll_item()
542 * apply some magic to the item or turn it into an artifact.
544 * Get some statistics about the rarity of an item:
545 * We create a lot of fake items and see if they are of the
546 * same type (tval and sval), then we compare pval and +AC.
547 * If the fake-item is better or equal it is counted.
548 * Note that cursed items that are better or equal (absolute values)
550 * HINT: This is *very* useful for balancing the game!
551 * - wiz_quantity_item()
552 * change the quantity of an item, but be sane about it.
554 * And now the high-level functions
555 * - do_cmd_wiz_play()
556 * play with an existing object
557 * - wiz_create_item()
558 * create a new object
560 * Note -- You do not have to specify "pval" and other item-properties
561 * directly. Just apply magic until you are satisfied with the item.
563 * Note -- For some items (such as wands, staffs, some rings, etc), you
564 * must apply magic, or you will get "broken" or "uncharged" objects.
566 * Note -- Redefining artifacts via "do_cmd_wiz_play()" may destroy
567 * the artifact. Be careful.
569 * Hack -- this function will allow you to create multiple artifacts.
570 * This "feature" may induce crashes or other nasty effects.
574 * Just display an item's properties (debug-info)
575 * Originally by David Reeve Sward <sward+@CMU.EDU>
576 * Verbose item flags by -Bernd-
578 static void wiz_display_item(object_type *o_ptr)
581 u32b flgs[TR_FLAG_SIZE];
584 /* Extract the flags */
585 object_flags(o_ptr, flgs);
587 /* Clear the screen */
588 for (i = 1; i <= 23; i++) prt("", i, j - 2);
590 prt_alloc(o_ptr->tval, o_ptr->sval, 1, 0);
593 object_desc(buf, o_ptr, OD_STORE);
597 prt(format("kind = %-5d level = %-4d tval = %-5d sval = %-5d",
598 o_ptr->k_idx, k_info[o_ptr->k_idx].level,
599 o_ptr->tval, o_ptr->sval), 4, j);
601 prt(format("number = %-3d wgt = %-6d ac = %-5d damage = %dd%d",
602 o_ptr->number, o_ptr->weight,
603 o_ptr->ac, o_ptr->dd, o_ptr->ds), 5, j);
605 prt(format("pval = %-5d toac = %-5d tohit = %-4d todam = %-4d",
606 o_ptr->pval, o_ptr->to_a, o_ptr->to_h, o_ptr->to_d), 6, j);
608 prt(format("name1 = %-4d name2 = %-4d cost = %ld",
609 o_ptr->name1, o_ptr->name2, (long)object_value_real(o_ptr)), 7, j);
611 prt(format("ident = %04x xtra1 = %-4d xtra2 = %-4d timeout = %-d",
612 o_ptr->ident, o_ptr->xtra1, o_ptr->xtra2, o_ptr->timeout), 8, j);
614 prt(format("xtra3 = %-4d xtra4 = %-4d xtra5 = %-4d cursed = %-d",
615 o_ptr->xtra3, o_ptr->xtra4, o_ptr->xtra5, o_ptr->curse_flags), 9, j);
617 prt("+------------FLAGS1------------+", 10, j);
618 prt("AFFECT........SLAY........BRAND.", 11, j);
619 prt(" mf cvae xsqpaefc", 12, j);
620 prt("siwdccsossidsahanvudotgddhuoclio", 13, j);
621 prt("tnieohtctrnipttmiinmrrnrrraiierl", 14, j);
622 prt("rtsxnarelcfgdkcpmldncltggpksdced", 15, j);
623 prt_binary(flgs[0], 16, j);
625 prt("+------------FLAGS2------------+", 17, j);
626 prt("SUST....IMMUN.RESIST............", 18, j);
627 prt(" reaefctrpsaefcpfldbc sn ", 19, j);
628 prt("siwdcciaclioheatcliooeialoshtncd", 20, j);
629 prt("tnieohdsierlrfraierliatrnnnrhehi", 21, j);
630 prt("rtsxnaeydcedwlatdcedsrekdfddrxss", 22, j);
631 prt_binary(flgs[1], 23, j);
633 prt("+------------FLAGS3------------+", 10, j+32);
634 prt("fe cnn t stdrmsiiii d ab ", 11, j+32);
635 prt("aa aoomywhs lleeieihgggg rtgl ", 12, j+32);
636 prt("uu utmacaih eielgggonnnnaaere ", 13, j+32);
637 prt("rr reanurdo vtieeehtrrrrcilas ", 14, j+32);
638 prt("aa algarnew ienpsntsaefctnevs ", 15, j+32);
639 prt_binary(flgs[2], 16, j+32);
641 prt("+------------FLAGS4------------+", 17, j+32);
642 prt("KILL....ESP......... ", 18, j+32);
643 prt("aeud tghaud tgdhegnu ", 19, j+32);
644 prt("nvneoriunneoriruvoon ", 20, j+32);
645 prt("iidmroamidmroagmionq ", 21, j+32);
646 prt("mlenclnmmenclnnnldlu ", 22, j+32);
647 prt_binary(flgs[3], 23, j+32);
652 * A structure to hold a tval and its description
654 typedef struct tval_desc
661 * A list of tvals and their textual names
663 static tval_desc tvals[] =
665 { TV_SWORD, "Sword" },
666 { TV_POLEARM, "Polearm" },
667 { TV_HAFTED, "Hafted Weapon" },
669 { TV_ARROW, "Arrows" },
670 { TV_BOLT, "Bolts" },
671 { TV_SHOT, "Shots" },
672 { TV_SHIELD, "Shield" },
673 { TV_CROWN, "Crown" },
675 { TV_GLOVES, "Gloves" },
676 { TV_BOOTS, "Boots" },
677 { TV_CLOAK, "Cloak" },
678 { TV_DRAG_ARMOR, "Dragon Scale Mail" },
679 { TV_HARD_ARMOR, "Hard Armor" },
680 { TV_SOFT_ARMOR, "Soft Armor" },
682 { TV_AMULET, "Amulet" },
684 { TV_POTION, "Potion" },
685 { TV_SCROLL, "Scroll" },
687 { TV_STAFF, "Staff" },
689 { TV_LIFE_BOOK, "Life Spellbook" },
690 { TV_SORCERY_BOOK, "Sorcery Spellbook" },
691 { TV_NATURE_BOOK, "Nature Spellbook" },
692 { TV_CHAOS_BOOK, "Chaos Spellbook" },
693 { TV_DEATH_BOOK, "Death Spellbook" },
694 { TV_TRUMP_BOOK, "Trump Spellbook" },
695 { TV_ARCANE_BOOK, "Arcane Spellbook" },
696 { TV_CRAFT_BOOK, "Craft Spellbook"},
697 { TV_DAEMON_BOOK, "Daemon Spellbook"},
698 { TV_CRUSADE_BOOK, "Crusade Spellbook"},
699 { TV_MUSIC_BOOK, "Music Spellbook" },
700 { TV_HISSATSU_BOOK, "Book of Kendo" },
701 { TV_HEX_BOOK, "Hex Spellbook" },
702 { TV_PARCHMENT, "Parchment" },
703 { TV_WHISTLE, "Whistle" },
704 { TV_SPIKE, "Spikes" },
705 { TV_DIGGING, "Digger" },
706 { TV_CHEST, "Chest" },
707 { TV_CAPTURE, "Capture Ball" },
708 { TV_CARD, "Express Card" },
709 { TV_FIGURINE, "Magical Figurine" },
710 { TV_STATUE, "Statue" },
711 { TV_CORPSE, "Corpse" },
713 { TV_FLASK, "Flask" },
715 { TV_SKELETON, "Skeleton" },
721 * Strip an "object name" into a buffer
723 void strip_name(char *buf, int k_idx)
727 object_kind *k_ptr = &k_info[k_idx];
729 cptr str = (k_name + k_ptr->name);
732 /* Skip past leading characters */
733 while ((*str == ' ') || (*str == '&')) str++;
735 /* Copy useful chars */
736 for (t = buf; *str; str++)
739 if (iskanji(*str)) {*t++ = *str++; *t++ = *str; continue;}
741 if (*str != '~') *t++ = *str;
744 /* Terminate the new name */
750 * Specify tval and sval (type and subtype of object) originally
751 * by RAK, heavily modified by -Bernd-
753 * This function returns the k_idx of an object type, or zero if failed
755 * List up to 50 choices in three columns
757 static int wiz_create_itemtype(void)
774 /* Print all tval's and their descriptions */
775 for (num = 0; (num < 80) && tvals[num].tval; num++)
777 row = 2 + (num % 20);
778 col = 20 * (num / 20);
780 prt(format("[%c] %s", ch, tvals[num].desc), row, col);
783 /* Me need to know the maximal possible tval_index */
787 if (!get_com("Get what type of object? ", &ch, FALSE)) return (0);
790 for (num = 0; num < max_num; num++)
792 if (listsym[num] == ch) break;
795 /* Bail out if choice is illegal */
796 if ((num < 0) || (num >= max_num)) return (0);
798 /* Base object type chosen, fill in tval */
799 tval = tvals[num].tval;
800 tval_desc = tvals[num].desc;
803 /*** And now we go for k_idx ***/
808 /* We have to search the whole itemlist. */
809 for (num = 0, i = 1; (num < 80) && (i < max_k_idx); i++)
811 object_kind *k_ptr = &k_info[i];
813 /* Analyze matching items */
814 if (k_ptr->tval == tval)
817 row = 2 + (num % 20);
818 col = 20 * (num / 20);
822 /* Acquire the "name" of object "i" */
826 prt(format("[%c] %s", ch, buf), row, col);
828 /* Remember the object index */
833 /* Me need to know the maximal possible remembered object_index */
837 if (!get_com(format("What Kind of %s? ", tval_desc), &ch, FALSE)) return (0);
840 for (num = 0; num < max_num; num++)
842 if (listsym[num] == ch) break;
845 /* Bail out if choice is "illegal" */
846 if ((num < 0) || (num >= max_num)) return (0);
848 /* And return successful */
849 return (choice[num]);
856 static void wiz_tweak_item(object_type *o_ptr)
862 /* Hack -- leave artifacts alone */
863 if (object_is_artifact(o_ptr)) return;
865 p = "Enter new 'pval' setting: ";
866 sprintf(tmp_val, "%d", o_ptr->pval);
867 if (!get_string(p, tmp_val, 5)) return;
868 o_ptr->pval = atoi(tmp_val);
869 wiz_display_item(o_ptr);
871 p = "Enter new 'to_a' setting: ";
872 sprintf(tmp_val, "%d", o_ptr->to_a);
873 if (!get_string(p, tmp_val, 5)) return;
874 o_ptr->to_a = atoi(tmp_val);
875 wiz_display_item(o_ptr);
877 p = "Enter new 'to_h' setting: ";
878 sprintf(tmp_val, "%d", o_ptr->to_h);
879 if (!get_string(p, tmp_val, 5)) return;
880 o_ptr->to_h = atoi(tmp_val);
881 wiz_display_item(o_ptr);
883 p = "Enter new 'to_d' setting: ";
884 sprintf(tmp_val, "%d", o_ptr->to_d);
885 if (!get_string(p, tmp_val, 5)) return;
886 o_ptr->to_d = atoi(tmp_val);
887 wiz_display_item(o_ptr);
892 * Apply magic to an item or turn it into an artifact. -Bernd-
894 static void wiz_reroll_item(object_type *o_ptr)
901 bool changed = FALSE;
904 /* Hack -- leave artifacts alone */
905 if (object_is_artifact(o_ptr)) return;
908 /* Get local object */
911 /* Copy the object */
912 object_copy(q_ptr, o_ptr);
915 /* Main loop. Ask for magification and artifactification */
918 /* Display full item debug information */
919 wiz_display_item(q_ptr);
921 /* Ask wizard what to do. */
922 if (!get_com("[a]ccept, [w]orthless, [c]ursed, [n]ormal, [g]ood, [e]xcellent, [s]pecial? ", &ch, FALSE))
924 /* Preserve wizard-generated artifacts */
925 if (object_is_fixed_artifact(q_ptr))
927 a_info[q_ptr->name1].cur_num = 0;
935 /* Create/change it! */
936 if (ch == 'A' || ch == 'a')
942 /* Preserve wizard-generated artifacts */
943 if (object_is_fixed_artifact(q_ptr))
945 a_info[q_ptr->name1].cur_num = 0;
951 /* Apply bad magic, but first clear object */
954 object_prep(q_ptr, o_ptr->k_idx);
955 apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT | AM_CURSED);
958 /* Apply bad magic, but first clear object */
961 object_prep(q_ptr, o_ptr->k_idx);
962 apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_CURSED);
965 /* Apply normal magic, but first clear object */
968 object_prep(q_ptr, o_ptr->k_idx);
969 apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART);
972 /* Apply good magic, but first clear object */
975 object_prep(q_ptr, o_ptr->k_idx);
976 apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART | AM_GOOD);
979 /* Apply great magic, but first clear object */
982 object_prep(q_ptr, o_ptr->k_idx);
983 apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT);
986 /* Apply special magic, but first clear object */
989 object_prep(q_ptr, o_ptr->k_idx);
990 apply_magic(q_ptr, dun_level, AM_GOOD | AM_GREAT | AM_SPECIAL);
992 /* Failed to create artifact; make a random one */
993 if (!object_is_artifact(q_ptr)) create_artifact(q_ptr, FALSE);
997 q_ptr->iy = o_ptr->iy;
998 q_ptr->ix = o_ptr->ix;
999 q_ptr->next_o_idx = o_ptr->next_o_idx;
1000 q_ptr->marked = o_ptr->marked;
1008 object_copy(o_ptr, q_ptr);
1010 /* Recalculate bonuses */
1011 p_ptr->update |= (PU_BONUS);
1013 /* Combine / Reorder the pack (later) */
1014 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1017 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1024 * Try to create an item again. Output some statistics. -Bernd-
1026 * The statistics are correct now. We acquire a clean grid, and then
1027 * repeatedly place an object in this grid, copying it into an item
1028 * holder, and then deleting the object. We fiddle with the artifact
1029 * counter flags to prevent weirdness. We use the items to collect
1030 * statistics on item creation relative to the initial item.
1032 static void wiz_statistics(object_type *o_ptr)
1034 u32b i, matches, better, worse, other, correct;
1036 u32b test_roll = 1000000;
1046 cptr q = "Rolls: %ld Correct: %ld Matches: %ld Better: %ld Worse: %ld Other: %ld";
1048 cptr p = "Enter number of items to roll: ";
1052 /* XXX XXX XXX Mega-Hack -- allow multiple artifacts */
1053 if (object_is_fixed_artifact(o_ptr)) a_info[o_ptr->name1].cur_num = 0;
1059 cptr pmt = "Roll for [n]ormal, [g]ood, or [e]xcellent treasure? ";
1062 wiz_display_item(o_ptr);
1065 if (!get_com(pmt, &ch, FALSE)) break;
1067 if (ch == 'n' || ch == 'N')
1072 else if (ch == 'g' || ch == 'G')
1077 else if (ch == 'e' || ch == 'E')
1079 mode = AM_GOOD | AM_GREAT;
1080 quality = "excellent";
1087 sprintf(tmp_val, "%ld", (long int)test_roll);
1088 if (get_string(p, tmp_val, 10)) test_roll = atol(tmp_val);
1089 test_roll = MAX(1, test_roll);
1091 /* Let us know what we are doing */
1092 msg_format("Creating a lot of %s items. Base level = %d.",
1093 quality, dun_level);
1096 /* Set counters to zero */
1097 correct = matches = better = worse = other = 0;
1099 /* Let's rock and roll */
1100 for (i = 0; i <= test_roll; i++)
1102 /* Output every few rolls */
1103 if ((i < 100) || (i % 100 == 0))
1108 /* Allow interupt */
1118 /* Dump the stats */
1119 prt(format(q, i, correct, matches, better, worse, other), 0, 0);
1124 /* Get local object */
1127 /* Wipe the object */
1130 /* Create an object */
1131 make_object(q_ptr, mode);
1134 /* XXX XXX XXX Mega-Hack -- allow multiple artifacts */
1135 if (object_is_fixed_artifact(q_ptr)) a_info[q_ptr->name1].cur_num = 0;
1138 /* Test for the same tval and sval. */
1139 if ((o_ptr->tval) != (q_ptr->tval)) continue;
1140 if ((o_ptr->sval) != (q_ptr->sval)) continue;
1142 /* One more correct item */
1145 /* Check for match */
1146 if ((q_ptr->pval == o_ptr->pval) &&
1147 (q_ptr->to_a == o_ptr->to_a) &&
1148 (q_ptr->to_h == o_ptr->to_h) &&
1149 (q_ptr->to_d == o_ptr->to_d) &&
1150 (q_ptr->name1 == o_ptr->name1))
1155 /* Check for better */
1156 else if ((q_ptr->pval >= o_ptr->pval) &&
1157 (q_ptr->to_a >= o_ptr->to_a) &&
1158 (q_ptr->to_h >= o_ptr->to_h) &&
1159 (q_ptr->to_d >= o_ptr->to_d))
1164 /* Check for worse */
1165 else if ((q_ptr->pval <= o_ptr->pval) &&
1166 (q_ptr->to_a <= o_ptr->to_a) &&
1167 (q_ptr->to_h <= o_ptr->to_h) &&
1168 (q_ptr->to_d <= o_ptr->to_d))
1173 /* Assume different */
1181 msg_format(q, i, correct, matches, better, worse, other);
1186 /* Hack -- Normally only make a single artifact */
1187 if (object_is_fixed_artifact(o_ptr)) a_info[o_ptr->name1].cur_num = 1;
1192 * Change the quantity of a the item
1194 static void wiz_quantity_item(object_type *o_ptr)
1196 int tmp_int, tmp_qnt;
1201 /* Never duplicate artifacts */
1202 if (object_is_artifact(o_ptr)) return;
1204 /* Store old quantity. -LM- */
1205 tmp_qnt = o_ptr->number;
1208 sprintf(tmp_val, "%d", o_ptr->number);
1211 if (get_string("Quantity: ", tmp_val, 2))
1214 tmp_int = atoi(tmp_val);
1217 if (tmp_int < 1) tmp_int = 1;
1218 if (tmp_int > 99) tmp_int = 99;
1220 /* Accept modifications */
1221 o_ptr->number = tmp_int;
1224 if (o_ptr->tval == TV_ROD)
1226 o_ptr->pval = o_ptr->pval * o_ptr->number / tmp_qnt;
1230 /* debug command for blue mage */
1231 static void do_cmd_wiz_blue_mage(void)
1236 s32b f4 = 0, f5 = 0, f6 = 0;
1241 set_rf_masks(&f4, &f5, &f6, j);
1243 for (i = 0; i < 32; i++)
1245 if ((0x00000001 << i) & f4) p_ptr->magic_num2[i] = 1;
1249 if ((0x00000001 << (i - 32)) & f5) p_ptr->magic_num2[i] = 1;
1253 if ((0x00000001 << (i - 64)) & f6) p_ptr->magic_num2[i] = 1;
1260 * Play with an item. Options include:
1261 * - Output statistics (via wiz_roll_item)
1262 * - Reroll item (via wiz_reroll_item)
1263 * - Change properties (via wiz_tweak_item)
1264 * - Change the number of items (via wiz_quantity_item)
1266 static void do_cmd_wiz_play(void)
1281 item_tester_no_ryoute = TRUE;
1283 q = "Play with which object? ";
1284 s = "You have nothing to play with.";
1285 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
1287 /* Get the item (in the pack) */
1290 o_ptr = &inventory[item];
1293 /* Get the item (on the floor) */
1296 o_ptr = &o_list[0 - item];
1299 /* The item was not changed */
1303 /* Save the screen */
1307 /* Get local object */
1311 object_copy(q_ptr, o_ptr);
1317 /* Display the item */
1318 wiz_display_item(q_ptr);
1321 if (!get_com("[a]ccept [s]tatistics [r]eroll [t]weak [q]uantity? ", &ch, FALSE))
1327 if (ch == 'A' || ch == 'a')
1333 if (ch == 's' || ch == 'S')
1335 wiz_statistics(q_ptr);
1338 if (ch == 'r' || ch == 'r')
1340 wiz_reroll_item(q_ptr);
1343 if (ch == 't' || ch == 'T')
1345 wiz_tweak_item(q_ptr);
1348 if (ch == 'q' || ch == 'Q')
1350 wiz_quantity_item(q_ptr);
1355 /* Restore the screen */
1363 msg_print("Changes accepted.");
1365 /* Recalcurate object's weight */
1368 p_ptr->total_weight += (q_ptr->weight * q_ptr->number)
1369 - (o_ptr->weight * o_ptr->number);
1373 object_copy(o_ptr, q_ptr);
1376 /* Recalculate bonuses */
1377 p_ptr->update |= (PU_BONUS);
1379 /* Combine / Reorder the pack (later) */
1380 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1383 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1389 msg_print("Changes ignored.");
1395 * Wizard routine for creating objects -RAK-
1396 * Heavily modified to allow magification and artifactification -Bernd-
1398 * Note that wizards cannot create objects on top of other objects.
1400 * Hack -- this routine always makes a "dungeon object", and applies
1401 * magic to it, and attempts to decline cursed items.
1403 static void wiz_create_item(void)
1411 /* Save the screen */
1414 /* Get object base type */
1415 k_idx = wiz_create_itemtype();
1417 /* Restore the screen */
1421 /* Return if failed */
1424 if (k_info[k_idx].gen_flags & TRG_INSTA_ART)
1429 for (i = 1; i < max_a_idx; i++)
1431 /* Ignore incorrect tval */
1432 if (a_info[i].tval != k_info[k_idx].tval) continue;
1434 /* Ignore incorrect sval */
1435 if (a_info[i].sval != k_info[k_idx].sval) continue;
1437 /* Create this artifact */
1438 (void)create_named_art(i, py, px);
1441 msg_print("Allocated(INSTA_ART).");
1447 /* Get local object */
1450 /* Create the item */
1451 object_prep(q_ptr, k_idx);
1454 apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART);
1456 /* Drop the object from heaven */
1457 (void)drop_near(q_ptr, -1, py, px);
1460 msg_print("Allocated.");
1465 * Cure everything instantly
1467 static void do_cmd_wiz_cure_all(void)
1470 (void)res_stat(A_STR);
1471 (void)res_stat(A_INT);
1472 (void)res_stat(A_WIS);
1473 (void)res_stat(A_CON);
1474 (void)res_stat(A_DEX);
1475 (void)res_stat(A_CHR);
1477 /* Restore the level */
1478 (void)restore_level();
1480 /* Heal the player */
1481 if (p_ptr->chp < p_ptr->mhp)
1483 p_ptr->chp = p_ptr->mhp;
1484 p_ptr->chp_frac = 0;
1487 p_ptr->redraw |= (PR_HP);
1490 p_ptr->window |= (PW_PLAYER);
1494 if (p_ptr->csp < p_ptr->msp)
1496 p_ptr->csp = p_ptr->msp;
1497 p_ptr->csp_frac = 0;
1499 p_ptr->redraw |= (PR_MANA);
1500 p_ptr->window |= (PW_PLAYER);
1501 p_ptr->window |= (PW_SPELL);
1506 (void)set_confused(0);
1507 (void)set_poisoned(0);
1508 (void)set_afraid(0);
1509 (void)set_paralyzed(0);
1513 (void)set_slow(0, TRUE);
1515 /* No longer hungry */
1516 (void)set_food(PY_FOOD_MAX - 1);
1523 static void do_cmd_wiz_jump(void)
1526 if (command_arg <= 0)
1531 int tmp_dungeon_type;
1534 sprintf(ppp, "Jump which dungeon : ");
1537 sprintf(tmp_val, "%d", dungeon_type);
1539 /* Ask for a level */
1540 if (!get_string(ppp, tmp_val, 2)) return;
1542 tmp_dungeon_type = atoi(tmp_val);
1543 if (!d_info[tmp_dungeon_type].maxdepth || (tmp_dungeon_type > max_d_idx)) tmp_dungeon_type = DUNGEON_ANGBAND;
1546 sprintf(ppp, "Jump to level (0, %d-%d): ", d_info[tmp_dungeon_type].mindepth, d_info[tmp_dungeon_type].maxdepth);
1549 sprintf(tmp_val, "%d", dun_level);
1551 /* Ask for a level */
1552 if (!get_string(ppp, tmp_val, 10)) return;
1554 /* Extract request */
1555 command_arg = atoi(tmp_val);
1557 dungeon_type = tmp_dungeon_type;
1561 if (command_arg < d_info[dungeon_type].mindepth) command_arg = 0;
1564 if (command_arg > d_info[dungeon_type].maxdepth) command_arg = d_info[dungeon_type].maxdepth;
1566 /* Accept request */
1567 msg_format("You jump to dungeon level %d.", command_arg);
1569 if (autosave_l) do_cmd_save_game(TRUE);
1572 dun_level = command_arg;
1574 prepare_change_floor_mode(CFM_RAND_PLACE);
1576 if (!dun_level) dungeon_type = 0;
1577 p_ptr->inside_arena = FALSE;
1578 p_ptr->wild_mode = FALSE;
1580 leave_quest_check();
1582 if (record_stair) do_cmd_write_nikki(NIKKI_WIZ_TELE,0,NULL);
1584 p_ptr->inside_quest = 0;
1587 /* Prevent energy_need from being too lower than 0 */
1588 p_ptr->energy_need = 0;
1591 * Clear all saved floors
1592 * and create a first saved floor
1594 prepare_change_floor_mode(CFM_FIRST_FLOOR);
1597 p_ptr->leaving = TRUE;
1602 * Become aware of a lot of objects
1604 static void do_cmd_wiz_learn(void)
1611 /* Scan every object */
1612 for (i = 1; i < max_k_idx; i++)
1614 object_kind *k_ptr = &k_info[i];
1616 /* Induce awareness */
1617 if (k_ptr->level <= command_arg)
1619 /* Get local object */
1622 /* Prepare object */
1623 object_prep(q_ptr, i);
1626 object_aware(q_ptr);
1633 * Summon some creatures
1635 static void do_cmd_wiz_summon(int num)
1639 for (i = 0; i < num; i++)
1641 (void)summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
1647 * Summon a creature of the specified type
1649 * XXX XXX XXX This function is rather dangerous
1651 static void do_cmd_wiz_named(int r_idx)
1653 (void)summon_named_creature(0, py, px, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
1658 * Summon a creature of the specified type
1660 * XXX XXX XXX This function is rather dangerous
1662 static void do_cmd_wiz_named_friendly(int r_idx)
1664 (void)summon_named_creature(0, py, px, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP | PM_FORCE_PET));
1670 * Hack -- Delete all nearby monsters
1672 static void do_cmd_wiz_zap(void)
1677 /* Genocide everyone nearby */
1678 for (i = 1; i < m_max; i++)
1680 monster_type *m_ptr = &m_list[i];
1682 /* Paranoia -- Skip dead monsters */
1683 if (!m_ptr->r_idx) continue;
1685 /* Skip the mount */
1686 if (i == p_ptr->riding) continue;
1688 /* Delete nearby monsters */
1689 if (m_ptr->cdis <= MAX_SIGHT)
1691 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
1695 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
1696 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_WIZ_ZAP, m_name);
1699 delete_monster_idx(i);
1706 * Hack -- Delete all monsters
1708 static void do_cmd_wiz_zap_all(void)
1712 /* Genocide everyone */
1713 for (i = 1; i < m_max; i++)
1715 monster_type *m_ptr = &m_list[i];
1717 /* Paranoia -- Skip dead monsters */
1718 if (!m_ptr->r_idx) continue;
1720 /* Skip the mount */
1721 if (i == p_ptr->riding) continue;
1723 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
1727 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
1728 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_WIZ_ZAP, m_name);
1731 /* Delete this monster */
1732 delete_monster_idx(i);
1738 * Create desired feature
1740 static void do_cmd_wiz_create_feature(void)
1742 static int prev_feat = 0;
1743 static int prev_mimic = 0;
1745 feature_type *f_ptr;
1747 int tmp_feat, tmp_mimic;
1750 if (!tgt_pt(&x, &y)) return;
1752 c_ptr = &cave[y][x];
1755 sprintf(tmp_val, "%d", prev_feat);
1759 if (!get_string("ÃÏ·Á: ", tmp_val, 3)) return;
1761 if (!get_string("Feature: ", tmp_val, 3)) return;
1765 tmp_feat = atoi(tmp_val);
1766 if (tmp_feat < 0) tmp_feat = 0;
1767 else if (tmp_feat >= max_f_idx) tmp_feat = max_f_idx - 1;
1770 sprintf(tmp_val, "%d", prev_mimic);
1774 if (!get_string("ÃÏ·Á (mimic): ", tmp_val, 3)) return;
1776 if (!get_string("Feature (mimic): ", tmp_val, 3)) return;
1780 tmp_mimic = atoi(tmp_val);
1781 if (tmp_mimic < 0) tmp_mimic = 0;
1782 else if (tmp_mimic >= max_f_idx) tmp_mimic = max_f_idx - 1;
1784 cave_set_feat(y, x, tmp_feat);
1785 c_ptr->mimic = tmp_mimic;
1787 f_ptr = &f_info[get_feat_mimic(c_ptr)];
1789 if (have_flag(f_ptr->flags, FF_GLYPH) ||
1790 have_flag(f_ptr->flags, FF_MINOR_GLYPH))
1791 c_ptr->info |= (CAVE_OBJECT);
1792 else if (have_flag(f_ptr->flags, FF_MIRROR))
1793 c_ptr->info |= (CAVE_GLOW | CAVE_OBJECT);
1801 /* Update some things */
1802 p_ptr->update |= (PU_FLOW);
1804 prev_feat = tmp_feat;
1805 prev_mimic = tmp_mimic;
1810 #define NUM_O_BIT 32
1813 * Hack -- Dump option bits usage
1815 static void do_cmd_dump_options(void)
1822 /* Build the filename */
1823 path_build(buf, sizeof buf, ANGBAND_DIR_USER, "opt_info.txt");
1825 /* File type is "TEXT" */
1826 FILE_TYPE(FILE_TYPE_TEXT);
1829 fff = my_fopen(buf, "a");
1835 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
1837 msg_format("Failed to open file %s.", buf);
1843 /* Allocate the "exist" array (2-dimension) */
1844 C_MAKE(exist, NUM_O_SET, int *);
1845 C_MAKE(*exist, NUM_O_BIT * NUM_O_SET, int);
1846 for (i = 1; i < NUM_O_SET; i++) exist[i] = *exist + i * NUM_O_BIT;
1848 /* Check for exist option bits */
1849 for (i = 0; option_info[i].o_desc; i++)
1851 const option_type *ot_ptr = &option_info[i];
1852 if (ot_ptr->o_var) exist[ot_ptr->o_set][ot_ptr->o_bit] = i + 1;
1855 fprintf(fff, "[Option bits usage on Hengband %d.%d.%d]\n\n",
1856 FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
1858 fputs("Set - Bit (Page) Option Name\n", fff);
1859 fputs("------------------------------------------------\n", fff);
1860 /* Dump option bits usage */
1861 for (i = 0; i < NUM_O_SET; i++)
1863 for (j = 0; j < NUM_O_BIT; j++)
1867 const option_type *ot_ptr = &option_info[exist[i][j] - 1];
1868 fprintf(fff, " %d - %02d (%4d) %s\n",
1869 i, j, ot_ptr->o_page, ot_ptr->o_text);
1873 fprintf(fff, " %d - %02d\n", i, j);
1879 /* Free the "exist" array (2-dimension) */
1880 C_KILL(*exist, NUM_O_BIT * NUM_O_SET, int);
1881 C_KILL(exist, NUM_O_SET, int *);
1887 msg_format("¥ª¥×¥·¥ç¥óbit»ÈÍѾõ¶·¤ò¥Õ¥¡¥¤¥ë %s ¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£", buf);
1889 msg_format("Option bits usage dump saved to file %s.", buf);
1894 #ifdef ALLOW_SPOILERS
1899 extern void do_cmd_spoilers(void);
1901 #endif /* ALLOW_SPOILERS */
1906 * Hack -- declare external function
1908 extern void do_cmd_debug(void);
1913 * Ask for and parse a "debug command"
1914 * The "command_arg" may have been set.
1916 void do_cmd_debug(void)
1922 /* Get a "debug command" */
1923 get_com("Debug Command: ", &cmd, FALSE);
1925 /* Analyze the command */
1935 #ifdef ALLOW_SPOILERS
1937 /* Hack -- Generate Spoilers */
1942 #endif /* ALLOW_SPOILERS */
1949 /* Cure all maladies */
1951 do_cmd_wiz_cure_all();
1954 /* Know alignment */
1956 msg_format("Your alignment is %d.", p_ptr->align);
1959 /* Teleport to target */
1968 /* Create any object */
1973 /* Create a named artifact */
1975 wiz_create_named_art();
1978 /* Detect everything */
1980 detect_all(DETECT_RAD_ALL * 3);
1983 /* Dimension_door */
1985 wiz_dimension_door();
1988 /* Edit character */
1990 do_cmd_wiz_change();
1993 /* Blue Mage Only */
1995 if (p_ptr->pclass == CLASS_BLUE_MAGE)
1997 do_cmd_wiz_blue_mage();
2001 /* View item info */
2003 identify_fully(FALSE);
2006 /* Create desired feature */
2008 do_cmd_wiz_create_feature();
2013 if (command_arg <= 0) command_arg = 1;
2014 acquirement(py, px, command_arg, FALSE, TRUE);
2017 /* Hitpoint rerating */
2019 do_cmd_rerate(TRUE);
2022 #ifdef MONSTER_HORDES
2024 do_cmd_summon_horde();
2026 #endif /* MONSTER_HORDES */
2030 (void)ident_spell(FALSE);
2033 /* Go up or down in the dungeon */
2038 /* Self-Knowledge */
2043 /* Learn about objects */
2050 map_area(DETECT_RAD_ALL * 3);
2055 (void)gain_random_mutation(command_arg);
2060 (void)do_cmd_wiz_reset_class();
2063 /* Specific reward */
2065 (void)gain_level_reward(command_arg);
2068 /* Summon _friendly_ named monster */
2070 do_cmd_wiz_named_friendly(command_arg);
2073 /* Summon Named Monster */
2075 do_cmd_wiz_named(command_arg);
2078 /* Dump option bits usage */
2080 do_cmd_dump_options();
2083 /* Object playing routines */
2090 teleport_player(10, 0L);
2094 /* Complete a Quest -KMW- */
2096 for (i = 0; i < max_quests; i++)
2098 if (p_ptr->quest[i].status == QUEST_STATUS_TAKEN)
2100 p_ptr->quest[i].status++;
2101 msg_print("Completed Quest");
2106 if (i == max_quests)
2108 msg_print("No current quest");
2114 /* Make every dungeon square "known" to test streamers -KMW- */
2116 for (y = 0; y < cur_hgt; y++)
2118 for (x = 0; x < cur_wid; x++)
2120 cave[y][x].info |= (CAVE_GLOW | CAVE_MARK);
2126 /* Summon Random Monster(s) */
2128 if (command_arg <= 0) command_arg = 1;
2129 do_cmd_wiz_summon(command_arg);
2134 teleport_player(100, 0L);
2137 /* Very Good Objects */
2139 if (command_arg <= 0) command_arg = 1;
2140 acquirement(py, px, command_arg, TRUE, TRUE);
2143 /* Wizard Light the Level */
2145 wiz_lite((bool)(p_ptr->pclass == CLASS_NINJA));
2148 /* Increase Experience */
2150 gain_exp(command_arg ? command_arg : (p_ptr->exp + 1));
2153 /* Zap Monsters (Genocide) */
2158 /* Zap Monsters (Omnicide) */
2160 do_cmd_wiz_zap_all();
2163 /* Hack -- whatever I desire */
2165 do_cmd_wiz_hack_ben();
2168 /* Not a Wizard Command */
2170 msg_print("That is not a valid debug command.");