3 * @brief ウィザードモードの処理(特別処理中心) / Wizard commands
6 * Copyright (c) 1997 Ben Harrison, and others<br>
7 * This software may be copied and distributed for educational, research,
8 * and not for profit purposes provided that this copyright and statement
9 * are included in all such copies. Other copyrights may also apply.<br>
10 * 2014 Deskull rearranged comment for Doxygen.<br>
22 #include "player-status.h"
23 #include "player-effects.h"
24 #include "player-skill.h"
27 #include "spells-object.h"
28 #include "spells-summon.h"
29 #include "spells-status.h"
30 #include "spells-world.h"
31 #include "spells-floor.h"
33 #include "object-flavor.h"
34 #include "object-hook.h"
35 #include "monster-status.h"
38 #include "floor-save.h"
40 #include "dungeon-file.h"
42 #include "monster-spell.h"
48 * @brief 必ず成功するウィザードモード用次元の扉処理 / Wizard Dimension Door
49 * @return 実際にテレポートを行ったらTRUEを返す
51 static bool wiz_dimension_door(void)
53 POSITION x = 0, y = 0;
54 if (!tgt_pt(&x, &y)) return FALSE;
55 teleport_player_to(y, x, TELEPORT_NONMAGICAL);
60 * @brief 指定されたIDの固定アーティファクトを生成する / Create the artifact of the specified number
63 static void wiz_create_named_art(void)
65 char tmp_val[10] = "";
69 if (!get_string("Artifact ID:", tmp_val, 3)) return;
72 a_idx = (ARTIFACT_IDX)atoi(tmp_val);
73 if(a_idx < 0) a_idx = 0;
74 if(a_idx >= max_a_idx) a_idx = 0;
76 (void)create_named_art(a_idx, p_ptr->y, p_ptr->x);
79 msg_print("Allocated.");
83 * @brief ウィザードモード用モンスターの群れ生成 / Summon a horde of monsters
86 static void do_cmd_summon_horde(void)
88 POSITION wy = p_ptr->y, wx = p_ptr->x;
93 scatter(&wy, &wx, p_ptr->y, p_ptr->x, 3, 0);
94 if (cave_empty_bold(wy, wx)) break;
97 (void)alloc_horde(wy, wx);
101 * @brief 32ビット変数のビット配列を並べて描画する / Output a long int in binary format.
104 static void prt_binary(BIT_FLAGS flags, int row, int col)
110 for (i = bitmask = 1; i <= 32; i++, bitmask *= 2)
115 Term_putch(col++, row, TERM_BLUE, '*');
118 /* Dump unset bits */
121 Term_putch(col++, row, TERM_WHITE, '-');
127 #define K_MAX_DEPTH 110 /*!< アイテムの階層毎生成率を表示する最大階 */
130 * @brief アイテムの階層毎生成率を表示する / Output a rarity graph for a type of object.
131 * @param tval ベースアイテムの大項目ID
132 * @param sval ベースアイテムの小項目ID
137 static void prt_alloc(OBJECT_TYPE_VALUE tval, OBJECT_SUBTYPE_VALUE sval, TERM_LEN row, TERM_LEN col)
141 u32b rarity[K_MAX_DEPTH];
142 u32b total[K_MAX_DEPTH];
144 concptr r = "+---Rate---+";
149 alloc_entry *table = alloc_kind_table;
151 /* Wipe the tables */
152 (void)C_WIPE(rarity, K_MAX_DEPTH, u32b);
153 (void)C_WIPE(total, K_MAX_DEPTH, u32b);
154 (void)C_WIPE(display, 22, s32b);
156 /* Scan all entries */
157 for (i = 0; i < K_MAX_DEPTH; i++)
160 for (j = 0; j < alloc_kind_size; j++)
164 if (table[j].level <= i)
166 prob = table[j].prob1 * GREAT_OBJ * K_MAX_DEPTH;
168 else if (table[j].level - 1 > 0)
170 prob = table[j].prob1 * i * K_MAX_DEPTH / (table[j].level - 1);
173 /* Acquire this kind */
174 k_ptr = &k_info[table[j].index];
176 /* Accumulate probabilities */
177 total[i] += prob / (GREAT_OBJ * K_MAX_DEPTH);
178 total_frac += prob % (GREAT_OBJ * K_MAX_DEPTH);
180 /* Accumulate probabilities */
181 if ((k_ptr->tval == tval) && (k_ptr->sval == sval))
184 rarity[i] += prob / (GREAT_OBJ * K_MAX_DEPTH);
187 total[i] += total_frac / (GREAT_OBJ * K_MAX_DEPTH);
190 /* Calculate probabilities for each range */
191 for (i = 0; i < 22; i++)
193 /* Shift the values into view */
195 for (j = i * K_MAX_DEPTH / 22; j < (i + 1) * K_MAX_DEPTH / 22; j++)
196 possibility += rarity[j] * 100000 / total[j];
197 display[i] = possibility / 5;
200 /* Graph the rarities */
201 for (i = 0; i < 22; i++)
203 Term_putch(col, row + i + 1, TERM_WHITE, '|');
205 prt(format("%2dF", (i * 5)), row + i + 1, col);
209 if ((i * K_MAX_DEPTH / 22 <= home) && (home < (i + 1) * K_MAX_DEPTH / 22))
211 c_prt(TERM_RED, format("%3d.%04d%%", display[i] / 1000, display[i] % 1000), row + i + 1, col + 3);
215 c_prt(TERM_WHITE, format("%3d.%04d%%", display[i] / 1000, display[i] % 1000), row + i + 1, col + 3);
219 /* Make it look nice */
224 * @brief プレイヤーの職業を変更する
226 * @todo 魔法領域の再選択などがまだ不完全、要実装。
228 static void do_cmd_wiz_reset_class(void)
235 sprintf(ppp, "Class (0-%d): ", MAX_CLASS - 1);
238 sprintf(tmp_val, "%d", p_ptr->pclass);
241 if (!get_string(ppp, tmp_val, 2)) return;
244 tmp_int = atoi(tmp_val);
247 if (tmp_int < 0 || tmp_int >= MAX_CLASS) return;
250 p_ptr->pclass = (byte_hack)tmp_int;
252 /* Redraw inscription */
253 p_ptr->window |= (PW_PLAYER);
255 /* {.} and {$} effect p_ptr->warning and TRC_TELEPORT_SELF */
256 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
263 * @brief ウィザードモード用処理としてターゲット中の相手をテレポートバックする / Hack -- Teleport to the target
266 static void do_cmd_wiz_bamf(void)
268 /* Must have a target */
269 if (!target_who) return;
271 /* Teleport to the target */
272 teleport_player_to(target_row, target_col, TELEPORT_NONMAGICAL);
277 * @brief プレイヤーの現能力値を調整する
278 * Aux function for "do_cmd_wiz_change()". -RAK-
281 static void do_cmd_wiz_change_aux(void)
291 /* Query the stats */
292 for (i = 0; i < A_MAX; i++)
295 sprintf(ppp, "%s (3-%d): ", stat_names[i], p_ptr->stat_max_max[i]);
298 sprintf(tmp_val, "%d", p_ptr->stat_max[i]);
301 if (!get_string(ppp, tmp_val, 3)) return;
304 tmp_int = atoi(tmp_val);
307 if (tmp_int > p_ptr->stat_max_max[i]) tmp_int = p_ptr->stat_max_max[i];
308 else if (tmp_int < 3) tmp_int = 3;
311 p_ptr->stat_cur[i] = p_ptr->stat_max[i] = (BASE_STATUS)tmp_int;
316 sprintf(tmp_val, "%d", WEAPON_EXP_MASTER);
319 if (!get_string(_("熟練度: ", "Proficiency: "), tmp_val, 9)) return;
322 tmp_s16b = (s16b)atoi(tmp_val);
325 if (tmp_s16b < WEAPON_EXP_UNSKILLED) tmp_s16b = WEAPON_EXP_UNSKILLED;
326 if (tmp_s16b > WEAPON_EXP_MASTER) tmp_s16b = WEAPON_EXP_MASTER;
328 for (j = 0; j <= TV_WEAPON_END - TV_WEAPON_BEGIN; j++)
330 for (i = 0;i < 64;i++)
332 p_ptr->weapon_exp[j][i] = tmp_s16b;
333 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];
337 for (j = 0; j < 10; j++)
339 p_ptr->skill_exp[j] = tmp_s16b;
340 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];
343 for (j = 0; j < 32; j++)
344 p_ptr->spell_exp[j] = (tmp_s16b > SPELL_EXP_MASTER ? SPELL_EXP_MASTER : tmp_s16b);
346 p_ptr->spell_exp[j] = (tmp_s16b > SPELL_EXP_EXPERT ? SPELL_EXP_EXPERT : tmp_s16b);
349 sprintf(tmp_val, "%ld", (long)(p_ptr->au));
352 if (!get_string("Gold: ", tmp_val, 9)) return;
355 tmp_long = atol(tmp_val);
358 if (tmp_long < 0) tmp_long = 0L;
361 p_ptr->au = tmp_long;
364 sprintf(tmp_val, "%ld", (long)(p_ptr->max_exp));
367 if (!get_string("Experience: ", tmp_val, 9)) return;
370 tmp_long = atol(tmp_val);
373 if (tmp_long < 0) tmp_long = 0L;
375 if (p_ptr->prace != RACE_ANDROID)
378 p_ptr->max_exp = tmp_long;
379 p_ptr->exp = tmp_long;
388 * @brief プレイヤーの現能力値を調整する(メインルーチン)
389 * Change various "permanent" player variables.
392 static void do_cmd_wiz_change(void)
395 do_cmd_wiz_change_aux();
401 * @brief アイテムの詳細ステータスを表示する /
402 * Change various "permanent" player variables.
403 * @param o_ptr 詳細を表示するアイテム情報の参照ポインタ
406 * Wizard routines for creating objects -RAK-
407 * And for manipulating them! -Bernd-
409 * This has been rewritten to make the whole procedure
410 * of debugging objects much easier and more comfortable.
412 * The following functions are meant to play with objects:
413 * Create, modify, roll for them (for statistic purposes) and more.
414 * The original functions were by RAK.
415 * The function to show an item's debug information was written
416 * by David Reeve Sward <sward+@CMU.EDU>.
417 * Bernd (wiebelt@mathematik.hu-berlin.de)
419 * Here are the low-level functions
420 * - wiz_display_item()
421 * display an item's debug-info
422 * - wiz_create_itemtype()
423 * specify tval and sval (type and subtype of object)
425 * specify pval, +AC, +tohit, +todam
426 * Note that the wizard can leave this function anytime,
427 * thus accepting the default-values for the remaining values.
428 * pval comes first now, since it is most important.
429 * - wiz_reroll_item()
430 * apply some magic to the item or current_world_ptr->game_turn it into an artifact.
432 * Get some statistics about the rarity of an item:
433 * We create a lot of fake items and see if they are of the
434 * same type (tval and sval), then we compare pval and +AC.
435 * If the fake-item is better or equal it is counted.
436 * Note that cursed items that are better or equal (absolute values)
438 * HINT: This is *very* useful for balancing the game!
439 * - wiz_quantity_item()
440 * change the quantity of an item, but be sane about it.
442 * And now the high-level functions
443 * - do_cmd_wiz_play()
444 * play with an existing object
445 * - wiz_create_item()
446 * create a new object
448 * Note -- You do not have to specify "pval" and other item-properties
449 * directly. Just apply magic until you are satisfied with the item.
451 * Note -- For some items (such as wands, staffs, some rings, etc), you
452 * must apply magic, or you will get "broken" or "uncharged" objects.
454 * Note -- Redefining artifacts via "do_cmd_wiz_play()" may destroy
455 * the artifact. Be careful.
457 * Hack -- this function will allow you to create multiple artifacts.
458 * This "feature" may induce crashes or other nasty effects.
459 * Just display an item's properties (debug-info)
460 * Originally by David Reeve Sward <sward+@CMU.EDU>
461 * Verbose item flags by -Bernd-
463 static void wiz_display_item(object_type *o_ptr)
466 BIT_FLAGS flgs[TR_FLAG_SIZE];
468 object_flags(o_ptr, flgs);
470 /* Clear the screen */
471 for (i = 1; i <= 23; i++) prt("", i, j - 2);
473 prt_alloc(o_ptr->tval, o_ptr->sval, 1, 0);
476 object_desc(buf, o_ptr, OD_STORE);
480 prt(format("kind = %-5d level = %-4d tval = %-5d sval = %-5d",
481 o_ptr->k_idx, k_info[o_ptr->k_idx].level,
482 o_ptr->tval, o_ptr->sval), 4, j);
484 prt(format("number = %-3d wgt = %-6d ac = %-5d damage = %dd%d",
485 o_ptr->number, o_ptr->weight,
486 o_ptr->ac, o_ptr->dd, o_ptr->ds), 5, j);
488 prt(format("pval = %-5d toac = %-5d tohit = %-4d todam = %-4d",
489 o_ptr->pval, o_ptr->to_a, o_ptr->to_h, o_ptr->to_d), 6, j);
491 prt(format("name1 = %-4d name2 = %-4d cost = %ld",
492 o_ptr->name1, o_ptr->name2, (long)object_value_real(o_ptr)), 7, j);
494 prt(format("ident = %04x xtra1 = %-4d xtra2 = %-4d timeout = %-d",
495 o_ptr->ident, o_ptr->xtra1, o_ptr->xtra2, o_ptr->timeout), 8, j);
497 prt(format("xtra3 = %-4d xtra4 = %-4d xtra5 = %-4d cursed = %-d",
498 o_ptr->xtra3, o_ptr->xtra4, o_ptr->xtra5, o_ptr->curse_flags), 9, j);
500 prt("+------------FLAGS1------------+", 10, j);
501 prt("AFFECT........SLAY........BRAND.", 11, j);
502 prt(" mf cvae xsqpaefc", 12, j);
503 prt("siwdccsossidsahanvudotgddhuoclio", 13, j);
504 prt("tnieohtctrnipttmiinmrrnrrraiierl", 14, j);
505 prt("rtsxnarelcfgdkcpmldncltggpksdced", 15, j);
506 prt_binary(flgs[0], 16, j);
508 prt("+------------FLAGS2------------+", 17, j);
509 prt("SUST....IMMUN.RESIST............", 18, j);
510 prt(" reaefctrpsaefcpfldbc sn ", 19, j);
511 prt("siwdcciaclioheatcliooeialoshtncd", 20, j);
512 prt("tnieohdsierlrfraierliatrnnnrhehi", 21, j);
513 prt("rtsxnaeydcedwlatdcedsrekdfddrxss", 22, j);
514 prt_binary(flgs[1], 23, j);
516 prt("+------------FLAGS3------------+", 10, j+32);
517 prt("fe cnn t stdrmsiiii d ab ", 11, j+32);
518 prt("aa aoomywhs lleeieihgggg rtgl ", 12, j+32);
519 prt("uu utmacaih eielgggonnnnaaere ", 13, j+32);
520 prt("rr reanurdo vtieeehtrrrrcilas ", 14, j+32);
521 prt("aa algarnew ienpsntsaefctnevs ", 15, j+32);
522 prt_binary(flgs[2], 16, j+32);
524 prt("+------------FLAGS4------------+", 17, j+32);
525 prt("KILL....ESP......... ", 18, j+32);
526 prt("aeud tghaud tgdhegnu ", 19, j+32);
527 prt("nvneoriunneoriruvoon ", 20, j+32);
528 prt("iidmroamidmroagmionq ", 21, j+32);
529 prt("mlenclnmmenclnnnldlu ", 22, j+32);
530 prt_binary(flgs[3], 23, j+32);
535 * ベースアイテムの大項目IDの種別名をまとめる構造体 / A structure to hold a tval and its description
537 typedef struct tval_desc
539 int tval; /*!< 大項目のID */
540 concptr desc; /*!< 大項目名 */
544 * ベースアイテムの大項目IDの種別名定義 / A list of tvals and their textual names
546 static tval_desc tvals[] =
548 { TV_SWORD, "Sword" },
549 { TV_POLEARM, "Polearm" },
550 { TV_HAFTED, "Hafted Weapon" },
552 { TV_ARROW, "Arrows" },
553 { TV_BOLT, "Bolts" },
554 { TV_SHOT, "Shots" },
555 { TV_SHIELD, "Shield" },
556 { TV_CROWN, "Crown" },
558 { TV_GLOVES, "Gloves" },
559 { TV_BOOTS, "Boots" },
560 { TV_CLOAK, "Cloak" },
561 { TV_DRAG_ARMOR, "Dragon Scale Mail" },
562 { TV_HARD_ARMOR, "Hard Armor" },
563 { TV_SOFT_ARMOR, "Soft Armor" },
565 { TV_AMULET, "Amulet" },
567 { TV_POTION, "Potion" },
568 { TV_SCROLL, "Scroll" },
570 { TV_STAFF, "Staff" },
572 { TV_LIFE_BOOK, "Life Spellbook" },
573 { TV_SORCERY_BOOK, "Sorcery Spellbook" },
574 { TV_NATURE_BOOK, "Nature Spellbook" },
575 { TV_CHAOS_BOOK, "Chaos Spellbook" },
576 { TV_DEATH_BOOK, "Death Spellbook" },
577 { TV_TRUMP_BOOK, "Trump Spellbook" },
578 { TV_ARCANE_BOOK, "Arcane Spellbook" },
579 { TV_CRAFT_BOOK, "Craft Spellbook"},
580 { TV_DAEMON_BOOK, "Daemon Spellbook"},
581 { TV_CRUSADE_BOOK, "Crusade Spellbook"},
582 { TV_MUSIC_BOOK, "Music Spellbook" },
583 { TV_HISSATSU_BOOK, "Book of Kendo" },
584 { TV_HEX_BOOK, "Hex Spellbook" },
585 { TV_PARCHMENT, "Parchment" },
586 { TV_WHISTLE, "Whistle" },
587 { TV_SPIKE, "Spikes" },
588 { TV_DIGGING, "Digger" },
589 { TV_CHEST, "Chest" },
590 { TV_CAPTURE, "Capture Ball" },
591 { TV_CARD, "Express Card" },
592 { TV_FIGURINE, "Magical Figurine" },
593 { TV_STATUE, "Statue" },
594 { TV_CORPSE, "Corpse" },
596 { TV_FLASK, "Flask" },
598 { TV_SKELETON, "Skeleton" },
604 * @brief nameバッファ内からベースアイテム名を返す / Strip an "object name" into a buffer
605 * @param buf ベースアイテム格納先の参照ポインタ
606 * @param k_idx ベースアイテムID
609 void strip_name(char *buf, KIND_OBJECT_IDX k_idx)
613 object_kind *k_ptr = &k_info[k_idx];
615 concptr str = (k_name + k_ptr->name);
618 /* Skip past leading characters */
619 while ((*str == ' ') || (*str == '&')) str++;
621 /* Copy useful chars */
622 for (t = buf; *str; str++)
625 if (iskanji(*str)) {*t++ = *str++; *t++ = *str; continue;}
627 if (*str != '~') *t++ = *str;
630 /* Terminate the new name */
636 * @brief ベースアイテムのウィザード生成のために大項目IDと小項目IDを取得する /
637 * Specify tval and sval (type and subtype of object) originally
640 * by RAK, heavily modified by -Bernd-
641 * This function returns the k_idx of an object type, or zero if failed
642 * List up to 50 choices in three columns
644 static KIND_OBJECT_IDX wiz_create_itemtype(void)
649 OBJECT_TYPE_VALUE tval;
654 KIND_OBJECT_IDX choice[80];
660 /* Print all tval's and their descriptions */
661 for (num = 0; (num < 80) && tvals[num].tval; num++)
663 row = 2 + (num % 20);
664 col = 20 * (num / 20);
666 prt(format("[%c] %s", ch, tvals[num].desc), row, col);
669 /* Me need to know the maximal possible tval_index */
673 if (!get_com("Get what type of object? ", &ch, FALSE)) return (0);
676 for (num = 0; num < max_num; num++)
678 if (listsym[num] == ch) break;
681 /* Bail out if choice is illegal */
682 if ((num < 0) || (num >= max_num)) return (0);
684 /* Base object type chosen, fill in tval */
685 tval = tvals[num].tval;
686 tval_desc = tvals[num].desc;
689 /*** And now we go for k_idx ***/
692 /* We have to search the whole itemlist. */
693 for (num = 0, i = 1; (num < 80) && (i < max_k_idx); i++)
695 object_kind *k_ptr = &k_info[i];
697 /* Analyze matching items */
698 if (k_ptr->tval == tval)
701 row = 2 + (num % 20);
702 col = 20 * (num / 20);
706 /* Acquire the "name" of object "i" */
710 prt(format("[%c] %s", ch, buf), row, col);
712 /* Remember the object index */
717 /* Me need to know the maximal possible remembered object_index */
721 if (!get_com(format("What Kind of %s? ", tval_desc), &ch, FALSE)) return (0);
724 for (num = 0; num < max_num; num++)
726 if (listsym[num] == ch) break;
729 /* Bail out if choice is "illegal" */
730 if ((num < 0) || (num >= max_num)) return (0);
732 /* And return successful */
733 return (choice[num]);
738 * @briefアイテムの基礎能力値を調整する / Tweak an item
739 * @param o_ptr 調整するアイテムの参照ポインタ
742 static void wiz_tweak_item(object_type *o_ptr)
747 if (object_is_artifact(o_ptr)) return;
749 p = "Enter new 'pval' setting: ";
750 sprintf(tmp_val, "%d", o_ptr->pval);
751 if (!get_string(p, tmp_val, 5)) return;
752 o_ptr->pval = (s16b)atoi(tmp_val);
753 wiz_display_item(o_ptr);
755 p = "Enter new 'to_a' setting: ";
756 sprintf(tmp_val, "%d", o_ptr->to_a);
757 if (!get_string(p, tmp_val, 5)) return;
758 o_ptr->to_a = (s16b)atoi(tmp_val);
759 wiz_display_item(o_ptr);
761 p = "Enter new 'to_h' setting: ";
762 sprintf(tmp_val, "%d", o_ptr->to_h);
763 if (!get_string(p, tmp_val, 5)) return;
764 o_ptr->to_h = (s16b)atoi(tmp_val);
765 wiz_display_item(o_ptr);
767 p = "Enter new 'to_d' setting: ";
768 sprintf(tmp_val, "%d", (int)o_ptr->to_d);
769 if (!get_string(p, tmp_val, 5)) return;
770 o_ptr->to_d = (s16b)atoi(tmp_val);
771 wiz_display_item(o_ptr);
776 * @brief アイテムの質を選択して再生成する /
777 * Apply magic to an item or current_world_ptr->game_turn it into an artifact. -Bernd-
778 * @param o_ptr 再生成の対象となるアイテム情報の参照ポインタ
781 static void wiz_reroll_item(object_type *o_ptr)
786 bool changed = FALSE;
788 if (object_is_artifact(o_ptr)) return;
791 object_copy(q_ptr, o_ptr);
793 /* Main loop. Ask for magification and artifactification */
796 /* Display full item debug information */
797 wiz_display_item(q_ptr);
799 /* Ask wizard what to do. */
800 if (!get_com("[a]ccept, [w]orthless, [c]ursed, [n]ormal, [g]ood, [e]xcellent, [s]pecial? ", &ch, FALSE))
802 /* Preserve wizard-generated artifacts */
803 if (object_is_fixed_artifact(q_ptr))
805 a_info[q_ptr->name1].cur_num = 0;
813 /* Create/change it! */
814 if (ch == 'A' || ch == 'a')
820 /* Preserve wizard-generated artifacts */
821 if (object_is_fixed_artifact(q_ptr))
823 a_info[q_ptr->name1].cur_num = 0;
829 /* Apply bad magic, but first clear object */
832 object_prep(q_ptr, o_ptr->k_idx);
833 apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT | AM_CURSED);
836 /* Apply bad magic, but first clear object */
839 object_prep(q_ptr, o_ptr->k_idx);
840 apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_CURSED);
843 /* Apply normal magic, but first clear object */
846 object_prep(q_ptr, o_ptr->k_idx);
847 apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART);
850 /* Apply good magic, but first clear object */
853 object_prep(q_ptr, o_ptr->k_idx);
854 apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD);
857 /* Apply great magic, but first clear object */
860 object_prep(q_ptr, o_ptr->k_idx);
861 apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT);
864 /* Apply special magic, but first clear object */
867 object_prep(q_ptr, o_ptr->k_idx);
868 apply_magic(q_ptr, current_floor_ptr->dun_level, AM_GOOD | AM_GREAT | AM_SPECIAL);
870 /* Failed to create artifact; make a random one */
871 if (!object_is_artifact(q_ptr)) create_artifact(q_ptr, FALSE);
875 q_ptr->iy = o_ptr->iy;
876 q_ptr->ix = o_ptr->ix;
877 q_ptr->next_o_idx = o_ptr->next_o_idx;
878 q_ptr->marked = o_ptr->marked;
884 object_copy(o_ptr, q_ptr);
885 p_ptr->update |= (PU_BONUS);
886 p_ptr->update |= (PU_COMBINE | PU_REORDER);
887 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
894 * @brief 検査対象のアイテムを基準とした生成テストを行う /
895 * Try to create an item again. Output some statistics. -Bernd-
896 * @param o_ptr 生成テストの基準となるアイテム情報の参照ポインタ
898 * The statistics are correct now. We acquire a clean grid, and then
899 * repeatedly place an object in this grid, copying it into an item
900 * holder, and then deleting the object. We fiddle with the artifact
901 * counter flags to prevent weirdness. We use the items to collect
902 * statistics on item creation relative to the initial item.
904 static void wiz_statistics(object_type *o_ptr)
906 u32b i, matches, better, worse, other, correct;
908 u32b test_roll = 1000000;
918 concptr q = "Rolls: %ld Correct: %ld Matches: %ld Better: %ld Worse: %ld Other: %ld";
920 concptr p = "Enter number of items to roll: ";
924 /* Mega-Hack -- allow multiple artifacts */
925 if (object_is_fixed_artifact(o_ptr)) a_info[o_ptr->name1].cur_num = 0;
931 concptr pmt = "Roll for [n]ormal, [g]ood, or [e]xcellent treasure? ";
934 wiz_display_item(o_ptr);
937 if (!get_com(pmt, &ch, FALSE)) break;
939 if (ch == 'n' || ch == 'N')
944 else if (ch == 'g' || ch == 'G')
949 else if (ch == 'e' || ch == 'E')
951 mode = AM_GOOD | AM_GREAT;
952 quality = "excellent";
959 sprintf(tmp_val, "%ld", (long int)test_roll);
960 if (get_string(p, tmp_val, 10)) test_roll = atol(tmp_val);
961 test_roll = MAX(1, test_roll);
963 /* Let us know what we are doing */
964 msg_format("Creating a lot of %s items. Base level = %d.",
965 quality, current_floor_ptr->dun_level);
968 /* Set counters to zero */
969 correct = matches = better = worse = other = 0;
971 /* Let's rock and roll */
972 for (i = 0; i <= test_roll; i++)
974 /* Output every few rolls */
975 if ((i < 100) || (i % 100 == 0))
984 break; // stop rolling
988 prt(format(q, i, correct, matches, better, worse, other), 0, 0);
994 /* Create an object */
995 make_object(q_ptr, mode);
998 /* Mega-Hack -- allow multiple artifacts */
999 if (object_is_fixed_artifact(q_ptr)) a_info[q_ptr->name1].cur_num = 0;
1002 /* Test for the same tval and sval. */
1003 if ((o_ptr->tval) != (q_ptr->tval)) continue;
1004 if ((o_ptr->sval) != (q_ptr->sval)) continue;
1006 /* One more correct item */
1009 /* Check for match */
1010 if ((q_ptr->pval == o_ptr->pval) &&
1011 (q_ptr->to_a == o_ptr->to_a) &&
1012 (q_ptr->to_h == o_ptr->to_h) &&
1013 (q_ptr->to_d == o_ptr->to_d) &&
1014 (q_ptr->name1 == o_ptr->name1))
1019 /* Check for better */
1020 else if ((q_ptr->pval >= o_ptr->pval) &&
1021 (q_ptr->to_a >= o_ptr->to_a) &&
1022 (q_ptr->to_h >= o_ptr->to_h) &&
1023 (q_ptr->to_d >= o_ptr->to_d))
1028 /* Check for worse */
1029 else if ((q_ptr->pval <= o_ptr->pval) &&
1030 (q_ptr->to_a <= o_ptr->to_a) &&
1031 (q_ptr->to_h <= o_ptr->to_h) &&
1032 (q_ptr->to_d <= o_ptr->to_d))
1037 /* Assume different */
1045 msg_format(q, i, correct, matches, better, worse, other);
1050 /* Hack -- Normally only make a single artifact */
1051 if (object_is_fixed_artifact(o_ptr)) a_info[o_ptr->name1].cur_num = 1;
1056 * @brief 検査対象のアイテムの数を変更する /
1057 * Change the quantity of a the item
1058 * @param o_ptr 変更するアイテム情報構造体の参照ポインタ
1061 static void wiz_quantity_item(object_type *o_ptr)
1063 int tmp_int, tmp_qnt;
1068 /* Never duplicate artifacts */
1069 if (object_is_artifact(o_ptr)) return;
1071 /* Store old quantity. -LM- */
1072 tmp_qnt = o_ptr->number;
1075 sprintf(tmp_val, "%d", (int)o_ptr->number);
1078 if (get_string("Quantity: ", tmp_val, 2))
1081 tmp_int = atoi(tmp_val);
1082 if (tmp_int < 1) tmp_int = 1;
1083 if (tmp_int > 99) tmp_int = 99;
1085 /* Accept modifications */
1086 o_ptr->number = (byte_hack)tmp_int;
1089 if (o_ptr->tval == TV_ROD)
1091 o_ptr->pval = o_ptr->pval * o_ptr->number / tmp_qnt;
1096 * @brief 青魔導師の魔法を全て習得済みにする /
1097 * debug command for blue mage
1100 static void do_cmd_wiz_blue_mage(void)
1104 BIT_FLAGS f4 = 0L, f5 = 0L, f6 = 0L;
1106 for (j = 1; j < A_MAX; j++)
1108 set_rf_masks(&f4, &f5, &f6, j);
1110 for (i = 0; i < 32; i++)
1112 if ((0x00000001 << i) & f4) p_ptr->magic_num2[i] = 1;
1116 if ((0x00000001 << (i - 32)) & f5) p_ptr->magic_num2[i] = 1;
1120 if ((0x00000001 << (i - 64)) & f6) p_ptr->magic_num2[i] = 1;
1127 * @brief アイテム検査のメインルーチン /
1128 * Play with an item. Options include:
1131 * - Output statistics (via wiz_roll_item)<br>
1132 * - Reroll item (via wiz_reroll_item)<br>
1133 * - Change properties (via wiz_tweak_item)<br>
1134 * - Change the number of items (via wiz_quantity_item)<br>
1136 static void do_cmd_wiz_play(void)
1146 q = "Play with which object? ";
1147 s = "You have nothing to play with.";
1149 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
1153 /* The item was not changed */
1159 object_copy(q_ptr, o_ptr);
1165 /* Display the item */
1166 wiz_display_item(q_ptr);
1169 if (!get_com("[a]ccept [s]tatistics [r]eroll [t]weak [q]uantity? ", &ch, FALSE))
1175 if (ch == 'A' || ch == 'a')
1181 if (ch == 's' || ch == 'S')
1183 wiz_statistics(q_ptr);
1186 if (ch == 'r' || ch == 'r')
1188 wiz_reroll_item(q_ptr);
1191 if (ch == 't' || ch == 'T')
1193 wiz_tweak_item(q_ptr);
1196 if (ch == 'q' || ch == 'Q')
1198 wiz_quantity_item(q_ptr);
1208 msg_print("Changes accepted.");
1210 /* Recalcurate object's weight */
1213 p_ptr->total_weight += (q_ptr->weight * q_ptr->number)
1214 - (o_ptr->weight * o_ptr->number);
1218 object_copy(o_ptr, q_ptr);
1220 p_ptr->update |= (PU_BONUS);
1221 p_ptr->update |= (PU_COMBINE | PU_REORDER);
1223 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1229 msg_print("Changes ignored.");
1235 * @brief 任意のベースアイテム生成のメインルーチン /
1236 * Wizard routine for creating objects -RAK-
1239 * Heavily modified to allow magification and artifactification -Bernd-
1241 * Note that wizards cannot create objects on top of other objects.
1243 * Hack -- this routine always makes a "dungeon object", and applies
1244 * magic to it, and attempts to decline cursed items.
1246 static void wiz_create_item(void)
1254 /* Get object base type */
1255 k_idx = wiz_create_itemtype();
1259 /* Return if failed */
1262 if (k_info[k_idx].gen_flags & TRG_INSTA_ART)
1267 for (i = 1; i < max_a_idx; i++)
1269 /* Ignore incorrect tval */
1270 if (a_info[i].tval != k_info[k_idx].tval) continue;
1272 /* Ignore incorrect sval */
1273 if (a_info[i].sval != k_info[k_idx].sval) continue;
1275 /* Create this artifact */
1276 (void)create_named_art(i, p_ptr->y, p_ptr->x);
1279 msg_print("Allocated(INSTA_ART).");
1285 object_prep(q_ptr, k_idx);
1287 apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART);
1289 /* Drop the object from heaven */
1290 (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
1293 msg_print("Allocated.");
1298 * @brief プレイヤーを完全回復する /
1299 * Cure everything instantly
1302 static void do_cmd_wiz_cure_all(void)
1304 (void)life_stream(FALSE, FALSE);
1305 (void)restore_mana(TRUE);
1306 (void)set_food(PY_FOOD_MAX - 1);
1311 * @brief 任意のダンジョン及び階層に飛ぶ /
1315 static void do_cmd_wiz_jump(void)
1318 if (command_arg <= 0)
1322 DUNGEON_IDX tmp_dungeon_type;
1325 sprintf(ppp, "Jump which dungeon : ");
1328 sprintf(tmp_val, "%d", p_ptr->dungeon_idx);
1330 /* Ask for a level */
1331 if (!get_string(ppp, tmp_val, 2)) return;
1333 tmp_dungeon_type = (DUNGEON_IDX)atoi(tmp_val);
1334 if (!d_info[tmp_dungeon_type].maxdepth || (tmp_dungeon_type > max_d_idx)) tmp_dungeon_type = DUNGEON_ANGBAND;
1337 sprintf(ppp, "Jump to level (0, %d-%d): ",
1338 (int)d_info[tmp_dungeon_type].mindepth, (int)d_info[tmp_dungeon_type].maxdepth);
1341 sprintf(tmp_val, "%d", (int)current_floor_ptr->dun_level);
1343 /* Ask for a level */
1344 if (!get_string(ppp, tmp_val, 10)) return;
1346 /* Extract request */
1347 command_arg = (COMMAND_ARG)atoi(tmp_val);
1349 p_ptr->dungeon_idx = tmp_dungeon_type;
1351 if (command_arg < d_info[p_ptr->dungeon_idx].mindepth) command_arg = 0;
1352 if (command_arg > d_info[p_ptr->dungeon_idx].maxdepth) command_arg = (COMMAND_ARG)d_info[p_ptr->dungeon_idx].maxdepth;
1354 /* Accept request */
1355 msg_format("You jump to dungeon level %d.", command_arg);
1357 if (autosave_l) do_cmd_save_game(TRUE);
1360 current_floor_ptr->dun_level = command_arg;
1362 prepare_change_floor_mode(CFM_RAND_PLACE);
1364 if (!current_floor_ptr->dun_level) p_ptr->dungeon_idx = 0;
1365 p_ptr->inside_arena = FALSE;
1366 p_ptr->wild_mode = FALSE;
1368 leave_quest_check();
1370 if (record_stair) do_cmd_write_nikki(NIKKI_WIZ_TELE,0,NULL);
1372 p_ptr->inside_quest = 0;
1375 /* Prevent energy_need from being too lower than 0 */
1376 p_ptr->energy_need = 0;
1379 * Clear all saved floors
1380 * and create a first saved floor
1382 prepare_change_floor_mode(CFM_FIRST_FLOOR);
1383 p_ptr->leaving = TRUE;
1388 * @brief 全ベースアイテムを鑑定済みにする /
1389 * Become aware of a lot of objects
1392 static void do_cmd_wiz_learn(void)
1399 /* Scan every object */
1400 for (i = 1; i < max_k_idx; i++)
1402 object_kind *k_ptr = &k_info[i];
1404 /* Induce awareness */
1405 if (k_ptr->level <= command_arg)
1408 object_prep(q_ptr, i);
1409 object_aware(q_ptr);
1416 * @brief 現在のフロアに合ったモンスターをランダムに召喚する /
1417 * Summon some creatures
1421 static void do_cmd_wiz_summon(int num)
1424 for (i = 0; i < num; i++)
1426 (void)summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE), '\0');
1433 * @brief モンスターを種族IDを指定して敵対的に召喚する /
1434 * Summon a creature of the specified type
1435 * @param r_idx モンスター種族ID
1438 * This function is rather dangerous
1440 static void do_cmd_wiz_named(MONRACE_IDX r_idx)
1442 (void)summon_named_creature(0, p_ptr->y, p_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
1447 * @brief モンスターを種族IDを指定してペット召喚する /
1448 * Summon a creature of the specified type
1449 * @param r_idx モンスター種族ID
1452 * This function is rather dangerous
1454 static void do_cmd_wiz_named_friendly(MONRACE_IDX r_idx)
1456 (void)summon_named_creature(0, p_ptr->y, p_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP | PM_FORCE_PET));
1462 * @brief プレイヤー近辺の全モンスターを消去する /
1463 * Hack -- Delete all nearby monsters
1466 static void do_cmd_wiz_zap(void)
1470 /* Genocide everyone nearby */
1471 for (i = 1; i < m_max; i++)
1473 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
1474 if (!monster_is_valid(m_ptr)) continue;
1476 /* Skip the mount */
1477 if (i == p_ptr->riding) continue;
1479 /* Delete nearby monsters */
1480 if (m_ptr->cdis <= MAX_SIGHT)
1482 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
1484 GAME_TEXT m_name[MAX_NLEN];
1486 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
1487 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_WIZ_ZAP, m_name);
1490 delete_monster_idx(i);
1497 * @brief フロアに存在する全モンスターを消去する /
1498 * Hack -- Delete all monsters
1501 static void do_cmd_wiz_zap_all(void)
1505 /* Genocide everyone */
1506 for (i = 1; i < m_max; i++)
1508 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
1509 if (!monster_is_valid(m_ptr)) continue;
1511 /* Skip the mount */
1512 if (i == p_ptr->riding) continue;
1514 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
1516 GAME_TEXT m_name[MAX_NLEN];
1518 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
1519 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_WIZ_ZAP, m_name);
1522 /* Delete this monster */
1523 delete_monster_idx(i);
1529 * @brief 指定された地点の地形IDを変更する /
1530 * Create desired feature
1533 static void do_cmd_wiz_create_feature(void)
1535 static int prev_feat = 0;
1536 static int prev_mimic = 0;
1538 feature_type *f_ptr;
1540 IDX tmp_feat, tmp_mimic;
1543 if (!tgt_pt(&x, &y)) return;
1545 g_ptr = ¤t_floor_ptr->grid_array[y][x];
1548 sprintf(tmp_val, "%d", prev_feat);
1551 if (!get_string(_("地形: ", "Feature: "), tmp_val, 3)) return;
1554 tmp_feat = (IDX)atoi(tmp_val);
1555 if (tmp_feat < 0) tmp_feat = 0;
1556 else if (tmp_feat >= max_f_idx) tmp_feat = max_f_idx - 1;
1559 sprintf(tmp_val, "%d", prev_mimic);
1562 if (!get_string(_("地形 (mimic): ", "Feature (mimic): "), tmp_val, 3)) return;
1565 tmp_mimic = (IDX)atoi(tmp_val);
1566 if (tmp_mimic < 0) tmp_mimic = 0;
1567 else if (tmp_mimic >= max_f_idx) tmp_mimic = max_f_idx - 1;
1569 cave_set_feat(y, x, tmp_feat);
1570 g_ptr->mimic = (s16b)tmp_mimic;
1572 f_ptr = &f_info[get_feat_mimic(g_ptr)];
1574 if (have_flag(f_ptr->flags, FF_GLYPH) ||
1575 have_flag(f_ptr->flags, FF_MINOR_GLYPH))
1576 g_ptr->info |= (CAVE_OBJECT);
1577 else if (have_flag(f_ptr->flags, FF_MIRROR))
1578 g_ptr->info |= (CAVE_GLOW | CAVE_OBJECT);
1582 p_ptr->update |= (PU_FLOW);
1584 prev_feat = tmp_feat;
1585 prev_mimic = tmp_mimic;
1590 #define NUM_O_BIT 32
1593 * @brief 現在のオプション設定をダンプ出力する /
1594 * Hack -- Dump option bits usage
1597 static void do_cmd_dump_options(void)
1604 /* Build the filename */
1605 path_build(buf, sizeof buf, ANGBAND_DIR_USER, "opt_info.txt");
1607 /* File type is "TEXT" */
1608 FILE_TYPE(FILE_TYPE_TEXT);
1611 fff = my_fopen(buf, "a");
1615 msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), buf);
1620 /* Allocate the "exist" array (2-dimension) */
1621 C_MAKE(exist, NUM_O_SET, int *);
1622 C_MAKE(*exist, NUM_O_BIT * NUM_O_SET, int);
1623 for (i = 1; i < NUM_O_SET; i++) exist[i] = *exist + i * NUM_O_BIT;
1625 /* Check for exist option bits */
1626 for (i = 0; option_info[i].o_desc; i++)
1628 const option_type *ot_ptr = &option_info[i];
1629 if (ot_ptr->o_var) exist[ot_ptr->o_set][ot_ptr->o_bit] = i + 1;
1632 fprintf(fff, "[Option bits usage on Hengband %d.%d.%d]\n\n",
1633 FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
1635 fputs("Set - Bit (Page) Option Name\n", fff);
1636 fputs("------------------------------------------------\n", fff);
1637 /* Dump option bits usage */
1638 for (i = 0; i < NUM_O_SET; i++)
1640 for (j = 0; j < NUM_O_BIT; j++)
1644 const option_type *ot_ptr = &option_info[exist[i][j] - 1];
1645 fprintf(fff, " %d - %02d (%4d) %s\n",
1646 i, j, ot_ptr->o_page, ot_ptr->o_text);
1650 fprintf(fff, " %d - %02d\n", i, j);
1656 /* Free the "exist" array (2-dimension) */
1657 C_KILL(*exist, NUM_O_BIT * NUM_O_SET, int);
1658 C_KILL(exist, NUM_O_SET, int *);
1661 msg_format(_("オプションbit使用状況をファイル %s に書き出しました。", "Option bits usage dump saved to file %s."), buf);
1665 #ifdef ALLOW_SPOILERS
1670 extern void do_cmd_spoilers(void);
1672 #endif /* ALLOW_SPOILERS */
1677 * Hack -- declare external function
1679 extern void do_cmd_debug(void);
1684 * @brief デバッグコマンドを選択する処理のメインルーチン /
1685 * Ask for and parse a "debug command"
1686 * The "command_arg" may have been set.
1689 void do_cmd_debug(void)
1694 /* Get a "debug command" */
1695 get_com("Debug Command: ", &cmd, FALSE);
1697 /* Analyze the command */
1707 #ifdef ALLOW_SPOILERS
1709 /* Hack -- Generate Spoilers */
1714 #endif /* ALLOW_SPOILERS */
1721 /* Cure all maladies */
1723 do_cmd_wiz_cure_all();
1726 /* Know alignment */
1728 msg_format("Your alignment is %d.", p_ptr->align);
1731 /* Teleport to target */
1737 update_gambling_monsters();
1740 /* Create any object */
1745 /* Create a named artifact */
1747 wiz_create_named_art();
1750 /* Detect everything */
1752 detect_all(DETECT_RAD_ALL * 3);
1755 /* Dimension_door */
1757 wiz_dimension_door();
1760 /* Edit character */
1762 do_cmd_wiz_change();
1765 /* Blue Mage Only */
1767 if (p_ptr->pclass == CLASS_BLUE_MAGE)
1769 do_cmd_wiz_blue_mage();
1773 /* View item info */
1775 identify_fully(FALSE);
1778 /* Create desired feature */
1780 do_cmd_wiz_create_feature();
1785 if (command_arg <= 0) command_arg = 1;
1786 acquirement(p_ptr->y, p_ptr->x, command_arg, FALSE, FALSE, TRUE);
1789 /* Hitpoint rerating */
1791 roll_hitdice(p_ptr, SPOP_DISPLAY_MES | SPOP_DEBUG);
1795 do_cmd_summon_horde();
1800 (void)ident_spell(FALSE);
1803 /* Go up or down in the dungeon */
1808 /* Self-Knowledge */
1813 /* Learn about objects */
1820 map_area(DETECT_RAD_ALL * 3);
1825 (void)gain_mutation(p_ptr, command_arg);
1830 (void)do_cmd_wiz_reset_class();
1833 /* Specific reward */
1835 (void)gain_level_reward(command_arg);
1838 /* Summon _friendly_ named monster */
1840 do_cmd_wiz_named_friendly(command_arg);
1843 /* Summon Named Monster */
1845 do_cmd_wiz_named(command_arg);
1848 /* Dump option bits usage */
1850 do_cmd_dump_options();
1853 /* Object playing routines */
1860 teleport_player(10, 0L);
1869 sprintf(ppp, "QuestID (0-%d):", max_q_idx - 1);
1870 sprintf(tmp_val, "%d", 0);
1872 if (!get_string(ppp, tmp_val, 3)) return;
1873 tmp_int = atoi(tmp_val);
1875 if(tmp_int < 0) break;
1876 if(tmp_int >= max_q_idx) break;
1878 p_ptr->inside_quest = (QUEST_IDX)tmp_int;
1879 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
1880 quest[tmp_int].status = QUEST_STATUS_TAKEN;
1881 p_ptr->inside_quest = 0;
1885 /* Complete a Quest -KMW- */
1887 if(p_ptr->inside_quest)
1889 if (quest[p_ptr->inside_quest].status == QUEST_STATUS_TAKEN)
1891 complete_quest(p_ptr->inside_quest);
1897 msg_print("No current quest");
1902 /* Make every dungeon square "known" to test streamers -KMW- */
1904 for (y = 0; y < current_floor_ptr->height; y++)
1906 for (x = 0; x < current_floor_ptr->width; x++)
1908 current_floor_ptr->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
1914 /* Summon Random Monster(s) */
1916 if (command_arg <= 0) command_arg = 1;
1917 do_cmd_wiz_summon(command_arg);
1920 /* Special(Random Artifact) Objects */
1922 if (command_arg <= 0) command_arg = 1;
1923 acquirement(p_ptr->y, p_ptr->x, command_arg, TRUE, TRUE, TRUE);
1928 teleport_player(100, 0L);
1931 /* Game Time Setting */
1937 /* Very Good Objects */
1939 if (command_arg <= 0) command_arg = 1;
1940 acquirement(p_ptr->y, p_ptr->x, command_arg, TRUE, FALSE, TRUE);
1943 /* Wizard Light the Level */
1945 wiz_lite((bool)(p_ptr->pclass == CLASS_NINJA));
1948 /* Increase Experience */
1950 gain_exp(command_arg ? command_arg : (p_ptr->exp + 1));
1953 /* Zap Monsters (Genocide) */
1958 /* Zap Monsters (Omnicide) */
1960 do_cmd_wiz_zap_all();
1963 /* Hack -- whatever I desire */
1968 /* For temporary test. */
1972 for(i = INVEN_TOTAL - 1; i >= 0; i--)
1974 if(p_ptr->inventory_list[i].k_idx) inven_drop(i, 999);
1981 do_cmd_wiz_reset_class();
1984 /* Not a Wizard Command */
1986 msg_print("That is not a valid debug command.");
1991 void cheat_death(player_type *creature_ptr)
1993 /* Mark social class, reset age, if needed */
1994 if (creature_ptr->sc) creature_ptr->sc = creature_ptr->age = 0;
1997 creature_ptr->age++;
2000 creature_ptr->noscore |= 0x0001;
2002 msg_print(_("ウィザードモードに念を送り、死を欺いた。", "You invoke wizard mode and cheat death."));
2005 (void)life_stream(FALSE, FALSE);
2007 if (creature_ptr->pclass == CLASS_MAGIC_EATER)
2010 for (magic_idx = 0; magic_idx < EATER_EXT * 2; magic_idx++)
2012 creature_ptr->magic_num1[magic_idx] = creature_ptr->magic_num2[magic_idx] * EATER_CHARGE;
2014 for (; magic_idx < EATER_EXT * 3; magic_idx++)
2016 creature_ptr->magic_num1[magic_idx] = 0;
2020 /* Restore spell points */
2021 creature_ptr->csp = creature_ptr->msp;
2022 creature_ptr->csp_frac = 0;
2024 /* Hack -- cancel recall */
2025 if (creature_ptr->word_recall)
2027 msg_print(_("張りつめた大気が流れ去った...", "A tension leaves the air around you..."));
2030 /* Hack -- Prevent recall */
2031 creature_ptr->word_recall = 0;
2032 creature_ptr->redraw |= (PR_STATUS);
2035 /* Hack -- cancel alter */
2036 if (creature_ptr->alter_reality)
2038 /* Hack -- Prevent alter */
2039 creature_ptr->alter_reality = 0;
2040 creature_ptr->redraw |= (PR_STATUS);
2043 /* Note cause of death */
2044 (void)strcpy(creature_ptr->died_from, _("死の欺き", "Cheating death"));
2047 creature_ptr->is_dead = FALSE;
2049 /* Hack -- Prevent starvation */
2050 (void)set_food(PY_FOOD_MAX - 1);
2052 current_floor_ptr->dun_level = 0;
2053 creature_ptr->inside_arena = FALSE;
2054 creature_ptr->inside_battle = FALSE;
2056 creature_ptr->inside_quest = 0;
2057 if (p_ptr->dungeon_idx) creature_ptr->recall_dungeon = p_ptr->dungeon_idx;
2058 p_ptr->dungeon_idx = 0;
2059 if (lite_town || vanilla_town)
2061 creature_ptr->wilderness_y = 1;
2062 creature_ptr->wilderness_x = 1;
2065 creature_ptr->oldpy = 10;
2066 creature_ptr->oldpx = 34;
2070 creature_ptr->oldpy = 33;
2071 creature_ptr->oldpx = 131;
2076 creature_ptr->wilderness_y = 48;
2077 creature_ptr->wilderness_x = 5;
2078 creature_ptr->oldpy = 33;
2079 creature_ptr->oldpx = 131;
2081 creature_ptr->wild_mode = FALSE;
2082 creature_ptr->leaving = TRUE;
2084 do_cmd_write_nikki(NIKKI_BUNSHOU, 1,
2088 /* Prepare next floor */