10 * Standard window names
12 const char angband_term_name[8][16] =
25 * Global table of color definitions
27 byte angband_color_table[256][4] =
29 {0x00, 0x00, 0x00, 0x00}, /* TERM_DARK */
30 {0x00, 0xFF, 0xFF, 0xFF}, /* TERM_WHITE */
31 {0x00, 0x80, 0x80, 0x80}, /* TERM_SLATE */
32 {0x00, 0xFF, 0x80, 0x00}, /* TERM_ORANGE */
33 {0x00, 0xC0, 0x00, 0x00}, /* TERM_RED */
34 {0x00, 0x00, 0x80, 0x40}, /* TERM_GREEN */
35 {0x00, 0x00, 0x00, 0xFF}, /* TERM_BLUE */
36 {0x00, 0x80, 0x40, 0x00}, /* TERM_UMBER */
37 {0x00, 0x40, 0x40, 0x40}, /* TERM_L_DARK */
38 {0x00, 0xC0, 0xC0, 0xC0}, /* TERM_L_WHITE */
39 {0x00, 0xFF, 0x00, 0xFF}, /* TERM_VIOLET */
40 {0x00, 0xFF, 0xFF, 0x00}, /* TERM_YELLOW */
41 {0x00, 0xFF, 0x00, 0x00}, /* TERM_L_RED */
42 {0x00, 0x00, 0xFF, 0x00}, /* TERM_L_GREEN */
43 {0x00, 0x00, 0xFF, 0xFF}, /* TERM_L_BLUE */
44 {0x00, 0xC0, 0x80, 0x40} /* TERM_L_UMBER */
48 * @brief 色名称テーブル / Hack -- the "basic" color names (see "TERM_xxx")
50 const concptr color_names[16] =
92 * @brief サブウィンドウ名称テーブル
95 * Certain "screens" always use the main screen, including News, Birth,
96 * Dungeon, Tomb-stone, High-scores, Macros, Colors, Visuals, Options.
98 * Later, special flags may allow sub-windows to "steal" stuff from the
99 * main window, including File dump (help), File dump (artifacts, uniques),
100 * Character screen, Small scale map, Previous Messages, Store screen, etc.
102 * The "ctrl-i" (tab) command flips the "Display inven/equip" and "Display
103 * equip/inven" flags for all windows.
105 * The "ctrl-g" command (or pseudo-command) should perhaps grab a snapshot
106 * of the main screen into any interested windows.
109 const concptr window_flag_desc[32] =
111 _("持ち物/装備一覧", "Display inven/equip"),
112 _("装備/持ち物一覧", "Display equip/inven"),
113 _("呪文一覧", "Display spell list"),
114 _("キャラクタ情報", "Display character"),
115 _("視界内のモンスター表示", "Display monsters in sight"),
117 _("メッセージ", "Display messages"),
118 _("ダンジョン全体図", "Display overhead view"),
119 _("モンスターの思い出", "Display monster recall"),
120 _("アイテムの詳細", "Display object recall"),
121 _("自分の周囲を表示", "Display dungeon view"),
122 _("記念撮影", "Display snap-shot"),
147 * @brief シンボル解説テーブル /
148 * The table of "symbol info" -- each entry is a string of the form "X:desc" where "X" is the trigger, and "desc" is the "info".
150 const concptr ident_info[] =
163 "*:財宝を含んだ鉱脈または球形の怪物",
168 "/:竿状武器(アックス/パイク/等)",
246 "}:飛び道具(弓/クロスボウ/スリング)",
250 "!:A potion (or oil)",
251 "\":An amulet (or necklace)",
252 "#:A wall (or secret door) / a plant / a gas",
253 "$:Treasure (gold or gems)",
254 "%:A vein (magma or quartz)",
259 "*:A vein with treasure or a ball monster",
261 ",:Food (or mushroom patch)",
264 "/:A polearm (Axe/Pike/etc)",
265 "0:Entrance to Museum",
266 "1:Entrance to General Store",
267 "2:Entrance to Armory",
268 "3:Entrance to Weaponsmith",
269 "4:Entrance to Temple",
270 "5:Entrance to Alchemy shop",
271 "6:Entrance to Magic store",
272 "7:Entrance to Black Market",
273 "8:Entrance to your home",
274 "9:Entrance to the bookstore",
276 ";:A glyph of warding / an explosive rune",
279 ">:A down staircase",
285 "D:Ancient Dragon/Wyrm",
294 "M:Multi-Headed Reptile",
298 "Q:Quylthulg (Pulsing Flesh Mound)",
299 "R:Reptile/Amphibian",
300 "S:Spider/Scorpion/Tick",
304 "W:Wight/Wraith/etc",
309 "\\:A hafted weapon (mace/whip/etc)",
313 "`:A figurine or statue",
321 "h:Hobbit/Elf/Dwarf",
340 "{:A missile (arrow/bolt/shot)",
341 "|:An edged weapon (sword/dagger/etc)",
342 "}:A launcher (bow/crossbow/sling)",
343 "~:Fluid terrain (or miscellaneous item)",
350 * The array of window pointers
352 term *angband_term[8];
356 * Encode the screen colors
358 const concptr color_char = "dwsorgbuDWvyRGBU";
361 * Specify attr/char pairs for visual special effects
362 * Be sure to use "index & 0x7F" to avoid illegal access
364 TERM_COLOR misc_to_attr[256];
365 SYMBOL_CODE misc_to_char[256];
368 * Specify attr/char pairs for inventory items (by tval)
369 * Be sure to use "index & 0x7F" to avoid illegal access
371 TERM_COLOR tval_to_attr[128];
372 SYMBOL_CODE tval_to_char[128];
375 * Default spell color table (quark index)
377 TERM_COLOR gf_color[MAX_GF];
380 * @brief 万色表現用にランダムな色を選択する関数 /
381 * Get a legal "multi-hued" color for drawing "spells"
385 TERM_COLOR mh_attr(int max)
387 switch (randint1(max))
389 case 1: return (TERM_RED);
390 case 2: return (TERM_GREEN);
391 case 3: return (TERM_BLUE);
392 case 4: return (TERM_YELLOW);
393 case 5: return (TERM_ORANGE);
394 case 6: return (TERM_VIOLET);
395 case 7: return (TERM_L_RED);
396 case 8: return (TERM_L_GREEN);
397 case 9: return (TERM_L_BLUE);
398 case 10: return (TERM_UMBER);
399 case 11: return (TERM_L_UMBER);
400 case 12: return (TERM_SLATE);
401 case 13: return (TERM_WHITE);
402 case 14: return (TERM_L_WHITE);
403 case 15: return (TERM_L_DARK);
411 * @brief 魔法属性に応じたエフェクトの色を返す /
412 * Return a color to use for the bolt/ball spells
416 TERM_COLOR spell_color(EFFECT_ID type)
418 /* Check if A.B.'s new graphics should be used (rr9) */
419 if (streq(ANGBAND_GRAF, "new") || streq(ANGBAND_GRAF, "ne2"))
424 case GF_PSY_SPEAR: return (0x06);
425 case GF_MISSILE: return (0x0F);
426 case GF_ACID: return (0x04);
427 case GF_ELEC: return (0x02);
428 case GF_FIRE: return (0x00);
429 case GF_COLD: return (0x01);
430 case GF_POIS: return (0x03);
431 case GF_HOLY_FIRE: return (0x00);
432 case GF_HELL_FIRE: return (0x00);
433 case GF_MANA: return (0x0E);
435 case GF_SEEKER: return (0x0E);
436 case GF_SUPER_RAY: return (0x0E);
438 case GF_ARROW: return (0x0F);
439 case GF_WATER: return (0x04);
440 case GF_NETHER: return (0x07);
441 case GF_CHAOS: return (mh_attr(15));
442 case GF_DISENCHANT: return (0x05);
443 case GF_NEXUS: return (0x0C);
444 case GF_CONFUSION: return (mh_attr(4));
445 case GF_SOUND: return (0x09);
446 case GF_SHARDS: return (0x08);
447 case GF_FORCE: return (0x09);
448 case GF_INERTIAL: return (0x09);
449 case GF_GRAVITY: return (0x09);
450 case GF_TIME: return (0x09);
451 case GF_LITE_WEAK: return (0x06);
452 case GF_LITE: return (0x06);
453 case GF_DARK_WEAK: return (0x07);
454 case GF_DARK: return (0x07);
455 case GF_PLASMA: return (0x0B);
456 case GF_METEOR: return (0x00);
457 case GF_ICE: return (0x01);
458 case GF_ROCKET: return (0x0F);
459 case GF_DEATH_RAY: return (0x07);
460 case GF_NUKE: return (mh_attr(2));
461 case GF_DISINTEGRATE: return (0x05);
473 case GF_CAUSE_4: return (0x0E);
474 case GF_HAND_DOOM: return (0x07);
475 case GF_CAPTURE: return (0x0E);
476 case GF_IDENTIFY: return (0x01);
477 case GF_ATTACK: return (0x0F);
478 case GF_PHOTO: return (0x06);
481 /* Normal tiles or ASCII */
487 /* Lookup the default colors for this type */
488 concptr s = quark_str(gf_color[type]);
490 if (!s) return (TERM_WHITE);
492 /* Pick a random color */
493 c = s[randint0(strlen(s))];
495 /* Lookup this color */
496 a = my_strchr(color_char, c) - color_char;
498 /* Invalid color (note check for < 0 removed, gave a silly
499 * warning because bytes are always >= 0 -- RG) */
500 if (a > 15) return (TERM_WHITE);
506 /* Standard "color" */
512 * @brief 始点から終点にかけた方向毎にボルトのキャラクタを返す /
513 * Find the attr/char pair to use for a spell effect
522 * It is moving (or has moved) from (x,y) to (nx,ny).
523 * If the distance is not "one", we (may) return "*".
526 u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, EFFECT_ID typ)
536 if ((ny == y) && (nx == x)) base = 0x30;
539 else if (nx == x) base = 0x40;
542 else if (ny == y) base = 0x50;
545 else if ((ny - y) == (x - nx)) base = 0x60;
548 else if ((ny - y) == (nx - x)) base = 0x70;
553 /* Basic spell color */
554 k = spell_color(typ);
556 /* Obtain attr/char */
557 a = misc_to_attr[base + k];
558 c = misc_to_char[base + k];
568 * @brief シンボル1文字をカラーIDに変更する /
569 * Convert a "color letter" into an "actual" color
570 * The colors are: dwsorgbuDWvyRGBU, as shown below
574 TERM_COLOR color_char_to_attr(SYMBOL_CODE c)
578 case 'd': return (TERM_DARK);
579 case 'w': return (TERM_WHITE);
580 case 's': return (TERM_SLATE);
581 case 'o': return (TERM_ORANGE);
582 case 'r': return (TERM_RED);
583 case 'g': return (TERM_GREEN);
584 case 'b': return (TERM_BLUE);
585 case 'u': return (TERM_UMBER);
587 case 'D': return (TERM_L_DARK);
588 case 'W': return (TERM_L_WHITE);
589 case 'v': return (TERM_VIOLET);
590 case 'y': return (TERM_YELLOW);
591 case 'R': return (TERM_L_RED);
592 case 'G': return (TERM_L_GREEN);
593 case 'B': return (TERM_L_BLUE);
594 case 'U': return (TERM_L_UMBER);