X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fspells2.c;h=35e95eceebaa0a3b5d4a8477e62ac28e0c5ab1fb;hb=c669f43936bbada842775ab38d3c67cac1982dc5;hp=4939345fb42f5339c9e4b7a357218917649315eb;hpb=55152c4da35a59498d59e8be2fdd60ea8150b79a;p=hengband%2Fhengband.git diff --git a/src/spells2.c b/src/spells2.c index 4939345fb..35e95ecee 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -13,2189 +13,567 @@ #include "angband.h" #include "grid.h" +#include "trap.h" +#include "monsterrace-hook.h" + /*! - * @brief èªå·±åæå¦ç(Nethackããã®ã¢ã¤ãã¢) / self-knowledge... idea from nethack. - * @return ãªã - * @details - *
- * Useful for determining powers and - * resistences of items. It saves the screen, clears it, then starts listing - * attributes, a screenful at a time. (There are a LOT of attributes to - * list. It will probably take 2 or 3 screens for a powerful character whose - * using several artifacts...) -CFT - * - * It is now a lot more efficient. -BEN- - * - * See also "identify_fully()". - * - * XXX XXX XXX Use the "show_file()" method, perhaps. - *+ * @brief ãã¬ã¤ã¤ã¼å¨è¾ºã®å°å½¢ãæç¥ãã + * @param range å¹æç¯å² + * @param flag ç¹å®å°å½¢ID + * @param known å°å½¢ããå±éºãã©ã°ãå¤ããªãTRUE + * @return å¹åããã£ãå ´åTRUEãè¿ã */ -void self_knowledge(void) +static bool detect_feat_flag(POSITION range, int flag, bool known) { - int i = 0, j, k; + POSITION x, y; + bool detect = FALSE; + cave_type *c_ptr; + + if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3; + + /* Scan the current panel */ + for (y = 1; y < cur_hgt - 1; y++) + { + for (x = 1; x <= cur_wid - 1; x++) + { + int dist = distance(p_ptr->y, p_ptr->x, y, x); + if (dist > range) continue; + c_ptr = &cave[y][x]; + + /* Hack -- Safe */ + if (flag == FF_TRAP) + { + /* Mark as detected */ + if (dist <= range && known) + { + if (dist <= range - 1) c_ptr->info |= (CAVE_IN_DETECT); + + c_ptr->info &= ~(CAVE_UNSAFE); + + lite_spot(y, x); + } + } + + /* Detect flags */ + if (cave_have_flag_grid(c_ptr, flag)) + { + /* Detect secrets */ + disclose_grid(y, x); + + /* Hack -- Memorize */ + c_ptr->info |= (CAVE_MARK); + + lite_spot(y, x); - int v_nr = 0; - char v_string [8] [128]; - char s_string [6] [128]; + detect = TRUE; + } + } + } + return detect; +} - u32b flgs[TR_FLAG_SIZE]; - object_type *o_ptr; +/*! + * @brief ãã¬ã¤ã¤ã¼å¨è¾ºã®ãã©ãããæç¥ãã / Detect all traps on current panel + * @param range å¹æç¯å² + * @param known æç¥å¤ç¯å²ãè¶ ããè¦åãã©ã°ãç«ã¦ãå ´åTRUEãè¿ã + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool detect_traps(POSITION range, bool known) +{ + bool detect = detect_feat_flag(range, FF_TRAP, known); - char Dummy[80]; - char buf[2][80]; + if (known) p_ptr->dtrap = TRUE; - cptr info[220]; + if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE; + if (detect) + { + msg_print(_("ãã©ããã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of traps!")); + } + return detect; +} - int plev = p_ptr->lev; - int percent; +/*! + * @brief ãã¬ã¤ã¤ã¼å¨è¾ºã®ãã¢ãæç¥ãã / Detect all doors on current panel + * @param range å¹æç¯å² + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool detect_doors(POSITION range) +{ + bool detect = detect_feat_flag(range, FF_DOOR, TRUE); - for (j = 0; j < TR_FLAG_SIZE; j++) - flgs[j] = 0L; + if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE; + if (detect) + { + msg_print(_("ãã¢ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of doors!")); + } + return detect; +} - p_ptr->knowledge |= (KNOW_STAT | KNOW_HPRATE); - strcpy(Dummy, ""); +/*! + * @brief ãã¬ã¤ã¤ã¼å¨è¾ºã®é段ãæç¥ãã / Detect all stairs on current panel + * @param range å¹æç¯å² + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool detect_stairs(POSITION range) +{ + bool detect = detect_feat_flag(range, FF_STAIRS, TRUE); - percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) / - (2 * p_ptr->hitdie + - ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1)))); + if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE; + if (detect) + { + msg_print(_("é段ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of stairs!")); + } + return detect; +} - sprintf(Dummy, _("ç¾å¨ã®ä½åã©ã³ã¯ : %d/100", "Your current Life Rating is %d/100."), percent); - strcpy(buf[0], Dummy); - info[i++] = buf[0]; - info[i++] = ""; - chg_virtue(V_KNOWLEDGE, 1); - chg_virtue(V_ENLIGHTEN, 1); +/*! + * @brief ãã¬ã¤ã¤ã¼å¨è¾ºã®å°å½¢è²¡å®ãæç¥ãã / Detect any treasure on the current panel + * @param range å¹æç¯å² + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool detect_treasure(POSITION range) +{ + bool detect = detect_feat_flag(range, FF_HAS_GOLD, TRUE); - /* Acquire item flags from equipment */ - for (k = INVEN_RARM; k < INVEN_TOTAL; k++) + if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE; + if (detect) { - u32b tflgs[TR_FLAG_SIZE]; + msg_print(_("åèµããã財å®ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of buried treasure!")); + } + return detect; +} + + +/*! + * @brief ãã¬ã¤ã¤ã¼å¨è¾ºã®ã¢ã¤ãã 財å®ãæç¥ãã / Detect all "gold" objects on the current panel + * @param range å¹æç¯å² + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool detect_objects_gold(POSITION range) +{ + OBJECT_IDX i; + POSITION y, x; + POSITION range2 = range; + + bool detect = FALSE; - o_ptr = &inventory[k]; + if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range2 /= 3; + + /* Scan objects */ + for (i = 1; i < o_max; i++) + { + object_type *o_ptr = &o_list[i]; - /* Skip non-objects */ + /* Skip dead objects */ if (!o_ptr->k_idx) continue; - /* Extract the flags */ - object_flags(o_ptr, tflgs); - - /* Extract flags */ - for (j = 0; j < TR_FLAG_SIZE; j++) - flgs[j] |= tflgs[j]; - } - - info[i++] = _("è½åã®æ大å¤", "Limits of maximum stats"); - - for (v_nr = 0; v_nr < 6; v_nr++) - { - char stat_desc[80]; - - sprintf(stat_desc, "%s 18/%d", stat_names[v_nr], p_ptr->stat_max_max[v_nr]-18); - - strcpy(s_string[v_nr], stat_desc); - - info[i++] = s_string[v_nr]; - } - info[i++] = ""; - - sprintf(Dummy, _("ç¾å¨ã®å±æ§ : %s(%ld)", "Your alighnment : %s(%ld)"), your_alignment(), (long int)p_ptr->align); - strcpy(buf[1], Dummy); - info[i++] = buf[1]; - for (v_nr = 0; v_nr < 8; v_nr++) - { - char vir_name [20]; - char vir_desc[80]; - int tester = p_ptr->virtues[v_nr]; - - strcpy(vir_name, virtue[(p_ptr->vir_types[v_nr])-1]); - - sprintf(vir_desc, _("ãã£ã¨ã%sã®æ å ±ãªãã", "Oops. No info about %s."), vir_name); - if (tester < -100) - sprintf(vir_desc, _("[%s]ã®å¯¾æ¥µ (%d)", "You are the polar opposite of %s (%d)."), - vir_name, tester); - else if (tester < -80) - sprintf(vir_desc, _("[%s]ã®å¤§æµ (%d)", "You are an arch-enemy of %s (%d)."), - vir_name, tester); - else if (tester < -60) - sprintf(vir_desc, _("[%s]ã®å¼·æµ (%d)", "You are a bitter enemy of %s (%d)."), - vir_name, tester); - else if (tester < -40) - sprintf(vir_desc, _("[%s]ã®æµ (%d)", "You are an enemy of %s (%d)."), - vir_name, tester); - else if (tester < -20) - sprintf(vir_desc, _("[%s]ã®ç½ªè (%d)", "You have sinned against %s (%d)."), - vir_name, tester); - else if (tester < 0) - sprintf(vir_desc, _("[%s]ã®è¿·éè (%d)", "You have strayed from the path of %s (%d)."), - vir_name, tester); - else if (tester == 0) - sprintf(vir_desc, _("[%s]ã®ä¸ç«è (%d)", "You are neutral to %s (%d)."), - vir_name, tester); - else if (tester < 20) - sprintf(vir_desc, _("[%s]ã®å°å¾³è (%d)", "You are somewhat virtuous in %s (%d)."), - vir_name, tester); - else if (tester < 40) - sprintf(vir_desc, _("[%s]ã®ä¸å¾³è (%d)", "You are virtuous in %s (%d)."), - vir_name, tester); - else if (tester < 60) - sprintf(vir_desc, _("[%s]ã®é«å¾³è (%d)", "You are very virtuous in %s (%d)."), - vir_name, tester); - else if (tester < 80) - sprintf(vir_desc, _("[%s]ã®è¦è (%d)", "You are a champion of %s (%d)."), - vir_name, tester); - else if (tester < 100) - sprintf(vir_desc, _("[%s]ã®å大ãªè¦è (%d)", "You are a great champion of %s (%d)."), - vir_name, tester); - else - sprintf(vir_desc, _("[%s]ã®å ·ç¾è (%d)", "You are the living embodiment of %s (%d)."), - vir_name, tester); - - strcpy(v_string[v_nr], vir_desc); - - info[i++] = v_string[v_nr]; - } - info[i++] = ""; - - /* Racial powers... */ - if (p_ptr->mimic_form) - { - switch (p_ptr->mimic_form) - { - case MIMIC_DEMON: - case MIMIC_DEMON_LORD: - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®å°çãç«çã®ãã¬ã¹ãåããã¨ãã§ããã(%d MP)", - "You can nether breathe, dam. %d (cost %d)."), 3 * plev, 10+plev/3); + /* Skip held objects */ + if (o_ptr->held_m_idx) continue; - info[i++] = Dummy; - break; - case MIMIC_VAMPIRE: - if (plev > 1) - { - sprintf(Dummy, _("ããªãã¯æµãã %d-%d HP ã®çå½åãå¸åã§ããã(%d MP)", - "You can steal life from a foe, dam. %d-%d (cost %d)."), - plev + MAX(1, plev / 10), plev + plev * MAX(1, plev / 10), 1 + (plev / 3)); - info[i++] = Dummy; - } - break; + y = o_ptr->iy; + x = o_ptr->ix; + + /* Only detect nearby objects */ + if (distance(p_ptr->y, p_ptr->x, y, x) > range2) continue; + + /* Detect "gold" objects */ + if (o_ptr->tval == TV_GOLD) + { + o_ptr->marked |= OM_FOUND; + lite_spot(y, x); + detect = TRUE; } } - else + + if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE; + if (detect) { - switch (p_ptr->prace) + msg_print(_("財å®ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of treasure!")); + } + + if (detect_monsters_string(range, "$")) { - case RACE_NIBELUNG: - case RACE_DWARF: - if (plev > 4) - info[i++] = _("ããªãã¯ç½ ã¨ãã¢ã¨é段ãæç¥ã§ããã(5 MP)", "You can find traps, doors and stairs (cost 5)."); - break; - case RACE_HOBBIT: - if (plev > 14) - { - info[i++] = _("ããªãã¯é£æãçæã§ããã(10 MP)", "You can produce food (cost 10)."); - } - break; - case RACE_GNOME: - if (plev > 4) - { - sprintf(Dummy, _("ããªãã¯ç¯å² %d 以å ã«ãã¬ãã¼ãã§ããã(%d MP)", "You can teleport, range %d (cost %d)."), - (1 + plev), (5 + (plev / 5))); - info[i++] = Dummy; - } - break; - case RACE_HALF_ORC: - if (plev > 2) - info[i++] = _("ããªãã¯ææãé¤å»ã§ããã(5 MP)", "You can remove fear (cost 5)."); - break; - case RACE_HALF_TROLL: - if (plev > 9) - info[i++] = _("ããªãã¯çæ´åãããã¨ãã§ããã(12 MP) ", "You enter berserk fury (cost 12)."); - break; - case RACE_AMBERITE: - if (plev > 29) - info[i++] = _("ããªãã¯ã·ã£ãã¦ã·ãããããã¨ãã§ããã(50 MP)", "You can Shift Shadows (cost 50)."); + detect = TRUE; + } + return (detect); +} - if (plev > 39) - info[i++] = _("ããªãã¯ããã¿ã¼ã³ããå¿ã«æãã¦æ©ããã¨ãã§ããã(75 MP)", "You can mentally Walk the Pattern (cost 75)."); - break; - case RACE_BARBARIAN: - if (plev > 7) - info[i++] = _("ããªãã¯çæ´åãããã¨ãã§ããã(10 MP) ", "You can enter berserk fury (cost 10)."); +/*! + * @brief é常ã®ã¢ã¤ãã ãªãã¸ã§ã¯ããæç¥ãã / Detect all "normal" objects on the current panel + * @param range å¹æç¯å² + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool detect_objects_normal(POSITION range) +{ + OBJECT_IDX i; + POSITION y, x; + POSITION range2 = range; - break; - case RACE_HALF_OGRE: - if (plev > 24) - info[i++] = _("ããªãã¯ççºã®ã«ã¼ã³ãä»æãããã¨ãã§ããã(35 MP)", "You can set an Explosive Rune (cost 35)."); + bool detect = FALSE; - break; - case RACE_HALF_GIANT: - if (plev > 19) - info[i++] = _("ããªãã¯ç³ã®å£ãå£ããã¨ãã§ããã(10 MP)", "You can break stone walls (cost 10)."); - break; - case RACE_HALF_TITAN: - if (plev > 34) - info[i++] = _("ããªãã¯ã¢ã³ã¹ã¿ã¼ãã¹ãã£ã³ãããã¨ãã§ããã(20 MP)", "You can probe monsters (cost 20)."); - break; - case RACE_CYCLOPS: - if (plev > 19) - { - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®å²©ç³ãæãããã¨ãã§ããã(15 MP)", - "You can throw a boulder, dam. %d (cost 15)."), 3 * plev); - info[i++] = Dummy; - } - break; - case RACE_YEEK: - if (plev > 14) - info[i++] = _("ããªãã¯ææãå¼ã³èµ·ããå«ã³å£°ãçºãããã¨ãã§ããã(15 MP)", "You can make a terrifying scream (cost 15)."); - break; - case RACE_KLACKON: - if (plev > 8) - { - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®é ¸ãå¹ãããããã¨ãã§ããã(9 MP)", "You can spit acid, dam. %d (cost 9)."), plev); - info[i++] = Dummy; - } - break; - case RACE_KOBOLD: - if (plev > 11) - { - sprintf(Dummy, - _("ããªã㯠%d ãã¡ã¼ã¸ã®æ¯ç¢ãæãããã¨ãã§ããã(8 MP)", "You can throw a dart of poison, dam. %d (cost 8)."), plev); - info[i++] = Dummy; - } - break; - case RACE_DARK_ELF: - if (plev > 1) - { - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®ãã¸ãã¯ã»ããµã¤ã«ã®åªæã使ããã(2 MP)", "You can cast a Magic Missile, dam %d (cost 2)."), - (3 + ((plev-1) / 5))); - info[i++] = Dummy; - } - break; - case RACE_DRACONIAN: - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®ãã¬ã¹ãåããã¨ãã§ããã(%d MP)", "You can breathe, dam. %d (cost %d)."), 2 * plev, plev); - info[i++] = Dummy; - break; - case RACE_MIND_FLAYER: - if (plev > 14) - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®ç²¾ç¥æ»æããããã¨ãã§ããã(12 MP)", "You can mind blast your enemies, dam %d (cost 12)."), plev); - info[i++] = Dummy; - break; - case RACE_IMP: - if (plev > 29) - { - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®ãã¡ã¤ã¢ã»ãã¼ã«ã®åªæã使ããã(15 MP)", "You can cast a Fire Ball, dam. %d (cost 15)."), plev); - info[i++] = Dummy; - } - else if (plev > 8) - { - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®ãã¡ã¤ã¢ã»ãã«ãã®åªæã使ããã(15 MP)", "You can cast a Fire Bolt, dam. %d (cost 15)."), plev); - info[i++] = Dummy; - } - break; - case RACE_GOLEM: - if (plev > 19) - info[i++] = _("ããªã㯠d20+30 ã¿ã¼ã³ã®éèãç³ã«å¤åãããããã(15 MP)", "You can turn your skin to stone, dur d20+30 (cost 15)."); - break; - case RACE_ZOMBIE: - case RACE_SKELETON: - if (plev > 29) - info[i++] = _("ããªãã¯å¤±ã£ãçµé¨å¤ãå復ãããã¨ãã§ããã(30 MP)", "You can restore lost experience (cost 30)."); - break; - case RACE_VAMPIRE: - if (plev > 1) - { - sprintf(Dummy, _("ããªãã¯æµãã %d-%d HP ã®çå½åãå¸åã§ããã(%d MP)", "You can steal life from a foe, dam. %d-%d (cost %d)."), - plev + MAX(1, plev / 10), plev + plev * MAX(1, plev / 10), 1 + (plev / 3)); - info[i++] = Dummy; - } - break; - case RACE_SPECTRE: - if (plev > 3) - { - info[i++] = _("ããªãã¯æ³£ãå«ãã§æµãææããããã¨ãã§ããã(3 MP)", "You can wail to terrify your enemies (cost 3)."); - } - break; - case RACE_SPRITE: - if (plev > 11) - { - info[i++] = _("ããªãã¯æµãç ãããéæ³ã®ç²ãæãããã¨ãã§ããã(12 MP)", "You can throw magical dust which induces sleep (cost 12)."); - } - break; - case RACE_DEMON: - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®å°çãç«çã®ãã¬ã¹ãåããã¨ãã§ããã(%d MP)", - "You can breathe nether, dam. %d (cost %d)."), 3 * plev, 10+plev/3); + if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range2 /= 3; - info[i++] = Dummy; - break; - case RACE_KUTAR: - if (plev > 19) - info[i++] = _("ããªã㯠d20+30 ã¿ã¼ã³ã®é横ã«ä¼¸ã³ããã¨ãã§ããã(15 MP)", "You can expand horizontally, dur d20+30 (cost 15)."); - break; - case RACE_ANDROID: - if (plev < 10) - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®ã¬ã¤ã¬ã³ãæã¤ãã¨ãã§ããã(7 MP)", "You can fire a ray gun with damage %d (cost 7)."), - (plev + 1) / 2); - else if (plev < 25) - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®ãã©ã¹ã¿ã¼ãæã¤ãã¨ãã§ããã(13 MP)", "You can fire a blaster with damage %d (cost 13)."), plev); - else if (plev < 35) - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®ããºã¼ã«ãæã¤ãã¨ãã§ããã(26 MP)", "You can fire a bazooka with damage %d (cost 26)."), plev * 2); - else if (plev < 45) - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®ãã¼ã ãã£ãã³ãæã¤ãã¨ãã§ããã(40 MP)", - "You can fire a beam cannon with damage %d (cost 40)."), plev * 2); - else - sprintf(Dummy, _("ããªã㯠%d ãã¡ã¼ã¸ã®ãã±ãããæã¤ãã¨ãã§ããã(60 MP)", - "You can fire a rocket with damage %d (cost 60)."), plev * 5); + /* Scan objects */ + for (i = 1; i < o_max; i++) + { + object_type *o_ptr = &o_list[i]; - info[i++] = Dummy; - break; - default: - break; + /* Skip dead objects */ + if (!o_ptr->k_idx) continue; + + /* Skip held objects */ + if (o_ptr->held_m_idx) continue; + + y = o_ptr->iy; + x = o_ptr->ix; + + /* Only detect nearby objects */ + if (distance(p_ptr->y, p_ptr->x, y, x) > range2) continue; + + /* Detect "real" objects */ + if (o_ptr->tval != TV_GOLD) + { + o_ptr->marked |= OM_FOUND; + lite_spot(y, x); + detect = TRUE; + } } + + if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE; + if (detect) + { + msg_print(_("ã¢ã¤ãã ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of objects!")); } - switch(p_ptr->pclass) + if (detect_monsters_string(range, "!=?|/`")) { - case CLASS_WARRIOR: - if (plev > 39) - { - info[i++] = _("ããªãã¯ã©ã³ãã ãªæ¹åã«å¯¾ãã¦æ°åæ»æãããã¨ãã§ããã(75 MP)", - "You can attack some random directions at a time (cost 75)."); - } - break; - case CLASS_HIGH_MAGE: - if (p_ptr->realm1 == REALM_HEX) break; - case CLASS_MAGE: - case CLASS_SORCERER: - if (plev > 24) - { - info[i++] = _("ããªãã¯ã¢ã¤ãã ã®éåãå¸åãããã¨ãã§ããã(1 MP)", - "You can absorb charges from an item (cost 1)."); - } - break; - case CLASS_PRIEST: - if (is_good_realm(p_ptr->realm1)) - { - if (plev > 34) - { - info[i++] = _("ããªãã¯æ¦å¨ãç¥ç¦ãããã¨ãã§ããã(70 MP)", "You can bless a weapon (cost 70)."); - } - } - else - { - if (plev > 41) - { - info[i++] = _("ããªãã¯å¨ãã®ãã¹ã¦ã®ã¢ã³ã¹ã¿ã¼ãæ»æãããã¨ãã§ããã(40 MP)", "You can damages all monsters in sight (cost 40)."); - } - } - break; - case CLASS_ROGUE: - if (plev > 7) - { - info[i++] = _("ããªãã¯æ»æãã¦å³åº§ã«éãããã¨ãã§ããã(12 MP)", "You can hit a monster and teleport at a time (cost 12)."); - } - break; - case CLASS_RANGER: - if (plev > 14) - { - info[i++] = _("ããªãã¯æªç©ã調æ»ãããã¨ãã§ããã(20 MP)", "You can prove monsters (cost 20)."); - } - break; - case CLASS_PALADIN: - if (is_good_realm(p_ptr->realm1)) - { - if (plev > 29) - { - info[i++] = _("ããªãã¯èãªãæ§ãæ¾ã¤ãã¨ãã§ããã(30 MP)", "You can fires a holy spear (cost 30)."); - } - } - else - { - if (plev > 29) - { - info[i++] = _("ããªãã¯çå½åãæ¸å°ãããæ§ãæ¾ã¤ãã¨ãã§ããã(30 MP)", "You can fires a spear which drains vitality (cost 30)."); - } - } - break; - case CLASS_WARRIOR_MAGE: - if (plev > 24) - { - info[i++] = _("ããªãã¯ï¼¨ï¼°ãï¼ï¼°ã«å¤æãããã¨ãã§ããã(0 MP)", "You can convert HP to SP (cost 0)."); - info[i++] = _("ããªãã¯ï¼ï¼°ãHPã«å¤æãããã¨ãã§ããã(0 MP)", "You can convert SP to HP (cost 0)."); - } - break; - case CLASS_CHAOS_WARRIOR: - if (plev > 39) - { - info[i++] = _("ããªãã¯å¨å²ã«æªç©ãæããå ãçºçããããã¨ãã§ããã(50 MP)", - "You can radiate light which confuses nearby monsters (cost 50)."); - } - break; - case CLASS_MONK: - if (plev > 24) - { - info[i++] = _("ããªãã¯æ§ãããã¨ãã§ããã(0 MP)", "You can assume a posture of special form (cost 0)."); - } - if (plev > 29) - { - info[i++] = _("ããªãã¯é常ã®2åã®æ»æãè¡ããã¨ãã§ããã(30 MP)", "You can perform double attacks in a time (cost 30)."); - } - break; - case CLASS_MINDCRAFTER: - case CLASS_FORCETRAINER: - if (plev > 14) - { - info[i++] = _("ããªãã¯ç²¾ç¥ãéä¸ãã¦ï¼ï¼°ãå復ããããã¨ãã§ããã(0 MP)", "You can concentrate to regenerate your mana (cost 0)."); - } - break; - case CLASS_TOURIST: - info[i++] = _("ããªãã¯åçãæ®å½±ãããã¨ãã§ããã(0 MP)", "You can take a photograph (cost 0)."); - if (plev > 24) - { - info[i++] = _("ããªãã¯ã¢ã¤ãã ãå®å ¨ã«éå®ãããã¨ãã§ããã(20 MP)", "You can *identify* items (cost 20)."); - } - break; - case CLASS_IMITATOR: - if (plev > 29) - { - info[i++] = _("ããªãã¯æªç©ã®ç¹æ®æ»æããã¡ã¼ã¸2åã§ã¾ãããã¨ãã§ããã(100 MP)", - "You can imitate monster's special attacks with double damage (cost 100)."); - } - break; - case CLASS_BEASTMASTER: - info[i++] = _("ããªãã¯1ä½ã®çå½ã®ããã¢ã³ã¹ã¿ã¼ãæ¯é ãããã¨ãã§ããã(ã¬ãã«/4 MP)", "You can dominate a monster (cost level/4)."); - if (plev > 29) - { - info[i++] = _("ããªãã¯è¦çå ã®çå½ã®ããã¢ã³ã¹ã¿ã¼ãæ¯é ãããã¨ãã§ããã((ã¬ãã«+20)/2 MP)", - "You can dominate living monsters in sight (cost (level+20)/4)."); - } - break; - case CLASS_MAGIC_EATER: - info[i++] = _("ããªãã¯æ/éæ³æ£/ãããã®éåãèªåã®ãã®ã«ãããã¨ãã§ããã", "You can absorb a staff, wand or rod itself."); - break; - case CLASS_RED_MAGE: - if (plev > 47) - { - info[i++] = _("ããªãã¯1ã¿ã¼ã³ã«2åéæ³ãå±ãããã¨ãã§ããã(20 MP)", "You can cast two spells in one time (cost 20)."); - } - break; - case CLASS_SAMURAI: - { - info[i++] = _("ããªãã¯ç²¾ç¥ãéä¸ãã¦æ°åããæºãããã¨ãã§ããã", "You can concentrate to regenerate your mana."); - } - if (plev > 24) - { - info[i++] = _("ããªãã¯ç¹æ®ãªåã§æ§ãããã¨ãã§ããã", "You can assume a posture of special form."); - } - break; - case CLASS_BLUE_MAGE: - info[i++] = _("ããªãã¯ç¸æã«ä½¿ãããéæ³ãå¦ã¶ãã¨ãã§ããã", "You can study spells which your enemy casts on you."); - break; - case CLASS_CAVALRY: - if (plev > 9) - { - info[i++] = _("ããªãã¯ã¢ã³ã¹ã¿ã¼ã«ä¹ã£ã¦ç¡çç¢çãããã«ãããã¨ãã§ããã", "You can ride on a hostile monster forcibly to turn it into pet."); - } - break; - case CLASS_BERSERKER: - if (plev > 9) - { - info[i++] = _("ããªãã¯è¡ã¨ãã³ã¸ã§ã³ã®éãè¡ãæ¥ãããã¨ãã§ããã", "You can travel between town and the depths."); - } - break; - case CLASS_MIRROR_MASTER: - info[i++] = _("ããªãã¯é¡ãä½ãåºããã¨ãã§ããã(2 MP)", "You can create a Mirror (cost 2)."); - info[i++] = _("ããªãã¯é¡ãå²ããã¨ãã§ããã(0 MP)", "You can break distant Mirrors (cost 0)."); - break; - case CLASS_NINJA: - if (plev > 19) - { - info[i++] = _("ããªãã¯ç´ æ©ã移åãããã¨ãã§ããã", "You can walk extremery fast."); - } - break; - } - - if (p_ptr->muta1) - { - if (p_ptr->muta1 & MUT1_SPIT_ACID) - { - info[i++] = _("ããªãã¯é ¸ãå¹ãããããã¨ãã§ããã(ãã¡ã¼ã¸ ã¬ãã«X1)", "You can spit acid (dam lvl)."); - } - if (p_ptr->muta1 & MUT1_BR_FIRE) - { - info[i++] = _("ããªãã¯çã®ãã¬ã¹ãåããã¨ãã§ããã(ãã¡ã¼ã¸ ã¬ãã«X2)", "You can breathe fire (dam lvl * 2)."); - } - if (p_ptr->muta1 & MUT1_HYPN_GAZE) - { - info[i++] = _("ããªãã®ç¨ã¿ã¯å¬ç å¹æããã¤ã", "Your gaze is hypnotic."); - } - if (p_ptr->muta1 & MUT1_TELEKINES) - { - info[i++] = _("ããªãã¯å¿µååããã£ã¦ããã", "You are telekinetic."); - } - if (p_ptr->muta1 & MUT1_VTELEPORT) - { - info[i++] = _("ããªãã¯èªåã®ææã§ãã¬ãã¼ãã§ããã", "You can teleport at will."); - } - if (p_ptr->muta1 & MUT1_MIND_BLST) - { - info[i++] = _("ããªãã¯ç²¾ç¥æ»æãè¡ããã(ãã¡ã¼ã¸ 3ï½12d3)", "You can Mind Blast your enemies (3 to 12d3 dam)."); - } - if (p_ptr->muta1 & MUT1_RADIATION) - { - info[i++] = _("ããªãã¯èªåã®ææã§å¼·ãæ¾å°ç·ãçºçãããã¨ãã§ããã(ãã¡ã¼ã¸ ã¬ãã«X2)", "You can emit hard radiation at will (dam lvl * 2)."); - } - if (p_ptr->muta1 & MUT1_VAMPIRISM) - { - info[i++] = _("ããªãã¯å¸è¡é¬¼ã®ããã«æµããçå½åãå¸åãããã¨ãã§ããã(ãã¡ã¼ã¸ ã¬ãã«X2)", - "You can drain life from a foe like a vampire (dam lvl * 2)."); - } - if (p_ptr->muta1 & MUT1_SMELL_MET) - { - info[i++] = _("ããªãã¯è¿ãã«ããè²´éå±ãããåãããã¨ãã§ããã", "You can smell nearby precious metal."); - } - if (p_ptr->muta1 & MUT1_SMELL_MON) - { - info[i++] = _("ããªãã¯è¿ãã®ã¢ã³ã¹ã¿ã¼ã®åå¨ãããåãããã¨ãã§ããã", "You can smell nearby monsters."); - } - if (p_ptr->muta1 & MUT1_BLINK) - { - info[i++] = _("ããªãã¯çãè·é¢ããã¬ãã¼ãã§ããã", "You can teleport yourself short distances."); - } - if (p_ptr->muta1 & MUT1_EAT_ROCK) - { - info[i++] = _("ããªãã¯ç¡¬ã岩ãé£ã¹ããã¨ãã§ããã", "You can consume solid rock."); - } - if (p_ptr->muta1 & MUT1_SWAP_POS) - { - info[i++] = _("ããªãã¯ä»ã®è ã¨å ´æãå ¥ãæ¿ãããã¨ãã§ããã", "You can switch locations with another being."); - } - if (p_ptr->muta1 & MUT1_SHRIEK) - { - info[i++] = _("ããªãã¯èº«ã®æ¯ããã ã¤å«ã³å£°ãçºãããã¨ãã§ããã(ãã¡ã¼ã¸ ã¬ãã«X2)", "You can emit a horrible shriek (dam 2 * lvl)."); - } - if (p_ptr->muta1 & MUT1_ILLUMINE) - { - info[i++] = _("ããªãã¯æããå ãæ¾ã¤ãã¨ãã§ããã", "You can emit bright light."); - } - if (p_ptr->muta1 & MUT1_DET_CURSE) - { - info[i++] = _("ããªãã¯éªæªãªéæ³ã®å±éºãæãã¨ããã¨ãã§ããã", "You can feel the danger of evil magic."); - } - if (p_ptr->muta1 & MUT1_BERSERK) - { - info[i++] = _("ããªãã¯èªåã®ææã§çä¹±æ¦éç¶æ ã«ãªããã¨ãã§ããã", "You can drive yourself into a berserk frenzy."); - } - if (p_ptr->muta1 & MUT1_POLYMORPH) - { - info[i++] = _("ããªãã¯èªåã®æå¿ã§å¤åã§ããã", "You can polymorph yourself at will."); - } - if (p_ptr->muta1 & MUT1_MIDAS_TCH) - { - info[i++] = _("ããªãã¯é常ã¢ã¤ãã ãéã«å¤ãããã¨ãã§ããã", "You can turn ordinary items to gold."); - } - if (p_ptr->muta1 & MUT1_GROW_MOLD) - { - info[i++] = _("ããªãã¯å¨å²ã«ããã³ãçãããã¨ãã§ããã", "You can cause mold to grow near you."); - } - if (p_ptr->muta1 & MUT1_RESIST) - { - info[i++] = _("ããªãã¯å ç´ ã®æ»æã«å¯¾ãã¦èº«ã硬ããããã¨ãã§ããã", "You can harden yourself to the ravages of the elements."); - } - if (p_ptr->muta1 & MUT1_EARTHQUAKE) - { - info[i++] = _("ããªãã¯å¨å²ã®ãã³ã¸ã§ã³ãå´©å£ããããã¨ãã§ããã", "You can bring down the dungeon around your ears."); - } - if (p_ptr->muta1 & MUT1_EAT_MAGIC) - { - info[i++] = _("ããªãã¯éæ³ã®ã¨ãã«ã®ã¼ãèªåã®ç©ã¨ãã¦ä½¿ç¨ã§ããã", "You can consume magic energy for your own use."); - } - if (p_ptr->muta1 & MUT1_WEIGH_MAG) - { - info[i++] = _("ããªãã¯èªåã«å½±é¿ãä¸ããéæ³ã®åãæãããã¨ãã§ããã", "You can feel the strength of the magics affecting you."); - } - if (p_ptr->muta1 & MUT1_STERILITY) - { - info[i++] = _("ããªãã¯éå£ççæ®ä¸è½ãèµ·ãããã¨ãã§ããã", "You can cause mass impotence."); - } - if (p_ptr->muta1 & MUT1_PANIC_HIT) - { - info[i++] = _("ããªãã¯æ»æããå¾èº«ãå®ãããéãããã¨ãã§ããã", "You can run for your life after hitting something."); - } - if (p_ptr->muta1 & MUT1_DAZZLE) - { - info[i++] = _("ããªãã¯æ··ä¹±ã¨ç²ç®ãå¼ãèµ·ããæ¾å°è½ãçºçãããã¨ãã§ããã ", "You can emit confusing, blinding radiation."); - } - if (p_ptr->muta1 & MUT1_LASER_EYE) - { - info[i++] = _("ããªãã¯ç®ããã¬ã¼ã¶ã¼å ç·ãçºãããã¨ãã§ããã(ãã¡ã¼ã¸ ã¬ãã«X2)", "Your eyes can fire laser beams (dam 2 * lvl)."); - } - if (p_ptr->muta1 & MUT1_RECALL) - { - info[i++] = _("ããªãã¯è¡ã¨ãã³ã¸ã§ã³ã®éãè¡ãæ¥ãããã¨ãã§ããã", "You can travel between town and the depths."); - } - if (p_ptr->muta1 & MUT1_BANISH) - { - info[i++] = _("ããªãã¯éªæªãªã¢ã³ã¹ã¿ã¼ãå°çã«è½ã¨ããã¨ãã§ããã", "You can send evil creatures directly to Hell."); - } - if (p_ptr->muta1 & MUT1_COLD_TOUCH) - { - info[i++] = _("ããªãã¯æµã触ã£ã¦åããããã¨ãã§ããã(ãã¡ã¼ã¸ ã¬ãã«X3)", "You can freeze things with a touch (dam 3 * lvl)."); - } - if (p_ptr->muta1 & MUT1_LAUNCHER) - { - info[i++] = _("ããªãã¯ã¢ã¤ãã ãåå¼·ãæãããã¨ãã§ããã", "You can hurl objects with great force."); - } - } - - if (p_ptr->muta2) - { - if (p_ptr->muta2 & MUT2_BERS_RAGE) - { - info[i++] = _("ããªãã¯çæ¦å£«åã®çºä½ãèµ·ããã", "You are subject to berserker fits."); - } - if (p_ptr->muta2 & MUT2_COWARDICE) - { - info[i++] = _("ããªãã¯æã èç ã«ãªãã", "You are subject to cowardice."); - } - if (p_ptr->muta2 & MUT2_RTELEPORT) - { - info[i++] = _("ããªãã¯ã©ã³ãã ã«ãã¬ãã¼ãããã", "You are teleporting randomly."); - } - if (p_ptr->muta2 & MUT2_ALCOHOL) - { - info[i++] = _("ããªãã®ä½ã¯ã¢ã«ã³ã¼ã«ãåæ³ããã", "Your body produces alcohol."); - } - if (p_ptr->muta2 & MUT2_HALLU) - { - info[i++] = _("ããªãã¯å¹»è¦ãå¼ãèµ·ããç²¾ç¥é¯ä¹±ã«ä¾µããã¦ããã", "You have a hallucinatory insanity."); - } - if (p_ptr->muta2 & MUT2_FLATULENT) - { - info[i++] = _("ããªãã¯å¶å¾¡ã§ããªãå¼·çãªå±ãããã", "You are subject to uncontrollable flatulence."); - } - if (p_ptr->muta2 & MUT2_PROD_MANA) - { - info[i++] = _("ããªãã¯å¶å¾¡ä¸è½ãªéæ³ã®ã¨ãã«ã®ã¼ãçºãã¦ããã", "You are producing magical energy uncontrollably."); - } - if (p_ptr->muta2 & MUT2_ATT_DEMON) - { - info[i++] = _("ããªãã¯ãã¼ã¢ã³ãå¼ãã¤ããã", "You attract demons."); - } - if (p_ptr->muta2 & MUT2_SCOR_TAIL) - { - info[i++] = _("ããªãã¯ãµã½ãªã®å°»å°¾ãçãã¦ããã(æ¯ããã¡ã¼ã¸ 3d7)", "You have a scorpion tail (poison, 3d7)."); - } - if (p_ptr->muta2 & MUT2_HORNS) - { - info[i++] = _("ããªãã¯è§ãçãã¦ããã(ãã¡ã¼ã¸ 2d6)", "You have horns (dam. 2d6)."); - } - if (p_ptr->muta2 & MUT2_BEAK) - { - info[i++] = _("ããªãã¯ã¯ããã·ãçãã¦ããã(ãã¡ã¼ã¸ 2d4)", "You have a beak (dam. 2d4)."); - } - if (p_ptr->muta2 & MUT2_SPEED_FLUX) - { - info[i++] = _("ããªãã¯ã©ã³ãã ã«æ©ãåãããé ãåãããããã", "You move faster or slower randomly."); - } - if (p_ptr->muta2 & MUT2_BANISH_ALL) - { - info[i++] = _("ããªãã¯æã è¿ãã®ã¢ã³ã¹ã¿ã¼ãæ¶æ» ãããã", "You sometimes cause nearby creatures to vanish."); - } - if (p_ptr->muta2 & MUT2_EAT_LIGHT) - { - info[i++] = _("ããªãã¯æã å¨å²ã®å ãå¸åãã¦æ é¤ã«ããã", "You sometimes feed off of the light around you."); - } - if (p_ptr->muta2 & MUT2_TRUNK) - { - info[i++] = _("ããªãã¯è±¡ã®ãããªé¼»ãæã£ã¦ããã(ãã¡ã¼ã¸ 1d4)", "You have an elephantine trunk (dam 1d4)."); - } - if (p_ptr->muta2 & MUT2_ATT_ANIMAL) - { - info[i++] = _("ããªãã¯åç©ãå¼ãã¤ããã", "You attract animals."); - } - if (p_ptr->muta2 & MUT2_TENTACLES) - { - info[i++] = _("ããªãã¯éªæªãªè§¦æãæã£ã¦ããã(ãã¡ã¼ã¸ 2d5)", "You have evil looking tentacles (dam 2d5)."); - } - if (p_ptr->muta2 & MUT2_RAW_CHAOS) - { - info[i++] = _("ããªãã¯ãã°ãã°ç´ã«ãªã¹ã«å ã¾ããã", "You occasionally are surrounded with raw chaos."); - } - if (p_ptr->muta2 & MUT2_NORMALITY) - { - info[i++] = _("ããªãã¯å¤ç°ãã¦ããããå復ãã¦ãã¦ããã", "You may be mutated, but you're recovering."); - } - if (p_ptr->muta2 & MUT2_WRAITH) - { - info[i++] = _("ããªãã®èä½ã¯å¹½ä½åãããå®ä½åãããããã", "You fade in and out of physical reality."); - } - if (p_ptr->muta2 & MUT2_POLY_WOUND) - { - info[i++] = _("ããªãã®å¥åº·ã¯ã«ãªã¹ã®åã«å½±é¿ãåããã", "Your health is subject to chaotic forces."); - } - if (p_ptr->muta2 & MUT2_WASTING) - { - info[i++] = _("ããªãã¯è¡°å¼±ããæãããç æ°ã«ããã£ã¦ããã", "You have a horrible wasting disease."); - } - if (p_ptr->muta2 & MUT2_ATT_DRAGON) - { - info[i++] = _("ããªãã¯ãã©ã´ã³ãå¼ãã¤ããã", "You attract dragons."); - } - if (p_ptr->muta2 & MUT2_WEIRD_MIND) - { - info[i++] = _("ããªãã®ç²¾ç¥ã¯ã©ã³ãã ã«æ¡å¤§ããã縮å°ããããã¦ããã", "Your mind randomly expands and contracts."); - } - if (p_ptr->muta2 & MUT2_NAUSEA) - { - info[i++] = _("ããªãã®èã¯é常ã«è½ã¡çãããªãã", "You have a seriously upset stomach."); - } - if (p_ptr->muta2 & MUT2_CHAOS_GIFT) - { - info[i++] = _("ããªãã¯ã«ãªã¹ã®å®è·æªéããè¤ç¾ãããã¨ãã", "Chaos deities give you gifts."); - } - if (p_ptr->muta2 & MUT2_WALK_SHAD) - { - info[i++] = _("ããªãã¯ãã°ãã°ä»ã®ãå½±ãã«è¿·ãè¾¼ãã", "You occasionally stumble into other shadows."); - } - if (p_ptr->muta2 & MUT2_WARNING) - { - info[i++] = _("ããªãã¯æµã«é¢ããè¦åãæããã", "You receive warnings about your foes."); - } - if (p_ptr->muta2 & MUT2_INVULN) - { - info[i++] = _("ããªãã¯æã è² ãç¥ãããªæ°åã«ãªãã", "You occasionally feel invincible."); - } - if (p_ptr->muta2 & MUT2_SP_TO_HP) - { - info[i++] = _("ããªãã¯æã è¡ãçèã«ã©ã£ã¨æµããã", "Your blood sometimes rushes to your muscles."); - } - if (p_ptr->muta2 & MUT2_HP_TO_SP) - { - info[i++] = _("ããªãã¯æã é ã«è¡ãã©ã£ã¨æµããã", "Your blood sometimes rushes to your head."); - } - if (p_ptr->muta2 & MUT2_DISARM) - { - info[i++] = _("ããªãã¯ããã¤ã¾ã¥ãã¦ç©ãè½ã¨ãã", "You occasionally stumble and drop things."); - } - } - - if (p_ptr->muta3) - { - if (p_ptr->muta3 & MUT3_HYPER_STR) - { - info[i++] = _("ããªãã¯è¶ 人çã«å¼·ãã(è å+4)", "You are superhumanly strong (+4 STR)."); - } - if (p_ptr->muta3 & MUT3_PUNY) - { - info[i++] = _("ããªãã¯èå¼±ã ã(è å-4)", "You are puny (-4 STR)."); - } - if (p_ptr->muta3 & MUT3_HYPER_INT) - { - info[i++] = _("ããªãã®è³ã¯çä½ã³ã³ãã¥ã¼ã¿ã ã(ç¥è½ï¼è³¢ã+4)", "Your brain is a living computer (+4 INT/WIS)."); - } - if (p_ptr->muta3 & MUT3_MORONIC) - { - info[i++] = _("ããªãã¯ç²¾ç¥èå¼±ã ã(ç¥è½ï¼è³¢ã-4)", "You are moronic (-4 INT/WIS)."); - } - if (p_ptr->muta3 & MUT3_RESILIENT) - { - info[i++] = _("ããªãã¯é常ã«ã¿ãã ã(èä¹ +4)", "You are very resilient (+4 CON)."); - } - if (p_ptr->muta3 & MUT3_XTRA_FAT) - { - info[i++] = _("ããªãã¯æ¥µç«¯ã«å¤ªã£ã¦ããã(èä¹ +2,ã¹ãã¼ã-2)", "You are extremely fat (+2 CON, -2 speed)."); - } - if (p_ptr->muta3 & MUT3_ALBINO) - { - info[i++] = _("ããªãã¯ã¢ã«ããã ã(èä¹ -4)", "You are albino (-4 CON)."); - } - if (p_ptr->muta3 & MUT3_FLESH_ROT) - { - info[i++] = _("ããªãã®èä½ã¯è æãã¦ããã(èä¹ -2,é å-1)", "Your flesh is rotting (-2 CON, -1 CHR)."); - } - if (p_ptr->muta3 & MUT3_SILLY_VOI) - { - info[i++] = _("ããªãã®å£°ã¯éæããªãã¼ãã¼å£°ã ã(é å-4)", "Your voice is a silly squeak (-4 CHR)."); - } - if (p_ptr->muta3 & MUT3_BLANK_FAC) - { - info[i++] = _("ããªãã¯ã®ã£ãºãã¼ãã ã(é å-1)", "Your face is featureless (-1 CHR)."); - } - if (p_ptr->muta3 & MUT3_ILL_NORM) - { - info[i++] = _("ããªãã¯å¹»å½±ã«è¦ããã¦ããã", "Your appearance is masked with illusion."); - } - if (p_ptr->muta3 & MUT3_XTRA_EYES) - { - info[i++] = _("ããªãã¯ä½åã«äºã¤ã®ç®ãæã£ã¦ããã(æ¢ç´¢+15)", "You have an extra pair of eyes (+15 search)."); - } - if (p_ptr->muta3 & MUT3_MAGIC_RES) - { - info[i++] = _("ããªãã¯éæ³ã¸ã®èæ§ããã£ã¦ããã", "You are resistant to magic."); - } - if (p_ptr->muta3 & MUT3_XTRA_NOIS) - { - info[i++] = _("ããªãã¯å¤ãªé³ãçºãã¦ããã(é å¯-3)", "You make a lot of strange noise (-3 stealth)."); - } - if (p_ptr->muta3 & MUT3_INFRAVIS) - { - info[i++] = _("ããªãã¯ç´ æ´ããã赤å¤ç·è¦åãæã£ã¦ããã(+3)", "You have remarkable infravision (+3)."); - } - if (p_ptr->muta3 & MUT3_XTRA_LEGS) - { - info[i++] = _("ããªãã¯ä½åã«äºæ¬ã®è¶³ãçãã¦ããã(å é+3)", "You have an extra pair of legs (+3 speed)."); - } - if (p_ptr->muta3 & MUT3_SHORT_LEG) - { - info[i++] = _("ããªãã®è¶³ã¯çãçªèµ·ã ã(å é-3)", "Your legs are short stubs (-3 speed)."); - } - if (p_ptr->muta3 & MUT3_ELEC_TOUC) - { - info[i++] = _("ããªãã®è¡ç®¡ã«ã¯é»æµãæµãã¦ããã", "Electricity is running through your veins."); - } - if (p_ptr->muta3 & MUT3_FIRE_BODY) - { - info[i++] = _("ããªãã®ä½ã¯çã«ã¤ã¤ã¾ãã¦ããã", "Your body is enveloped in flames."); - } - if (p_ptr->muta3 & MUT3_WART_SKIN) - { - info[i++] = _("ããªãã®èã¯ã¤ãã«è¢«ããã¦ããã(é å-2, AC+5)", "Your skin is covered with warts (-2 CHR, +5 AC)."); - } - if (p_ptr->muta3 & MUT3_SCALES) - { - info[i++] = _("ããªãã®èã¯é±ã«ãªã£ã¦ããã(é å-1, AC+10)", "Your skin has turned into scales (-1 CHR, +10 AC)."); - } - if (p_ptr->muta3 & MUT3_IRON_SKIN) - { - info[i++] = _("ããªãã®èã¯éã§ã§ãã¦ããã(å¨ç¨-1, AC+25)", "Your skin is made of steel (-1 DEX, +25 AC)."); - } - if (p_ptr->muta3 & MUT3_WINGS) - { - info[i++] = _("ããªãã¯ç¾½ãæã£ã¦ããã", "You have wings."); - } - if (p_ptr->muta3 & MUT3_FEARLESS) - { - /* Unnecessary */ - } - if (p_ptr->muta3 & MUT3_REGEN) - { - /* Unnecessary */ - } - if (p_ptr->muta3 & MUT3_ESP) - { - /* Unnecessary */ - } - if (p_ptr->muta3 & MUT3_LIMBER) - { - info[i++] = _("ããªãã®ä½ã¯é常ã«ããªããã ã(å¨ç¨+3)", "Your body is very limber (+3 DEX)."); - } - if (p_ptr->muta3 & MUT3_ARTHRITIS) - { - info[i++] = _("ããªãã¯ãã¤ãé¢ç¯ã«çã¿ãæãã¦ããã(å¨ç¨-3)", "Your joints ache constantly (-3 DEX)."); - } - if (p_ptr->muta3 & MUT3_VULN_ELEM) - { - info[i++] = _("ããªãã¯å ç´ ã®æ»æã«å¼±ãã", "You are susceptible to damage from the elements."); - } - if (p_ptr->muta3 & MUT3_MOTION) - { - info[i++] = _("ããªãã®åä½ã¯æ£ç¢ºã§åå¼·ãã(é å¯+1)", "Your movements are precise and forceful (+1 STL)."); - } - if (p_ptr->muta3 & MUT3_GOOD_LUCK) - { - info[i++] = _("ããªãã¯ç½ããªã¼ã©ã«ã¤ã¤ã¾ãã¦ããã", "There is a white aura surrounding you."); - } - if (p_ptr->muta3 & MUT3_BAD_LUCK) - { - info[i++] = _("ããªãã¯é»ããªã¼ã©ã«ã¤ã¤ã¾ãã¦ããã", "There is a black aura surrounding you."); - } - } - - if (p_ptr->blind) - { - info[i++] = _("ããªãã¯ç®ãè¦ããªãã", "You cannot see."); - } - if (p_ptr->confused) - { - info[i++] = _("ããªãã¯æ··ä¹±ãã¦ããã", "You are confused."); - } - if (p_ptr->afraid) - { - info[i++] = _("ããªãã¯ææã«ä¾µããã¦ããã", "You are terrified."); - } - if (p_ptr->cut) - { - info[i++] = _("ããªãã¯åºè¡ãã¦ããã", "You are bleeding."); - } - if (p_ptr->stun) - { - info[i++] = _("ããªãã¯ããããã¨ãã¦ããã", "You are stunned."); - } - if (p_ptr->poisoned) - { - info[i++] = _("ããªãã¯æ¯ã«ä¾µããã¦ããã", "You are poisoned."); - } - if (p_ptr->image) - { - info[i++] = _("ããªãã¯å¹»è¦ãè¦ã¦ããã", "You are hallucinating."); - } - if (p_ptr->cursed & TRC_TY_CURSE) - { - info[i++] = _("ããªãã¯éªæªãªæ¨å¿µã«å ã¾ãã¦ããã", "You carry an ancient foul curse."); - } - if (p_ptr->cursed & TRC_AGGRAVATE) - { - info[i++] = _("ããªãã¯ã¢ã³ã¹ã¿ã¼ãæããã¦ããã", "You aggravate monsters."); - } - if (p_ptr->cursed & TRC_DRAIN_EXP) - { - info[i++] = _("ããªãã¯çµé¨å¤ãå¸ããã¦ããã", "You are drained."); - } - if (p_ptr->cursed & TRC_SLOW_REGEN) - { - info[i++] = _("ããªãã®å復åã¯é常ã«é ãã", "You regenerate slowly."); - } - if (p_ptr->cursed & TRC_ADD_L_CURSE) - { - info[i++] = _("ããªãã®å¼±ãåªãã¯å¢ããã","Your weak curses multiply."); /* æ«å®ç -- henkma */ - } - if (p_ptr->cursed & TRC_ADD_H_CURSE) - { - info[i++] = _("ããªãã®å¼·ãåªãã¯å¢ããã","Your heavy curses multiply."); /* æ«å®ç -- henkma */ - } - if (p_ptr->cursed & TRC_CALL_ANIMAL) - { - info[i++] = _("ããªãã¯åç©ã«çããã¦ããã", "You attract animals."); - } - if (p_ptr->cursed & TRC_CALL_DEMON) - { - info[i++] = _("ããªãã¯æªéã«çããã¦ããã", "You attract demons."); - } - if (p_ptr->cursed & TRC_CALL_DRAGON) - { - info[i++] = _("ããªãã¯ãã©ã´ã³ã«çããã¦ããã", "You attract dragons."); - } - if (p_ptr->cursed & TRC_COWARDICE) - { - info[i++] = _("ããªãã¯æã èç ã«ãªãã", "You are subject to cowardice."); - } - if (p_ptr->cursed & TRC_TELEPORT) - { - info[i++] = _("ããªãã®ä½ç½®ã¯ã²ãããã«ä¸å®å®ã ã", "Your position is very uncertain."); - } - if (p_ptr->cursed & TRC_LOW_MELEE) - { - info[i++] = _("ããªãã®æ¦å¨ã¯æ»æãå¤ããããã", "Your weapon causes you to miss blows."); - } - if (p_ptr->cursed & TRC_LOW_AC) - { - info[i++] = _("ããªãã¯æ»æãåããããã", "You are subject to be hit."); - } - if (p_ptr->cursed & TRC_LOW_MAGIC) - { - info[i++] = _("ããªãã¯éæ³ã失æããããã", "You are subject to fail spellcasting."); - } - if (p_ptr->cursed & TRC_FAST_DIGEST) - { - info[i++] = _("ããªãã¯ãããè ¹ãã¸ãã", "You have a good appetite."); - } - if (p_ptr->cursed & TRC_DRAIN_HP) - { - info[i++] = _("ããªãã¯ä½åãå¸ããã¦ããã", "You are drained."); - } - if (p_ptr->cursed & TRC_DRAIN_MANA) - { - info[i++] = _("ããªãã¯éåãå¸ããã¦ããã", "You brain is drained."); - } - if (IS_BLESSED()) - { - info[i++] = _("ããªãã¯é«æ½ããæãã¦ããã", "You feel rightous."); - } - if (IS_HERO()) - { - info[i++] = _("ããªãã¯ãã¼ãã¼æ°åã ã", "You feel heroic."); - } - if (p_ptr->shero) - { - info[i++] = _("ããªãã¯æ¦éçã ã", "You are in a battle rage."); - } - if (p_ptr->protevil) - { - info[i++] = _("ããªãã¯éªæªãªãåå¨ããå®ããã¦ããã", "You are protected from evil."); - } - if (p_ptr->shield) - { - info[i++] = _("ããªãã¯ç¥ç§ã®ã·ã¼ã«ãã§å®ããã¦ããã", "You are protected by a mystic shield."); - } - if (IS_INVULN()) - { - info[i++] = _("ããªãã¯ç¾å¨å·ã¤ããªãã", "You are temporarily invulnerable."); - } - if (p_ptr->wraith_form) - { - info[i++] = _("ããªãã¯ä¸æçã«å¹½ä½åãã¦ããã", "You are temporarily incorporeal."); - } - if (p_ptr->special_attack & ATTACK_CONFUSE) - { - info[i++] = _("ããªãã®æã¯èµ¤ãè¼ãã¦ããã", "Your hands are glowing dull red."); - } - if (p_ptr->special_attack & ATTACK_FIRE) - { - info[i++] = _("ããªãã®æã¯ç«çã«è¦ããã¦ããã", "You can strike the enemy with flame."); - } - if (p_ptr->special_attack & ATTACK_COLD) - { - info[i++] = _("ããªãã®æã¯å·æ°ã«è¦ããã¦ããã", "You can strike the enemy with cold."); - } - if (p_ptr->special_attack & ATTACK_ACID) - { - info[i++] = _("ããªãã®æã¯é ¸ã«è¦ããã¦ããã", "You can strike the enemy with acid."); - } - if (p_ptr->special_attack & ATTACK_ELEC) - { - info[i++] = _("ããªãã®æã¯é»æã«è¦ããã¦ããã", "You can strike the enemy with electoric shock."); - } - if (p_ptr->special_attack & ATTACK_POIS) - { - info[i++] = _("ããªãã®æã¯æ¯ã«è¦ããã¦ããã", "You can strike the enemy with poison."); - } - switch (p_ptr->action) - { - case ACTION_SEARCH: - info[i++] = _("ããªãã¯ã²ãããã«æ³¨ææ·±ãå¨å²ãè¦æ¸¡ãã¦ããã", "You are looking around very carefully."); - break; - } - if (p_ptr->new_spells) - { - info[i++] = _("ããªãã¯åªæãç¥ããå¦ã¶ãã¨ãã§ããã", "You can learn some spells/prayers."); - } - if (p_ptr->word_recall) - { - info[i++] = _("ããªãã¯ããã«å¸°éããã ããã", "You will soon be recalled."); - } - if (p_ptr->alter_reality) - { - info[i++] = _("ããªãã¯ããã«ãã®ä¸çãé¢ããã ããã", "You will soon be altered."); - } - if (p_ptr->see_infra) - { - info[i++] = _("ããªãã®ç³ã¯èµ¤å¤ç·ã«ææã§ããã", "Your eyes are sensitive to infrared light."); - } - if (p_ptr->see_inv) - { - info[i++] = _("ããªãã¯éæãªã¢ã³ã¹ã¿ã¼ãè¦ããã¨ãã§ããã", "You can see invisible creatures."); - } - if (p_ptr->levitation) - { - info[i++] = _("ããªãã¯é£ã¶ãã¨ãã§ããã", "You can fly."); - } - if (p_ptr->free_act) - { - info[i++] = _("ããªãã¯éº»çºç¥ããã®å¹æãæã£ã¦ããã", "You have free action."); - } - if (p_ptr->regenerate) - { - info[i++] = _("ããªãã¯ç´ æ©ãä½åãå復ããã", "You regenerate quickly."); - } - if (p_ptr->slow_digest) - { - info[i++] = _("ããªãã¯é£æ¬²ãå°ãªãã", "Your appetite is small."); - } - if (p_ptr->telepathy) - { - info[i++] = _("ããªãã¯ãã¬ãã·ã¼è½åãæã£ã¦ããã", "You have ESP."); - } - if (p_ptr->esp_animal) - { - info[i++] = _("ããªãã¯èªç¶çã®çç©ã®åå¨ãæããè½åãæã£ã¦ããã", "You sense natural creatures."); - } - if (p_ptr->esp_undead) - { - info[i++] = _("ããªãã¯ã¢ã³ãããã®åå¨ãæããè½åãæã£ã¦ããã", "You sense undead."); - } - if (p_ptr->esp_demon) - { - info[i++] = _("ããªãã¯æªéã®åå¨ãæããè½åãæã£ã¦ããã", "You sense demons."); - } - if (p_ptr->esp_orc) - { - info[i++] = _("ããªãã¯ãªã¼ã¯ã®åå¨ãæããè½åãæã£ã¦ããã", "You sense orcs."); - } - if (p_ptr->esp_troll) - { - info[i++] = _("ããªãã¯ããã«ã®åå¨ãæããè½åãæã£ã¦ããã", "You sense trolls."); - } - if (p_ptr->esp_giant) - { - info[i++] = _("ããªãã¯å·¨äººã®åå¨ãæããè½åãæã£ã¦ããã", "You sense giants."); - } - if (p_ptr->esp_dragon) - { - info[i++] = _("ããªãã¯ãã©ã´ã³ã®åå¨ãæããè½åãæã£ã¦ããã", "You sense dragons."); - } - if (p_ptr->esp_human) - { - info[i++] = _("ããªãã¯äººéã®åå¨ãæããè½åãæã£ã¦ããã", "You sense humans."); - } - if (p_ptr->esp_evil) - { - info[i++] = _("ããªãã¯éªæªãªçãç©ã®åå¨ãæããè½åãæã£ã¦ããã", "You sense evil creatures."); - } - if (p_ptr->esp_good) - { - info[i++] = _("ããªãã¯åè¯ãªçãç©ã®åå¨ãæããè½åãæã£ã¦ããã", "You sense good creatures."); - } - if (p_ptr->esp_nonliving) - { - info[i++] = _("ããªãã¯æ´»åããç¡çç©ä½ã®åå¨ãæããè½åãæã£ã¦ããã", "You sense non-living creatures."); - } - if (p_ptr->esp_unique) - { - info[i++] = _("ããªãã¯ç¹å¥ãªå¼·æµã®åå¨ãæããè½åãæã£ã¦ããã", "You sense unique monsters."); - } - if (p_ptr->hold_exp) - { - info[i++] = _("ããªãã¯èªå·±ã®çµé¨å¤ããã£ããã¨ç¶æããã", "You have a firm hold on your experience."); - } - if (p_ptr->reflect) - { - info[i++] = _("ããªãã¯ç¢ã®åªæãåå°ããã", "You reflect bolt spells."); - } - if (p_ptr->sh_fire) - { - info[i++] = _("ããªãã¯çã®ãªã¼ã©ã«å ã¾ãã¦ããã", "You are surrounded with a fiery aura."); - } - if (p_ptr->sh_elec) - { - info[i++] = _("ããªãã¯é»æ°ã«å ã¾ãã¦ããã", "You are surrounded with electricity."); - } - if (p_ptr->sh_cold) - { - info[i++] = _("ããªãã¯å·æ°ã®ãªã¼ã©ã«å ã¾ãã¦ããã", "You are surrounded with an aura of coldness."); - } - if (p_ptr->tim_sh_holy) - { - info[i++] = _("ããªãã¯èãªããªã¼ã©ã«å ã¾ãã¦ããã", "You are surrounded with a holy aura."); - } - if (p_ptr->tim_sh_touki) - { - info[i++] = _("ããªãã¯éæ°ã®ãªã¼ã©ã«å ã¾ãã¦ããã", "You are surrounded with a energy aura."); - } - if (p_ptr->anti_magic) - { - info[i++] = _("ããªãã¯åéæ³ã·ã¼ã«ãã«å ã¾ãã¦ããã", "You are surrounded by an anti-magic shell."); - } - if (p_ptr->anti_tele) - { - info[i++] = _("ããªãã¯ãã¬ãã¼ãã§ããªãã", "You cannot teleport."); - } - if (p_ptr->lite) - { - info[i++] = _("ããªãã®èº«ä½ã¯å ã£ã¦ããã", "You are carrying a permanent light."); - } - if (p_ptr->warning) - { - info[i++] = _("ããªãã¯è¡åã®åã«å±éºãå¯ç¥ãããã¨ãã§ããã", "You will be warned before dangerous actions."); - } - if (p_ptr->dec_mana) - { - info[i++] = _("ããªãã¯å°ãªãæ¶è²»éåã§éæ³ãå±ãããã¨ãã§ããã", "You can cast spells with fewer mana points."); - } - if (p_ptr->easy_spell) - { - info[i++] = _("ããªãã¯ä½ã失æçã§éæ³ãå±ãããã¨ãã§ããã", "Fail rate of your magic is decreased."); - } - if (p_ptr->heavy_spell) - { - info[i++] = _("ããªãã¯é«ã失æçã§éæ³ãå±ããªããã°ãããªãã", "Fail rate of your magic is increased."); - } - if (p_ptr->mighty_throw) - { - info[i++] = _("ããªãã¯å¼·ãç©ãæããã", "You can throw objects powerfully."); - } - - if (p_ptr->immune_acid) - { - info[i++] = _("ããªãã¯é ¸ã«å¯¾ããå®å ¨ãªãå ç«ãæã£ã¦ããã", "You are completely immune to acid."); - } - else if (p_ptr->resist_acid && IS_OPPOSE_ACID()) - { - info[i++] = _("ããªãã¯é ¸ã¸ã®å¼·åãªèæ§ãæã£ã¦ããã", "You resist acid exceptionally well."); - } - else if (p_ptr->resist_acid || IS_OPPOSE_ACID()) - { - info[i++] = _("ããªãã¯é ¸ã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to acid."); - } - - if (p_ptr->immune_elec) - { - info[i++] = _("ããªãã¯é»æã«å¯¾ããå®å ¨ãªãå ç«ãæã£ã¦ããã", "You are completely immune to lightning."); - } - else if (p_ptr->resist_elec && IS_OPPOSE_ELEC()) - { - info[i++] = _("ããªãã¯é»æã¸ã®å¼·åãªèæ§ãæã£ã¦ããã", "You resist lightning exceptionally well."); - } - else if (p_ptr->resist_elec || IS_OPPOSE_ELEC()) - { - info[i++] = _("ããªãã¯é»æã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to lightning."); - } - - if (prace_is_(RACE_ANDROID) && !p_ptr->immune_elec) - { - info[i++] = _("ããªãã¯é»æã«å¼±ãã", "You are susceptible to damage from lightning."); - } - - if (p_ptr->immune_fire) - { - info[i++] = _("ããªãã¯ç«ã«å¯¾ããå®å ¨ãªãå ç«ãæã£ã¦ããã", "You are completely immune to fire."); - } - else if (p_ptr->resist_fire && IS_OPPOSE_FIRE()) - { - info[i++] = _("ããªãã¯ç«ã¸ã®å¼·åãªèæ§ãæã£ã¦ããã", "You resist fire exceptionally well."); - } - else if (p_ptr->resist_fire || IS_OPPOSE_FIRE()) - { - info[i++] = _("ããªãã¯ç«ã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to fire."); - } - - if (prace_is_(RACE_ENT) && !p_ptr->immune_fire) - { - info[i++] = _("ããªãã¯ç«ã«å¼±ãã", "You are susceptible to damage from fire."); - } - - if (p_ptr->immune_cold) - { - info[i++] = _("ããªãã¯å·æ°ã«å¯¾ããå®å ¨ãªãå ç«ãæã£ã¦ããã", "You are completely immune to cold."); - } - else if (p_ptr->resist_cold && IS_OPPOSE_COLD()) - { - info[i++] = _("ããªãã¯å·æ°ã¸ã®å¼·åãªèæ§ãæã£ã¦ããã", "You resist cold exceptionally well."); - } - else if (p_ptr->resist_cold || IS_OPPOSE_COLD()) - { - info[i++] = _("ããªãã¯å·æ°ã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to cold."); - } - - if (p_ptr->resist_pois && IS_OPPOSE_POIS()) - { - info[i++] = _("ããªãã¯æ¯ã¸ã®å¼·åãªèæ§ãæã£ã¦ããã", "You resist poison exceptionally well."); - } - else if (p_ptr->resist_pois || IS_OPPOSE_POIS()) - { - info[i++] = _("ããªãã¯æ¯ã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to poison."); - } - - if (p_ptr->resist_lite) - { - info[i++] = _("ããªãã¯éå ã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to bright light."); - } - - if (prace_is_(RACE_VAMPIRE) || prace_is_(RACE_S_FAIRY) || (p_ptr->mimic_form == MIMIC_VAMPIRE)) - { - info[i++] = _("ããªãã¯éå ã«å¼±ãã", "You are susceptible to damage from bright light."); - } - - if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) - { - info[i++] = _("ããªãã¯æé»ã«å¯¾ããå®å ¨ãªãå ç«ãæã£ã¦ããã", "You are completely immune to darkness."); - } - - else if (p_ptr->resist_dark) - { - info[i++] = _("ããªãã¯æé»ã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to darkness."); - } - if (p_ptr->resist_conf) - { - info[i++] = _("ããªãã¯æ··ä¹±ã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to confusion."); - } - if (p_ptr->resist_sound) - { - info[i++] = _("ããªãã¯é³æ³¢ã®è¡æã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to sonic attacks."); - } - if (p_ptr->resist_disen) - { - info[i++] = _("ããªãã¯å£åã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to disenchantment."); - } - if (p_ptr->resist_chaos) - { - info[i++] = _("ããªãã¯ã«ãªã¹ã®åã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to chaos."); - } - if (p_ptr->resist_shard) - { - info[i++] = _("ããªãã¯ç ´çã®æ»æã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to blasts of shards."); - } - if (p_ptr->resist_nexus) - { - info[i++] = _("ããªãã¯å ææ··ä¹±ã®æ»æã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to nexus attacks."); - } - - if (prace_is_(RACE_SPECTRE)) - { - info[i++] = _("ããªãã¯å°çã®åãå¸åã§ããã", "You can drain nether forces."); - } - else if (p_ptr->resist_neth) - { - info[i++] = _("ããªãã¯å°çã®åã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to nether forces."); - } - if (p_ptr->resist_fear) - { - info[i++] = _("ããªãã¯å ¨ãææãæããªãã", "You are completely fearless."); - } - if (p_ptr->resist_blind) - { - info[i++] = _("ããªãã®ç®ã¯ç²ç®ã¸ã®èæ§ãæã£ã¦ããã", "Your eyes are resistant to blindness."); - } - if (p_ptr->resist_time) - { - info[i++] = _("ããªãã¯æéé転ã¸ã®èæ§ãæã£ã¦ããã", "You are resistant to time."); - } - - if (p_ptr->sustain_str) - { - info[i++] = _("ããªãã®è åã¯ç¶æããã¦ããã", "Your strength is sustained."); - } - if (p_ptr->sustain_int) - { - info[i++] = _("ããªãã®ç¥è½ã¯ç¶æããã¦ããã", "Your intelligence is sustained."); - } - if (p_ptr->sustain_wis) - { - info[i++] = _("ããªãã®è³¢ãã¯ç¶æããã¦ããã", "Your wisdom is sustained."); - } - if (p_ptr->sustain_con) - { - info[i++] = _("ããªãã®èä¹ åã¯ç¶æããã¦ããã", "Your constitution is sustained."); - } - if (p_ptr->sustain_dex) - { - info[i++] = _("ããªãã®å¨ç¨ãã¯ç¶æããã¦ããã", "Your dexterity is sustained."); - } - if (p_ptr->sustain_chr) - { - info[i++] = _("ããªãã®é åã¯ç¶æããã¦ããã", "Your charisma is sustained."); - } - - if (have_flag(flgs, TR_STR)) - { - info[i++] = _("ããªãã®è åã¯è£ åã«ãã£ã¦å½±é¿ãåãã¦ããã", "Your strength is affected by your equipment."); - } - if (have_flag(flgs, TR_INT)) - { - info[i++] = _("ããªãã®ç¥è½ã¯è£ åã«ãã£ã¦å½±é¿ãåãã¦ããã", "Your intelligence is affected by your equipment."); - } - if (have_flag(flgs, TR_WIS)) - { - info[i++] = _("ããªãã®è³¢ãã¯è£ åã«ãã£ã¦å½±é¿ãåãã¦ããã", "Your wisdom is affected by your equipment."); - } - if (have_flag(flgs, TR_DEX)) - { - info[i++] = _("ããªãã®å¨ç¨ãã¯è£ åã«ãã£ã¦å½±é¿ãåãã¦ããã", "Your dexterity is affected by your equipment."); - } - if (have_flag(flgs, TR_CON)) - { - info[i++] = _("ããªãã®èä¹ åã¯è£ åã«ãã£ã¦å½±é¿ãåãã¦ããã", "Your constitution is affected by your equipment."); - } - if (have_flag(flgs, TR_CHR)) - { - info[i++] = _("ããªãã®é åã¯è£ åã«ãã£ã¦å½±é¿ãåãã¦ããã", "Your charisma is affected by your equipment."); - } - - if (have_flag(flgs, TR_STEALTH)) - { - info[i++] = _("ããªãã®é å¯è¡åè½åã¯è£ åã«ãã£ã¦å½±é¿ãåãã¦ããã", "Your stealth is affected by your equipment."); - } - if (have_flag(flgs, TR_SEARCH)) - { - info[i++] = _("ããªãã®æ¢ç´¢è½åã¯è£ åã«ãã£ã¦å½±é¿ãåãã¦ããã", "Your searching ability is affected by your equipment."); - } - if (have_flag(flgs, TR_INFRA)) - { - info[i++] = _("ããªãã®èµ¤å¤ç·è¦åã¯è£ åã«ãã£ã¦å½±é¿ãåãã¦ããã", "Your infravision is affected by your equipment."); - } - if (have_flag(flgs, TR_TUNNEL)) - { - info[i++] = _("ããªãã®æ¡æè½åã¯è£ åã«ãã£ã¦å½±é¿ãåãã¦ããã", "Your digging ability is affected by your equipment."); - } - if (have_flag(flgs, TR_SPEED)) - { - info[i++] = _("ããªãã®ã¹ãã¼ãã¯è£ åã«ãã£ã¦å½±é¿ãåãã¦ããã", "Your speed is affected by your equipment."); - } - if (have_flag(flgs, TR_BLOWS)) - { - info[i++] = _("ããªãã®æ»æé度ã¯è£ åã«ãã£ã¦å½±é¿ãåãã¦ããã", "Your attack speed is affected by your equipment."); - } - - - /* Access the current weapon */ - o_ptr = &inventory[INVEN_RARM]; - - /* Analyze the weapon */ - if (o_ptr->k_idx) - { - /* Indicate Blessing */ - if (have_flag(flgs, TR_BLESSED)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ç¥ã®ç¥ç¦ãåãã¦ããã", "Your weapon has been blessed by the gods."); - } - - if (have_flag(flgs, TR_CHAOTIC)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ãã°ã«ã¹ã®å¾´ã®å±æ§ããã¤ã", "Your weapon is branded with the Sign of Logrus."); - } - - /* Hack */ - if (have_flag(flgs, TR_IMPACT)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ææã§å°éãçºçãããã¨ãã§ããã", "The impact of your weapon can cause earthquakes."); - } - - if (have_flag(flgs, TR_VORPAL)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯é常ã«éãã", "Your weapon is very sharp."); - } - - if (have_flag(flgs, TR_VAMPIRIC)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯æµããçå½åãå¸åããã", "Your weapon drains life from your foes."); - } - - /* Special "Attack Bonuses" */ - if (have_flag(flgs, TR_BRAND_ACID)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯æµã溶ããã", "Your weapon melts your foes."); - } - if (have_flag(flgs, TR_BRAND_ELEC)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯æµãæé»ãããã", "Your weapon shocks your foes."); - } - if (have_flag(flgs, TR_BRAND_FIRE)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯æµãçããã", "Your weapon burns your foes."); - } - if (have_flag(flgs, TR_BRAND_COLD)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯æµãåãããã", "Your weapon freezes your foes."); - } - if (have_flag(flgs, TR_BRAND_POIS)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯æµãæ¯ã§ä¾µãã", "Your weapon poisons your foes."); - } - - /* Special "slay" flags */ - if (have_flag(flgs, TR_KILL_ANIMAL)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯åç©ã®å¤©æµã§ããã", "Your weapon is a great bane of animals."); - } - else if (have_flag(flgs, TR_SLAY_ANIMAL)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯åç©ã«å¯¾ãã¦å¼·ãåãçºæ®ããã", "Your weapon strikes at animals with extra force."); - } - if (have_flag(flgs, TR_KILL_EVIL)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯éªæªãªãåå¨ã®å¤©æµã§ããã", "Your weapon is a great bane of evil."); - } - else if (have_flag(flgs, TR_SLAY_EVIL)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯éªæªãªãåå¨ã«å¯¾ãã¦å¼·ãåãçºæ®ããã", "Your weapon strikes at evil with extra force."); - } - if (have_flag(flgs, TR_KILL_HUMAN)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯äººéã®å¤©æµã§ããã", "Your weapon is a great bane of humans."); - } - else if (have_flag(flgs, TR_SLAY_HUMAN)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯äººéã«å¯¾ãã¦ç¹ã«å¼·ãåãçºæ®ããã", "Your weapon is especially deadly against humans."); - } - if (have_flag(flgs, TR_KILL_UNDEAD)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ã¢ã³ãããã®å¤©æµã§ããã", "Your weapon is a great bane of undead."); - } - else if (have_flag(flgs, TR_SLAY_UNDEAD)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ã¢ã³ãããã«å¯¾ãã¦ç¥èãªãåãçºæ®ããã", "Your weapon strikes at undead with holy wrath."); - } - if (have_flag(flgs, TR_KILL_DEMON)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ãã¼ã¢ã³ã®å¤©æµã§ããã", "Your weapon is a great bane of demons."); - } - else if (have_flag(flgs, TR_SLAY_DEMON)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ãã¼ã¢ã³ã«å¯¾ãã¦ç¥èãªãåãçºæ®ããã", "Your weapon strikes at demons with holy wrath."); - } - if (have_flag(flgs, TR_KILL_ORC)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ãªã¼ã¯ã®å¤©æµã§ããã", "Your weapon is a great bane of orcs."); - } - else if (have_flag(flgs, TR_SLAY_ORC)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ãªã¼ã¯ã«å¯¾ãã¦ç¹ã«å¼·ãåãçºæ®ããã", "Your weapon is especially deadly against orcs."); - } - if (have_flag(flgs, TR_KILL_TROLL)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ããã«ã®å¤©æµã§ããã", "Your weapon is a great bane of trolls."); - } - else if (have_flag(flgs, TR_SLAY_TROLL)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ããã«ã«å¯¾ãã¦ç¹ã«å¼·ãåãçºæ®ããã", "Your weapon is especially deadly against trolls."); - } - if (have_flag(flgs, TR_KILL_GIANT)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ã¸ã£ã¤ã¢ã³ãã®å¤©æµã§ããã", "Your weapon is a great bane of giants."); - } - else if (have_flag(flgs, TR_SLAY_GIANT)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ã¸ã£ã¤ã¢ã³ãã«å¯¾ãã¦ç¹ã«å¼·ãåãçºæ®ããã", "Your weapon is especially deadly against giants."); - } - /* Special "kill" flags */ - if (have_flag(flgs, TR_KILL_DRAGON)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ãã©ã´ã³ã®å¤©æµã§ããã", "Your weapon is a great bane of dragons."); - } - else if (have_flag(flgs, TR_SLAY_DRAGON)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯ãã©ã´ã³ã«å¯¾ãã¦ç¹ã«å¼·ãåãçºæ®ããã", "Your weapon is especially deadly against dragons."); - } - - if (have_flag(flgs, TR_FORCE_WEAPON)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯MPã使ã£ã¦æ»æããã", "Your weapon causes greate damages using your MP."); - } - if (have_flag(flgs, TR_THROW)) - { - info[i++] = _("ããªãã®æ¦å¨ã¯æããããã", "Your weapon can be thrown well."); - } - } - - - /* Save the screen */ - screen_save(); - - /* Erase the screen */ - for (k = 1; k < 24; k++) prt("", k, 13); - - /* Label the information */ - prt(_(" ããªãã®ç¶æ :", " Your Attributes:"), 1, 15); - - /* We will print on top of the map (column 13) */ - for (k = 2, j = 0; j < i; j++) - { - /* Show the info */ - prt(info[j], k++, 15); - - /* Every 20 entries (lines 2 to 21), start over */ - if ((k == 22) && (j+1 < i)) - { - prt(_("-- ç¶ã --", "-- more --"), k, 15); - inkey(); - for (; k > 2; k--) prt("", k, 15); - } - } - - /* Pause */ - prt(_("[ä½ããã¼ãæ¼ãã¨ã²ã¼ã ã«æ»ãã¾ã]", "[Press any key to continue]"), k, 13); - inkey(); - - /* Restore the screen */ - screen_load(); -} - -/*! - * @brief éæ³å¹ææéã®ã¿ã¼ã³æ°ã«åºã¥ãã¦è¡¨ç¾IDãè¿ãã - * @param dur å¹æã¿ã¼ã³æ° - * @return å¹ææéã®è¡¨ç¾ID - */ -static int report_magics_aux(int dur) -{ - if (dur <= 5) - { - return 0; - } - else if (dur <= 10) - { - return 1; - } - else if (dur <= 20) - { - return 2; - } - else if (dur <= 50) - { - return 3; - } - else if (dur <= 100) - { - return 4; - } - else if (dur <= 200) - { - return 5; - } - else - { - return 6; + detect = TRUE; } + return (detect); } -static cptr report_magic_durations[] = -{ -#ifdef JP -"ããçãé", -"å°ãã®é", -"ãã°ããã®é", -"å¤å°é·ãé", -"é·ãé", -"é常ã«é·ãé", -"ä¿¡ãé£ãã»ã©é·ãé", -"ã¢ã³ã¹ã¿ã¼ãæ»æããã¾ã§" -#else - "for a short time", - "for a little while", - "for a while", - "for a long while", - "for a long time", - "for a very long time", - "for an incredibly long time", - "until you hit a monster" -#endif - -}; - -/*! - * @brief ç¾å¨ã®ä¸æçå¹æä¸è¦§ãè¿ã / Report all currently active magical effects. - * @return ãªã - */ -void report_magics(void) -{ - int i = 0, j, k; - char Dummy[80]; - cptr info[128]; - int info2[128]; - - - if (p_ptr->blind) - { - info2[i] = report_magics_aux(p_ptr->blind); - info[i++] = _("ããªãã¯ç®ãè¦ããªã", "You cannot see"); - } - if (p_ptr->confused) - { - info2[i] = report_magics_aux(p_ptr->confused); - info[i++] = _("ããªãã¯æ··ä¹±ãã¦ãã", "You are confused"); - } - if (p_ptr->afraid) - { - info2[i] = report_magics_aux(p_ptr->afraid); - info[i++] = _("ããªãã¯ææã«ä¾µããã¦ãã", "You are terrified"); - } - if (p_ptr->poisoned) - { - info2[i] = report_magics_aux(p_ptr->poisoned); - info[i++] = _("ããªãã¯æ¯ã«ä¾µããã¦ãã", "You are poisoned"); - } - if (p_ptr->image) - { - info2[i] = report_magics_aux(p_ptr->image); - info[i++] = _("ããªãã¯å¹»è¦ãè¦ã¦ãã", "You are hallucinating"); - } - if (p_ptr->blessed) - { - info2[i] = report_magics_aux(p_ptr->blessed); - info[i++] = _("ããªãã¯é«æ½ããæãã¦ãã", "You feel rightous"); - } - if (p_ptr->hero) - { - info2[i] = report_magics_aux(p_ptr->hero); - info[i++] = _("ããªãã¯ãã¼ãã¼æ°åã ", "You feel heroic"); - } - if (p_ptr->shero) - { - info2[i] = report_magics_aux(p_ptr->shero); - info[i++] = _("ããªãã¯æ¦éçã ", "You are in a battle rage"); - } - if (p_ptr->protevil) - { - info2[i] = report_magics_aux(p_ptr->protevil); - info[i++] = _("ããªãã¯éªæªãªãåå¨ããå®ããã¦ãã", "You are protected from evil"); - } - if (p_ptr->shield) - { - info2[i] = report_magics_aux(p_ptr->shield); - info[i++] = _("ããªãã¯ç¥ç§ã®ã·ã¼ã«ãã§å®ããã¦ãã", "You are protected by a mystic shield"); - } - if (p_ptr->invuln) - { - info2[i] = report_magics_aux(p_ptr->invuln); - info[i++] = _("ããªãã¯ç¡æµã ", "You are invulnerable"); - } - if (p_ptr->wraith_form) - { - info2[i] = report_magics_aux(p_ptr->wraith_form); - info[i++] = _("ããªãã¯å¹½ä½åãã¦ãã", "You are incorporeal"); - } - if (p_ptr->special_attack & ATTACK_CONFUSE) - { - info2[i] = 7; - info[i++] = _("ããªãã®æã¯èµ¤ãè¼ãã¦ãã", "Your hands are glowing dull red."); - } - if (p_ptr->word_recall) - { - info2[i] = report_magics_aux(p_ptr->word_recall); - info[i++] = _("ãã®å¾å¸°éã®è©ãçºåãã", "You are waiting to be recalled"); - } - if (p_ptr->alter_reality) - { - info2[i] = report_magics_aux(p_ptr->alter_reality); - info[i++] = _("ãã®å¾ç¾å®å¤å®¹ãçºåãã", "You waiting to be altered"); - } - if (p_ptr->oppose_acid) - { - info2[i] = report_magics_aux(p_ptr->oppose_acid); - info[i++] = _("ããªãã¯é ¸ã¸ã®èæ§ãæã£ã¦ãã", "You are resistant to acid"); - } - if (p_ptr->oppose_elec) - { - info2[i] = report_magics_aux(p_ptr->oppose_elec); - info[i++] = _("ããªãã¯é»æã¸ã®èæ§ãæã£ã¦ãã", "You are resistant to lightning"); - } - if (p_ptr->oppose_fire) - { - info2[i] = report_magics_aux(p_ptr->oppose_fire); - info[i++] = _("ããªãã¯ç«ã¸ã®èæ§ãæã£ã¦ãã", "You are resistant to fire"); - } - if (p_ptr->oppose_cold) - { - info2[i] = report_magics_aux(p_ptr->oppose_cold); - info[i++] = _("ããªãã¯å·æ°ã¸ã®èæ§ãæã£ã¦ãã", "You are resistant to cold"); - } - if (p_ptr->oppose_pois) - { - info2[i] = report_magics_aux(p_ptr->oppose_pois); - info[i++] = _("ããªãã¯æ¯ã¸ã®èæ§ãæã£ã¦ãã", "You are resistant to poison"); - } - - /* Save the screen */ - screen_save(); - - /* Erase the screen */ - for (k = 1; k < 24; k++) prt("", k, 13); - - /* Label the information */ - prt(_(" ç¾å¨ããã£ã¦ããéæ³ :", " Your Current Magic:"), 1, 15); - - - /* We will print on top of the map (column 13) */ - for (k = 2, j = 0; j < i; j++) - { - /* Show the info */ - sprintf(Dummy, _("%-28s : æé - %s ", "%s %s."), info[j], - report_magic_durations[info2[j]]); - prt(Dummy, k++, 15); - - /* Every 20 entries (lines 2 to 21), start over */ - if ((k == 22) && (j + 1 < i)) - { - prt(_("-- ç¶ã --", "-- more --"), k, 15); - inkey(); - for (; k > 2; k--) prt("", k, 15); - } - } - - /* Pause */ - prt(_("[ä½ããã¼ãæ¼ãã¨ã²ã¼ã ã«æ»ãã¾ã]", "[Press any key to continue]"), k, 13); - inkey(); - - /* Restore the screen */ - screen_load(); -} /*! - * @brief ãã¬ã¤ã¤ã¼å¨è¾ºã®å°å½¢ãæç¥ãã + * @brief éæ³å¹æã®ããã®ã¢ã¤ãã ãªãã¸ã§ã¯ããæç¥ãã / Detect all "magic" objects on the current panel. * @param range å¹æç¯å² - * @param flag ç¹å®å°å½¢ID - * @param known å°å½¢ããå±éºãã©ã°ãå¤ããªãTRUE * @return å¹åããã£ãå ´åTRUEãè¿ã + * @details + *
+ * This will light up all spaces with "magic" items, including artifacts, + * ego-items, potions, scrolls, books, rods, wands, staves, amulets, rings, + * and "enchanted" items of the "good" variety. + * + * It can probably be argued that this function is now too powerful. + **/ -static bool detect_feat_flag(int range, int flag, bool known) +bool detect_objects_magic(POSITION range) { - int x, y; - bool detect = FALSE; - cave_type *c_ptr; + OBJECT_TYPE_VALUE tv; + OBJECT_IDX i; + POSITION y, x; + + bool detect = FALSE; if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3; - /* Scan the current panel */ - for (y = 1; y < cur_hgt - 1; y++) + /* Scan all objects */ + for (i = 1; i < o_max; i++) { - for (x = 1; x <= cur_wid - 1; x++) - { - int dist = distance(p_ptr->y, p_ptr->x, y, x); - if (dist > range) continue; - - /* Access the grid */ - c_ptr = &cave[y][x]; - - /* Hack -- Safe */ - if (flag == FF_TRAP) - { - /* Mark as detected */ - if (dist <= range && known) - { - if (dist <= range - 1) c_ptr->info |= (CAVE_IN_DETECT); - - c_ptr->info &= ~(CAVE_UNSAFE); - - /* Redraw */ - lite_spot(y, x); - } - } - - /* Detect flags */ - if (cave_have_flag_grid(c_ptr, flag)) - { - /* Detect secrets */ - disclose_grid(y, x); - - /* Hack -- Memorize */ - c_ptr->info |= (CAVE_MARK); - - /* Redraw */ - lite_spot(y, x); - - /* Obvious */ - detect = TRUE; - } - } - } - - /* Result */ - return detect; -} - - -/*! - * @brief ãã¬ã¤ã¤ã¼å¨è¾ºã®ãã©ãããæç¥ãã / Detect all traps on current panel - * @param range å¹æç¯å² - * @param known æç¥å¤ç¯å²ãè¶ ããè¦åãã©ã°ãç«ã¦ãå ´åTRUEãè¿ã - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool detect_traps(int range, bool known) -{ - bool detect = detect_feat_flag(range, FF_TRAP, known); - - if (known) p_ptr->dtrap = TRUE; - - if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 0) detect = FALSE; + object_type *o_ptr = &o_list[i]; - /* Describe */ - if (detect) - { - msg_print(_("ãã©ããã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of traps!")); - } + /* Skip dead objects */ + if (!o_ptr->k_idx) continue; - /* Result */ - return detect; -} + /* Skip held objects */ + if (o_ptr->held_m_idx) continue; + y = o_ptr->iy; + x = o_ptr->ix; -/*! - * @brief ãã¬ã¤ã¤ã¼å¨è¾ºã®ãã¢ãæç¥ãã / Detect all doors on current panel - * @param range å¹æç¯å² - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool detect_doors(int range) -{ - bool detect = detect_feat_flag(range, FF_DOOR, TRUE); + /* Only detect nearby objects */ + if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue; - if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 0) detect = FALSE; + /* Examine the tval */ + tv = o_ptr->tval; - /* Describe */ + /* Artifacts, misc magic items, or enchanted wearables */ + if (object_is_artifact(o_ptr) || + object_is_ego(o_ptr) || + (tv == TV_WHISTLE) || + (tv == TV_AMULET) || + (tv == TV_RING) || + (tv == TV_STAFF) || + (tv == TV_WAND) || + (tv == TV_ROD) || + (tv == TV_SCROLL) || + (tv == TV_POTION) || + (tv == TV_LIFE_BOOK) || + (tv == TV_SORCERY_BOOK) || + (tv == TV_NATURE_BOOK) || + (tv == TV_CHAOS_BOOK) || + (tv == TV_DEATH_BOOK) || + (tv == TV_TRUMP_BOOK) || + (tv == TV_ARCANE_BOOK) || + (tv == TV_CRAFT_BOOK) || + (tv == TV_DAEMON_BOOK) || + (tv == TV_CRUSADE_BOOK) || + (tv == TV_MUSIC_BOOK) || + (tv == TV_HISSATSU_BOOK) || + (tv == TV_HEX_BOOK) || + ((o_ptr->to_a > 0) || (o_ptr->to_h + o_ptr->to_d > 0))) + { + /* Memorize the item */ + o_ptr->marked |= OM_FOUND; + lite_spot(y, x); + detect = TRUE; + } + } if (detect) { - msg_print(_("ãã¢ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of doors!")); + msg_print(_("éæ³ã®ã¢ã¤ãã ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of magic objects!")); } - /* Result */ - return detect; + /* Return result */ + return (detect); } /*! - * @brief ãã¬ã¤ã¤ã¼å¨è¾ºã®é段ãæç¥ãã / Detect all stairs on current panel + * @brief ä¸è¬ã®ã¢ã³ã¹ã¿ã¼ãæç¥ãã / Detect all "normal" monsters on the current panel * @param range å¹æç¯å² * @return å¹åããã£ãå ´åTRUEãè¿ã */ -bool detect_stairs(int range) +bool detect_monsters_normal(POSITION range) { - bool detect = detect_feat_flag(range, FF_STAIRS, TRUE); + MONSTER_IDX i; + POSITION y, x; + + bool flag = FALSE; - if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 0) detect = FALSE; + if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3; - /* Describe */ - if (detect) + /* Scan monsters */ + for (i = 1; i < m_max; i++) { - msg_print(_("é段ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of stairs!")); - } + monster_type *m_ptr = &m_list[i]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; - /* Result */ - return detect; -} + /* Skip dead monsters */ + if (!m_ptr->r_idx) continue; + y = m_ptr->fy; + x = m_ptr->fx; -/*! - * @brief ãã¬ã¤ã¤ã¼å¨è¾ºã®å°å½¢è²¡å®ãæç¥ãã / Detect any treasure on the current panel - * @param range å¹æç¯å² - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool detect_treasure(int range) -{ - bool detect = detect_feat_flag(range, FF_HAS_GOLD, TRUE); + /* Only detect nearby monsters */ + if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue; - if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 6) detect = FALSE; + /* Detect all non-invisible monsters */ + if (!(r_ptr->flags2 & RF2_INVISIBLE) || p_ptr->see_inv) + { + /* Repair visibility later */ + repair_monsters = TRUE; - /* Describe */ - if (detect) - { - msg_print(_("åèµããã財å®ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of buried treasure!")); + /* Hack -- Detect monster */ + m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW); + update_monster(i, FALSE); + flag = TRUE; + } } - /* Result */ - return detect; + if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE; + if (flag) + { + /* Describe result */ + msg_print(_("ã¢ã³ã¹ã¿ã¼ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of monsters!")); + } + return (flag); } /*! - * @brief ãã¬ã¤ã¤ã¼å¨è¾ºã®ã¢ã¤ãã 財å®ãæç¥ãã / Detect all "gold" objects on the current panel + * @brief ä¸å¯è¦ã®ã¢ã³ã¹ã¿ã¼ãæç¥ãã / Detect all "invisible" monsters around the player * @param range å¹æç¯å² * @return å¹åããã£ãå ´åTRUEãè¿ã */ -bool detect_objects_gold(int range) +bool detect_monsters_invis(POSITION range) { - int i, y, x; - int range2 = range; - - bool detect = FALSE; + MONSTER_IDX i; + POSITION y, x; + bool flag = FALSE; - if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range2 /= 3; + if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3; - /* Scan objects */ - for (i = 1; i < o_max; i++) + /* Scan monsters */ + for (i = 1; i < m_max; i++) { - object_type *o_ptr = &o_list[i]; - - /* Skip dead objects */ - if (!o_ptr->k_idx) continue; + monster_type *m_ptr = &m_list[i]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; - /* Skip held objects */ - if (o_ptr->held_m_idx) continue; + /* Skip dead monsters */ + if (!m_ptr->r_idx) continue; - /* Location */ - y = o_ptr->iy; - x = o_ptr->ix; + y = m_ptr->fy; + x = m_ptr->fx; - /* Only detect nearby objects */ - if (distance(p_ptr->y, p_ptr->x, y, x) > range2) continue; + /* Only detect nearby monsters */ + if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue; - /* Detect "gold" objects */ - if (o_ptr->tval == TV_GOLD) + /* Detect invisible monsters */ + if (r_ptr->flags2 & RF2_INVISIBLE) { - /* Hack -- memorize it */ - o_ptr->marked |= OM_FOUND; + /* Update monster recall window */ + if (p_ptr->monster_race_idx == m_ptr->r_idx) + { + p_ptr->window |= (PW_MONSTER); + } - /* Redraw */ - lite_spot(y, x); + /* Repair visibility later */ + repair_monsters = TRUE; - /* Detect */ - detect = TRUE; + /* Hack -- Detect monster */ + m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW); + update_monster(i, FALSE); + flag = TRUE; } } - if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 6) detect = FALSE; - - /* Describe */ - if (detect) - { - msg_print(_("財å®ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of treasure!")); - } - - if (detect_monsters_string(range, "$")) + if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE; + if (flag) { - detect = TRUE; + /* Describe result */ + msg_print(_("éæãªçç©ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of invisible creatures!")); } - - /* Result */ - return (detect); + return (flag); } - /*! - * @brief é常ã®ã¢ã¤ãã ãªãã¸ã§ã¯ããæç¥ãã / Detect all "normal" objects on the current panel + * @brief éªæªãªã¢ã³ã¹ã¿ã¼ãæç¥ãã / Detect all "evil" monsters on current panel * @param range å¹æç¯å² * @return å¹åããã£ãå ´åTRUEãè¿ã */ -bool detect_objects_normal(int range) +bool detect_monsters_evil(POSITION range) { - int i, y, x; - int range2 = range; - - bool detect = FALSE; + MONSTER_IDX i; + POSITION y, x; + bool flag = FALSE; - if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range2 /= 3; + if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3; - /* Scan objects */ - for (i = 1; i < o_max; i++) + /* Scan monsters */ + for (i = 1; i < m_max; i++) { - object_type *o_ptr = &o_list[i]; - - /* Skip dead objects */ - if (!o_ptr->k_idx) continue; + monster_type *m_ptr = &m_list[i]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; - /* Skip held objects */ - if (o_ptr->held_m_idx) continue; + /* Skip dead monsters */ + if (!m_ptr->r_idx) continue; - /* Location */ - y = o_ptr->iy; - x = o_ptr->ix; + y = m_ptr->fy; + x = m_ptr->fx; - /* Only detect nearby objects */ - if (distance(p_ptr->y, p_ptr->x, y, x) > range2) continue; + /* Only detect nearby monsters */ + if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue; - /* Detect "real" objects */ - if (o_ptr->tval != TV_GOLD) + /* Detect evil monsters */ + if (r_ptr->flags3 & RF3_EVIL) { - /* Hack -- memorize it */ - o_ptr->marked |= OM_FOUND; - - /* Redraw */ - lite_spot(y, x); + if (is_original_ap(m_ptr)) + { + /* Take note that they are evil */ + r_ptr->r_flags3 |= (RF3_EVIL); - /* Detect */ - detect = TRUE; - } - } + /* Update monster recall window */ + if (p_ptr->monster_race_idx == m_ptr->r_idx) + { + p_ptr->window |= (PW_MONSTER); + } + } - if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 6) detect = FALSE; + /* Repair visibility later */ + repair_monsters = TRUE; - /* Describe */ - if (detect) - { - msg_print(_("ã¢ã¤ãã ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of objects!")); + /* Hack -- Detect monster */ + m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW); + update_monster(i, FALSE); + flag = TRUE; + } } - - if (detect_monsters_string(range, "!=?|/`")) + if (flag) { - detect = TRUE; + /* Describe result */ + msg_print(_("éªæªãªãçç©ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of evil creatures!")); } - - /* Result */ - return (detect); + return (flag); } - /*! - * @brief éæ³å¹æã®ããã®ã¢ã¤ãã ãªãã¸ã§ã¯ããæç¥ãã / Detect all "magic" objects on the current panel. + * @brief ç¡çå½ã®ã¢ã³ã¹ã¿ã¼ãæç¥ãã(ã¢ã³ããããæªéç³»ãå«ã) / Detect all "nonliving", "undead" or "demonic" monsters on current panel * @param range å¹æç¯å² * @return å¹åããã£ãå ´åTRUEãè¿ã - * @details - *
- * This will light up all spaces with "magic" items, including artifacts, - * ego-items, potions, scrolls, books, rods, wands, staves, amulets, rings, - * and "enchanted" items of the "good" variety. - * - * It can probably be argued that this function is now too powerful. - **/ -bool detect_objects_magic(int range) +bool detect_monsters_nonliving(POSITION range) { - int i, y, x, tv; - - bool detect = FALSE; + MONSTER_IDX i; + POSITION y, x; + bool flag = FALSE; if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3; - /* Scan all objects */ - for (i = 1; i < o_max; i++) + /* Scan monsters */ + for (i = 1; i < m_max; i++) { - object_type *o_ptr = &o_list[i]; - - /* Skip dead objects */ - if (!o_ptr->k_idx) continue; + monster_type *m_ptr = &m_list[i]; - /* Skip held objects */ - if (o_ptr->held_m_idx) continue; + /* Skip dead monsters */ + if (!m_ptr->r_idx) continue; - /* Location */ - y = o_ptr->iy; - x = o_ptr->ix; + y = m_ptr->fy; + x = m_ptr->fx; - /* Only detect nearby objects */ + /* Only detect nearby monsters */ if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue; - /* Examine the tval */ - tv = o_ptr->tval; - - /* Artifacts, misc magic items, or enchanted wearables */ - if (object_is_artifact(o_ptr) || - object_is_ego(o_ptr) || - (tv == TV_WHISTLE) || - (tv == TV_AMULET) || - (tv == TV_RING) || - (tv == TV_STAFF) || - (tv == TV_WAND) || - (tv == TV_ROD) || - (tv == TV_SCROLL) || - (tv == TV_POTION) || - (tv == TV_LIFE_BOOK) || - (tv == TV_SORCERY_BOOK) || - (tv == TV_NATURE_BOOK) || - (tv == TV_CHAOS_BOOK) || - (tv == TV_DEATH_BOOK) || - (tv == TV_TRUMP_BOOK) || - (tv == TV_ARCANE_BOOK) || - (tv == TV_CRAFT_BOOK) || - (tv == TV_DAEMON_BOOK) || - (tv == TV_CRUSADE_BOOK) || - (tv == TV_MUSIC_BOOK) || - (tv == TV_HISSATSU_BOOK) || - (tv == TV_HEX_BOOK) || - ((o_ptr->to_a > 0) || (o_ptr->to_h + o_ptr->to_d > 0))) + /* Detect non-living monsters */ + if (!monster_living(m_ptr->r_idx)) { - /* Memorize the item */ - o_ptr->marked |= OM_FOUND; + /* Update monster recall window */ + if (p_ptr->monster_race_idx == m_ptr->r_idx) + { + p_ptr->window |= (PW_MONSTER); + } - /* Redraw */ - lite_spot(y, x); + /* Repair visibility later */ + repair_monsters = TRUE; - /* Detect */ - detect = TRUE; + /* Hack -- Detect monster */ + m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW); + update_monster(i, FALSE); + flag = TRUE; } } - - /* Describe */ - if (detect) + if (flag) { - msg_print(_("éæ³ã®ã¢ã¤ãã ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of magic objects!")); + /* Describe result */ + msg_print(_("èªç¶ã§ãªãã¢ã³ã¹ã¿ã¼ã®åå¨ãæããï¼", "You sense the presence of unnatural beings!")); } - - /* Return result */ - return (detect); + return (flag); } - /*! - * @brief ä¸è¬ã®ã¢ã³ã¹ã¿ã¼ãæç¥ãã / Detect all "normal" monsters on the current panel + * @brief ç²¾ç¥ã®ããã¢ã³ã¹ã¿ã¼ãæç¥ãã / Detect all monsters it has mind on current panel * @param range å¹æç¯å² * @return å¹åããã£ãå ´åTRUEãè¿ã */ -bool detect_monsters_normal(int range) +bool detect_monsters_mind(POSITION range) { - int i, y, x; - + MONSTER_IDX i; + POSITION y, x; bool flag = FALSE; if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3; @@ -2209,52 +587,49 @@ bool detect_monsters_normal(int range) /* Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ y = m_ptr->fy; x = m_ptr->fx; /* Only detect nearby monsters */ if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue; - /* Detect all non-invisible monsters */ - if (!(r_ptr->flags2 & RF2_INVISIBLE) || p_ptr->see_inv) + /* Detect non-living monsters */ + if (!(r_ptr->flags2 & RF2_EMPTY_MIND)) { + /* Update monster recall window */ + if (p_ptr->monster_race_idx == m_ptr->r_idx) + { + p_ptr->window |= (PW_MONSTER); + } + /* Repair visibility later */ repair_monsters = TRUE; /* Hack -- Detect monster */ m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW); - - /* Update the monster */ - update_mon(i, FALSE); - - /* Detect */ + update_monster(i, FALSE); flag = TRUE; } } - - if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 3) flag = FALSE; - - /* Describe */ if (flag) { /* Describe result */ - msg_print(_("ã¢ã³ã¹ã¿ã¼ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of monsters!")); + msg_print(_("殺æ°ãæãã¨ã£ãï¼", "You sense the presence of someone's mind!")); } - - /* Result */ return (flag); } /*! - * @brief ä¸å¯è¦ã®ã¢ã³ã¹ã¿ã¼ãæç¥ãã / Detect all "invisible" monsters around the player + * @brief 該å½ã·ã³ãã«ã®ã¢ã³ã¹ã¿ã¼ãæç¥ãã / Detect all (string) monsters on current panel * @param range å¹æç¯å² + * @param Match 対å¿ã·ã³ãã«ã®æ··ãã£ãã¢ã³ã¹ã¿ã¼æåå(è¤æ°æå®å) * @return å¹åããã£ãå ´åTRUEãè¿ã */ -bool detect_monsters_invis(int range) +bool detect_monsters_string(POSITION range, cptr Match) { - int i, y, x; + MONSTER_IDX i; + POSITION y, x; bool flag = FALSE; if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3; @@ -2268,20 +643,18 @@ bool detect_monsters_invis(int range) /* Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ y = m_ptr->fy; x = m_ptr->fx; /* Only detect nearby monsters */ if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue; - /* Detect invisible monsters */ - if (r_ptr->flags2 & RF2_INVISIBLE) + /* Detect monsters with the same symbol */ + if (my_strchr(Match, r_ptr->d_char)) { /* Update monster recall window */ if (p_ptr->monster_race_idx == m_ptr->r_idx) { - /* Window stuff */ p_ptr->window |= (PW_MONSTER); } @@ -2290,37 +663,32 @@ bool detect_monsters_invis(int range) /* Hack -- Detect monster */ m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW); - - /* Update the monster */ - update_mon(i, FALSE); - - /* Detect */ + update_monster(i, FALSE); flag = TRUE; } } - if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 3) flag = FALSE; - - /* Describe */ + if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE; if (flag) { /* Describe result */ - msg_print(_("éæãªçç©ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of invisible creatures!")); + msg_print(_("ã¢ã³ã¹ã¿ã¼ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of monsters!")); } - - /* Result */ return (flag); } /*! - * @brief éªæªãªã¢ã³ã¹ã¿ã¼ãæç¥ãã / Detect all "evil" monsters on current panel + * @brief flags3ã«å¯¾å¿ããã¢ã³ã¹ã¿ã¼ãæç¥ãã / A "generic" detect monsters routine, tagged to flags3 * @param range å¹æç¯å² + * @param match_flag æç¥ãã©ã° * @return å¹åããã£ãå ´åTRUEãè¿ã */ -bool detect_monsters_evil(int range) +bool detect_monsters_xxx(POSITION range, u32b match_flag) { - int i, y, x; + MONSTER_IDX i; + POSITION y, x; bool flag = FALSE; + cptr desc_monsters = _("å¤ãªã¢ã³ã¹ã¿ã¼", "weird monsters"); if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3; @@ -2333,7 +701,6 @@ bool detect_monsters_evil(int range) /* Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ y = m_ptr->fy; x = m_ptr->fx; @@ -2341,17 +708,16 @@ bool detect_monsters_evil(int range) if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue; /* Detect evil monsters */ - if (r_ptr->flags3 & RF3_EVIL) + if (r_ptr->flags3 & (match_flag)) { if (is_original_ap(m_ptr)) { - /* Take note that they are evil */ - r_ptr->r_flags3 |= (RF3_EVIL); + /* Take note that they are something */ + r_ptr->r_flags3 |= (match_flag); /* Update monster recall window */ if (p_ptr->monster_race_idx == m_ptr->r_idx) { - /* Window stuff */ p_ptr->window |= (PW_MONSTER); } } @@ -2361,3679 +727,4400 @@ bool detect_monsters_evil(int range) /* Hack -- Detect monster */ m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW); - - /* Update the monster */ - update_mon(i, FALSE); - - /* Detect */ + update_monster(i, FALSE); flag = TRUE; } } - - /* Describe */ if (flag) { + switch (match_flag) + { + case RF3_DEMON: + desc_monsters = _("ãã¼ã¢ã³", "demons"); + break; + case RF3_UNDEAD: + desc_monsters = _("ã¢ã³ããã", "the undead"); + break; + } + /* Describe result */ - msg_print(_("éªæªãªãçç©ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of evil creatures!")); + msg_format(_("%sã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of %s!"), desc_monsters); + msg_print(NULL); } - - /* Result */ return (flag); } + /*! - * @brief ç¡çå½ã®ã¢ã³ã¹ã¿ã¼ãæç¥ãã(ã¢ã³ããããæªéç³»ãå«ã) / Detect all "nonliving", "undead" or "demonic" monsters on current panel + * @brief å ¨æç¥å¦ç / Detect everything * @param range å¹æç¯å² * @return å¹åããã£ãå ´åTRUEãè¿ã */ -bool detect_monsters_nonliving(int range) +bool detect_all(POSITION range) { - int i, y, x; - bool flag = FALSE; + bool detect = FALSE; - if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3; + /* Detect everything */ + if (detect_traps(range, TRUE)) detect = TRUE; + if (detect_doors(range)) detect = TRUE; + if (detect_stairs(range)) detect = TRUE; - /* Scan monsters */ + /* There are too many hidden treasure. So... */ + /* if (detect_treasure(range)) detect = TRUE; */ + + if (detect_objects_gold(range)) detect = TRUE; + if (detect_objects_normal(range)) detect = TRUE; + if (detect_monsters_invis(range)) detect = TRUE; + if (detect_monsters_normal(range)) detect = TRUE; + return (detect); +} + + +/*! + * @brief è¦çå ã¢ã³ã¹ã¿ã¼ã«éæ³å¹æãä¸ãã / Apply a "project()" directly to all viewable monsters + * @param typ å±æ§å¹æ + * @param dam å¹æé + * @return å¹åããã£ãå ´åTRUEãè¿ã + * @details + *
+ * Note that affected monsters are NOT auto-tracked by this usage. + * + * To avoid misbehavior when monster deaths have side-effects, + * this is done in two passes. -- JDL + *+ */ +bool project_hack(EFFECT_ID typ, HIT_POINT dam) +{ + MONSTER_IDX i; + POSITION x, y; + BIT_FLAGS flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE; + bool obvious = FALSE; + + + /* Mark all (nearby) monsters */ for (i = 1; i < m_max; i++) { monster_type *m_ptr = &m_list[i]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; - /* Skip dead monsters */ + /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ y = m_ptr->fy; x = m_ptr->fx; - /* Only detect nearby monsters */ - if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue; + /* Require line of sight */ + if (!player_has_los_bold(y, x) || !projectable(p_ptr->y, p_ptr->x, y, x)) continue; - /* Detect non-living monsters */ - if (!monster_living(r_ptr)) - { - /* Update monster recall window */ - if (p_ptr->monster_race_idx == m_ptr->r_idx) - { - /* Window stuff */ - p_ptr->window |= (PW_MONSTER); - } + /* Mark the monster */ + m_ptr->mflag |= (MFLAG_TEMP); + } - /* Repair visibility later */ - repair_monsters = TRUE; + /* Affect all marked monsters */ + for (i = 1; i < m_max; i++) + { + monster_type *m_ptr = &m_list[i]; - /* Hack -- Detect monster */ - m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW); + /* Skip unmarked monsters */ + if (!(m_ptr->mflag & (MFLAG_TEMP))) continue; + + /* Remove mark */ + m_ptr->mflag &= ~(MFLAG_TEMP); - /* Update the monster */ - update_mon(i, FALSE); + y = m_ptr->fy; + x = m_ptr->fx; - /* Detect */ - flag = TRUE; - } + /* Jump directly to the target monster */ + if (project(0, 0, y, x, dam, typ, flg, -1)) obvious = TRUE; } + return (obvious); +} - /* Describe */ - if (flag) - { - /* Describe result */ - msg_print(_("èªç¶ã§ãªãã¢ã³ã¹ã¿ã¼ã®åå¨ãæããï¼", "You sense the presence of unnatural beings!")); - } - /* Result */ - return (flag); +/*! + * @brief è¦çå ã¢ã³ã¹ã¿ã¼ãå éããå¦ç / Speed monsters + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool speed_monsters(void) +{ + return (project_hack(GF_OLD_SPEED, p_ptr->lev)); +} + +/*! + * @brief è¦çå ã¢ã³ã¹ã¿ã¼ãå éããå¦ç / Slow monsters + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool slow_monsters(int power) +{ + return (project_hack(GF_OLD_SLOW, power)); +} + +/*! + * @brief è¦çå ã¢ã³ã¹ã¿ã¼ãç ãããå¦ç / Sleep monsters + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool sleep_monsters(int power) +{ + return (project_hack(GF_OLD_SLEEP, power)); +} + +/*! + * @brief è¦çå ã®éªæªãªã¢ã³ã¹ã¿ã¼ããã¬ãã¼ãã»ã¢ã¦ã§ã¤ãããå¦ç / Banish evil monsters + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool banish_evil(int dist) +{ + return (project_hack(GF_AWAY_EVIL, dist)); +} + +/*! + * @brief è¦çå ã®ã¢ã³ãããã»ã¢ã³ã¹ã¿ã¼ãææãããå¦ç / Turn undead + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool turn_undead(void) +{ + bool tester = (project_hack(GF_TURN_UNDEAD, p_ptr->lev)); + if (tester) + chg_virtue(V_UNLIFE, -1); + return tester; +} + +/*! + * @brief è¦çå ã®ã¢ã³ãããã»ã¢ã³ã¹ã¿ã¼ã«ãã¡ã¼ã¸ãä¸ããå¦ç / Dispel undead monsters + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool dispel_undead(HIT_POINT dam) +{ + bool tester = (project_hack(GF_DISP_UNDEAD, dam)); + if (tester) + chg_virtue(V_UNLIFE, -2); + return tester; +} + +/*! + * @brief è¦çå ã®éªæªãªã¢ã³ã¹ã¿ã¼ã«ãã¡ã¼ã¸ãä¸ããå¦ç / Dispel evil monsters + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool dispel_evil(HIT_POINT dam) +{ + return (project_hack(GF_DISP_EVIL, dam)); +} + +/*! + * @brief è¦çå ã®åè¯ãªã¢ã³ã¹ã¿ã¼ã«ãã¡ã¼ã¸ãä¸ããå¦ç / Dispel good monsters + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool dispel_good(HIT_POINT dam) +{ + return (project_hack(GF_DISP_GOOD, dam)); +} + +/*! + * @brief è¦çå ã®ããããã¢ã³ã¹ã¿ã¼ã«ãã¡ã¼ã¸ãä¸ããå¦ç / Dispel all monsters + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool dispel_monsters(HIT_POINT dam) +{ + return (project_hack(GF_DISP_ALL, dam)); +} + +/*! + * @brief è¦çå ã®çå½ã®ããã¢ã³ã¹ã¿ã¼ã«ãã¡ã¼ã¸ãä¸ããå¦ç / Dispel 'living' monsters + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool dispel_living(HIT_POINT dam) +{ + return (project_hack(GF_DISP_LIVING, dam)); +} + +/*! + * @brief è¦çå ã®æªéç³»ã¢ã³ã¹ã¿ã¼ã«ãã¡ã¼ã¸ãä¸ããå¦ç / Dispel 'living' monsters + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool dispel_demons(HIT_POINT dam) +{ + return (project_hack(GF_DISP_DEMON, dam)); } /*! - * @brief ç²¾ç¥ã®ããã¢ã³ã¹ã¿ã¼ãæç¥ãã / Detect all monsters it has mind on current panel - * @param range å¹æç¯å² + * @brief è¦çå ã®ã¢ã³ã¹ã¿ã¼ã«ãèæ¦ãå¹æãä¸ããå¦ç * @return å¹åããã£ãå ´åTRUEãè¿ã */ -bool detect_monsters_mind(int range) +bool crusade(void) { - int i, y, x; - bool flag = FALSE; + return (project_hack(GF_CRUSADE, p_ptr->lev*4)); +} - if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3; +/*! + * @brief è¦çå ã¢ã³ã¹ã¿ã¼ãæãããå¦ç / Wake up all monsters, and speed up "los" monsters. + * @param who æãããåå ãèµ·ãããã¢ã³ã¹ã¿ã¼(0ãªãã°ãã¬ã¤ã¤ã¼) + * @return ãªã + */ +void aggravate_monsters(MONSTER_IDX who) +{ + MONSTER_IDX i; + bool sleep = FALSE; + bool speed = FALSE; - /* Scan monsters */ + /* Aggravate everyone nearby */ for (i = 1; i < m_max; i++) { monster_type *m_ptr = &m_list[i]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; - /* Skip dead monsters */ + /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ - y = m_ptr->fy; - x = m_ptr->fx; - - /* Only detect nearby monsters */ - if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue; + /* Skip aggravating monster (or player) */ + if (i == who) continue; - /* Detect non-living monsters */ - if (!(r_ptr->flags2 & RF2_EMPTY_MIND)) + /* Wake up nearby sleeping monsters */ + if (m_ptr->cdis < MAX_SIGHT * 2) { - /* Update monster recall window */ - if (p_ptr->monster_race_idx == m_ptr->r_idx) + /* Wake up */ + if (MON_CSLEEP(m_ptr)) { - /* Window stuff */ - p_ptr->window |= (PW_MONSTER); + (void)set_monster_csleep(i, 0); + sleep = TRUE; } - - /* Repair visibility later */ - repair_monsters = TRUE; - - /* Hack -- Detect monster */ - m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW); - - /* Update the monster */ - update_mon(i, FALSE); - - /* Detect */ - flag = TRUE; + if (!is_pet(m_ptr)) m_ptr->mflag2 |= MFLAG2_NOPET; } - } - /* Describe */ - if (flag) - { - /* Describe result */ - msg_print(_("殺æ°ãæãã¨ã£ãï¼", "You sense the presence of someone's mind!")); + /* Speed up monsters in line of sight */ + if (player_has_los_bold(m_ptr->fy, m_ptr->fx)) + { + if (!is_pet(m_ptr)) + { + (void)set_monster_fast(i, MON_FAST(m_ptr) + 100); + speed = TRUE; + } + } } - /* Result */ - return (flag); + if (speed) msg_print(_("ä»è¿ã§ä½ããçªå¦è奮ãããããªæããåããï¼", "You feel a sudden stirring nearby!")); + else if (sleep) msg_print(_("ä½ããçªå¦è奮ãããããªé¨ã ããé³ãé ãã«èãããï¼", "You hear a sudden stirring in the distance!")); + if (p_ptr->riding) p_ptr->update |= PU_BONUS; } /*! - * @brief 該å½ã·ã³ãã«ã®ã¢ã³ã¹ã¿ã¼ãæç¥ãã / Detect all (string) monsters on current panel - * @param range å¹æç¯å² - * @param Match 対å¿ã·ã³ãã«ã®æ··ãã£ãã¢ã³ã¹ã¿ã¼æåå(è¤æ°æå®å) + * @brief ã¢ã³ã¹ã¿ã¼ã¸ã®åä½æ¹æ®ºå¦çãµãã«ã¼ãã³ / Delete a non-unique/non-quest monster + * @param m_idx æ¹æ®ºããã¢ã³ã¹ã¿ã¼ID + * @param power æ¹æ®ºã®å¨å + * @param player_cast ãã¬ã¤ã¤ã¼ã®éæ³ã«ãããã®ãªãã° TRUE + * @param dam_side ãã¬ã¤ã¤ã¼ã¸ã®è² æ ãã¡ã¼ã¸é(1d(dam_side)) + * @param spell_name æ¹æ®ºå¹æãèµ·ãããéæ³ã®åå * @return å¹åããã£ãå ´åTRUEãè¿ã */ -bool detect_monsters_string(int range, cptr Match) +bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, cptr spell_name) { - int i, y, x; - bool flag = FALSE; + int msec = delay_factor * delay_factor * delay_factor; + monster_type *m_ptr = &m_list[m_idx]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; + bool resist = FALSE; - if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3; + if (is_pet(m_ptr) && !player_cast) return FALSE; - /* Scan monsters */ - for (i = 1; i < m_max; i++) + /* Hack -- Skip Unique Monsters or Quest Monsters */ + if (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) resist = TRUE; + else if (r_ptr->flags7 & RF7_UNIQUE2) resist = TRUE; + else if (m_idx == p_ptr->riding) resist = TRUE; + else if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) resist = TRUE; + else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE; + else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE; + + + else { - monster_type *m_ptr = &m_list[i]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; + if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname) + { + char m_name[80]; - /* Skip dead monsters */ - if (!m_ptr->r_idx) continue; + monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE); + do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name); + } - /* Location */ - y = m_ptr->fy; - x = m_ptr->fx; + delete_monster_idx(m_idx); + } - /* Only detect nearby monsters */ - if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue; + if (resist && player_cast) + { + bool see_m = is_seen(m_ptr); + char m_name[80]; - /* Detect monsters with the same symbol */ - if (my_strchr(Match, r_ptr->d_char)) + monster_desc(m_name, m_ptr, 0); + if (see_m) { - /* Update monster recall window */ - if (p_ptr->monster_race_idx == m_ptr->r_idx) + msg_format(_("%^sã«ã¯å¹æããªãã£ãã", "%^s is unaffected."), m_name); + } + if (MON_CSLEEP(m_ptr)) + { + (void)set_monster_csleep(m_idx, 0); + if (m_ptr->ml) { - /* Window stuff */ - p_ptr->window |= (PW_MONSTER); + msg_format(_("%^sãç®ãè¦ã¾ããã", "%^s wakes up."), m_name); } - - /* Repair visibility later */ - repair_monsters = TRUE; - - /* Hack -- Detect monster */ - m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW); - - /* Update the monster */ - update_mon(i, FALSE); - - /* Detect */ - flag = TRUE; } + if (is_friendly(m_ptr) && !is_pet(m_ptr)) + { + if (see_m) + { + msg_format(_("%sã¯æã£ãï¼", "%^s gets angry!"), m_name); + } + set_hostile(m_ptr); + } + if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO; } - if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 3) flag = FALSE; - - /* Describe */ - if (flag) + if (player_cast) { - /* Describe result */ - msg_print(_("ã¢ã³ã¹ã¿ã¼ã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of monsters!")); + take_hit(DAMAGE_GENO, randint1(dam_side), format(_("%^sã®åªæãå±ããç²å´", "the strain of casting %^s"), spell_name), -1); } - /* Result */ - return (flag); + /* Visual feedback */ + move_cursor_relative(p_ptr->y, p_ptr->x); + + p_ptr->redraw |= (PR_HP); + p_ptr->window |= (PW_PLAYER); + + /* Handle */ + handle_stuff(); + Term_fresh(); + + Term_xtra(TERM_XTRA_DELAY, msec); + + return !resist; } + /*! - * @brief flags3ã«å¯¾å¿ããã¢ã³ã¹ã¿ã¼ãæç¥ãã / A "generic" detect monsters routine, tagged to flags3 - * @param range å¹æç¯å² - * @param match_flag æç¥ãã©ã° + * @brief ã¢ã³ã¹ã¿ã¼ã¸ã®ã·ã³ãã«æ¹æ®ºå¦çã«ã¼ãã³ / Delete all non-unique/non-quest monsters of a given "type" from the level + * @param power æ¹æ®ºã®å¨å + * @param player_cast ãã¬ã¤ã¤ã¼ã®éæ³ã«ãããã®ãªãã° TRUE * @return å¹åããã£ãå ´åTRUEãè¿ã */ -bool detect_monsters_xxx(int range, u32b match_flag) +bool symbol_genocide(int power, bool player_cast) { - int i, y, x; - bool flag = FALSE; - cptr desc_monsters = _("å¤ãªã¢ã³ã¹ã¿ã¼", "weird monsters"); + MONSTER_IDX i; + char typ; + bool result = FALSE; - if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3; + /* Prevent genocide in quest levels */ + if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) + { + return (FALSE); + } - /* Scan monsters */ + /* Mega-Hack -- Get a monster symbol */ + while (!get_com(_("ã©ã®ç¨®é¡(æå)ã®ã¢ã³ã¹ã¿ã¼ãæ¹æ®ºãã¾ãã: ", "Choose a monster race (by symbol) to genocide: "), &typ, FALSE)) ; + + /* Delete the monsters of that "type" */ for (i = 1; i < m_max; i++) { monster_type *m_ptr = &m_list[i]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; - /* Skip dead monsters */ + /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ - y = m_ptr->fy; - x = m_ptr->fx; - - /* Only detect nearby monsters */ - if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue; + /* Skip "wrong" monsters */ + if (r_ptr->d_char != typ) continue; - /* Detect evil monsters */ - if (r_ptr->flags3 & (match_flag)) - { - if (is_original_ap(m_ptr)) - { - /* Take note that they are something */ - r_ptr->r_flags3 |= (match_flag); + /* Take note */ + result |= genocide_aux(i, power, player_cast, 4, _("æ¹æ®º", "Genocide")); + } - /* Update monster recall window */ - if (p_ptr->monster_race_idx == m_ptr->r_idx) - { - /* Window stuff */ - p_ptr->window |= (PW_MONSTER); - } - } + if (result) + { + chg_virtue(V_VITALITY, -2); + chg_virtue(V_CHANCE, -1); + } - /* Repair visibility later */ - repair_monsters = TRUE; + return result; +} - /* Hack -- Detect monster */ - m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW); - /* Update the monster */ - update_mon(i, FALSE); +/*! + * @brief ã¢ã³ã¹ã¿ã¼ã¸ã®å¨è¾ºæ¹æ®ºå¦çã«ã¼ãã³ / Delete all nearby (non-unique) monsters + * @param power æ¹æ®ºã®å¨å + * @param player_cast ãã¬ã¤ã¤ã¼ã®éæ³ã«ãããã®ãªãã° TRUE + * @return å¹åããã£ãå ´åTRUEãè¿ã + */ +bool mass_genocide(int power, bool player_cast) +{ + MONSTER_IDX i; + bool result = FALSE; - /* Detect */ - flag = TRUE; - } + /* Prevent mass genocide in quest levels */ + if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) + { + return (FALSE); } - /* Describe */ - if (flag) + /* Delete the (nearby) monsters */ + for (i = 1; i < m_max; i++) { - switch (match_flag) - { - case RF3_DEMON: - desc_monsters = _("ãã¼ã¢ã³", "demons"); - break; - case RF3_UNDEAD: - desc_monsters = _("ã¢ã³ããã", "the undead"); - break; - } + monster_type *m_ptr = &m_list[i]; + + /* Paranoia -- Skip dead monsters */ + if (!m_ptr->r_idx) continue; + + /* Skip distant monsters */ + if (m_ptr->cdis > MAX_SIGHT) continue; - /* Describe result */ - msg_format(_("%sã®åå¨ãæãã¨ã£ãï¼", "You sense the presence of %s!"), desc_monsters); - msg_print(NULL); + /* Note effect */ + result |= genocide_aux(i, power, player_cast, 3, _("å¨è¾ºæ¹æ®º", "Mass Genocide")); } - /* Result */ - return (flag); + if (result) + { + chg_virtue(V_VITALITY, -2); + chg_virtue(V_CHANCE, -1); + } + + return result; } /*! - * @brief å ¨æç¥å¦ç / Detect everything - * @param range å¹æç¯å² + * @brief ã¢ã³ãããã»ã¢ã³ã¹ã¿ã¼ã¸ã®å¨è¾ºæ¹æ®ºå¦çã«ã¼ãã³ / Delete all nearby (non-unique) undead + * @param power æ¹æ®ºã®å¨å + * @param player_cast ãã¬ã¤ã¤ã¼ã®éæ³ã«ãããã®ãªãã° TRUE * @return å¹åããã£ãå ´åTRUEãè¿ã */ -bool detect_all(int range) +bool mass_genocide_undead(int power, bool player_cast) { - bool detect = FALSE; + MONSTER_IDX i; + bool result = FALSE; - /* Detect everything */ - if (detect_traps(range, TRUE)) detect = TRUE; - if (detect_doors(range)) detect = TRUE; - if (detect_stairs(range)) detect = TRUE; + /* Prevent mass genocide in quest levels */ + if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) + { + return (FALSE); + } - /* There are too many hidden treasure. So... */ - /* if (detect_treasure(range)) detect = TRUE; */ + /* Delete the (nearby) monsters */ + for (i = 1; i < m_max; i++) + { + monster_type *m_ptr = &m_list[i]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; - if (detect_objects_gold(range)) detect = TRUE; - if (detect_objects_normal(range)) detect = TRUE; - if (detect_monsters_invis(range)) detect = TRUE; - if (detect_monsters_normal(range)) detect = TRUE; + /* Paranoia -- Skip dead monsters */ + if (!m_ptr->r_idx) continue; - /* Result */ - return (detect); + if (!(r_ptr->flags3 & RF3_UNDEAD)) continue; + + /* Skip distant monsters */ + if (m_ptr->cdis > MAX_SIGHT) continue; + + /* Note effect */ + result |= genocide_aux(i, power, player_cast, 3, _("ã¢ã³ãããæ¶æ» ", "Annihilate Undead")); + } + + if (result) + { + chg_virtue(V_UNLIFE, -2); + chg_virtue(V_CHANCE, -1); + } + + return result; } /*! - * @brief è¦çå ã¢ã³ã¹ã¿ã¼ã«éæ³å¹æãä¸ãã / Apply a "project()" directly to all viewable monsters - * @param typ å±æ§å¹æ - * @param dam å¹æé + * @brief å¨è¾ºã¢ã³ã¹ã¿ã¼ã調æ»ãã / Probe nearby monsters * @return å¹åããã£ãå ´åTRUEãè¿ã - * @details - *
- * Note that affected monsters are NOT auto-tracked by this usage. - * - * To avoid misbehavior when monster deaths have side-effects, - * this is done in two passes. -- JDL - **/ -bool project_hack(int typ, int dam) +bool probing(void) { - int i, x, y; - int flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE; - bool obvious = FALSE; + int i; + SPEED speed; + bool_hack cu, cv; + bool probe = FALSE; + char buf[256]; + cptr align; + cu = Term->scr->cu; + cv = Term->scr->cv; + Term->scr->cu = 0; + Term->scr->cv = 1; - /* Mark all (nearby) monsters */ + /* Probe all (nearby) monsters */ for (i = 1; i < m_max; i++) { monster_type *m_ptr = &m_list[i]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ - y = m_ptr->fy; - x = m_ptr->fx; - /* Require line of sight */ - if (!player_has_los_bold(y, x) || !projectable(p_ptr->y, p_ptr->x, y, x)) continue; + if (!player_has_los_bold(m_ptr->fy, m_ptr->fx)) continue; - /* Mark the monster */ - m_ptr->mflag |= (MFLAG_TEMP); - } + /* Probe visible monsters */ + if (m_ptr->ml) + { + char m_name[80]; - /* Affect all marked monsters */ - for (i = 1; i < m_max; i++) - { - monster_type *m_ptr = &m_list[i]; + /* Start the message */ + if (!probe) + { + msg_print(_("調æ»ä¸...", "Probing...")); + } - /* Skip unmarked monsters */ - if (!(m_ptr->mflag & (MFLAG_TEMP))) continue; + msg_print(NULL); - /* Remove mark */ - m_ptr->mflag &= ~(MFLAG_TEMP); + if (!is_original_ap(m_ptr)) + { + if (m_ptr->mflag2 & MFLAG2_KAGE) + m_ptr->mflag2 &= ~(MFLAG2_KAGE); - /* Location */ - y = m_ptr->fy; - x = m_ptr->fx; + m_ptr->ap_r_idx = m_ptr->r_idx; + lite_spot(m_ptr->fy, m_ptr->fx); + } + /* Get "the monster" or "something" */ + monster_desc(m_name, m_ptr, MD_IGNORE_HALLU | MD_INDEF_HIDDEN); - /* Jump directly to the target monster */ - if (project(0, 0, y, x, dam, typ, flg, -1)) obvious = TRUE; - } + speed = m_ptr->mspeed - 110; + if (MON_FAST(m_ptr)) speed += 10; + if (MON_SLOW(m_ptr)) speed -= 10; + if (ironman_nightmare) speed += 5; - /* Result */ - return (obvious); -} + /* Get the monster's alignment */ + if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = _("åæª", "good&evil"); + else if (r_ptr->flags3 & RF3_EVIL) align = _("éªæª", "evil"); + else if (r_ptr->flags3 & RF3_GOOD) align = _("åè¯", "good"); + else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) _(align = "ä¸ç«(åæª)", "neutral(good&evil)"); + else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = _("ä¸ç«(éªæª)", "neutral(evil)"); + else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = _("ä¸ç«(åè¯)", "neutral(good)"); + else align = _("ä¸ç«", "neutral"); + /* Describe the monster */ + sprintf(buf,_("%s ... å±æ§:%s HP:%d/%d AC:%d é度:%s%d çµé¨:", "%s ... align:%s HP:%d/%d AC:%d speed:%s%d exp:"), + m_name, align, (int)m_ptr->hp, (int)m_ptr->maxhp, r_ptr->ac, (speed > 0) ? "+" : "", speed); -/*! - * @brief è¦çå ã¢ã³ã¹ã¿ã¼ãå éããå¦ç / Speed monsters - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool speed_monsters(void) -{ - return (project_hack(GF_OLD_SPEED, p_ptr->lev)); -} + if (r_ptr->next_r_idx) + { + strcat(buf, format("%d/%d ", m_ptr->exp, r_ptr->next_exp)); + } + else + { + strcat(buf, "xxx "); + } -/*! - * @brief è¦çå ã¢ã³ã¹ã¿ã¼ãå éããå¦ç / Slow monsters - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool slow_monsters(int power) -{ - return (project_hack(GF_OLD_SLOW, power)); -} + if (MON_CSLEEP(m_ptr)) strcat(buf,_("ç¡ç ", "sleeping ")); + if (MON_STUNNED(m_ptr)) strcat(buf, _("æ¦æ§ ", "stunned ")); + if (MON_MONFEAR(m_ptr)) strcat(buf, _("ææ ", "scared ")); + if (MON_CONFUSED(m_ptr)) strcat(buf, _("æ··ä¹± ", "confused ")); + if (MON_INVULNER(m_ptr)) strcat(buf, _("ç¡æµ ", "invulnerable ")); + buf[strlen(buf)-1] = '\0'; + prt(buf, 0, 0); -/*! - * @brief è¦çå ã¢ã³ã¹ã¿ã¼ãç ãããå¦ç / Sleep monsters - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool sleep_monsters(int power) -{ - return (project_hack(GF_OLD_SLEEP, power)); -} + /* HACK : Add the line to message buffer */ + message_add(buf); + p_ptr->window |= (PW_MESSAGE); + window_stuff(); -/*! - * @brief è¦çå ã®éªæªãªã¢ã³ã¹ã¿ã¼ããã¬ãã¼ãã»ã¢ã¦ã§ã¤ãããå¦ç / Banish evil monsters - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool banish_evil(int dist) -{ - return (project_hack(GF_AWAY_EVIL, dist)); -} + if (m_ptr->ml) move_cursor_relative(m_ptr->fy, m_ptr->fx); + inkey(); -/*! - * @brief è¦çå ã®ã¢ã³ãããã»ã¢ã³ã¹ã¿ã¼ãææãããå¦ç / Turn undead - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool turn_undead(void) -{ - bool tester = (project_hack(GF_TURN_UNDEAD, p_ptr->lev)); - if (tester) - chg_virtue(V_UNLIFE, -1); - return tester; -} + Term_erase(0, 0, 255); -/*! - * @brief è¦çå ã®ã¢ã³ãããã»ã¢ã³ã¹ã¿ã¼ã«ãã¡ã¼ã¸ãä¸ããå¦ç / Dispel undead monsters - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool dispel_undead(int dam) -{ - bool tester = (project_hack(GF_DISP_UNDEAD, dam)); - if (tester) - chg_virtue(V_UNLIFE, -2); - return tester; -} + /* Learn everything about this monster */ + if (lore_do_probe(m_ptr->r_idx)) + { + /* Get base name of monster */ + strcpy(buf, (r_name + r_ptr->name)); -/*! - * @brief è¦çå ã®éªæªãªã¢ã³ã¹ã¿ã¼ã«ãã¡ã¼ã¸ãä¸ããå¦ç / Dispel evil monsters - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool dispel_evil(int dam) -{ - return (project_hack(GF_DISP_EVIL, dam)); -} +#ifdef JP + /* Note that we learnt some new flags -Mogami- */ + msg_format("%sã«ã¤ãã¦ããã«è©³ãããªã£ãæ°ãããã", buf); +#else + /* Pluralize it */ + plural_aux(buf); -/*! - * @brief è¦çå ã®åè¯ãªã¢ã³ã¹ã¿ã¼ã«ãã¡ã¼ã¸ãä¸ããå¦ç / Dispel good monsters - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool dispel_good(int dam) -{ - return (project_hack(GF_DISP_GOOD, dam)); -} + /* Note that we learnt some new flags -Mogami- */ + msg_format("You now know more about %s.", buf); +#endif + /* Clear -more- prompt */ + msg_print(NULL); + } -/*! - * @brief è¦çå ã®ããããã¢ã³ã¹ã¿ã¼ã«ãã¡ã¼ã¸ãä¸ããå¦ç / Dispel all monsters - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool dispel_monsters(int dam) -{ - return (project_hack(GF_DISP_ALL, dam)); -} + /* Probe worked */ + probe = TRUE; + } + } -/*! - * @brief è¦çå ã®çå½ã®ããã¢ã³ã¹ã¿ã¼ã«ãã¡ã¼ã¸ãä¸ããå¦ç / Dispel 'living' monsters - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool dispel_living(int dam) -{ - return (project_hack(GF_DISP_LIVING, dam)); + Term->scr->cu = cu; + Term->scr->cv = cv; + Term_fresh(); + + if (probe) + { + chg_virtue(V_KNOWLEDGE, 1); + msg_print(_("ããã§å ¨é¨ã§ãã", "That's all.")); + } + return (probe); } -/*! - * @brief è¦çå ã®æªéç³»ã¢ã³ã¹ã¿ã¼ã«ãã¡ã¼ã¸ãä¸ããå¦ç / Dispel 'living' monsters - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool dispel_demons(int dam) -{ - return (project_hack(GF_DISP_DEMON, dam)); -} + /*! - * @brief è¦çå ã®ã¢ã³ã¹ã¿ã¼ã«ãèæ¦ãå¹æãä¸ããå¦ç + * @brief *ç ´å£*å¦çãè¡ã / The spell of destruction + * @param y1 ç ´å£ã®ä¸å¿Yåº§æ¨ + * @param x1 ç ´å£ã®ä¸å¿Xåº§æ¨ + * @param r ç ´å£ã®åå¾ + * @param in_generate ãã³ã¸ã§ã³ããã¢çæä¸ã®å¦çãªãã°TRUE * @return å¹åããã£ãå ´åTRUEãè¿ã + * @details + *
+ * This spell "deletes" monsters (instead of "killing" them). + * + * Later we may use one function for both "destruction" and + * "earthquake" by using the "full" to select "destruction". + **/ -bool crusade(void) +bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate) { - return (project_hack(GF_CRUSADE, p_ptr->lev*4)); -} + POSITION y, x; + int k, t; + cave_type *c_ptr; + bool flag = FALSE; -/*! - * @brief è¦çå ã¢ã³ã¹ã¿ã¼ãæãããå¦ç / Wake up all monsters, and speed up "los" monsters. - * @param who æãããåå ãèµ·ãããã¢ã³ã¹ã¿ã¼(0ãªãã°ãã¬ã¤ã¤ã¼) - * @return ãªã - */ -void aggravate_monsters(int who) -{ - int i; - bool sleep = FALSE; - bool speed = FALSE; + /* Prevent destruction of quest levels and town */ + if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level) + { + return (FALSE); + } + /* Lose monster light */ + if (!in_generate) clear_mon_lite(); - /* Aggravate everyone nearby */ - for (i = 1; i < m_max; i++) + /* Big area of affect */ + for (y = (y1 - r); y <= (y1 + r); y++) { - monster_type *m_ptr = &m_list[i]; -/* monster_race *r_ptr = &r_info[m_ptr->r_idx]; */ + for (x = (x1 - r); x <= (x1 + r); x++) + { + /* Skip illegal grids */ + if (!in_bounds(y, x)) continue; - /* Paranoia -- Skip dead monsters */ - if (!m_ptr->r_idx) continue; + /* Extract the distance */ + k = distance(y1, x1, y, x); - /* Skip aggravating monster (or player) */ - if (i == who) continue; + /* Stay in the circle of death */ + if (k > r) continue; + c_ptr = &cave[y][x]; - /* Wake up nearby sleeping monsters */ - if (m_ptr->cdis < MAX_SIGHT * 2) - { - /* Wake up */ - if (MON_CSLEEP(m_ptr)) - { - (void)set_monster_csleep(i, 0); - sleep = TRUE; - } - if (!is_pet(m_ptr)) m_ptr->mflag2 |= MFLAG2_NOPET; - } + /* Lose room and vault */ + c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); - /* Speed up monsters in line of sight */ - if (player_has_los_bold(m_ptr->fy, m_ptr->fx)) - { - if (!is_pet(m_ptr)) + /* Lose light and knowledge */ + c_ptr->info &= ~(CAVE_MARK | CAVE_GLOW | CAVE_KNOWN); + + if (!in_generate) /* Normal */ { - (void)set_monster_fast(i, MON_FAST(m_ptr) + 100); - speed = TRUE; - } - } - } + /* Lose unsafety */ + c_ptr->info &= ~(CAVE_UNSAFE); - /* Messages */ -#ifdef JP - if (speed) msg_print("ä»è¿ã§ä½ããçªå¦è奮ãããããªæããåããï¼"); - else if (sleep) msg_print("ä½ããçªå¦è奮ãããããªé¨ã ããé³ãé ãã«èãããï¼"); -#else - if (speed) msg_print("You feel a sudden stirring nearby!"); - else if (sleep) msg_print("You hear a sudden stirring in the distance!"); -#endif - if (p_ptr->riding) p_ptr->update |= PU_BONUS; -} + /* Hack -- Notice player affect */ + if (player_bold(y, x)) + { + /* Hurt the player later */ + flag = TRUE; + /* Do not hurt this grid */ + continue; + } + } -/*! - * @brief ã¢ã³ã¹ã¿ã¼ã¸ã®åä½æ¹æ®ºå¦çãµãã«ã¼ãã³ / Delete a non-unique/non-quest monster - * @param m_idx æ¹æ®ºããã¢ã³ã¹ã¿ã¼ID - * @param power æ¹æ®ºã®å¨å - * @param player_cast ãã¬ã¤ã¤ã¼ã®éæ³ã«ãããã®ãªãã° TRUE - * @param dam_side ãã¬ã¤ã¤ã¼ã¸ã®è² æ ãã¡ã¼ã¸é(1d(dam_side)) - * @param spell_name æ¹æ®ºå¹æãèµ·ãããéæ³ã®åå - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool genocide_aux(int m_idx, int power, bool player_cast, int dam_side, cptr spell_name) -{ - int msec = delay_factor * delay_factor * delay_factor; - monster_type *m_ptr = &m_list[m_idx]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; - bool resist = FALSE; + /* Hack -- Skip the epicenter */ + if ((y == y1) && (x == x1)) continue; - if (is_pet(m_ptr) && !player_cast) return FALSE; + if (c_ptr->m_idx) + { + monster_type *m_ptr = &m_list[c_ptr->m_idx]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; - /* Hack -- Skip Unique Monsters or Quest Monsters */ - if (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) resist = TRUE; + if (in_generate) /* In generation */ + { + /* Delete the monster (if any) */ + delete_monster(y, x); + } + else if (r_ptr->flags1 & RF1_QUESTOR) + { + /* Heal the monster */ + m_ptr->hp = m_ptr->maxhp; - else if (r_ptr->flags7 & RF7_UNIQUE2) resist = TRUE; + /* Try to teleport away quest monsters */ + if (!teleport_away(c_ptr->m_idx, (r * 2) + 1, TELEPORT_DEC_VALOUR)) continue; + } + else + { + if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname) + { + char m_name[80]; - else if (m_idx == p_ptr->riding) resist = TRUE; + monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE); + do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_DESTROY, m_name); + } - else if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) resist = TRUE; + /* Delete the monster (if any) */ + delete_monster(y, x); + } + } - else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE; + /* During generation, destroyed artifacts are "preserved" */ + if (preserve_mode || in_generate) + { + OBJECT_IDX this_o_idx, next_o_idx = 0; - else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE; + /* Scan all objects in the grid */ + for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) + { + object_type *o_ptr; + o_ptr = &o_list[this_o_idx]; - /* Delete the monster */ - else - { - if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname) - { - char m_name[80]; + /* Acquire next object */ + next_o_idx = o_ptr->next_o_idx; - monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE); - do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name); - } + /* Hack -- Preserve unknown artifacts */ + if (object_is_fixed_artifact(o_ptr) && (!object_is_known(o_ptr) || in_generate)) + { + /* Mega-Hack -- Preserve the artifact */ + a_info[o_ptr->name1].cur_num = 0; - delete_monster_idx(m_idx); - } + if (in_generate && cheat_peek) + { + char o_name[MAX_NLEN]; + object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE)); + msg_format(_("ä¼èª¬ã®ã¢ã¤ãã (%s) ã¯çæä¸ã«*ç ´å£*ãããã", "Artifact (%s) was *destroyed* during generation."), o_name); + } + } + else if (in_generate && cheat_peek && o_ptr->art_name) + { + msg_print(_("ã©ã³ãã ã»ã¢ã¼ãã£ãã¡ã¯ãã®1ã¤ã¯çæä¸ã«*ç ´å£*ãããã", + "One of the random artifacts was *destroyed* during generation.")); + } + } + } - if (resist && player_cast) - { - bool see_m = is_seen(m_ptr); - char m_name[80]; + /* Delete objects */ + delete_object(y, x); - monster_desc(m_name, m_ptr, 0); - if (see_m) - { - msg_format(_("%^sã«ã¯å¹æããªãã£ãã", "%^s is unaffected."), m_name); - } - if (MON_CSLEEP(m_ptr)) - { - (void)set_monster_csleep(m_idx, 0); - if (m_ptr->ml) - { - msg_format(_("%^sãç®ãè¦ã¾ããã", "%^s wakes up."), m_name); - } - } - if (is_friendly(m_ptr) && !is_pet(m_ptr)) - { - if (see_m) + /* Destroy "non-permanent" grids */ + if (!cave_perma_grid(c_ptr)) { - msg_format(_("%sã¯æã£ãï¼", "%^s gets angry!"), m_name); + /* Wall (or floor) type */ + t = randint0(200); + + if (!in_generate) /* Normal */ + { + if (t < 20) + { + /* Create granite wall */ + cave_set_feat(y, x, feat_granite); + } + else if (t < 70) + { + /* Create quartz vein */ + cave_set_feat(y, x, feat_quartz_vein); + } + else if (t < 100) + { + /* Create magma vein */ + cave_set_feat(y, x, feat_magma_vein); + } + else + { + /* Create floor */ + cave_set_feat(y, x, floor_type[randint0(100)]); + } + } + else /* In generation */ + { + if (t < 20) + { + /* Create granite wall */ + place_extra_grid(c_ptr); + } + else if (t < 70) + { + /* Create quartz vein */ + c_ptr->feat = feat_quartz_vein; + } + else if (t < 100) + { + /* Create magma vein */ + c_ptr->feat = feat_magma_vein; + } + else + { + /* Create floor */ + place_floor_grid(c_ptr); + } + + /* Clear garbage of hidden trap or door */ + c_ptr->mimic = 0; + } } - set_hostile(m_ptr); } - if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO; } - if (player_cast) + if (!in_generate) { - /* Take damage */ - take_hit(DAMAGE_GENO, randint1(dam_side), format(_("%^sã®åªæãå±ããç²å´", "the strain of casting %^s"), spell_name), -1); - } - - /* Visual feedback */ - move_cursor_relative(p_ptr->y, p_ptr->x); - - /* Redraw */ - p_ptr->redraw |= (PR_HP); - - /* Window stuff */ - p_ptr->window |= (PW_PLAYER); - - /* Handle */ - handle_stuff(); + /* Process "re-glowing" */ + for (y = (y1 - r); y <= (y1 + r); y++) + { + for (x = (x1 - r); x <= (x1 + r); x++) + { + /* Skip illegal grids */ + if (!in_bounds(y, x)) continue; - /* Fresh */ - Term_fresh(); + /* Extract the distance */ + k = distance(y1, x1, y, x); - /* Delay */ - Term_xtra(TERM_XTRA_DELAY, msec); + /* Stay in the circle of death */ + if (k > r) continue; + c_ptr = &cave[y][x]; - return !resist; -} + if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW; + else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) + { + int i, yy, xx; + cave_type *cc_ptr; + for (i = 0; i < 9; i++) + { + yy = y + ddy_ddd[i]; + xx = x + ddx_ddd[i]; + if (!in_bounds2(yy, xx)) continue; + cc_ptr = &cave[yy][xx]; + if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW)) + { + c_ptr->info |= CAVE_GLOW; + break; + } + } + } + } + } -/*! - * @brief ã¢ã³ã¹ã¿ã¼ã¸ã®ã·ã³ãã«æ¹æ®ºå¦çã«ã¼ãã³ / Delete all non-unique/non-quest monsters of a given "type" from the level - * @param power æ¹æ®ºã®å¨å - * @param player_cast ãã¬ã¤ã¤ã¼ã®éæ³ã«ãããã®ãªãã° TRUE - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool symbol_genocide(int power, bool player_cast) -{ - int i; - char typ; - bool result = FALSE; + /* Hack -- Affect player */ + if (flag) + { + msg_print(_("çãããããªéå ãçºçããï¼", "There is a searing blast of light!")); - /* Prevent genocide in quest levels */ - if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) - { - return (FALSE); - } + /* Blind the player */ + if (!p_ptr->resist_blind && !p_ptr->resist_lite) + { + /* Become blind */ + (void)set_blind(p_ptr->blind + 10 + randint1(10)); + } + } - /* Mega-Hack -- Get a monster symbol */ - while (!get_com(_("ã©ã®ç¨®é¡(æå)ã®ã¢ã³ã¹ã¿ã¼ãæ¹æ®ºãã¾ãã: ", "Choose a monster race (by symbol) to genocide: "), &typ, FALSE)) ; + forget_flow(); - /* Delete the monsters of that "type" */ - for (i = 1; i < m_max; i++) - { - monster_type *m_ptr = &m_list[i]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; + /* Mega-Hack -- Forget the view and lite */ + p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE); - /* Paranoia -- Skip dead monsters */ - if (!m_ptr->r_idx) continue; + p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS); - /* Skip "wrong" monsters */ - if (r_ptr->d_char != typ) continue; + p_ptr->redraw |= (PR_MAP); - /* Take note */ - result |= genocide_aux(i, power, player_cast, 4, _("æ¹æ®º", "Genocide")); - } + p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); - if (result) - { - chg_virtue(V_VITALITY, -2); - chg_virtue(V_CHANCE, -1); + if (p_ptr->special_defense & NINJA_S_STEALTH) + { + if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE); + } } - return result; + /* Success */ + return (TRUE); } /*! - * @brief ã¢ã³ã¹ã¿ã¼ã¸ã®å¨è¾ºæ¹æ®ºå¦çã«ã¼ãã³ / Delete all nearby (non-unique) monsters - * @param power æ¹æ®ºã®å¨å - * @param player_cast ãã¬ã¤ã¤ã¼ã®éæ³ã«ãããã®ãªãã° TRUE + * @brief å°éå¦ç(ãµãã«ã¼ãã³) / + * Induce an "earthquake" of the given radius at the given location. * @return å¹åããã£ãå ´åTRUEãè¿ã + * @param cy ä¸å¿Yåº§æ¨ + * @param cx ä¸å¿Xåº§æ¨ + * @param r å¹æåå¾ + * @param m_idx å°éãèµ·ãããã¢ã³ã¹ã¿ã¼ID(0ãªãã°ãã¬ã¤ã¤ã¼) + * @details + *
+ * + * This will turn some walls into floors and some floors into walls. + * + * The player will take damage and "jump" into a safe grid if possible, + * otherwise, he will "tunnel" through the rubble instantaneously. + * + * Monsters will take damage, and "jump" into a safe grid if possible, + * otherwise they will be "buried" in the rubble, disappearing from + * the level in the same way that they do when genocided. + * + * Note that thus the player and monsters (except eaters of walls and + * passers through walls) will never occupy the same grid as a wall. + * Note that as of now (2.7.8) no monster may occupy a "wall" grid, even + * for a single turn, unless that monster can pass_walls or kill_walls. + * This has allowed massive simplification of the "monster" code. + **/ -bool mass_genocide(int power, bool player_cast) +bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx) { - int i; - bool result = FALSE; + DIRECTION i; + int t; + POSITION y, x, yy, xx, dy, dx; + int damage = 0; + int sn = 0; + POSITION sy = 0, sx = 0; + bool hurt = FALSE; + cave_type *c_ptr; + bool map[32][32]; - /* Prevent mass genocide in quest levels */ - if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) + + /* Prevent destruction of quest levels and town */ + if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level) { return (FALSE); } - /* Delete the (nearby) monsters */ - for (i = 1; i < m_max; i++) - { - monster_type *m_ptr = &m_list[i]; - - /* Paranoia -- Skip dead monsters */ - if (!m_ptr->r_idx) continue; - - /* Skip distant monsters */ - if (m_ptr->cdis > MAX_SIGHT) continue; - - /* Note effect */ - result |= genocide_aux(i, power, player_cast, 3, _("å¨è¾ºæ¹æ®º", "Mass Genocide")); - } + /* Paranoia -- Enforce maximum range */ + if (r > 12) r = 12; - if (result) + /* Clear the "maximal blast" area */ + for (y = 0; y < 32; y++) { - chg_virtue(V_VITALITY, -2); - chg_virtue(V_CHANCE, -1); + for (x = 0; x < 32; x++) + { + map[y][x] = FALSE; + } } - return result; -} + /* Check around the epicenter */ + for (dy = -r; dy <= r; dy++) + { + for (dx = -r; dx <= r; dx++) + { + /* Extract the location */ + yy = cy + dy; + xx = cx + dx; + /* Skip illegal grids */ + if (!in_bounds(yy, xx)) continue; -/*! - * @brief ã¢ã³ãããã»ã¢ã³ã¹ã¿ã¼ã¸ã®å¨è¾ºæ¹æ®ºå¦çã«ã¼ãã³ / Delete all nearby (non-unique) undead - * @param power æ¹æ®ºã®å¨å - * @param player_cast ãã¬ã¤ã¤ã¼ã®éæ³ã«ãããã®ãªãã° TRUE - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool mass_genocide_undead(int power, bool player_cast) -{ - int i; - bool result = FALSE; + /* Skip distant grids */ + if (distance(cy, cx, yy, xx) > r) continue; + c_ptr = &cave[yy][xx]; - /* Prevent mass genocide in quest levels */ - if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) - { - return (FALSE); - } + /* Lose room and vault */ + c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE); - /* Delete the (nearby) monsters */ - for (i = 1; i < m_max; i++) - { - monster_type *m_ptr = &m_list[i]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; + /* Lose light and knowledge */ + c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK | CAVE_KNOWN); - /* Paranoia -- Skip dead monsters */ - if (!m_ptr->r_idx) continue; + /* Skip the epicenter */ + if (!dx && !dy) continue; - if (!(r_ptr->flags3 & RF3_UNDEAD)) continue; + /* Skip most grids */ + if (randint0(100) < 85) continue; - /* Skip distant monsters */ - if (m_ptr->cdis > MAX_SIGHT) continue; + /* Damage this grid */ + map[16+yy-cy][16+xx-cx] = TRUE; - /* Note effect */ - result |= genocide_aux(i, power, player_cast, 3, _("ã¢ã³ãããæ¶æ» ", "Annihilate Undead")); + /* Hack -- Take note of player damage */ + if (player_bold(yy, xx)) hurt = TRUE; + } } - if (result) + /* First, affect the player (if necessary) */ + if (hurt && !p_ptr->pass_wall && !p_ptr->kill_wall) { - chg_virtue(V_UNLIFE, -2); - chg_virtue(V_CHANCE, -1); - } - - return result; -} + /* Check around the player */ + for (i = 0; i < 8; i++) + { + /* Access the location */ + y = p_ptr->y + ddy_ddd[i]; + x = p_ptr->x + ddx_ddd[i]; + /* Skip non-empty grids */ + if (!cave_empty_bold(y, x)) continue; -/*! - * @brief å¨è¾ºã¢ã³ã¹ã¿ã¼ã調æ»ãã / Probe nearby monsters - * @return å¹åããã£ãå ´åTRUEãè¿ã - */ -bool probing(void) -{ - int i, speed; - int cu, cv; - bool probe = FALSE; - char buf[256]; - cptr align; + /* Important -- Skip "quake" grids */ + if (map[16+y-cy][16+x-cx]) continue; - cu = Term->scr->cu; - cv = Term->scr->cv; - Term->scr->cu = 0; - Term->scr->cv = 1; + if (cave[y][x].m_idx) continue; - /* Probe all (nearby) monsters */ - for (i = 1; i < m_max; i++) - { - monster_type *m_ptr = &m_list[i]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; + /* Count "safe" grids */ + sn++; - /* Paranoia -- Skip dead monsters */ - if (!m_ptr->r_idx) continue; + /* Randomize choice */ + if (randint0(sn) > 0) continue; - /* Require line of sight */ - if (!player_has_los_bold(m_ptr->fy, m_ptr->fx)) continue; + /* Save the safe location */ + sy = y; sx = x; + } - /* Probe visible monsters */ - if (m_ptr->ml) + /* Random message */ + switch (randint1(3)) { - char m_name[80]; - - /* Start the message */ - if (!probe) + case 1: { - msg_print(_("調æ»ä¸...", "Probing...")); + msg_print(_("ãã³ã¸ã§ã³ã®å£ãå´©ããï¼", "The cave ceiling collapses!")); + break; } + case 2: + { + msg_print(_("ãã³ã¸ã§ã³ã®åºãä¸èªç¶ã«ããæ²ãã£ãï¼", "The cave floor twists in an unnatural way!")); + break; + } + default: + { + msg_print(_("ãã³ã¸ã§ã³ãæºããï¼å´©ãã岩ãé ã«éã£ã¦ããï¼", "The cave quakes! You are pummeled with debris!")); + break; + } + } - msg_print(NULL); + /* Hurt the player a lot */ + if (!sn) + { + /* Message and damage */ + msg_print(_("ããªãã¯ã²ã©ãæªæãè² ã£ãï¼", "You are severely crushed!")); + damage = 200; + } - if (!is_original_ap(m_ptr)) + /* Destroy the grid, and push the player to safety */ + else + { + /* Calculate results */ + switch (randint1(3)) { - if (m_ptr->mflag2 & MFLAG2_KAGE) - m_ptr->mflag2 &= ~(MFLAG2_KAGE); - - m_ptr->ap_r_idx = m_ptr->r_idx; - lite_spot(m_ptr->fy, m_ptr->fx); + case 1: + { + msg_print(_("éã注ã岩ããã¾ãé¿ããï¼", "You nimbly dodge the blast!")); + damage = 0; + break; + } + case 2: + { + msg_print(_("岩ç³ãããªãã«ç´æãã!", "You are bashed by rubble!")); + damage = damroll(10, 4); + (void)set_stun(p_ptr->stun + randint1(50)); + break; + } + case 3: + { + msg_print(_("ããªãã¯åºã¨å£ã¨ã®éã«æã¾ãã¦ãã¾ã£ãï¼", "You are crushed between the floor and ceiling!")); + damage = damroll(10, 4); + (void)set_stun(p_ptr->stun + randint1(50)); + break; + } } - /* Get "the monster" or "something" */ - monster_desc(m_name, m_ptr, MD_IGNORE_HALLU | MD_INDEF_HIDDEN); - speed = m_ptr->mspeed - 110; - if (MON_FAST(m_ptr)) speed += 10; - if (MON_SLOW(m_ptr)) speed -= 10; + /* Move the player to the safe location */ + (void)move_player_effect(sy, sx, MPE_DONT_PICKUP); + } - /* Get the monster's alignment */ -#ifdef JP - if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = "åæª"; - else if (r_ptr->flags3 & RF3_EVIL) align = "éªæª"; - else if (r_ptr->flags3 & RF3_GOOD) align = "åè¯"; - else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) align = "ä¸ç«(åæª)"; - else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = "ä¸ç«(éªæª)"; - else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = "ä¸ç«(åè¯)"; - else align = "ä¸ç«"; -#else - if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = "good&evil"; - else if (r_ptr->flags3 & RF3_EVIL) align = "evil"; - else if (r_ptr->flags3 & RF3_GOOD) align = "good"; - else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) align = "neutral(good&evil)"; - else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = "neutral(evil)"; - else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = "neutral(good)"; - else align = "neutral"; -#endif + /* Important -- no wall on player */ + map[16+p_ptr->y-cy][16+p_ptr->x-cx] = FALSE; - /* Describe the monster */ - sprintf(buf,_("%s ... å±æ§:%s HP:%d/%d AC:%d é度:%s%d çµé¨:", "%s ... align:%s HP:%d/%d AC:%d speed:%s%d exp:"), - m_name, align, (int)m_ptr->hp, (int)m_ptr->maxhp, r_ptr->ac, (speed > 0) ? "+" : "", speed); + if (damage) + { + cptr killer; - if (r_ptr->next_r_idx) + if (m_idx) { - strcat(buf, format("%d/%d ", m_ptr->exp, r_ptr->next_exp)); + char m_name[80]; + monster_type *m_ptr = &m_list[m_idx]; + + /* Get the monster's real name */ + monster_desc(m_name, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE); + + killer = format(_("%sã®èµ·ãããå°é", "an earthquake caused by %s"), m_name); } else { - strcat(buf, "xxx "); + killer = _("å°é", "an earthquake"); } -#ifdef JP - if (MON_CSLEEP(m_ptr)) strcat(buf,"ç¡ç "); - if (MON_STUNNED(m_ptr)) strcat(buf,"æ¦æ§ "); - if (MON_MONFEAR(m_ptr)) strcat(buf,"ææ "); - if (MON_CONFUSED(m_ptr)) strcat(buf,"æ··ä¹± "); - if (MON_INVULNER(m_ptr)) strcat(buf,"ç¡æµ "); -#else - if (MON_CSLEEP(m_ptr)) strcat(buf,"sleeping "); - if (MON_STUNNED(m_ptr)) strcat(buf,"stunned "); - if (MON_MONFEAR(m_ptr)) strcat(buf,"scared "); - if (MON_CONFUSED(m_ptr)) strcat(buf,"confused "); - if (MON_INVULNER(m_ptr)) strcat(buf,"invulnerable "); -#endif - buf[strlen(buf)-1] = '\0'; - prt(buf,0,0); + take_hit(DAMAGE_ATTACK, damage, killer, -1); + } + } - /* HACK : Add the line to message buffer */ - message_add(buf); - p_ptr->window |= (PW_MESSAGE); - window_stuff(); + /* Examine the quaked region */ + for (dy = -r; dy <= r; dy++) + { + for (dx = -r; dx <= r; dx++) + { + /* Extract the location */ + yy = cy + dy; + xx = cx + dx; - if (m_ptr->ml) move_cursor_relative(m_ptr->fy, m_ptr->fx); - inkey(); + /* Skip unaffected grids */ + if (!map[16+yy-cy][16+xx-cx]) continue; + c_ptr = &cave[yy][xx]; - Term_erase(0, 0, 255); + if (c_ptr->m_idx == p_ptr->riding) continue; - /* Learn everything about this monster */ - if (lore_do_probe(m_ptr->r_idx)) + /* Process monsters */ + if (c_ptr->m_idx) { - /* Get base name of monster */ - strcpy(buf, (r_name + r_ptr->name)); - -#ifdef JP - /* Note that we learnt some new flags -Mogami- */ - msg_format("%sã«ã¤ãã¦ããã«è©³ãããªã£ãæ°ãããã", buf); -#else - /* Pluralize it */ - plural_aux(buf); - - /* Note that we learnt some new flags -Mogami- */ - msg_format("You now know more about %s.", buf); -#endif - /* Clear -more- prompt */ - msg_print(NULL); - } + monster_type *m_ptr = &m_list[c_ptr->m_idx]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; - /* Probe worked */ - probe = TRUE; - } - } + /* Quest monsters */ + if (r_ptr->flags1 & RF1_QUESTOR) + { + /* No wall on quest monsters */ + map[16+yy-cy][16+xx-cx] = FALSE; - Term->scr->cu = cu; - Term->scr->cv = cv; - Term_fresh(); + continue; + } - /* Done */ - if (probe) - { - chg_virtue(V_KNOWLEDGE, 1); - msg_print(_("ããã§å ¨é¨ã§ãã", "That's all.")); - } + /* Most monsters cannot co-exist with rock */ + if (!(r_ptr->flags2 & (RF2_KILL_WALL)) && + !(r_ptr->flags2 & (RF2_PASS_WALL))) + { + char m_name[80]; - /* Result */ - return (probe); -} + /* Assume not safe */ + sn = 0; + /* Monster can move to escape the wall */ + if (!(r_ptr->flags1 & (RF1_NEVER_MOVE))) + { + /* Look for safety */ + for (i = 0; i < 8; i++) + { + y = yy + ddy_ddd[i]; + x = xx + ddx_ddd[i]; + /* Skip non-empty grids */ + if (!cave_empty_bold(y, x)) continue; -/*! - * @brief *ç ´å£*å¦çãè¡ã / The spell of destruction - * @param y1 ç ´å£ã®ä¸å¿Yåº§æ¨ - * @param x1 ç ´å£ã®ä¸å¿Xåº§æ¨ - * @param r ç ´å£ã®åå¾ - * @param in_generate ãã³ã¸ã§ã³ããã¢çæä¸ã®å¦çãªãã°TRUE - * @return å¹åããã£ãå ´åTRUEãè¿ã - * @details - *
- * This spell "deletes" monsters (instead of "killing" them). - * - * Later we may use one function for both "destruction" and - * "earthquake" by using the "full" to select "destruction". - *- */ -bool destroy_area(int y1, int x1, int r, bool in_generate) -{ - int y, x, k, t; - cave_type *c_ptr; - bool flag = FALSE; + /* Hack -- no safety on glyph of warding */ + if (is_glyph_grid(&cave[y][x])) continue; + if (is_explosive_rune_grid(&cave[y][x])) continue; - /* Prevent destruction of quest levels and town */ - if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level) - { - return (FALSE); - } + /* ... nor on the Pattern */ + if (pattern_tile(y, x)) continue; - /* Lose monster light */ - if (!in_generate) clear_mon_lite(); + /* Important -- Skip "quake" grids */ + if (map[16+y-cy][16+x-cx]) continue; - /* Big area of affect */ - for (y = (y1 - r); y <= (y1 + r); y++) - { - for (x = (x1 - r); x <= (x1 + r); x++) - { - /* Skip illegal grids */ - if (!in_bounds(y, x)) continue; + if (cave[y][x].m_idx) continue; + if (player_bold(y, x)) continue; - /* Extract the distance */ - k = distance(y1, x1, y, x); + /* Count "safe" grids */ + sn++; - /* Stay in the circle of death */ - if (k > r) continue; + /* Randomize choice */ + if (randint0(sn) > 0) continue; - /* Access the grid */ - c_ptr = &cave[y][x]; + /* Save the safe grid */ + sy = y; sx = x; + } + } - /* Lose room and vault */ - c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY); + /* Describe the monster */ + monster_desc(m_name, m_ptr, 0); - /* Lose light and knowledge */ - c_ptr->info &= ~(CAVE_MARK | CAVE_GLOW | CAVE_KNOWN); + /* Scream in pain */ + if (!ignore_unview || is_seen(m_ptr)) msg_format(_("%^sã¯è¦çã§æ³£ãããããï¼", "%^s wails out in pain!"), m_name); - if (!in_generate) /* Normal */ - { - /* Lose unsafety */ - c_ptr->info &= ~(CAVE_UNSAFE); + /* Take damage from the quake */ + damage = (sn ? damroll(4, 8) : (m_ptr->hp + 1)); - /* Hack -- Notice player affect */ - if (player_bold(y, x)) - { - /* Hurt the player later */ - flag = TRUE; + /* Monster is certainly awake */ + (void)set_monster_csleep(c_ptr->m_idx, 0); - /* Do not hurt this grid */ - continue; - } - } + /* Apply damage directly */ + m_ptr->hp -= damage; - /* Hack -- Skip the epicenter */ - if ((y == y1) && (x == x1)) continue; + /* Delete (not kill) "dead" monsters */ + if (m_ptr->hp < 0) + { + if (!ignore_unview || is_seen(m_ptr)) + msg_format(_("%^sã¯å²©ç³ã«åããã¦ãã¾ã£ãï¼", "%^s is embedded in the rock!"), m_name); - if (c_ptr->m_idx) - { - monster_type *m_ptr = &m_list[c_ptr->m_idx]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; + if (c_ptr->m_idx) + { + if (record_named_pet && is_pet(&m_list[c_ptr->m_idx]) && m_list[c_ptr->m_idx].nickname) + { + char m2_name[80]; - if (in_generate) /* In generation */ - { - /* Delete the monster (if any) */ - delete_monster(y, x); - } - else if (r_ptr->flags1 & RF1_QUESTOR) - { - /* Heal the monster */ - m_ptr->hp = m_ptr->maxhp; + monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE); + do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_EARTHQUAKE, m2_name); + } + } - /* Try to teleport away quest monsters */ - if (!teleport_away(c_ptr->m_idx, (r * 2) + 1, TELEPORT_DEC_VALOUR)) continue; - } - else - { - if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname) - { - char m_name[80]; - monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE); - do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_DESTROY, m_name); + delete_monster(yy, xx); + + /* No longer safe */ + sn = 0; } - /* Delete the monster (if any) */ - delete_monster(y, x); - } - } + /* Hack -- Escape from the rock */ + if (sn) + { + IDX m_idx_aux = cave[yy][xx].m_idx; - /* During generation, destroyed artifacts are "preserved" */ - if (preserve_mode || in_generate) - { - s16b this_o_idx, next_o_idx = 0; + /* Update the old location */ + cave[yy][xx].m_idx = 0; - /* Scan all objects in the grid */ - for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) - { - object_type *o_ptr; + /* Update the new location */ + cave[sy][sx].m_idx = m_idx_aux; - /* Acquire object */ - o_ptr = &o_list[this_o_idx]; + /* Move the monster */ + m_ptr->fy = sy; + m_ptr->fx = sx; - /* Acquire next object */ - next_o_idx = o_ptr->next_o_idx; + /* Update the monster (new location) */ + update_monster(m_idx, TRUE); - /* Hack -- Preserve unknown artifacts */ - if (object_is_fixed_artifact(o_ptr) && (!object_is_known(o_ptr) || in_generate)) - { - /* Mega-Hack -- Preserve the artifact */ - a_info[o_ptr->name1].cur_num = 0; + /* Redraw the old grid */ + lite_spot(yy, xx); - if (in_generate && cheat_peek) - { - char o_name[MAX_NLEN]; - object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE)); - msg_format(_("ä¼èª¬ã®ã¢ã¤ãã (%s) ã¯çæä¸ã«*ç ´å£*ãããã", "Artifact (%s) was *destroyed* during generation."), o_name); - } - } - else if (in_generate && cheat_peek && o_ptr->art_name) - { - msg_print(_("ã©ã³ãã ã»ã¢ã¼ãã£ãã¡ã¯ãã®1ã¤ã¯çæä¸ã«*ç ´å£*ãããã", - "One of the random artifacts was *destroyed* during generation.")); + /* Redraw the new grid */ + lite_spot(sy, sx); } } } + } + } - /* Delete objects */ - delete_object(y, x); + /* Lose monster light */ + clear_mon_lite(); - /* Destroy "non-permanent" grids */ - if (!cave_perma_grid(c_ptr)) + /* Examine the quaked region */ + for (dy = -r; dy <= r; dy++) + { + for (dx = -r; dx <= r; dx++) + { + /* Extract the location */ + yy = cy + dy; + xx = cx + dx; + + /* Skip unaffected grids */ + if (!map[16+yy-cy][16+xx-cx]) continue; + + /* Access the cave grid */ + c_ptr = &cave[yy][xx]; + + /* Paranoia -- never affect player */ +/* if (player_bold(yy, xx)) continue; */ + + /* Destroy location (if valid) */ + if (cave_valid_bold(yy, xx)) { + /* Delete objects */ + delete_object(yy, xx); + /* Wall (or floor) type */ - t = randint0(200); + t = cave_have_flag_bold(yy, xx, FF_PROJECT) ? randint0(100) : 200; - if (!in_generate) /* Normal */ + /* Granite */ + if (t < 20) { - if (t < 20) - { - /* Create granite wall */ - cave_set_feat(y, x, feat_granite); - } - else if (t < 70) - { - /* Create quartz vein */ - cave_set_feat(y, x, feat_quartz_vein); - } - else if (t < 100) - { - /* Create magma vein */ - cave_set_feat(y, x, feat_magma_vein); - } - else - { - /* Create floor */ - cave_set_feat(y, x, floor_type[randint0(100)]); - } + /* Create granite wall */ + cave_set_feat(yy, xx, feat_granite); } - else /* In generation */ + + /* Quartz */ + else if (t < 70) { - if (t < 20) - { - /* Create granite wall */ - place_extra_grid(c_ptr); - } - else if (t < 70) - { - /* Create quartz vein */ - c_ptr->feat = feat_quartz_vein; - } - else if (t < 100) - { - /* Create magma vein */ - c_ptr->feat = feat_magma_vein; - } - else - { - /* Create floor */ - place_floor_grid(c_ptr); - } + /* Create quartz vein */ + cave_set_feat(yy, xx, feat_quartz_vein); + } - /* Clear garbage of hidden trap or door */ - c_ptr->mimic = 0; + /* Magma */ + else if (t < 100) + { + /* Create magma vein */ + cave_set_feat(yy, xx, feat_magma_vein); + } + + /* Floor */ + else + { + /* Create floor */ + cave_set_feat(yy, xx, floor_type[randint0(100)]); } } } } - if (!in_generate) + + /* Process "re-glowing" */ + for (dy = -r; dy <= r; dy++) { - /* Process "re-glowing" */ - for (y = (y1 - r); y <= (y1 + r); y++) + for (dx = -r; dx <= r; dx++) { - for (x = (x1 - r); x <= (x1 + r); x++) - { - /* Skip illegal grids */ - if (!in_bounds(y, x)) continue; + /* Extract the location */ + yy = cy + dy; + xx = cx + dx; - /* Extract the distance */ - k = distance(y1, x1, y, x); + /* Skip illegal grids */ + if (!in_bounds(yy, xx)) continue; - /* Stay in the circle of death */ - if (k > r) continue; + /* Skip distant grids */ + if (distance(cy, cx, yy, xx) > r) continue; + c_ptr = &cave[yy][xx]; - /* Access the grid */ - c_ptr = &cave[y][x]; + if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW; + else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) + { + int ii, yyy, xxx; + cave_type *cc_ptr; - if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW; - else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) + for (ii = 0; ii < 9; ii++) { - int i, yy, xx; - cave_type *cc_ptr; - - for (i = 0; i < 9; i++) + yyy = yy + ddy_ddd[ii]; + xxx = xx + ddx_ddd[ii]; + if (!in_bounds2(yyy, xxx)) continue; + cc_ptr = &cave[yyy][xxx]; + if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW)) { - yy = y + ddy_ddd[i]; - xx = x + ddx_ddd[i]; - if (!in_bounds2(yy, xx)) continue; - cc_ptr = &cave[yy][xx]; - if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW)) - { - c_ptr->info |= CAVE_GLOW; - break; - } + c_ptr->info |= CAVE_GLOW; + break; } } } } + } - /* Hack -- Affect player */ - if (flag) - { - /* Message */ - msg_print(_("çãããããªéå ãçºçããï¼", "There is a searing blast of light!")); - - /* Blind the player */ - if (!p_ptr->resist_blind && !p_ptr->resist_lite) - { - /* Become blind */ - (void)set_blind(p_ptr->blind + 10 + randint1(10)); - } - } - forget_flow(); + /* Mega-Hack -- Forget the view and lite */ + p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE); - /* Mega-Hack -- Forget the view and lite */ - p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE); + p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS); - /* Update stuff */ - p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS); + /* Update the health bar */ + p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH); - /* Redraw map */ - p_ptr->redraw |= (PR_MAP); + p_ptr->redraw |= (PR_MAP); - /* Window stuff */ - p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); + p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); - if (p_ptr->special_defense & NINJA_S_STEALTH) - { - if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE); - } + if (p_ptr->special_defense & NINJA_S_STEALTH) + { + if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE); } /* Success */ return (TRUE); } - /*! - * @brief å°éå¦ç(ãµãã«ã¼ãã³) / + * @brief å°éå¦ç(ãã¬ã¤ã¤ã¼ã®ä¸å¿çºå) / * Induce an "earthquake" of the given radius at the given location. * @return å¹åããã£ãå ´åTRUEãè¿ã * @param cy ä¸å¿Yåº§æ¨ * @param cx ä¸å¿Xåº§æ¨ * @param r å¹æåå¾ - * @param m_idx å°éãèµ·ãããã¢ã³ã¹ã¿ã¼ID(0ãªãã°ãã¬ã¤ã¤ã¼) - * @details - *
- * - * This will turn some walls into floors and some floors into walls. - * - * The player will take damage and "jump" into a safe grid if possible, - * otherwise, he will "tunnel" through the rubble instantaneously. - * - * Monsters will take damage, and "jump" into a safe grid if possible, - * otherwise they will be "buried" in the rubble, disappearing from - * the level in the same way that they do when genocided. - * - * Note that thus the player and monsters (except eaters of walls and - * passers through walls) will never occupy the same grid as a wall. - * Note that as of now (2.7.8) no monster may occupy a "wall" grid, even - * for a single turn, unless that monster can pass_walls or kill_walls. - * This has allowed massive simplification of the "monster" code. - **/ -bool earthquake_aux(int cy, int cx, int r, int m_idx) +bool earthquake(POSITION cy, POSITION cx, POSITION r) { - int i, t, y, x, yy, xx, dy, dx; - int damage = 0; - int sn = 0; - POSITION sy = 0, sx = 0; - bool hurt = FALSE; - cave_type *c_ptr; - bool map[32][32]; + return earthquake_aux(cy, cx, r, 0); +} +/*! + * @brief ãããçç ´å¦ç / + * @return ãªã + */ +void discharge_minion(void) +{ + MONSTER_IDX i; + bool okay = TRUE; - /* Prevent destruction of quest levels and town */ - if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level) + for (i = 1; i < m_max; i++) { - return (FALSE); + monster_type *m_ptr = &m_list[i]; + if (!m_ptr->r_idx || !is_pet(m_ptr)) continue; + if (m_ptr->nickname) okay = FALSE; + } + if (!okay || p_ptr->riding) + { + if (!get_check(_("æ¬å½ã«å ¨ããããçç ´ãã¾ããï¼", "You will blast all pets. Are you sure? "))) + return; } + for (i = 1; i < m_max; i++) + { + HIT_POINT dam; + monster_type *m_ptr = &m_list[i]; + monster_race *r_ptr; - /* Paranoia -- Enforce maximum range */ - if (r > 12) r = 12; + if (!m_ptr->r_idx || !is_pet(m_ptr)) continue; + r_ptr = &r_info[m_ptr->r_idx]; - /* Clear the "maximal blast" area */ - for (y = 0; y < 32; y++) - { - for (x = 0; x < 32; x++) + /* Uniques resist discharging */ + if (r_ptr->flags1 & RF1_UNIQUE) { - map[y][x] = FALSE; + char m_name[80]; + monster_desc(m_name, m_ptr, 0x00); + msg_format(_("%sã¯çç ´ãããã®ãå«ãããåæã«èªåã®ä¸çã¸ã¨å¸°ã£ãã", "%^s resists to be blasted, and run away."), m_name); + delete_monster_idx(i); + continue; + } + dam = m_ptr->maxhp / 2; + if (dam > 100) dam = (dam-100)/2 + 100; + if (dam > 400) dam = (dam-400)/2 + 400; + if (dam > 800) dam = 800; + project(i, 2+(r_ptr->level/20), m_ptr->fy, + m_ptr->fx, dam, GF_PLASMA, + PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1); + + if (record_named_pet && m_ptr->nickname) + { + char m_name[80]; + + monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE); + do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_BLAST, m_name); } + + delete_monster_idx(i); } +} - /* Check around the epicenter */ - for (dy = -r; dy <= r; dy++) + +/*! + * @brief é¨å±å ¨ä½ãç §ãããµãã«ã¼ãã³ + * @return ãªã + * @details + *
+ * This routine clears the entire "temp" set. + * This routine will Perma-Lite all "temp" grids. + * This routine is used (only) by "lite_room()" + * Dark grids are illuminated. + * Also, process all affected monsters. + * + * SMART monsters always wake up when illuminated + * NORMAL monsters wake up 1/4 the time when illuminated + * STUPID monsters wake up 1/10 the time when illuminated + *+ */ +static void cave_temp_room_lite(void) +{ + int i; + + /* Clear them all */ + for (i = 0; i < temp_n; i++) { - for (dx = -r; dx <= r; dx++) - { - /* Extract the location */ - yy = cy + dy; - xx = cx + dx; + POSITION y = temp_y[i]; + POSITION x = temp_x[i]; - /* Skip illegal grids */ - if (!in_bounds(yy, xx)) continue; + cave_type *c_ptr = &cave[y][x]; - /* Skip distant grids */ - if (distance(cy, cx, yy, xx) > r) continue; + /* No longer in the array */ + c_ptr->info &= ~(CAVE_TEMP); - /* Access the grid */ - c_ptr = &cave[yy][xx]; + /* Update only non-CAVE_GLOW grids */ + /* if (c_ptr->info & (CAVE_GLOW)) continue; */ - /* Lose room and vault */ - c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE); + /* Perma-Lite */ + c_ptr->info |= (CAVE_GLOW); - /* Lose light and knowledge */ - c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK | CAVE_KNOWN); + /* Process affected monsters */ + if (c_ptr->m_idx) + { + int chance = 25; - /* Skip the epicenter */ - if (!dx && !dy) continue; + monster_type *m_ptr = &m_list[c_ptr->m_idx]; - /* Skip most grids */ - if (randint0(100) < 85) continue; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; + update_monster(c_ptr->m_idx, FALSE); - /* Damage this grid */ - map[16+yy-cy][16+xx-cx] = TRUE; + /* Stupid monsters rarely wake up */ + if (r_ptr->flags2 & (RF2_STUPID)) chance = 10; - /* Hack -- Take note of player damage */ - if (player_bold(yy, xx)) hurt = TRUE; + /* Smart monsters always wake up */ + if (r_ptr->flags2 & (RF2_SMART)) chance = 100; + + /* Sometimes monsters wake up */ + if (MON_CSLEEP(m_ptr) && (randint0(100) < chance)) + { + /* Wake up! */ + (void)set_monster_csleep(c_ptr->m_idx, 0); + + /* Notice the "waking up" */ + if (m_ptr->ml) + { + char m_name[80]; + monster_desc(m_name, m_ptr, 0); + msg_format(_("%^sãç®ãè¦ã¾ããã", "%^s wakes up."), m_name); + } + } } + + /* Note */ + note_spot(y, x); + + lite_spot(y, x); + + update_local_illumination(y, x); } - /* First, affect the player (if necessary) */ - if (hurt && !p_ptr->pass_wall && !p_ptr->kill_wall) - { - /* Check around the player */ - for (i = 0; i < 8; i++) - { - /* Access the location */ - y = p_ptr->y + ddy_ddd[i]; - x = p_ptr->x + ddx_ddd[i]; + /* None left */ + temp_n = 0; +} - /* Skip non-empty grids */ - if (!cave_empty_bold(y, x)) continue; - /* Important -- Skip "quake" grids */ - if (map[16+y-cy][16+x-cx]) continue; - if (cave[y][x].m_idx) continue; +/*! + * @brief é¨å±å ¨ä½ãæããããµãã«ã¼ãã³ + * @return ãªã + * @details + *
+ * This routine clears the entire "temp" set. + * This routine will "darken" all "temp" grids. + * In addition, some of these grids will be "unmarked". + * This routine is used (only) by "unlite_room()" + * Also, process all affected monsters + *+ */ +static void cave_temp_room_unlite(void) +{ + int i; - /* Count "safe" grids */ - sn++; + /* Clear them all */ + for (i = 0; i < temp_n; i++) + { + POSITION y = temp_y[i]; + POSITION x = temp_x[i]; + int j; - /* Randomize choice */ - if (randint0(sn) > 0) continue; + cave_type *c_ptr = &cave[y][x]; + bool do_dark = !is_mirror_grid(c_ptr); - /* Save the safe location */ - sy = y; sx = x; - } + /* No longer in the array */ + c_ptr->info &= ~(CAVE_TEMP); - /* Random message */ - switch (randint1(3)) + /* Darken the grid */ + if (do_dark) { - case 1: - { - msg_print(_("ãã³ã¸ã§ã³ã®å£ãå´©ããï¼", "The cave ceiling collapses!")); - break; - } - case 2: - { - msg_print(_("ãã³ã¸ã§ã³ã®åºãä¸èªç¶ã«ããæ²ãã£ãï¼", "The cave floor twists in an unnatural way!")); - break; - } - default: + if (dun_level || !is_daytime()) { - msg_print(_("ãã³ã¸ã§ã³ãæºããï¼å´©ãã岩ãé ã«éã£ã¦ããï¼", "The cave quakes! You are pummeled with debris!")); - break; - } - } + for (j = 0; j < 9; j++) + { + int by = y + ddy_ddd[j]; + int bx = x + ddx_ddd[j]; - /* Hurt the player a lot */ - if (!sn) - { - /* Message and damage */ - msg_print(_("ããªãã¯ã²ã©ãæªæãè² ã£ãï¼", "You are severely crushed!")); - damage = 200; - } + if (in_bounds2(by, bx)) + { + cave_type *cc_ptr = &cave[by][bx]; - /* Destroy the grid, and push the player to safety */ - else - { - /* Calculate results */ - switch (randint1(3)) - { - case 1: - { - msg_print(_("éã注ã岩ããã¾ãé¿ããï¼", "You nimbly dodge the blast!")); - damage = 0; - break; - } - case 2: - { - msg_print(_("岩ç³ãããªãã«ç´æãã!", "You are bashed by rubble!")); - damage = damroll(10, 4); - (void)set_stun(p_ptr->stun + randint1(50)); - break; - } - case 3: - { - msg_print(_("ããªãã¯åºã¨å£ã¨ã®éã«æã¾ãã¦ãã¾ã£ãï¼", "You are crushed between the floor and ceiling!")); - damage = damroll(10, 4); - (void)set_stun(p_ptr->stun + randint1(50)); - break; + if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW)) + { + do_dark = FALSE; + break; + } + } } - } - - /* Move the player to the safe location */ - (void)move_player_effect(sy, sx, MPE_DONT_PICKUP); - } - /* Important -- no wall on player */ - map[16+p_ptr->y-cy][16+p_ptr->x-cx] = FALSE; + if (!do_dark) continue; + } - /* Take some damage */ - if (damage) - { - cptr killer; + c_ptr->info &= ~(CAVE_GLOW); - if (m_idx) + /* Hack -- Forget "boring" grids */ + if (!have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_REMEMBER)) { - char m_name[80]; - monster_type *m_ptr = &m_list[m_idx]; - - /* Get the monster's real name */ - monster_desc(m_name, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE); + /* Forget the grid */ + if (!view_torch_grids) c_ptr->info &= ~(CAVE_MARK); - killer = format(_("%sã®èµ·ãããå°é", "an earthquake caused by %s"), m_name); + note_spot(y, x); } - else + + /* Process affected monsters */ + if (c_ptr->m_idx) { - killer = _("å°é", "an earthquake"); + update_monster(c_ptr->m_idx, FALSE); } - take_hit(DAMAGE_ATTACK, damage, killer, -1); + lite_spot(y, x); + + update_local_illumination(y, x); } } - /* Examine the quaked region */ - for (dy = -r; dy <= r; dy++) - { - for (dx = -r; dx <= r; dx++) - { - /* Extract the location */ - yy = cy + dy; - xx = cx + dx; + /* None left */ + temp_n = 0; +} - /* Skip unaffected grids */ - if (!map[16+yy-cy][16+xx-cx]) continue; - /* Access the grid */ - c_ptr = &cave[yy][xx]; +/*! + * @brief å¨è¾ºã«é¢æ°ãã¤ã³ã¿ã®æ¡ä»¶ã«è©²å½ããå°å½¢ãããã¤ããããè¨ç®ãã / Determine how much contiguous open space this grid is next to + * @param cy Yåº§æ¨ + * @param cx Xåº§æ¨ + * @param pass_bold å°å½¢æ¡ä»¶ãè¿ãé¢æ°ãã¤ã³ã¿ + * @return 該å½å°å½¢ã®æ° + */ +static int next_to_open(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION)) +{ + int i; + POSITION y, x; + int len = 0; + int blen = 0; - if (c_ptr->m_idx == p_ptr->riding) continue; + for (i = 0; i < 16; i++) + { + y = cy + ddy_cdd[i % 8]; + x = cx + ddx_cdd[i % 8]; - /* Process monsters */ - if (c_ptr->m_idx) + /* Found a wall, break the length */ + if (!pass_bold(y, x)) + { + /* Track best length */ + if (len > blen) { - monster_type *m_ptr = &m_list[c_ptr->m_idx]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; - - /* Quest monsters */ - if (r_ptr->flags1 & RF1_QUESTOR) - { - /* No wall on quest monsters */ - map[16+yy-cy][16+xx-cx] = FALSE; + blen = len; + } - continue; - } + len = 0; + } + else + { + len++; + } + } - /* Most monsters cannot co-exist with rock */ - if (!(r_ptr->flags2 & (RF2_KILL_WALL)) && - !(r_ptr->flags2 & (RF2_PASS_WALL))) - { - char m_name[80]; + return (MAX(len, blen)); +} - /* Assume not safe */ - sn = 0; +/*! + * @brief å¨è¾ºã«é¢æ°ãã¤ã³ã¿ã®æ¡ä»¶ã«è©²å½ããå°å½¢ãããã¤ããããè¨ç®ãã / Determine how much contiguous open space this grid is next to + * @param cy Yåº§æ¨ + * @param cx Xåº§æ¨ + * @param pass_bold å°å½¢æ¡ä»¶ãè¿ãé¢æ°ãã¤ã³ã¿ + * @return 該å½å°å½¢ã®æ° + */ +static int next_to_walls_adj(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION)) +{ + DIRECTION i; + POSITION y, x; + int c = 0; - /* Monster can move to escape the wall */ - if (!(r_ptr->flags1 & (RF1_NEVER_MOVE))) - { - /* Look for safety */ - for (i = 0; i < 8; i++) - { - /* Access the grid */ - y = yy + ddy_ddd[i]; - x = xx + ddx_ddd[i]; + for (i = 0; i < 8; i++) + { + y = cy + ddy_ddd[i]; + x = cx + ddx_ddd[i]; - /* Skip non-empty grids */ - if (!cave_empty_bold(y, x)) continue; + if (!pass_bold(y, x)) c++; + } - /* Hack -- no safety on glyph of warding */ - if (is_glyph_grid(&cave[y][x])) continue; - if (is_explosive_rune_grid(&cave[y][x])) continue; + return c; +} - /* ... nor on the Pattern */ - if (pattern_tile(y, x)) continue; - /* Important -- Skip "quake" grids */ - if (map[16+y-cy][16+x-cx]) continue; +/*! + * @brief é¨å±å ã«ããä¸ç¹ã®å¨å²ã«è©²å½ããå°å½¢æ°ãããã¤ããããã°ãã¼ãã«å¤æ°temp_nã«è¿ã / Aux function -- see below + * @param y é¨å±å ã®y座æ¨1ç¹ + * @param x é¨å±å ã®x座æ¨1ç¹ + * @param only_room é¨å±å å°å½¢ã®ã¿ããã§ãã¯å¯¾è±¡ã«ãããªãã° TRUE + * @param pass_bold å°å½¢æ¡ä»¶ãè¿ãé¢æ°ãã¤ã³ã¿ + * @return 該å½å°å½¢ã®æ° + */ +static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION)) +{ + cave_type *c_ptr; - if (cave[y][x].m_idx) continue; - if (player_bold(y, x)) continue; + /* Get the grid */ + c_ptr = &cave[y][x]; - /* Count "safe" grids */ - sn++; + /* Avoid infinite recursion */ + if (c_ptr->info & (CAVE_TEMP)) return; - /* Randomize choice */ - if (randint0(sn) > 0) continue; + /* Do not "leave" the current room */ + if (!(c_ptr->info & (CAVE_ROOM))) + { + if (only_room) return; - /* Save the safe grid */ - sy = y; sx = x; - } - } + /* Verify */ + if (!in_bounds2(y, x)) return; - /* Describe the monster */ - monster_desc(m_name, m_ptr, 0); + /* Do not exceed the maximum spell range */ + if (distance(p_ptr->y, p_ptr->x, y, x) > MAX_RANGE) return; - /* Scream in pain */ - if (!ignore_unview || is_seen(m_ptr)) msg_format(_("%^sã¯è¦çã§æ³£ãããããï¼", "%^s wails out in pain!"), m_name); + /* Verify this grid */ + /* + * The reason why it is ==6 instead of >5 is that 8 is impossible + * due to the check for cave_bold above. + * 7 lights dead-end corridors (you need to do this for the + * checkboard interesting rooms, so that the boundary is lit + * properly. + * This leaves only a check for 6 bounding walls! + */ + if (in_bounds(y, x) && pass_bold(y, x) && + (next_to_walls_adj(y, x, pass_bold) == 6) && (next_to_open(y, x, pass_bold) <= 1)) return; + } - /* Take damage from the quake */ - damage = (sn ? damroll(4, 8) : (m_ptr->hp + 1)); + /* Paranoia -- verify space */ + if (temp_n == TEMP_MAX) return; - /* Monster is certainly awake */ - (void)set_monster_csleep(c_ptr->m_idx, 0); + /* Mark the grid as "seen" */ + c_ptr->info |= (CAVE_TEMP); - /* Apply damage directly */ - m_ptr->hp -= damage; + /* Add it to the "seen" set */ + temp_y[temp_n] = y; + temp_x[temp_n] = x; + temp_n++; +} - /* Delete (not kill) "dead" monsters */ - if (m_ptr->hp < 0) - { - /* Message */ - if (!ignore_unview || is_seen(m_ptr)) - msg_format(_("%^sã¯å²©ç³ã«åããã¦ãã¾ã£ãï¼", "%^s is embedded in the rock!"), m_name); +/*! + * @brief æå®ã®ãã¹ãå ãéãã(LOSãã©ã°ãæã¤ã)ãè¿ãã / Aux function -- see below + * @param y æå®Yåº§æ¨ + * @param x æå®Xåº§æ¨ + * @return å ãéããªãã°trueãè¿ãã + */ +static bool cave_pass_lite_bold(POSITION y, POSITION x) +{ + return cave_los_bold(y, x); +} - if (c_ptr->m_idx) - { - if (record_named_pet && is_pet(&m_list[c_ptr->m_idx]) && m_list[c_ptr->m_idx].nickname) - { - char m2_name[80]; +/*! + * @brief é¨å±å ã«ããä¸ç¹ã®å¨å²ãããã¤å ãéãããã°ãã¼ãã«å¤æ°temp_nã«è¿ã / Aux function -- see below + * @param y æå®Yåº§æ¨ + * @param x æå®Xåº§æ¨ + * @return ãªã + */ +static void cave_temp_lite_room_aux(POSITION y, POSITION x) +{ + cave_temp_room_aux(y, x, FALSE, cave_pass_lite_bold); +} - monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE); - do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_EARTHQUAKE, m2_name); - } - } +/*! + * @brief æå®ã®ãã¹ãå ãéããå°ç·ã®ã¿ãéãããè¿ãã / Aux function -- see below + * @param y æå®Yåº§æ¨ + * @param x æå®Xåº§æ¨ + * @return å°ç·ãéããªãã°trueãè¿ãã + */ +static bool cave_pass_dark_bold(POSITION y, POSITION x) +{ + return cave_have_flag_bold(y, x, FF_PROJECT); +} - /* Delete the monster */ - delete_monster(yy, xx); - /* No longer safe */ - sn = 0; - } +/*! + * @brief é¨å±å ã«ããä¸ç¹ã®å¨å²ãããã¤å°ç·ãéãããã°ãã¼ãã«å¤æ°temp_nã«è¿ã / Aux function -- see below + * @param y æå®Yåº§æ¨ + * @param x æå®Xåº§æ¨ + * @return ãªã + */ +static void cave_temp_unlite_room_aux(POSITION y, POSITION x) +{ + cave_temp_room_aux(y, x, TRUE, cave_pass_dark_bold); +} - /* Hack -- Escape from the rock */ - if (sn) - { - IDX m_idx_aux = cave[yy][xx].m_idx; - /* Update the old location */ - cave[yy][xx].m_idx = 0; +/*! + * @brief æå®ãããé¨å±å ãç §ãã / Illuminate any room containing the given location. + * @param y1 æå®Yåº§æ¨ + * @param x1 æå®Xåº§æ¨ + * @return ãªã + */ +void lite_room(POSITION y1, POSITION x1) +{ + int i; + POSITION x, y; - /* Update the new location */ - cave[sy][sx].m_idx = m_idx_aux; + /* Add the initial grid */ + cave_temp_lite_room_aux(y1, x1); - /* Move the monster */ - m_ptr->fy = sy; - m_ptr->fx = sx; + /* While grids are in the queue, add their neighbors */ + for (i = 0; i < temp_n; i++) + { + x = temp_x[i], y = temp_y[i]; - /* Update the monster (new location) */ - update_mon(m_idx, TRUE); + /* Walls get lit, but stop light */ + if (!cave_pass_lite_bold(y, x)) continue; - /* Redraw the old grid */ - lite_spot(yy, xx); + /* Spread adjacent */ + cave_temp_lite_room_aux(y + 1, x); + cave_temp_lite_room_aux(y - 1, x); + cave_temp_lite_room_aux(y, x + 1); + cave_temp_lite_room_aux(y, x - 1); - /* Redraw the new grid */ - lite_spot(sy, sx); - } - } - } - } + /* Spread diagonal */ + cave_temp_lite_room_aux(y + 1, x + 1); + cave_temp_lite_room_aux(y - 1, x - 1); + cave_temp_lite_room_aux(y - 1, x + 1); + cave_temp_lite_room_aux(y + 1, x - 1); } - /* Lose monster light */ - clear_mon_lite(); + /* Now, lite them all up at once */ + cave_temp_room_lite(); - /* Examine the quaked region */ - for (dy = -r; dy <= r; dy++) + if (p_ptr->special_defense & NINJA_S_STEALTH) { - for (dx = -r; dx <= r; dx++) - { - /* Extract the location */ - yy = cy + dy; - xx = cx + dx; - - /* Skip unaffected grids */ - if (!map[16+yy-cy][16+xx-cx]) continue; - - /* Access the cave grid */ - c_ptr = &cave[yy][xx]; + if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE); + } +} - /* Paranoia -- never affect player */ -/* if (player_bold(yy, xx)) continue; */ - /* Destroy location (if valid) */ - if (cave_valid_bold(yy, xx)) - { - /* Delete objects */ - delete_object(yy, xx); +/*! + * @brief æå®ãããé¨å±å ãæããã / Darken all rooms containing the given location + * @param y1 æå®Yåº§æ¨ + * @param x1 æå®Xåº§æ¨ + * @return ãªã + */ +void unlite_room(POSITION y1, POSITION x1) +{ + int i; + POSITION x, y; - /* Wall (or floor) type */ - t = cave_have_flag_bold(yy, xx, FF_PROJECT) ? randint0(100) : 200; + /* Add the initial grid */ + cave_temp_unlite_room_aux(y1, x1); - /* Granite */ - if (t < 20) - { - /* Create granite wall */ - cave_set_feat(yy, xx, feat_granite); - } + /* Spread, breadth first */ + for (i = 0; i < temp_n; i++) + { + x = temp_x[i], y = temp_y[i]; - /* Quartz */ - else if (t < 70) - { - /* Create quartz vein */ - cave_set_feat(yy, xx, feat_quartz_vein); - } + /* Walls get dark, but stop darkness */ + if (!cave_pass_dark_bold(y, x)) continue; - /* Magma */ - else if (t < 100) - { - /* Create magma vein */ - cave_set_feat(yy, xx, feat_magma_vein); - } + /* Spread adjacent */ + cave_temp_unlite_room_aux(y + 1, x); + cave_temp_unlite_room_aux(y - 1, x); + cave_temp_unlite_room_aux(y, x + 1); + cave_temp_unlite_room_aux(y, x - 1); - /* Floor */ - else - { - /* Create floor */ - cave_set_feat(yy, xx, floor_type[randint0(100)]); - } - } - } + /* Spread diagonal */ + cave_temp_unlite_room_aux(y + 1, x + 1); + cave_temp_unlite_room_aux(y - 1, x - 1); + cave_temp_unlite_room_aux(y - 1, x + 1); + cave_temp_unlite_room_aux(y + 1, x - 1); } + /* Now, darken them all at once */ + cave_temp_room_unlite(); +} - /* Process "re-glowing" */ - for (dy = -r; dy <= r; dy++) - { - for (dx = -r; dx <= r; dx++) - { - /* Extract the location */ - yy = cy + dy; - xx = cx + dx; - - /* Skip illegal grids */ - if (!in_bounds(yy, xx)) continue; - - /* Skip distant grids */ - if (distance(cy, cx, yy, xx) > r) continue; - /* Access the grid */ - c_ptr = &cave[yy][xx]; - if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW; - else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) - { - int ii, yyy, xxx; - cave_type *cc_ptr; +/*! + * @brief ãã¬ã¤ã¤ã¼ä½ç½®ãä¸å¿ã«LITE_WEAKå±æ§ãéããç §æå¦çãè¡ã / Hack -- call light around the player Affect all monsters in the projection radius + * @param dam å¨å + * @param rad å¹æåå¾ + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool lite_area(HIT_POINT dam, POSITION rad) +{ + BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL; - for (ii = 0; ii < 9; ii++) - { - yyy = yy + ddy_ddd[ii]; - xxx = xx + ddx_ddd[ii]; - if (!in_bounds2(yyy, xxx)) continue; - cc_ptr = &cave[yyy][xxx]; - if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW)) - { - c_ptr->info |= CAVE_GLOW; - break; - } - } - } - } + if (d_info[dungeon_type].flags1 & DF1_DARKNESS) + { + msg_print(_("ãã³ã¸ã§ã³ãå ãå¸åããã", "The darkness of this dungeon absorb your light.")); + return FALSE; } + /* Hack -- Message */ + if (!p_ptr->blind) + { + msg_print(_("ç½ãå ã辺ããè¦ã£ãã", "You are surrounded by a white light.")); + } - /* Mega-Hack -- Forget the view and lite */ - p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE); + /* Hook into the "project()" function */ + (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_LITE_WEAK, flg, -1); - /* Update stuff */ - p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS); + /* Lite up the room */ + lite_room(p_ptr->y, p_ptr->x); - /* Update the health bar */ - p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH); + /* Assume seen */ + return (TRUE); +} - /* Redraw map */ - p_ptr->redraw |= (PR_MAP); - /* Window stuff */ - p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); +/*! + * @brief ãã¬ã¤ã¤ã¼ä½ç½®ãä¸å¿ã«LITE_DARKå±æ§ãéããæ¶ç¯å¦çãè¡ã / Hack -- call light around the player Affect all monsters in the projection radius + * @param dam å¨å + * @param rad å¹æåå¾ + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool unlite_area(HIT_POINT dam, POSITION rad) +{ + BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL; - if (p_ptr->special_defense & NINJA_S_STEALTH) + /* Hack -- Message */ + if (!p_ptr->blind) { - if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE); + msg_print(_("æéã辺ããè¦ã£ãã", "Darkness surrounds you.")); } - /* Success */ + /* Hook into the "project()" function */ + (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_DARK_WEAK, flg, -1); + + /* Lite up the room */ + unlite_room(p_ptr->y, p_ptr->x); + + /* Assume seen */ return (TRUE); } -/*! - * @brief å°éå¦ç(ãã¬ã¤ã¤ã¼ã®ä¸å¿çºå) / - * Induce an "earthquake" of the given radius at the given location. - * @return å¹åããã£ãå ´åTRUEãè¿ã - * @param cy ä¸å¿Yåº§æ¨ - * @param cx ä¸å¿Xåº§æ¨ - * @param r å¹æåå¾ - */ -bool earthquake(int cy, int cx, int r) -{ - return earthquake_aux(cy, cx, r, 0); -} + /*! - * @brief ãããçç ´å¦ç / - * @return ãªã + * @brief ãã¼ã«ç³»ã¹ãã«ã®çºå / Cast a ball spell + * @param typ å¹æå±æ§ + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param dam å¨å + * @param rad åå¾ + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + * @details + *
+ * Stop if we hit a monster, act as a "ball" + * Allow "target" mode to pass over monsters + * Affect grids, objects, and monsters + **/ -void discharge_minion(void) +bool fire_ball(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad) { - int i; - bool okay = TRUE; + POSITION tx, ty; - for (i = 1; i < m_max; i++) - { - monster_type *m_ptr = &m_list[i]; - if (!m_ptr->r_idx || !is_pet(m_ptr)) continue; - if (m_ptr->nickname) okay = FALSE; - } - if (!okay || p_ptr->riding) + BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; + + if (typ == GF_CHARM_LIVING) flg|= PROJECT_HIDE; + /* Use the given direction */ + tx = p_ptr->x + 99 * ddx[dir]; + ty = p_ptr->y + 99 * ddy[dir]; + + /* Hack -- Use an actual "target" */ + if ((dir == 5) && target_okay()) { - if (!get_check(_("æ¬å½ã«å ¨ããããçç ´ãã¾ããï¼", "You will blast all pets. Are you sure? "))) - return; + flg &= ~(PROJECT_STOP); + tx = target_col; + ty = target_row; } - for (i = 1; i < m_max; i++) - { - int dam; - monster_type *m_ptr = &m_list[i]; - monster_race *r_ptr; - if (!m_ptr->r_idx || !is_pet(m_ptr)) continue; - r_ptr = &r_info[m_ptr->r_idx]; + /* Analyze the "dir" and the "target". Hurt items on floor. */ + return (project(0, rad, ty, tx, dam, typ, flg, -1)); +} - /* Uniques resist discharging */ - if (r_ptr->flags1 & RF1_UNIQUE) - { - char m_name[80]; - monster_desc(m_name, m_ptr, 0x00); - msg_format(_("%sã¯çç ´ãããã®ãå«ãããåæã«èªåã®ä¸çã¸ã¨å¸°ã£ãã", "%^s resists to be blasted, and run away."), m_name); - delete_monster_idx(i); - continue; - } - dam = m_ptr->maxhp / 2; - if (dam > 100) dam = (dam-100)/2 + 100; - if (dam > 400) dam = (dam-400)/2 + 400; - if (dam > 800) dam = 800; - project(i, 2+(r_ptr->level/20), m_ptr->fy, - m_ptr->fx, dam, GF_PLASMA, - PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1); +/*! +* @brief ãã¬ã¹ç³»ã¹ãã«ã®çºå / Cast a breath spell +* @param typ å¹æå±æ§ +* @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) +* @param dam å¨å +* @param rad åå¾ +* @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã +* @details +*
+* Stop if we hit a monster, act as a "ball" +* Allow "target" mode to pass over monsters +* Affect grids, objects, and monsters +*+*/ +bool fire_breath(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad) +{ + return fire_ball(typ, dir, dam, -rad); +} - if (record_named_pet && m_ptr->nickname) - { - char m_name[80]; - monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE); - do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_BLAST, m_name); - } +/*! + * @brief ãã±ããç³»ã¹ãã«ã®çºå(詳細ãªå·®ã¯ç¢ºèªä¸) / Cast a ball spell + * @param typ å¹æå±æ§ + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param dam å¨å + * @param rad åå¾ + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + * @details + *
+ * Stop if we hit a monster, act as a "ball" + * Allow "target" mode to pass over monsters + * Affect grids, objects, and monsters + *+ */ +bool fire_rocket(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad) +{ + POSITION tx, ty; + BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; - delete_monster_idx(i); + /* Use the given direction */ + tx = p_ptr->x + 99 * ddx[dir]; + ty = p_ptr->y + 99 * ddy[dir]; + + /* Hack -- Use an actual "target" */ + if ((dir == 5) && target_okay()) + { + tx = target_col; + ty = target_row; } + + /* Analyze the "dir" and the "target". Hurt items on floor. */ + return (project(0, rad, ty, tx, dam, typ, flg, -1)); } /*! - * @brief é¨å±å ¨ä½ãç §ãããµãã«ã¼ãã³ - * @return ãªã + * @brief ãã¼ã«(ãã¤ã)ç³»ã¹ãã«ã®çºå / Cast a ball spell + * @param typ å¹æå±æ§ + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param dam å¨å + * @param rad åå¾ + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã * @details *
- * This routine clears the entire "temp" set. - * This routine will Perma-Lite all "temp" grids. - * This routine is used (only) by "lite_room()" - * Dark grids are illuminated. - * Also, process all affected monsters. - * - * SMART monsters always wake up when illuminated - * NORMAL monsters wake up 1/4 the time when illuminated - * STUPID monsters wake up 1/10 the time when illuminated + * Stop if we hit a monster, act as a "ball" + * Allow "target" mode to pass over monsters + * Affect grids, objects, and monsters **/ -static void cave_temp_room_lite(void) +bool fire_ball_hide(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad) { - int i; - - /* Clear them all */ - for (i = 0; i < temp_n; i++) - { - int y = temp_y[i]; - int x = temp_x[i]; + POSITION tx, ty; + BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE; - cave_type *c_ptr = &cave[y][x]; + /* Use the given direction */ + tx = p_ptr->x + 99 * ddx[dir]; + ty = p_ptr->y + 99 * ddy[dir]; - /* No longer in the array */ - c_ptr->info &= ~(CAVE_TEMP); + /* Hack -- Use an actual "target" */ + if ((dir == 5) && target_okay()) + { + flg &= ~(PROJECT_STOP); + tx = target_col; + ty = target_row; + } - /* Update only non-CAVE_GLOW grids */ - /* if (c_ptr->info & (CAVE_GLOW)) continue; */ + /* Analyze the "dir" and the "target". Hurt items on floor. */ + return (project(0, rad, ty, tx, dam, typ, flg, -1)); +} - /* Perma-Lite */ - c_ptr->info |= (CAVE_GLOW); - /* Process affected monsters */ - if (c_ptr->m_idx) - { - int chance = 25; +/*! + * @brief ã¡ããªç³»ã¹ãã«ã®çºå / Cast a meteor spell + * @param who ã¹ãºã«è© å±è ã®ã¢ã³ã¹ã¿ã¼ID(0=ãã¬ã¤ã¤ã¼) + * @param typ å¹æå±æ§ + * @param dam å¨å + * @param rad åå¾ + * @param y ä¸å¿ç¹Yåº§æ¨ + * @param x ä¸å¿ç¹Xåº§æ¨ + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + * @details + *
+ * Cast a meteor spell, defined as a ball spell cast by an arbitary monster, + * player, or outside source, that starts out at an arbitrary location, and + * leaving no trail from the "caster" to the target. This function is + * especially useful for bombardments and similar. -LM- + * Option to hurt the player. + *+ */ +bool fire_meteor(MONSTER_IDX who, EFFECT_ID typ, POSITION y, POSITION x, HIT_POINT dam, POSITION rad) +{ + BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; - monster_type *m_ptr = &m_list[c_ptr->m_idx]; + /* Analyze the "target" and the caster. */ + return (project(who, rad, y, x, dam, typ, flg, -1)); +} - monster_race *r_ptr = &r_info[m_ptr->r_idx]; - /* Update the monster */ - update_mon(c_ptr->m_idx, FALSE); +/*! + * @brief ãã©ã¹ãç³»ã¹ãã«ã®çºå / Cast a blast spell + * @param typ å¹æå±æ§ + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param dd å¨åãã¤ã¹æ° + * @param ds å¨åãã¤ã¹ç® + * @param num åºæ¬åæ° + * @param dev åæ°åæ£ + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool fire_blast(EFFECT_ID typ, DIRECTION dir, int dd, int ds, int num, int dev) +{ + POSITION ly, lx; + int ld; + POSITION ty, tx, y, x; + int i; - /* Stupid monsters rarely wake up */ - if (r_ptr->flags2 & (RF2_STUPID)) chance = 10; + BIT_FLAGS flg = PROJECT_FAST | PROJECT_THRU | PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE | PROJECT_GRID; - /* Smart monsters always wake up */ - if (r_ptr->flags2 & (RF2_SMART)) chance = 100; + /* Assume okay */ + bool result = TRUE; - /* Sometimes monsters wake up */ - if (MON_CSLEEP(m_ptr) && (randint0(100) < chance)) - { - /* Wake up! */ - (void)set_monster_csleep(c_ptr->m_idx, 0); + /* Use the given direction */ + if (dir != 5) + { + ly = ty = p_ptr->y + 20 * ddy[dir]; + lx = tx = p_ptr->x + 20 * ddx[dir]; + } - /* Notice the "waking up" */ - if (m_ptr->ml) - { - char m_name[80]; + /* Use an actual "target" */ + else /* if (dir == 5) */ + { + tx = target_col; + ty = target_row; - /* Acquire the monster name */ - monster_desc(m_name, m_ptr, 0); + lx = 20 * (tx - p_ptr->x) + p_ptr->x; + ly = 20 * (ty - p_ptr->y) + p_ptr->y; + } - /* Dump a message */ - msg_format(_("%^sãç®ãè¦ã¾ããã", "%^s wakes up."), m_name); - } - } - } + ld = distance(p_ptr->y, p_ptr->x, ly, lx); - /* Note */ - note_spot(y, x); + /* Blast */ + for (i = 0; i < num; i++) + { + while (1) + { + /* Get targets for some bolts */ + y = rand_spread(ly, ld * dev / 20); + x = rand_spread(lx, ld * dev / 20); - /* Redraw */ - lite_spot(y, x); + if (distance(ly, lx, y, x) <= ld * dev / 20) break; + } - update_local_illumination(y, x); + /* Analyze the "dir" and the "target". */ + if (!project(0, 0, y, x, damroll(dd, ds), typ, flg, -1)) + { + result = FALSE; + } } - /* None left */ - temp_n = 0; + return (result); } - /*! - * @brief é¨å±å ¨ä½ãæããããµãã«ã¼ãã³ - * @return ãªã - * @details - *
- * This routine clears the entire "temp" set. - * This routine will "darken" all "temp" grids. - * In addition, some of these grids will be "unmarked". - * This routine is used (only) by "unlite_room()" - * Also, process all affected monsters - *+ * @brief ã¢ã³ã¹ã¿ã¼ã¨ã®ä½ç½®äº¤æå¦ç / Switch position with a monster. + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -static void cave_temp_room_unlite(void) +bool teleport_swap(DIRECTION dir) { - int i; + POSITION tx, ty; + cave_type* c_ptr; + monster_type* m_ptr; + monster_race* r_ptr; - /* Clear them all */ - for (i = 0; i < temp_n; i++) + if ((dir == 5) && target_okay()) { - int y = temp_y[i]; - int x = temp_x[i]; - int j; + tx = target_col; + ty = target_row; + } + else + { + tx = p_ptr->x + ddx[dir]; + ty = p_ptr->y + ddy[dir]; + } + c_ptr = &cave[ty][tx]; - cave_type *c_ptr = &cave[y][x]; - bool do_dark = !is_mirror_grid(c_ptr); + if (p_ptr->anti_tele) + { + msg_print(_("ä¸æè°ãªåããã¬ãã¼ããé²ãã ï¼", "A mysterious force prevents you from teleporting!")); + return FALSE; + } - /* No longer in the array */ - c_ptr->info &= ~(CAVE_TEMP); + if (!c_ptr->m_idx || (c_ptr->m_idx == p_ptr->riding)) + { + msg_print(_("ããã¨ã¯å ´æã交æã§ãã¾ããã", "You can't trade places with that!")); - /* Darken the grid */ - if (do_dark) - { - if (dun_level || !is_daytime()) - { - for (j = 0; j < 9; j++) - { - int by = y + ddy_ddd[j]; - int bx = x + ddx_ddd[j]; + /* Failure */ + return FALSE; + } - if (in_bounds2(by, bx)) - { - cave_type *cc_ptr = &cave[by][bx]; + if ((c_ptr->info & CAVE_ICKY) || (distance(ty, tx, p_ptr->y, p_ptr->x) > p_ptr->lev * 3 / 2 + 10)) + { + msg_print(_("失æããã", "Failed to swap.")); - if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW)) - { - do_dark = FALSE; - break; - } - } - } + /* Failure */ + return FALSE; + } - if (!do_dark) continue; - } + m_ptr = &m_list[c_ptr->m_idx]; + r_ptr = &r_info[m_ptr->r_idx]; - c_ptr->info &= ~(CAVE_GLOW); + (void)set_monster_csleep(c_ptr->m_idx, 0); - /* Hack -- Forget "boring" grids */ - if (!have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_REMEMBER)) - { - /* Forget the grid */ - if (!view_torch_grids) c_ptr->info &= ~(CAVE_MARK); + if (r_ptr->flagsr & RFR_RES_TELE) + { + msg_print(_("ãã¬ãã¼ããéªéãããï¼", "Your teleportation is blocked!")); - /* Notice */ - note_spot(y, x); - } + if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE; - /* Process affected monsters */ - if (c_ptr->m_idx) - { - /* Update the monster */ - update_mon(c_ptr->m_idx, FALSE); - } + /* Failure */ + return FALSE; + } - /* Redraw */ - lite_spot(y, x); + sound(SOUND_TELEPORT); - update_local_illumination(y, x); - } - } + /* Swap the player and monster */ + (void)move_player_effect(ty, tx, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP); - /* None left */ - temp_n = 0; + /* Success */ + return TRUE; } /*! - * @brief å¨è¾ºã«é¢æ°ãã¤ã³ã¿ã®æ¡ä»¶ã«è©²å½ããå°å½¢ãããã¤ããããè¨ç®ãã / Determine how much contiguous open space this grid is next to - * @param cy Yåº§æ¨ - * @param cx Xåº§æ¨ - * @param pass_bold å°å½¢æ¡ä»¶ãè¿ãé¢æ°ãã¤ã³ã¿ - * @return 該å½å°å½¢ã®æ° + * @brief æå®æ¹åã«é£ã³éå ·ãé£ã°ãï¼ãã©ã°ä»»ææå®ï¼ / Hack -- apply a "projection()" in a direction (or at the target) + * @param typ å¹æå±æ§ + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param dam å¨å + * @param flg ãã©ã° + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -static int next_to_open(int cy, int cx, bool (*pass_bold)(int, int)) +bool project_hook(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg) { - int i; + int tx, ty; - int y, x; + /* Pass through the target if needed */ + flg |= (PROJECT_THRU); - int len = 0; - int blen = 0; + /* Use the given direction */ + tx = p_ptr->x + ddx[dir]; + ty = p_ptr->y + ddy[dir]; - for (i = 0; i < 16; i++) + /* Hack -- Use an actual "target" */ + if ((dir == 5) && target_okay()) { - y = cy + ddy_cdd[i % 8]; - x = cx + ddx_cdd[i % 8]; + tx = target_col; + ty = target_row; + } - /* Found a wall, break the length */ - if (!pass_bold(y, x)) - { - /* Track best length */ - if (len > blen) - { - blen = len; - } + /* Analyze the "dir" and the "target", do NOT explode */ + return (project(0, 0, ty, tx, dam, typ, flg, -1)); +} - len = 0; - } - else - { - len++; - } + +/*! + * @brief ãã«ãç³»ã¹ãã«ã®çºå / Cast a bolt spell. + * @param typ å¹æå±æ§ + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param dam å¨å + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + * @details + *
+ * Stop if we hit a monster, as a "bolt". + * Affect monsters and grids (not objects). + *+ */ +bool fire_bolt(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam) +{ + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID; + if (typ != GF_ARROW) flg |= PROJECT_REFLECTABLE; + return (project_hook(typ, dir, dam, flg)); +} + + +/*! + * @brief ãã¼ã ç³»ã¹ãã«ã®çºå / Cast a beam spell. + * @param typ å¹æå±æ§ + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param dam å¨å + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + * @details + *
+ * Pass through monsters, as a "beam". + * Affect monsters, grids and objects. + *+ */ +bool fire_beam(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam) +{ + BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM; + return (project_hook(typ, dir, dam, flg)); +} + + +/*! + * @brief 確çã«å¿ãããã«ãç³»/ãã¼ã ç³»ã¹ãã«ã®çºå / Cast a bolt spell, or rarely, a beam spell. + * @param prob ãã¼ã åãã確ç(%) + * @param typ å¹æå±æ§ + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param dam å¨å + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + * @details + *
+ * Pass through monsters, as a "beam". + * Affect monsters, grids and objects. + *+ */ +bool fire_bolt_or_beam(PERCENTAGE prob, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam) +{ + if (randint0(100) < prob) + { + return (fire_beam(typ, dir, dam)); + } + else + { + return (fire_bolt(typ, dir, dam)); } +} - return (MAX(len, blen)); +/*! + * @brief LITE_WEAKå±æ§ã«ããå æºãã¼ã å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param dam å¨å + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool lite_line(DIRECTION dir, HIT_POINT dam) +{ + BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL; + return (project_hook(GF_LITE_WEAK, dir, dam, flg)); +} + +/*! + * @brief è¡°å¼±ãã«ãå¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param dam å¨å + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool hypodynamic_bolt(DIRECTION dir, HIT_POINT dam) +{ + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; + return (project_hook(GF_HYPODYNAMIA, dir, dam, flg)); } /*! - * @brief å¨è¾ºã«é¢æ°ãã¤ã³ã¿ã®æ¡ä»¶ã«è©²å½ããå°å½¢ãããã¤ããããè¨ç®ãã / Determine how much contiguous open space this grid is next to - * @param cy Yåº§æ¨ - * @param cx Xåº§æ¨ - * @param pass_bold å°å½¢æ¡ä»¶ãè¿ãé¢æ°ãã¤ã³ã¿ - * @return 該å½å°å½¢ã®æ° + * @brief 岩ç³æº¶è§£å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param dam å¨å + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -static int next_to_walls_adj(int cy, int cx, bool (*pass_bold)(int, int)) +bool wall_to_mud(DIRECTION dir, HIT_POINT dam) { - int i; - - int y, x; - - int c = 0; - - for (i = 0; i < 8; i++) - { - y = cy + ddy_ddd[i]; - x = cx + ddx_ddd[i]; - - if (!pass_bold(y, x)) c++; - } - - return c; + BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; + return (project_hook(GF_KILL_WALL, dir, dam, flg)); } - /*! - * @brief é¨å±å ã«ããä¸ç¹ã®å¨å²ã«è©²å½ããå°å½¢æ°ãããã¤ããããã°ãã¼ãã«å¤æ°temp_nã«è¿ã / Aux function -- see below - * @param y é¨å±å ã®y座æ¨1ç¹ - * @param x é¨å±å ã®x座æ¨1ç¹ - * @param only_room é¨å±å å°å½¢ã®ã¿ããã§ãã¯å¯¾è±¡ã«ãããªãã° TRUE - * @param pass_bold å°å½¢æ¡ä»¶ãè¿ãé¢æ°ãã¤ã³ã¿ - * @return 該å½å°å½¢ã®æ° + * @brief éæ³ã®æ½é å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -static void cave_temp_room_aux(int y, int x, bool only_room, bool (*pass_bold)(int, int)) +bool wizard_lock(DIRECTION dir) { - cave_type *c_ptr; - - /* Get the grid */ - c_ptr = &cave[y][x]; - - /* Avoid infinite recursion */ - if (c_ptr->info & (CAVE_TEMP)) return; - - /* Do not "leave" the current room */ - if (!(c_ptr->info & (CAVE_ROOM))) - { - if (only_room) return; - - /* Verify */ - if (!in_bounds2(y, x)) return; - - /* Do not exceed the maximum spell range */ - if (distance(p_ptr->y, p_ptr->x, y, x) > MAX_RANGE) return; - - /* Verify this grid */ - /* - * The reason why it is ==6 instead of >5 is that 8 is impossible - * due to the check for cave_bold above. - * 7 lights dead-end corridors (you need to do this for the - * checkboard interesting rooms, so that the boundary is lit - * properly. - * This leaves only a check for 6 bounding walls! - */ - if (in_bounds(y, x) && pass_bold(y, x) && - (next_to_walls_adj(y, x, pass_bold) == 6) && (next_to_open(y, x, pass_bold) <= 1)) return; - } - - /* Paranoia -- verify space */ - if (temp_n == TEMP_MAX) return; - - /* Mark the grid as "seen" */ - c_ptr->info |= (CAVE_TEMP); - - /* Add it to the "seen" set */ - temp_y[temp_n] = y; - temp_x[temp_n] = x; - temp_n++; + BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; + return (project_hook(GF_JAM_DOOR, dir, 20 + randint1(30), flg)); } /*! - * @brief æå®ã®ãã¹ãå ãéãã(LOSãã©ã°ãæã¤ã)ãè¿ãã / Aux function -- see below - * @param y æå®Yåº§æ¨ - * @param x æå®Xåº§æ¨ - * @return å ãéããªãã°trueãè¿ãã + * @brief ãã¢ç ´å£å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -static bool cave_pass_lite_bold(int y, int x) +bool destroy_door(DIRECTION dir) { - return cave_los_bold(y, x); + BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM; + return (project_hook(GF_KILL_DOOR, dir, 0, flg)); } /*! - * @brief é¨å±å ã«ããä¸ç¹ã®å¨å²ãããã¤å ãéãããã°ãã¼ãã«å¤æ°temp_nã«è¿ã / Aux function -- see below - * @param y æå®Yåº§æ¨ - * @param x æå®Xåº§æ¨ - * @return ãªã + * @brief ãã©ãã解é¤å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -static void cave_temp_lite_room_aux(int y, int x) +bool disarm_trap(DIRECTION dir) { - cave_temp_room_aux(y, x, FALSE, cave_pass_lite_bold); + BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM; + return (project_hook(GF_KILL_TRAP, dir, 0, flg)); } /*! - * @brief æå®ã®ãã¹ãå ãéããå°ç·ã®ã¿ãéãããè¿ãã / Aux function -- see below - * @param y æå®Yåº§æ¨ - * @param x æå®Xåº§æ¨ - * @return å°ç·ãéããªãã°trueãè¿ãã + * @brief ã¢ã³ã¹ã¿ã¼å復å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param dam å¨å + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -static bool cave_pass_dark_bold(int y, int x) +bool heal_monster(DIRECTION dir, HIT_POINT dam) { - return cave_have_flag_bold(y, x, FF_PROJECT); + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; + return (project_hook(GF_OLD_HEAL, dir, dam, flg)); } - /*! - * @brief é¨å±å ã«ããä¸ç¹ã®å¨å²ãããã¤å°ç·ãéãããã°ãã¼ãã«å¤æ°temp_nã«è¿ã / Aux function -- see below - * @param y æå®Yåº§æ¨ - * @param x æå®Xåº§æ¨ - * @return ãªã + * @brief ã¢ã³ã¹ã¿ã¼å éå¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param power å¹å + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -static void cave_temp_unlite_room_aux(int y, int x) +bool speed_monster(DIRECTION dir, int power) { - cave_temp_room_aux(y, x, TRUE, cave_pass_dark_bold); + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; + return (project_hook(GF_OLD_SPEED, dir, power, flg)); } - /*! - * @brief æå®ãããé¨å±å ãç §ãã / Illuminate any room containing the given location. - * @param y1 æå®Yåº§æ¨ - * @param x1 æå®Xåº§æ¨ - * @return ãªã + * @brief ã¢ã³ã¹ã¿ã¼æ¸éå¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param power å¹å + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -void lite_room(int y1, int x1) +bool slow_monster(DIRECTION dir, int power) { - int i, x, y; - - /* Add the initial grid */ - cave_temp_lite_room_aux(y1, x1); - - /* While grids are in the queue, add their neighbors */ - for (i = 0; i < temp_n; i++) - { - x = temp_x[i], y = temp_y[i]; - - /* Walls get lit, but stop light */ - if (!cave_pass_lite_bold(y, x)) continue; - - /* Spread adjacent */ - cave_temp_lite_room_aux(y + 1, x); - cave_temp_lite_room_aux(y - 1, x); - cave_temp_lite_room_aux(y, x + 1); - cave_temp_lite_room_aux(y, x - 1); - - /* Spread diagonal */ - cave_temp_lite_room_aux(y + 1, x + 1); - cave_temp_lite_room_aux(y - 1, x - 1); - cave_temp_lite_room_aux(y - 1, x + 1); - cave_temp_lite_room_aux(y + 1, x - 1); - } - - /* Now, lite them all up at once */ - cave_temp_room_lite(); - - if (p_ptr->special_defense & NINJA_S_STEALTH) - { - if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE); - } + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; + return (project_hook(GF_OLD_SLOW, dir, power, flg)); } +/*! + * @brief ã¢ã³ã¹ã¿ã¼å¬ç å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param power å¹å + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool sleep_monster(DIRECTION dir, int power) +{ + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; + return (project_hook(GF_OLD_SLEEP, dir, power, flg)); +} /*! - * @brief æå®ãããé¨å±å ãæããã / Darken all rooms containing the given location - * @param y1 æå®Yåº§æ¨ - * @param x1 æå®Xåº§æ¨ - * @return ãªã + * @brief ã¢ã³ã¹ã¿ã¼ææ(STASIS)å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + * @details å¨åã¯ãã¬ã¤ã¤ã¼ã¬ãã«*2ã«åºå® */ -void unlite_room(int y1, int x1) +bool stasis_monster(DIRECTION dir) { - int i, x, y; + return (fire_ball_hide(GF_STASIS, dir, p_ptr->lev*2, 0)); +} - /* Add the initial grid */ - cave_temp_unlite_room_aux(y1, x1); +/*! + * @brief éªæªãªã¢ã³ã¹ã¿ã¼ææ(STASIS)å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + * @details å¨åã¯ãã¬ã¤ã¤ã¼ã¬ãã«*2ã«åºå® + */ +bool stasis_evil(DIRECTION dir) +{ + return (fire_ball_hide(GF_STASIS_EVIL, dir, p_ptr->lev*2, 0)); +} - /* Spread, breadth first */ - for (i = 0; i < temp_n; i++) - { - x = temp_x[i], y = temp_y[i]; +/*! + * @brief ã¢ã³ã¹ã¿ã¼æ··ä¹±å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param plev ãã¬ã¤ã¤ã¼ã¬ãã«(=å¹å) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool confuse_monster(DIRECTION dir, PLAYER_LEVEL plev) +{ + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; + return (project_hook(GF_OLD_CONF, dir, plev, flg)); +} - /* Walls get dark, but stop darkness */ - if (!cave_pass_dark_bold(y, x)) continue; +/*! + * @brief ã¢ã³ã¹ã¿ã¼æ¦æ§å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param plev ãã¬ã¤ã¤ã¼ã¬ãã«(=å¹å) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool stun_monster(DIRECTION dir, PLAYER_LEVEL plev) +{ + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; + return (project_hook(GF_STUN, dir, plev, flg)); +} - /* Spread adjacent */ - cave_temp_unlite_room_aux(y + 1, x); - cave_temp_unlite_room_aux(y - 1, x); - cave_temp_unlite_room_aux(y, x + 1); - cave_temp_unlite_room_aux(y, x - 1); +/*! + * @brief ãã§ã³ã¸ã¢ã³ã¹ã¿ã¼å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param power å¹å + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool poly_monster(DIRECTION dir, int power) +{ + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; + bool tester = (project_hook(GF_OLD_POLY, dir, power, flg)); + if (tester) + chg_virtue(V_CHANCE, 1); + return(tester); +} - /* Spread diagonal */ - cave_temp_unlite_room_aux(y + 1, x + 1); - cave_temp_unlite_room_aux(y - 1, x - 1); - cave_temp_unlite_room_aux(y - 1, x + 1); - cave_temp_unlite_room_aux(y + 1, x - 1); - } +/*! + * @brief ã¯ãã¼ã³ã¢ã³ã¹ã¿ã¼å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool clone_monster(DIRECTION dir) +{ + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; + return (project_hook(GF_OLD_CLONE, dir, 0, flg)); +} - /* Now, darken them all at once */ - cave_temp_room_unlite(); +/*! + * @brief ã¢ã³ã¹ã¿ã¼ææ å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param plev ãã¬ã¤ã¤ã¼ã¬ãã«(=å¹å) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool fear_monster(DIRECTION dir, PLAYER_LEVEL plev) +{ + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; + return (project_hook(GF_TURN_ALL, dir, plev, flg)); } - - /*! - * @brief ãã¬ã¤ã¤ã¼ä½ç½®ãä¸å¿ã«LITE_WEAKå±æ§ãéããç §æå¦çãè¡ã / Hack -- call light around the player Affect all monsters in the projection radius - * @param dam å¨å - * @param rad å¹æåå¾ + * @brief æ»ã®å ç·å¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param plev ãã¬ã¤ã¤ã¼ã¬ãã«(å¹åã¯plev*200) * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool lite_area(int dam, int rad) +bool death_ray(DIRECTION dir, PLAYER_LEVEL plev) { - int flg = PROJECT_GRID | PROJECT_KILL; - - if (d_info[dungeon_type].flags1 & DF1_DARKNESS) - { - msg_print(_("ãã³ã¸ã§ã³ãå ãå¸åããã", "The darkness of this dungeon absorb your light.")); - return FALSE; - } - - /* Hack -- Message */ - if (!p_ptr->blind) - { - msg_print(_("ç½ãå ã辺ããè¦ã£ãã", "You are surrounded by a white light.")); - } - - /* Hook into the "project()" function */ - (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_LITE_WEAK, flg, -1); - - /* Lite up the room */ - lite_room(p_ptr->y, p_ptr->x); - - /* Assume seen */ - return (TRUE); + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; + return (project_hook(GF_DEATH_RAY, dir, plev * 200, flg)); } - /*! - * @brief ãã¬ã¤ã¤ã¼ä½ç½®ãä¸å¿ã«LITE_DARKå±æ§ãéããæ¶ç¯å¦çãè¡ã / Hack -- call light around the player Affect all monsters in the projection radius - * @param dam å¨å - * @param rad å¹æåå¾ + * @brief ã¢ã³ã¹ã¿ã¼ç¨ãã¬ãã¼ãå¦ç + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param distance 移åè·é¢ * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool unlite_area(int dam, int rad) +bool teleport_monster(DIRECTION dir, int distance) { - int flg = PROJECT_GRID | PROJECT_KILL; - - /* Hack -- Message */ - if (!p_ptr->blind) - { - msg_print(_("æéã辺ããè¦ã£ãã", "Darkness surrounds you.")); - } - - /* Hook into the "project()" function */ - (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_DARK_WEAK, flg, -1); - - /* Lite up the room */ - unlite_room(p_ptr->y, p_ptr->x); - - /* Assume seen */ - return (TRUE); + BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL; + return (project_hook(GF_AWAY_ALL, dir, distance, flg)); } - - /*! - * @brief ãã¼ã«ç³»ã¹ãã«ã®çºå / Cast a ball spell - * @param typ å¹æå±æ§ - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param dam å¨å - * @param rad åå¾ + * @brief ãã¢çæå¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) / Hooks -- affect adjacent grids (radius 1 ball attack) * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - * @details - *
- * Stop if we hit a monster, act as a "ball" - * Allow "target" mode to pass over monsters - * Affect grids, objects, and monsters - **/ -bool fire_ball(int typ, int dir, int dam, int rad) +bool door_creation(void) { - int tx, ty; - - int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; - - if (typ == GF_CONTROL_LIVING) flg|= PROJECT_HIDE; - /* Use the given direction */ - tx = p_ptr->x + 99 * ddx[dir]; - ty = p_ptr->y + 99 * ddy[dir]; - - /* Hack -- Use an actual "target" */ - if ((dir == 5) && target_okay()) - { - flg &= ~(PROJECT_STOP); - tx = target_col; - ty = target_row; - } + BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; + return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_DOOR, flg, -1)); +} - /* Analyze the "dir" and the "target". Hurt items on floor. */ - return (project(0, rad, ty, tx, dam, typ, flg, -1)); +/*! + * @brief ãã©ããçæå¦ç(èµ·ç¹ããå¨å²1ãã¹) + * @param y èµ·ç¹Yåº§æ¨ + * @param x èµ·ç¹Xåº§æ¨ + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool trap_creation(POSITION y, POSITION x) +{ + BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; + return (project(0, 1, y, x, 0, GF_MAKE_TRAP, flg, -1)); } +/*! + * @brief 森æçæå¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool tree_creation(void) +{ + BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; + return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_TREE, flg, -1)); +} +/*! + * @brief éæ³ã®ã«ã¼ã³çæå¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool glyph_creation(void) +{ + BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM; + return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_GLYPH, flg, -1)); +} /*! - * @brief ãã±ããç³»ã¹ãã«ã®çºå(詳細ãªå·®ã¯ç¢ºèªä¸) / Cast a ball spell - * @param typ å¹æå±æ§ - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param dam å¨å - * @param rad åå¾ + * @brief å£çæå¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - * @details - *
- * Stop if we hit a monster, act as a "ball" - * Allow "target" mode to pass over monsters - * Affect grids, objects, and monsters - **/ -bool fire_rocket(int typ, int dir, int dam, int rad) +bool wall_stone(void) { - int tx, ty; + BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; - int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; + bool dummy = (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_STONE_WALL, flg, -1)); - /* Use the given direction */ - tx = p_ptr->x + 99 * ddx[dir]; - ty = p_ptr->y + 99 * ddy[dir]; + p_ptr->update |= (PU_FLOW); - /* Hack -- Use an actual "target" */ - if ((dir == 5) && target_okay()) - { - tx = target_col; - ty = target_row; - } + p_ptr->redraw |= (PR_MAP); - /* Analyze the "dir" and the "target". Hurt items on floor. */ - return (project(0, rad, ty, tx, dam, typ, flg, -1)); + return dummy; } - /*! - * @brief ãã¼ã«(ãã¤ã)ç³»ã¹ãã«ã®çºå / Cast a ball spell - * @param typ å¹æå±æ§ - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param dam å¨å - * @param rad åå¾ + * @brief ãã¢ç ´å£å¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - * @details - *
- * Stop if we hit a monster, act as a "ball" - * Allow "target" mode to pass over monsters - * Affect grids, objects, and monsters - **/ -bool fire_ball_hide(int typ, int dir, int dam, int rad) +bool destroy_doors_touch(void) { - int tx, ty; + BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; + return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_KILL_DOOR, flg, -1)); +} - int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE; +/*! + * @brief ãã©ãã解é¤å¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool disarm_traps_touch(void) +{ + BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; + return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_KILL_TRAP, flg, -1)); +} - /* Use the given direction */ - tx = p_ptr->x + 99 * ddx[dir]; - ty = p_ptr->y + 99 * ddy[dir]; +/*! + * @brief ã¹ãªã¼ãã¢ã³ã¹ã¿ã¼å¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool sleep_monsters_touch(void) +{ + BIT_FLAGS flg = PROJECT_KILL | PROJECT_HIDE; + return (project(0, 1, p_ptr->y, p_ptr->x, p_ptr->lev, GF_OLD_SLEEP, flg, -1)); +} - /* Hack -- Use an actual "target" */ - if ((dir == 5) && target_okay()) - { - flg &= ~(PROJECT_STOP); - tx = target_col; - ty = target_row; - } - /* Analyze the "dir" and the "target". Hurt items on floor. */ - return (project(0, rad, ty, tx, dam, typ, flg, -1)); +/*! + * @brief æ»è 復活å¦ç(èµ·ç¹ããå¨å²5ãã¹) + * @param who è¡è ã¢ã³ã¹ã¿ã¼ID(0ãªãã°ãã¬ã¤ã¤ã¼) + * @param y èµ·ç¹Yåº§æ¨ + * @param x èµ·ç¹Xåº§æ¨ + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + */ +bool animate_dead(MONSTER_IDX who, POSITION y, POSITION x) +{ + BIT_FLAGS flg = PROJECT_ITEM | PROJECT_HIDE; + return (project(who, 5, y, x, 0, GF_ANIM_DEAD, flg, -1)); } - /*! - * @brief ã¡ããªç³»ã¹ãã«ã®çºå / Cast a meteor spell - * @param who ã¹ãºã«è© å±è ã®ã¢ã³ã¹ã¿ã¼ID(0=ãã¬ã¤ã¤ã¼) - * @param typ å¹æå±æ§ - * @param dam å¨å - * @param rad åå¾ - * @param y ä¸å¿ç¹Yåº§æ¨ - * @param x ä¸å¿ç¹Xåº§æ¨ + * @brief æ··æ²ææ¥å¦ç * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - * @details - *
- * Cast a meteor spell, defined as a ball spell cast by an arbitary monster, - * player, or outside source, that starts out at an arbitrary location, and - * leaving no trail from the "caster" to the target. This function is - * especially useful for bombardments and similar. -LM- - * Option to hurt the player. - **/ -bool fire_meteor(int who, int typ, int y, int x, int dam, int rad) +void call_chaos(void) { - int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; + int Chaos_type, dummy, dir; + PLAYER_LEVEL plev = p_ptr->lev; + bool line_chaos = FALSE; - /* Analyze the "target" and the caster. */ - return (project(who, rad, y, x, dam, typ, flg, -1)); -} + int hurt_types[31] = + { + GF_ELEC, GF_POIS, GF_ACID, GF_COLD, + GF_FIRE, GF_MISSILE, GF_ARROW, GF_PLASMA, + GF_HOLY_FIRE, GF_WATER, GF_LITE, GF_DARK, + GF_FORCE, GF_INERTIAL, GF_MANA, GF_METEOR, + GF_ICE, GF_CHAOS, GF_NETHER, GF_DISENCHANT, + GF_SHARDS, GF_SOUND, GF_NEXUS, GF_CONFUSION, + GF_TIME, GF_GRAVITY, GF_ROCKET, GF_NUKE, + GF_HELL_FIRE, GF_DISINTEGRATE, GF_PSY_SPEAR + }; + + Chaos_type = hurt_types[randint0(31)]; + if (one_in_(4)) line_chaos = TRUE; + if (one_in_(6)) + { + for (dummy = 1; dummy < 10; dummy++) + { + if (dummy - 5) + { + if (line_chaos) + fire_beam(Chaos_type, dummy, 150); + else + fire_ball(Chaos_type, dummy, 150, 2); + } + } + } + else if (one_in_(3)) + { + fire_ball(Chaos_type, 0, 500, 8); + } + else + { + if (!get_aim_dir(&dir)) return; + if (line_chaos) + fire_beam(Chaos_type, dir, 250); + else + fire_ball(Chaos_type, dir, 250, 3 + (plev / 35)); + } +} /*! - * @brief ãã©ã¹ãç³»ã¹ãã«ã®çºå / Cast a blast spell - * @param typ å¹æå±æ§ - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param dd å¨åãã¤ã¹æ° - * @param ds å¨åãã¤ã¹ç® - * @param num åºæ¬åæ° - * @param dev åæ°åæ£ + * @brief TY_CURSEå¦ççºå / Activate the evil Topi Ylinen curse + * @param stop_ty å帰å¦çåæ¢ãã©ã° + * @param count çºååæ° * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + * @details + *
+ * rr9: Stop the nasty things when a Cyberdemon is summoned + * or the player gets paralyzed. + **/ -bool fire_blast(int typ, int dir, int dd, int ds, int num, int dev) +bool activate_ty_curse(bool stop_ty, int *count) { - int ly, lx, ld; - int ty, tx, y, x; - int i; - - int flg = PROJECT_FAST | PROJECT_THRU | PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE | PROJECT_GRID; - - /* Assume okay */ - bool result = TRUE; - - /* Use the given direction */ - if (dir != 5) - { - ly = ty = p_ptr->y + 20 * ddy[dir]; - lx = tx = p_ptr->x + 20 * ddx[dir]; - } - - /* Use an actual "target" */ - else /* if (dir == 5) */ - { - tx = target_col; - ty = target_row; - - lx = 20 * (tx - p_ptr->x) + p_ptr->x; - ly = 20 * (ty - p_ptr->y) + p_ptr->y; - } + int i = 0; - ld = distance(p_ptr->y, p_ptr->x, ly, lx); + BIT_FLAGS flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP); - /* Blast */ - for (i = 0; i < num; i++) + do { - while (1) + switch (randint1(34)) { - /* Get targets for some bolts */ - y = rand_spread(ly, ld * dev / 20); - x = rand_spread(lx, ld * dev / 20); - - if (distance(ly, lx, y, x) <= ld * dev / 20) break; - } + case 28: case 29: + if (!(*count)) + { + msg_print(_("å°é¢ãæºãã...", "The ground trembles...")); + earthquake(p_ptr->y, p_ptr->x, 5 + randint0(10)); + if (!one_in_(6)) break; + } + case 30: case 31: + if (!(*count)) + { + HIT_POINT dam = damroll(10, 10); + msg_print(_("ç´ç²ãªéåã®æ¬¡å ã¸ã®æãéããï¼", "A portal opens to a plane of raw mana!")); + project(0, 8, p_ptr->y, p_ptr->x, dam, GF_MANA, flg, -1); + take_hit(DAMAGE_NOESCAPE, dam, _("ç´ç²ãªéåã®è§£æ¾", "released pure mana"), -1); + if (!one_in_(6)) break; + } + case 32: case 33: + if (!(*count)) + { + msg_print(_("å¨å²ã®ç©ºéãæªãã ï¼", "Space warps about you!")); + teleport_player(damroll(10, 10), TELEPORT_PASSIVE); + if (randint0(13)) (*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE); + if (!one_in_(6)) break; + } + case 34: + msg_print(_("ã¨ãã«ã®ã¼ã®ããããæããï¼", "You feel a surge of energy!")); + wall_breaker(); + if (!randint0(7)) + { + project(0, 7, p_ptr->y, p_ptr->x, 50, GF_KILL_WALL, flg, -1); + take_hit(DAMAGE_NOESCAPE, 50, _("ã¨ãã«ã®ã¼ã®ããã", "surge of energy"), -1); + } + if (!one_in_(6)) break; + case 1: case 2: case 3: case 16: case 17: + aggravate_monsters(0); + if (!one_in_(6)) break; + case 4: case 5: case 6: + (*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE); + if (!one_in_(6)) break; + case 7: case 8: case 9: case 18: + (*count) += summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); + if (!one_in_(6)) break; + case 10: case 11: case 12: + msg_print(_("çµé¨å¤ãä½ããå¸ãåãããæ°ãããï¼", "You feel your experience draining away...")); + lose_exp(p_ptr->exp / 16); + if (!one_in_(6)) break; + case 13: case 14: case 15: case 19: case 20: + if (stop_ty || (p_ptr->free_act && (randint1(125) < p_ptr->skill_sav)) || (p_ptr->pclass == CLASS_BERSERKER)) + { + /* Do nothing */ ; + } + else + { + msg_print(_("彫åã«ãªã£ãæ°åã ï¼", "You feel like a statue!")); + if (p_ptr->free_act) + set_paralyzed(p_ptr->paralyzed + randint1(3)); + else + set_paralyzed(p_ptr->paralyzed + randint1(13)); + stop_ty = TRUE; + } + if (!one_in_(6)) break; + case 21: case 22: case 23: + (void)do_dec_stat(randint0(6)); + if (!one_in_(6)) break; + case 24: + msg_print(_("ã»ãï¼ç§ã¯èª°ï¼ããã§ä½ãã¦ãï¼", "Huh? Who am I? What am I doing here?")); + lose_all_info(); + if (!one_in_(6)) break; + case 25: + /* + * Only summon Cyberdemons deep in the dungeon. + */ + if ((dun_level > 65) && !stop_ty) + { + (*count) += summon_cyber(-1, p_ptr->y, p_ptr->x); + stop_ty = TRUE; + break; + } + if (!one_in_(6)) break; + default: + while (i < 6) + { + do + { + (void)do_dec_stat(i); + } + while (one_in_(2)); - /* Analyze the "dir" and the "target". */ - if (!project(0, 0, y, x, damroll(dd, ds), typ, flg, -1)) - { - result = FALSE; + i++; + } } } + while (one_in_(3) && !stop_ty); - return (result); + return stop_ty; } - /*! - * @brief ã¢ã³ã¹ã¿ã¼ã¨ã®ä½ç½®äº¤æå¦ç / Switch position with a monster. - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @brief HI_SUMMON(ä¸ç´å¬å)å¦ççºå + * @param y å¬åä½ç½®Yåº§æ¨ + * @param x å¬åä½ç½®Xåº§æ¨ + * @param can_pet ãã¬ã¤ã¤ã¼ã®ãããã¨ãªãå¯è½æ§ããããªãã°TRUEã«ãã * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool teleport_swap(int dir) +int activate_hi_summon(POSITION y, POSITION x, bool can_pet) { - int tx, ty; - cave_type * c_ptr; - monster_type * m_ptr; - monster_race * r_ptr; - - if ((dir == 5) && target_okay()) - { - tx = target_col; - ty = target_row; - } - else - { - tx = p_ptr->x + ddx[dir]; - ty = p_ptr->y + ddy[dir]; - } - c_ptr = &cave[ty][tx]; - - if (p_ptr->anti_tele) - { - msg_print(_("ä¸æè°ãªåããã¬ãã¼ããé²ãã ï¼", "A mysterious force prevents you from teleporting!")); - return FALSE; - } - - if (!c_ptr->m_idx || (c_ptr->m_idx == p_ptr->riding)) - { - msg_print(_("ããã¨ã¯å ´æã交æã§ãã¾ããã", "You can't trade places with that!")); - - /* Failure */ - return FALSE; - } + int i; + int count = 0; + DEPTH summon_lev; + BIT_FLAGS mode = PM_ALLOW_GROUP; + bool pet = FALSE; - if ((c_ptr->info & CAVE_ICKY) || (distance(ty, tx, p_ptr->y, p_ptr->x) > p_ptr->lev * 3 / 2 + 10)) + if (can_pet) { - msg_print(_("失æããã", "Failed to swap.")); - - /* Failure */ - return FALSE; + if (one_in_(4)) + { + mode |= PM_FORCE_FRIENDLY; + } + else + { + mode |= PM_FORCE_PET; + pet = TRUE; + } } - m_ptr = &m_list[c_ptr->m_idx]; - r_ptr = &r_info[m_ptr->r_idx]; + if (!pet) mode |= PM_NO_PET; - (void)set_monster_csleep(c_ptr->m_idx, 0); + summon_lev = (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : dun_level); - if (r_ptr->flagsr & RFR_RES_TELE) + for (i = 0; i < (randint1(7) + (dun_level / 40)); i++) { - msg_print(_("ãã¬ãã¼ããéªéãããï¼", "Your teleportation is blocked!")); - - if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE; - - /* Failure */ - return FALSE; + switch (randint1(25) + (dun_level / 20)) + { + case 1: case 2: + count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode); + break; + case 3: case 4: + count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode); + break; + case 5: case 6: + count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode); + break; + case 7: case 8: + count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode); + break; + case 9: case 10: + count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode); + break; + case 11: case 12: + count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode); + break; + case 13: case 14: + count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode); + break; + case 15: case 16: + count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode); + break; + case 17: + if (can_pet) break; + count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE)); + break; + case 18: case 19: + if (can_pet) break; + count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE)); + break; + case 20: case 21: + if (!can_pet) mode |= PM_ALLOW_UNIQUE; + count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode); + break; + case 22: case 23: + if (!can_pet) mode |= PM_ALLOW_UNIQUE; + count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode); + break; + case 24: + count += summon_specific((pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode); + break; + default: + if (!can_pet) mode |= PM_ALLOW_UNIQUE; + count += summon_specific((pet ? -1 : 0), y, x,pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode); + } } - sound(SOUND_TELEPORT); - - /* Swap the player and monster */ - (void)move_player_effect(ty, tx, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP); - - /* Success */ - return TRUE; + return count; } /*! - * @brief æå®æ¹åã«é£ã³éå ·ãé£ã°ãï¼ãã©ã°ä»»ææå®ï¼ / Hack -- apply a "projection()" in a direction (or at the target) - * @param typ å¹æå±æ§ - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param dam å¨å - * @param flg ãã©ã° + * @brief ãµã¤ãã¼ãã¼ã¢ã³ã®å¬å + * @param who å¬å主ã®ã¢ã³ã¹ã¿ã¼ID(0ãªãã°ãã¬ã¤ã¤ã¼) + * @param y å¬åä½ç½®Yåº§æ¨ + * @param x å¬åä½ç½®Xåº§æ¨ * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool project_hook(int typ, int dir, int dam, int flg) +int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x) { - int tx, ty; + int i; + int max_cyber = (easy_band ? 1 : (dun_level / 50) + randint1(2)); + int count = 0; + BIT_FLAGS mode = PM_ALLOW_GROUP; - /* Pass through the target if needed */ - flg |= (PROJECT_THRU); + /* Summoned by a monster */ + if (who > 0) + { + monster_type *m_ptr = &m_list[who]; + if (is_pet(m_ptr)) mode |= PM_FORCE_PET; + } - /* Use the given direction */ - tx = p_ptr->x + ddx[dir]; - ty = p_ptr->y + ddy[dir]; + if (max_cyber > 4) max_cyber = 4; - /* Hack -- Use an actual "target" */ - if ((dir == 5) && target_okay()) + for (i = 0; i < max_cyber; i++) { - tx = target_col; - ty = target_row; + count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode); } - /* Analyze the "dir" and the "target", do NOT explode */ - return (project(0, 0, ty, tx, dam, typ, flg, -1)); + return count; } - /*! - * @brief ãã«ãç³»ã¹ãã«ã®çºå / Cast a bolt spell. - * @param typ å¹æå±æ§ - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param dam å¨å + * @brief å¨è¾ºç ´å£å¹æ(ãã¬ã¤ã¤ã¼ä¸å¿) * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - * @details - *
- * Stop if we hit a monster, as a "bolt". - * Affect monsters and grids (not objects). - **/ -bool fire_bolt(int typ, int dir, int dam) +void wall_breaker(void) { - int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID; - if (typ != GF_ARROW) flg |= PROJECT_REFLECTABLE; - return (project_hook(typ, dir, dam, flg)); -} + int i; + POSITION y = 0, x = 0; + int attempts = 1000; + if (randint1(80 + p_ptr->lev) < 70) + { + while (attempts--) + { + scatter(&y, &x, p_ptr->y, p_ptr->x, 4, 0); -/*! - * @brief ãã¼ã ç³»ã¹ãã«ã®çºå / Cast a beam spell. - * @param typ å¹æå±æ§ - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param dam å¨å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - * @details - *
- * Pass through monsters, as a "beam". - * Affect monsters, grids and objects. - *- */ -bool fire_beam(int typ, int dir, int dam) -{ - int flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM; - return (project_hook(typ, dir, dam, flg)); -} + if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue; + if (!player_bold(y, x)) break; + } -/*! - * @brief 確çã«å¿ãããã«ãç³»/ãã¼ã ç³»ã¹ãã«ã®çºå / Cast a bolt spell, or rarely, a beam spell. - * @param prob ãã¼ã åãã確ç(%) - * @param typ å¹æå±æ§ - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param dam å¨å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - * @details - *
- * Pass through monsters, as a "beam". - * Affect monsters, grids and objects. - *- */ -bool fire_bolt_or_beam(int prob, int typ, int dir, int dam) -{ - if (randint0(100) < prob) + project(0, 0, y, x, 20 + randint1(30), GF_KILL_WALL, + (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1); + } + else if (randint1(100) > 30) { - return (fire_beam(typ, dir, dam)); + earthquake(p_ptr->y, p_ptr->x, 1); } else { - return (fire_bolt(typ, dir, dam)); - } -} - -/*! - * @brief LITE_WEAKå±æ§ã«ããå æºãã¼ã å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param dam å¨å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool lite_line(int dir, int dam) -{ - int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL; - return (project_hook(GF_LITE_WEAK, dir, dam, flg)); -} - -/*! - * @brief å¸è¡ãã«ãå¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param dam å¨å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool drain_life(int dir, int dam) -{ - int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(GF_OLD_DRAIN, dir, dam, flg)); -} - -/*! - * @brief 岩ç³æº¶è§£å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param dam å¨å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool wall_to_mud(int dir, int dam) -{ - int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; - return (project_hook(GF_KILL_WALL, dir, dam, flg)); -} + int num = damroll(5, 3); -/*! - * @brief éæ³ã®æ½é å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool wizard_lock(int dir) -{ - int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; - return (project_hook(GF_JAM_DOOR, dir, 20 + randint1(30), flg)); -} + for (i = 0; i < num; i++) + { + while (1) + { + scatter(&y, &x, p_ptr->y, p_ptr->x, 10, 0); -/*! - * @brief ãã¢ç ´å£å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool destroy_door(int dir) -{ - int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM; - return (project_hook(GF_KILL_DOOR, dir, 0, flg)); -} + if (!player_bold(y, x)) break; + } -/*! - * @brief ãã©ãã解é¤å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool disarm_trap(int dir) -{ - int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM; - return (project_hook(GF_KILL_TRAP, dir, 0, flg)); + project(0, 0, y, x, 20 + randint1(30), GF_KILL_WALL, + (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1); + } + } } -/*! - * @brief ã¢ã³ã¹ã¿ã¼å復å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param dam å¨å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool heal_monster(int dir, int dam) -{ - int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(GF_OLD_HEAL, dir, dam, flg)); -} /*! - * @brief ã¢ã³ã¹ã¿ã¼å éå¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param power å¹å + * @brief ãããã¯ã»ã¢ã³ã¹ã¿ã¼å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Confuse monsters + * @param dam å¹å * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool speed_monster(int dir, int power) +bool confuse_monsters(HIT_POINT dam) { - int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(GF_OLD_SPEED, dir, power, flg)); + return (project_hack(GF_OLD_CONF, dam)); } -/*! - * @brief ã¢ã³ã¹ã¿ã¼æ¸éå¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param power å¹å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool slow_monster(int dir, int power) -{ - int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(GF_OLD_SLOW, dir, power, flg)); -} /*! - * @brief ã¢ã³ã¹ã¿ã¼å¬ç å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param power å¹å + * @brief ãã£ã¼ã ã»ã¢ã³ã¹ã¿ã¼å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Charm monsters + * @param dam å¹å * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool sleep_monster(int dir, int power) +bool charm_monsters(HIT_POINT dam) { - int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(GF_OLD_SLEEP, dir, power, flg)); + return (project_hack(GF_CHARM, dam)); } -/*! - * @brief ã¢ã³ã¹ã¿ã¼ææ(STASIS)å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - * @details å¨åã¯ãã¬ã¤ã¤ã¼ã¬ãã«*2ã«åºå® - */ -bool stasis_monster(int dir) -{ - return (fire_ball_hide(GF_STASIS, dir, p_ptr->lev*2, 0)); -} /*! - * @brief éªæªãªã¢ã³ã¹ã¿ã¼ææ(STASIS)å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @brief åç©é äºå¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Charm Animals + * @param dam å¹å * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - * @details å¨åã¯ãã¬ã¤ã¤ã¼ã¬ãã«*2ã«åºå® */ -bool stasis_evil(int dir) +bool charm_animals(HIT_POINT dam) { - return (fire_ball_hide(GF_STASIS_EVIL, dir, p_ptr->lev*2, 0)); + return (project_hack(GF_CONTROL_ANIMAL, dam)); } -/*! - * @brief ã¢ã³ã¹ã¿ã¼æ··ä¹±å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param plev ãã¬ã¤ã¤ã¼ã¬ãã«(=å¹å) - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool confuse_monster(int dir, int plev) -{ - int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(GF_OLD_CONF, dir, plev, flg)); -} /*! - * @brief ã¢ã³ã¹ã¿ã¼æ¦æ§å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param plev ãã¬ã¤ã¤ã¼ã¬ãã«(=å¹å) + * @brief ã¢ã³ã¹ã¿ã¼æ¦æ§å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Stun monsters + * @param dam å¹å * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool stun_monster(int dir, int plev) +bool stun_monsters(HIT_POINT dam) { - int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(GF_STUN, dir, plev, flg)); + return (project_hack(GF_STUN, dam)); } -/*! - * @brief ãã§ã³ã¸ã¢ã³ã¹ã¿ã¼å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param power å¹å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool poly_monster(int dir, int power) -{ - int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - bool tester = (project_hook(GF_OLD_POLY, dir, power, flg)); - if (tester) - chg_virtue(V_CHANCE, 1); - return(tester); -} /*! - * @brief ã¯ãã¼ã³ã¢ã³ã¹ã¿ã¼å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @brief ã¢ã³ã¹ã¿ã¼åæ¢å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Stasis monsters + * @param dam å¹å * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool clone_monster(int dir) +bool stasis_monsters(HIT_POINT dam) { - int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(GF_OLD_CLONE, dir, 0, flg)); + return (project_hack(GF_STASIS, dam)); } + /*! - * @brief ã¢ã³ã¹ã¿ã¼ææ å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param plev ãã¬ã¤ã¤ã¼ã¬ãã«(=å¹å) + * @brief ã¢ã³ã¹ã¿ã¼ç²¾ç¥æ»æå¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Mindblast monsters + * @param dam å¹å * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool fear_monster(int dir, int plev) +bool mindblast_monsters(HIT_POINT dam) { - int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(GF_TURN_ALL, dir, plev, flg)); + return (project_hack(GF_PSI, dam)); } + /*! - * @brief æ»ã®å ç·å¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param plev ãã¬ã¤ã¤ã¼ã¬ãã«(å¹åã¯plev*200) + * @brief ã¢ã³ã¹ã¿ã¼è¿½æ¾å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Banish all monsters + * @param dist å¹åï¼è·é¢ï¼ * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool death_ray(int dir, int plev) +bool banish_monsters(int dist) { - int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(GF_DEATH_RAY, dir, plev * 200, flg)); + return (project_hack(GF_AWAY_ALL, dist)); } + /*! - * @brief ã¢ã³ã¹ã¿ã¼ç¨ãã¬ãã¼ãå¦ç - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param distance 移åè·é¢ + * @brief éªæªéæ£å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Turn evil + * @param dam å¹å * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool teleport_monster(int dir, int distance) +bool turn_evil(HIT_POINT dam) { - int flg = PROJECT_BEAM | PROJECT_KILL; - return (project_hook(GF_AWAY_ALL, dir, distance, flg)); + return (project_hack(GF_TURN_EVIL, dam)); } + /*! - * @brief ãã¢çæå¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) / Hooks -- affect adjacent grids (radius 1 ball attack) + * @brief å ¨ã¢ã³ã¹ã¿ã¼éæ£å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Turn everyone + * @param dam å¹å * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool door_creation(void) +bool turn_monsters(HIT_POINT dam) { - int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; - return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_DOOR, flg, -1)); + return (project_hack(GF_TURN_ALL, dam)); } + /*! - * @brief ãã©ããçæå¦ç(èµ·ç¹ããå¨å²1ãã¹) - * @param y èµ·ç¹Yåº§æ¨ - * @param x èµ·ç¹Xåº§æ¨ + * @brief æ»ã®å ç·(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Death-ray all monsters (note: OBSCENELY powerful) * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool trap_creation(int y, int x) +bool deathray_monsters(void) { - int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; - return (project(0, 1, y, x, 0, GF_MAKE_TRAP, flg, -1)); + return (project_hack(GF_DEATH_RAY, p_ptr->lev * 200)); } /*! - * @brief 森æçæå¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) + * @brief ãã£ã¼ã ã»ã¢ã³ã¹ã¿ã¼(1ä½) + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param plev ãã¯ã¼ * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool tree_creation(void) +bool charm_monster(DIRECTION dir, PLAYER_LEVEL plev) { - int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; - return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_TREE, flg, -1)); + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL; + return (project_hook(GF_CHARM, dir, plev, flg)); } /*! - * @brief éæ³ã®ã«ã¼ã³çæå¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) + * @brief ã¢ã³ãããæ¯é (1ä½) + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param plev ãã¯ã¼ * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool glyph_creation(void) +bool control_one_undead(DIRECTION dir, PLAYER_LEVEL plev) { - int flg = PROJECT_GRID | PROJECT_ITEM; - return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_GLYPH, flg, -1)); + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL; + return (project_hook(GF_CONTROL_UNDEAD, dir, plev, flg)); } /*! - * @brief å£çæå¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) + * @brief æªéæ¯é (1ä½) + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param plev ãã¯ã¼ * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool wall_stone(void) +bool control_one_demon(DIRECTION dir, PLAYER_LEVEL plev) { - int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; - - bool dummy = (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_STONE_WALL, flg, -1)); - - /* Update stuff */ - p_ptr->update |= (PU_FLOW); - - /* Redraw map */ - p_ptr->redraw |= (PR_MAP); - - return dummy; + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL; + return (project_hook(GF_CONTROL_DEMON, dir, plev, flg)); } /*! - * @brief ãã¢ç ´å£å¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) + * @brief åç©æ¯é (1ä½) + * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) + * @param plev ãã¯ã¼ * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool destroy_doors_touch(void) +bool charm_animal(DIRECTION dir, PLAYER_LEVEL plev) { - int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; - return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_KILL_DOOR, flg, -1)); + BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL; + return (project_hook(GF_CONTROL_ANIMAL, dir, plev, flg)); } + /*! - * @brief ãã©ãã解é¤å¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) + * @brief å¤ãã身å¦ç + * @param success å¤å®æåä¸ã®å¦çãªãã°TRUE * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã */ -bool disarm_traps_touch(void) +bool kawarimi(bool success) { - int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; - return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_KILL_TRAP, flg, -1)); + object_type forge; + object_type *q_ptr = &forge; + POSITION y, x; + + if (p_ptr->is_dead) return FALSE; + if (p_ptr->confused || p_ptr->blind || p_ptr->paralyzed || p_ptr->image) return FALSE; + if (randint0(200) < p_ptr->stun) return FALSE; + + if (!success && one_in_(3)) + { + msg_print(_("失æï¼éããããªãã£ãã", "Failed! You couldn't run away.")); + p_ptr->special_defense &= ~(NINJA_KAWARIMI); + p_ptr->redraw |= (PR_STATUS); + return FALSE; + } + + y = p_ptr->y; + x = p_ptr->x; + + teleport_player(10 + randint1(90), 0L); + + object_wipe(q_ptr); + + object_prep(q_ptr, lookup_kind(TV_STATUE, SV_WOODEN_STATUE)); + + q_ptr->pval = MON_NINJA; + + /* Drop it in the dungeon */ + (void)drop_near(q_ptr, -1, y, x); + +#ifdef JP + if (success) msg_print("æ»æãåããåã«ç´ æ©ã身ãã²ãããããã"); + else msg_print("失æï¼æ»æãåãã¦ãã¾ã£ãã"); +#else + if (success) msg_print("You have turned around just before the attack hit you."); + else msg_print("Failed! You are hit by the attack."); +#endif + + p_ptr->special_defense &= ~(NINJA_KAWARIMI); + p_ptr->redraw |= (PR_STATUS); + + /* Teleported */ + return TRUE; } + /*! - * @brief ã¹ãªã¼ãã¢ã³ã¹ã¿ã¼å¦ç(ãã¬ã¤ã¤ã¼ä¸å¿ã«å¨å²1ãã¹) - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + * @brief å ¥èº«å¦ç / "Rush Attack" routine for Samurai or Ninja + * @param mdeath ç®æ¨ã¢ã³ã¹ã¿ã¼ãæ»äº¡ããããè¿ã + * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã / Return value is for checking "done" */ -bool sleep_monsters_touch(void) +bool rush_attack(bool *mdeath) { - int flg = PROJECT_KILL | PROJECT_HIDE; - return (project(0, 1, p_ptr->y, p_ptr->x, p_ptr->lev, GF_OLD_SLEEP, flg, -1)); + DIRECTION dir; + int tx, ty; + int tm_idx = 0; + u16b path_g[32]; + int path_n, i; + bool tmp_mdeath = FALSE; + bool moved = FALSE; + + if (mdeath) *mdeath = FALSE; + + project_length = 5; + if (!get_aim_dir(&dir)) return FALSE; + + /* Use the given direction */ + tx = p_ptr->x + project_length * ddx[dir]; + ty = p_ptr->y + project_length * ddy[dir]; + + /* Hack -- Use an actual "target" */ + if ((dir == 5) && target_okay()) + { + tx = target_col; + ty = target_row; + } + + if (in_bounds(ty, tx)) tm_idx = cave[ty][tx].m_idx; + + path_n = project_path(path_g, project_length, p_ptr->y, p_ptr->x, ty, tx, PROJECT_STOP | PROJECT_KILL); + project_length = 0; + + /* No need to move */ + if (!path_n) return TRUE; + + /* Use ty and tx as to-move point */ + ty = p_ptr->y; + tx = p_ptr->x; + + /* Project along the path */ + for (i = 0; i < path_n; i++) + { + monster_type *m_ptr; + + int ny = GRID_Y(path_g[i]); + int nx = GRID_X(path_g[i]); + + if (cave_empty_bold(ny, nx) && player_can_enter(cave[ny][nx].feat, 0)) + { + ty = ny; + tx = nx; + + /* Go to next grid */ + continue; + } + + if (!cave[ny][nx].m_idx) + { + if (tm_idx) + { + msg_print(_("失æï¼", "Failed!")); + } + else + { + msg_print(_("ããã«ã¯å ¥èº«ã§ã¯å ¥ããªãã", "You can't move to that place.")); + } + + /* Exit loop */ + break; + } + + /* Move player before updating the monster */ + if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL); + update_monster(cave[ny][nx].m_idx, TRUE); + + /* Found a monster */ + m_ptr = &m_list[cave[ny][nx].m_idx]; + + if (tm_idx != cave[ny][nx].m_idx) + { +#ifdef JP + msg_format("%s%sãç«ã¡ãµããã£ã¦ããï¼", tm_idx ? "å¥ã®" : "", + m_ptr->ml ? "ã¢ã³ã¹ã¿ã¼" : "ä½ã"); +#else + msg_format("There is %s in the way!", m_ptr->ml ? (tm_idx ? "another monster" : "a monster") : "someone"); +#endif + } + else if (!player_bold(ty, tx)) + { + /* Hold the monster name */ + char m_name[80]; + + /* Get the monster name (BEFORE polymorphing) */ + monster_desc(m_name, m_ptr, 0); + msg_format(_("ç´ æ©ã%sã®æã«å ¥ãè¾¼ãã ï¼", "You quickly jump in and attack %s!"), m_name); + } + + if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL); + moved = TRUE; + tmp_mdeath = py_attack(ny, nx, HISSATSU_NYUSIN); + + break; + } + + if (!moved && !player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL); + + if (mdeath) *mdeath = tmp_mdeath; + return TRUE; } /*! - * @brief æ»è 復活å¦ç(èµ·ç¹ããå¨å²5ãã¹) - * @param who è¡è ã¢ã³ã¹ã¿ã¼ID(0ãªãã°ãã¬ã¤ãã¼) - * @param y èµ·ç¹Yåº§æ¨ - * @param x èµ·ç¹Xåº§æ¨ - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + * @brief å ¨é¡ã®æ¶å» / Remove all mirrors in this floor + * @param explode ççºå¦çãä¼´ããªãã°TRUE + * @return ãªã */ -bool animate_dead(int who, int y, int x) +void remove_all_mirrors(bool explode) { - int flg = PROJECT_ITEM | PROJECT_HIDE; - return (project(who, 5, y, x, 0, GF_ANIM_DEAD, flg, -1)); + POSITION x, y; + + for (x = 0; x < cur_wid; x++) + { + for (y = 0; y < cur_hgt; y++) + { + if (is_mirror_grid(&cave[y][x])) + { + remove_mirror(y, x); + if (explode) + project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, + (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1); + } + } + } } /*! - * @brief æ··æ²ææ¥å¦ç - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + * @brief ãä¸ã¤ã®æ輪ãã®å¹æå¦ç / + * Hack -- activate the ring of power + * @param dir çºåã®æ¹åID + * @return ãªã */ -void call_chaos(void) +void ring_of_power(DIRECTION dir) { - int Chaos_type, dummy, dir; - int plev = p_ptr->lev; - bool line_chaos = FALSE; - - int hurt_types[31] = + /* Pick a random effect */ + switch (randint1(10)) { - GF_ELEC, GF_POIS, GF_ACID, GF_COLD, - GF_FIRE, GF_MISSILE, GF_ARROW, GF_PLASMA, - GF_HOLY_FIRE, GF_WATER, GF_LITE, GF_DARK, - GF_FORCE, GF_INERTIAL, GF_MANA, GF_METEOR, - GF_ICE, GF_CHAOS, GF_NETHER, GF_DISENCHANT, - GF_SHARDS, GF_SOUND, GF_NEXUS, GF_CONFUSION, - GF_TIME, GF_GRAVITY, GF_ROCKET, GF_NUKE, - GF_HELL_FIRE, GF_DISINTEGRATE, GF_PSY_SPEAR - }; + case 1: + case 2: + { + msg_print(_("ããªãã¯æªæ§ã®ãªã¼ã©ã«å ã¿è¾¼ã¾ããã", "You are surrounded by a malignant aura.")); + sound(SOUND_EVIL); - Chaos_type = hurt_types[randint0(31)]; - if (one_in_(4)) line_chaos = TRUE; + /* Decrease all stats (permanently) */ + (void)dec_stat(A_STR, 50, TRUE); + (void)dec_stat(A_INT, 50, TRUE); + (void)dec_stat(A_WIS, 50, TRUE); + (void)dec_stat(A_DEX, 50, TRUE); + (void)dec_stat(A_CON, 50, TRUE); + (void)dec_stat(A_CHR, 50, TRUE); - if (one_in_(6)) + /* Lose some experience (permanently) */ + p_ptr->exp -= (p_ptr->exp / 4); + p_ptr->max_exp -= (p_ptr->exp / 4); + check_experience(); + + break; + } + + case 3: { - for (dummy = 1; dummy < 10; dummy++) - { - if (dummy - 5) - { - if (line_chaos) - fire_beam(Chaos_type, dummy, 150); - else - fire_ball(Chaos_type, dummy, 150, 2); - } - } + msg_print(_("ããªãã¯å¼·åãªãªã¼ã©ã«å ã¿è¾¼ã¾ããã", "You are surrounded by a powerful aura.")); + + /* Dispel monsters */ + dispel_monsters(1000); + + break; } - else if (one_in_(3)) + + case 4: + case 5: + case 6: { - fire_ball(Chaos_type, 0, 500, 8); + /* Mana Ball */ + fire_ball(GF_MANA, dir, 600, 3); + + break; } - else + + case 7: + case 8: + case 9: + case 10: { - if (!get_aim_dir(&dir)) return; - if (line_chaos) - fire_beam(Chaos_type, dir, 250); - else - fire_ball(Chaos_type, dir, 250, 3 + (plev / 35)); + /* Mana Bolt */ + fire_bolt(GF_MANA, dir, 500); + + break; + } } } /*! - * @brief TY_CURSEå¦ççºå / Activate the evil Topi Ylinen curse - * @param stop_ty å帰å¦çåæ¢ãã©ã° - * @param count çºååæ° - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - * @details - *
- * rr9: Stop the nasty things when a Cyberdemon is summoned - * or the player gets paralyzed. - *- */ -bool activate_ty_curse(bool stop_ty, int *count) +* @brief éå½ã®è¼ªã並ã³ã«ã«ãªã¹çãªå¹æã®çºå +* @param spell ã©ã³ãã ãªå¹æãé¸æããããã®åºæºID +* @return ãªã +*/ +void wild_magic(int spell) { - int i = 0; + int counter = 0; + int type = SUMMON_MOLD + randint0(6); - int flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP); + if (type < SUMMON_MOLD) type = SUMMON_MOLD; + else if (type > SUMMON_MIMIC) type = SUMMON_MIMIC; - do + switch (randint1(spell) + randint1(8) + 1) { - switch (randint1(34)) + case 1: + case 2: + case 3: + teleport_player(10, TELEPORT_PASSIVE); + break; + case 4: + case 5: + case 6: + teleport_player(100, TELEPORT_PASSIVE); + break; + case 7: + case 8: + teleport_player(200, TELEPORT_PASSIVE); + break; + case 9: + case 10: + case 11: + unlite_area(10, 3); + break; + case 12: + case 13: + case 14: + lite_area(damroll(2, 3), 2); + break; + case 15: + destroy_doors_touch(); + break; + case 16: case 17: + wall_breaker(); + case 18: + sleep_monsters_touch(); + break; + case 19: + case 20: + trap_creation(p_ptr->y, p_ptr->x); + break; + case 21: + case 22: + door_creation(); + break; + case 23: + case 24: + case 25: + aggravate_monsters(0); + break; + case 26: + earthquake(p_ptr->y, p_ptr->x, 5); + break; + case 27: + case 28: + (void)gain_random_mutation(0); + break; + case 29: + case 30: + apply_disenchant(1); + break; + case 31: + lose_all_info(); + break; + case 32: + fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10)); + break; + case 33: + wall_stone(); + break; + case 34: + case 35: + while (counter++ < 8) { - case 28: case 29: - if (!(*count)) - { - msg_print(_("å°é¢ãæºãã...", "The ground trembles...")); - earthquake(p_ptr->y, p_ptr->x, 5 + randint0(10)); - if (!one_in_(6)) break; - } - case 30: case 31: - if (!(*count)) - { - int dam = damroll(10, 10); - msg_print(_("ç´ç²ãªéåã®æ¬¡å ã¸ã®æãéããï¼", "A portal opens to a plane of raw mana!")); - project(0, 8, p_ptr->y, p_ptr->x, dam, GF_MANA, flg, -1); - take_hit(DAMAGE_NOESCAPE, dam, _("ç´ç²ãªéåã®è§£æ¾", "released pure mana"), -1); - if (!one_in_(6)) break; - } - case 32: case 33: - if (!(*count)) - { - msg_print(_("å¨å²ã®ç©ºéãæªãã ï¼", "Space warps about you!")); - teleport_player(damroll(10, 10), TELEPORT_PASSIVE); - if (randint0(13)) (*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE); - if (!one_in_(6)) break; - } - case 34: - msg_print(_("ã¨ãã«ã®ã¼ã®ããããæããï¼", "You feel a surge of energy!")); - wall_breaker(); - if (!randint0(7)) - { - project(0, 7, p_ptr->y, p_ptr->x, 50, GF_KILL_WALL, flg, -1); - take_hit(DAMAGE_NOESCAPE, 50, _("ã¨ãã«ã®ã¼ã®ããã", "surge of energy"), -1); - } - if (!one_in_(6)) break; - case 1: case 2: case 3: case 16: case 17: - aggravate_monsters(0); - if (!one_in_(6)) break; - case 4: case 5: case 6: - (*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE); - if (!one_in_(6)) break; - case 7: case 8: case 9: case 18: - (*count) += summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); - if (!one_in_(6)) break; - case 10: case 11: case 12: - msg_print(_("çµé¨å¤ãä½ããå¸ãåãããæ°ãããï¼", "You feel your experience draining away...")); - lose_exp(p_ptr->exp / 16); - if (!one_in_(6)) break; - case 13: case 14: case 15: case 19: case 20: - if (stop_ty || (p_ptr->free_act && (randint1(125) < p_ptr->skill_sav)) || (p_ptr->pclass == CLASS_BERSERKER)) - { - /* Do nothing */ ; - } - else - { - msg_print(_("彫åã«ãªã£ãæ°åã ï¼", "You feel like a statue!")); - if (p_ptr->free_act) - set_paralyzed(p_ptr->paralyzed + randint1(3)); - else - set_paralyzed(p_ptr->paralyzed + randint1(13)); - stop_ty = TRUE; - } - if (!one_in_(6)) break; - case 21: case 22: case 23: - (void)do_dec_stat(randint0(6)); - if (!one_in_(6)) break; - case 24: - msg_print(_("ã»ãï¼ç§ã¯èª°ï¼ããã§ä½ãã¦ãï¼", "Huh? Who am I? What am I doing here?")); - lose_all_info(); - if (!one_in_(6)) break; - case 25: - /* - * Only summon Cyberdemons deep in the dungeon. - */ - if ((dun_level > 65) && !stop_ty) - { - (*count) += summon_cyber(-1, p_ptr->y, p_ptr->x); - stop_ty = TRUE; - break; - } - if (!one_in_(6)) break; - default: - while (i < 6) - { - do - { - (void)do_dec_stat(i); - } - while (one_in_(2)); - - i++; - } + (void)summon_specific(0, p_ptr->y, p_ptr->x, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET)); } + break; + case 36: + case 37: + activate_hi_summon(p_ptr->y, p_ptr->x, FALSE); + break; + case 38: + (void)summon_cyber(-1, p_ptr->y, p_ptr->x); + break; + default: + { + int count = 0; + (void)activate_ty_curse(FALSE, &count); + break; + } } - while (one_in_(3) && !stop_ty); - return stop_ty; + return; } /*! - * @brief HI_SUMMON(ä¸ç´å¬å)å¦ççºå - * @param y å¬åä½ç½®Yåº§æ¨ - * @param x å¬åä½ç½®Xåº§æ¨ - * @param can_pet ãã¬ã¤ã¤ã¼ã®ãããã¨ãªãå¯è½æ§ããããªãã°TRUEã«ãã - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -int activate_hi_summon(int y, int x, bool can_pet) +* @brief ã«ãªã¹éæ³ãæµæ群ãã®å¦çã¨ãã¦ãã¬ã¤ã¤ã¼ãä¸å¿ã«éç³è½ä¸å¦çã10+1d10åç¹°ãè¿ãã +* / Drop 10+1d10 meteor ball at random places near the player +* @param dam ãã¡ã¼ã¸ +* @param rad å¹åã®åå¾ +* @return ãªã +*/ +void cast_meteor(HIT_POINT dam, POSITION rad) { int i; - int count = 0; - int summon_lev; - u32b mode = PM_ALLOW_GROUP; - bool pet = FALSE; + int b = 10 + randint1(10); - if (can_pet) + for (i = 0; i < b; i++) { - if (one_in_(4)) - { - mode |= PM_FORCE_FRIENDLY; - } - else + POSITION y = 0, x = 0; + int count; + + for (count = 0; count <= 20; count++) { - mode |= PM_FORCE_PET; - pet = TRUE; - } - } + int dy, dx, d; - if (!pet) mode |= PM_NO_PET; + x = p_ptr->x - 8 + randint0(17); + y = p_ptr->y - 8 + randint0(17); - summon_lev = (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : dun_level); + dx = (p_ptr->x > x) ? (p_ptr->x - x) : (x - p_ptr->x); + dy = (p_ptr->y > y) ? (p_ptr->y - y) : (y - p_ptr->y); - for (i = 0; i < (randint1(7) + (dun_level / 40)); i++) - { - switch (randint1(25) + (dun_level / 20)) - { - case 1: case 2: - count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode); - break; - case 3: case 4: - count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode); - break; - case 5: case 6: - count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode); - break; - case 7: case 8: - count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode); - break; - case 9: case 10: - count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode); - break; - case 11: case 12: - count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode); - break; - case 13: case 14: - count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode); - break; - case 15: case 16: - count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode); - break; - case 17: - if (can_pet) break; - count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE)); - break; - case 18: case 19: - if (can_pet) break; - count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE)); - break; - case 20: case 21: - if (!can_pet) mode |= PM_ALLOW_UNIQUE; - count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode); - break; - case 22: case 23: - if (!can_pet) mode |= PM_ALLOW_UNIQUE; - count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode); - break; - case 24: - count += summon_specific((pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode); - break; - default: - if (!can_pet) mode |= PM_ALLOW_UNIQUE; - count += summon_specific((pet ? -1 : 0), y, x,pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode); + /* Approximate distance */ + d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1)); + + if (d >= 9) continue; + + if (!in_bounds(y, x) || !projectable(p_ptr->y, p_ptr->x, y, x) + || !cave_have_flag_bold(y, x, FF_PROJECT)) continue; + + /* Valid position */ + break; } - } - return count; + if (count > 20) continue; + + project(0, rad, y, x, dam, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1); + } } /*! - * @brief ãµã¤ãã¼ãã¼ã¢ã³ã®å¬å - * @param who å¬å主ã®ã¢ã³ã¹ã¿ã¼ID(0ãªãã°ãã¬ã¤ã¤ã¼) - * @param y å¬åä½ç½®Yåº§æ¨ - * @param x å¬åä½ç½®Xåº§æ¨ - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -int summon_cyber(int who, int y, int x) +* @brief ç ´éªéæ³ãç¥ã®æããã®å¦çã¨ãã¦ã¿ã¼ã²ãããæå®ããå¾å解ã®ãã¼ã«ãæ大20åçºçãããã +* @param dam ãã¡ã¼ã¸ +* @param rad å¹åã®åå¾ +* @return ã¿ã¼ã²ãããæå®ããå®è¡ãããªãã°TRUEãè¿ãã +*/ +bool cast_wrath_of_the_god(HIT_POINT dam, POSITION rad) { + POSITION x, y, tx, ty; + POSITION nx, ny; + DIRECTION dir; int i; - int max_cyber = (easy_band ? 1 : (dun_level / 50) + randint1(2)); - int count = 0; - u32b mode = PM_ALLOW_GROUP; + int b = 10 + randint1(10); - /* Summoned by a monster */ - if (who > 0) + if (!get_aim_dir(&dir)) return FALSE; + + /* Use the given direction */ + tx = p_ptr->x + 99 * ddx[dir]; + ty = p_ptr->y + 99 * ddy[dir]; + + /* Hack -- Use an actual "target" */ + if ((dir == 5) && target_okay()) { - monster_type *m_ptr = &m_list[who]; - if (is_pet(m_ptr)) mode |= PM_FORCE_PET; + tx = target_col; + ty = target_row; } - if (max_cyber > 4) max_cyber = 4; + x = p_ptr->x; + y = p_ptr->y; - for (i = 0; i < max_cyber; i++) + while (1) { - count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode); + /* Hack -- Stop at the target */ + if ((y == ty) && (x == tx)) break; + + ny = y; + nx = x; + mmove2(&ny, &nx, p_ptr->y, p_ptr->x, ty, tx); + + /* Stop at maximum range */ + if (MAX_RANGE <= distance(p_ptr->y, p_ptr->x, ny, nx)) break; + + /* Stopped by walls/doors */ + if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break; + + /* Stopped by monsters */ + if ((dir != 5) && cave[ny][nx].m_idx != 0) break; + + /* Save the new location */ + x = nx; + y = ny; } + tx = x; + ty = y; - return count; + for (i = 0; i < b; i++) + { + int count = 20, d = 0; + + while (count--) + { + int dx, dy; + + x = tx - 5 + randint0(11); + y = ty - 5 + randint0(11); + + dx = (tx > x) ? (tx - x) : (x - tx); + dy = (ty > y) ? (ty - y) : (y - ty); + + /* Approximate distance */ + d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1)); + /* Within the radius */ + if (d < 5) break; + } + + if (count < 0) continue; + + /* Cannot penetrate perm walls */ + if (!in_bounds(y, x) || + cave_stop_disintegration(y, x) || + !in_disintegration_range(ty, tx, y, x)) + continue; + + project(0, rad, y, x, dam, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1); + } + + return TRUE; } /*! - * @brief å¨è¾ºç ´å£å¹æ(ãã¬ã¤ã¤ã¼ä¸å¿) - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -void wall_breaker(void) +* @brief ãã¯ã³ãã¼ãã®ã©ã³ãã ãªå¹æã決å®ãã¦å¦çããã +* @param dir æ¹åID +* @return ãªã +* @details +* This spell should become more useful (more controlled) as the\n +* player gains experience levels. Thus, add 1/5 of the player's\n +* level to the die roll. This eliminates the worst effects later on,\n +* while keeping the results quite random. It also allows some potent\n +* effects only at high level. +*/ +void cast_wonder(DIRECTION dir) { - int i; - POSITION y = 0, x = 0; - int attempts = 1000; + PLAYER_LEVEL plev = p_ptr->lev; + int die = randint1(100) + plev / 5; + int vir = virtue_number(V_CHANCE); - if (randint1(80 + p_ptr->lev) < 70) + if (vir) { - while (attempts--) + if (p_ptr->virtues[vir - 1] > 0) { - scatter(&y, &x, p_ptr->y, p_ptr->x, 4, 0); + while (randint1(400) < p_ptr->virtues[vir - 1]) die++; + } + else + { + while (randint1(400) < (0 - p_ptr->virtues[vir - 1])) die--; + } + } - if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue; + if (die < 26) + chg_virtue(V_CHANCE, 1); - if (!player_bold(y, x)) break; + if (die > 100) + { + msg_print(_("ããªãã¯åãã¿ãªããã®ãæããï¼", "You feel a surge of power!")); + } + + if (die < 8) clone_monster(dir); + else if (die < 14) speed_monster(dir, plev); + else if (die < 26) heal_monster(dir, damroll(4, 6)); + else if (die < 31) poly_monster(dir, plev); + else if (die < 36) + fire_bolt_or_beam(beam_chance() - 10, GF_MISSILE, dir, + damroll(3 + ((plev - 1) / 5), 4)); + else if (die < 41) confuse_monster(dir, plev); + else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3); + else if (die < 51) (void)lite_line(dir, damroll(6, 8)); + else if (die < 56) + fire_bolt_or_beam(beam_chance() - 10, GF_ELEC, dir, + damroll(3 + ((plev - 5) / 4), 8)); + else if (die < 61) + fire_bolt_or_beam(beam_chance() - 10, GF_COLD, dir, + damroll(5 + ((plev - 5) / 4), 8)); + else if (die < 66) + fire_bolt_or_beam(beam_chance(), GF_ACID, dir, + damroll(6 + ((plev - 5) / 4), 8)); + else if (die < 71) + fire_bolt_or_beam(beam_chance(), GF_FIRE, dir, + damroll(8 + ((plev - 5) / 4), 8)); + else if (die < 76) hypodynamic_bolt(dir, 75); + else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2); + else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2); + else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3); + else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3); + else if (die < 101) hypodynamic_bolt(dir, 100 + plev); + else if (die < 104) + { + earthquake(p_ptr->y, p_ptr->x, 12); + } + else if (die < 106) + { + (void)destroy_area(p_ptr->y, p_ptr->x, 13 + randint0(5), FALSE); + } + else if (die < 108) + { + symbol_genocide(plev + 50, TRUE); + } + else if (die < 110) dispel_monsters(120); + else /* RARE */ + { + dispel_monsters(150); + slow_monsters(plev); + sleep_monsters(plev); + hp_player(300); + } +} + + +/*! +* @brief ãæªéå¬åãã®ã©ã³ãã ãªå¹æã決å®ãã¦å¦çããã +* @param dir æ¹åID +* @return ãªã +*/ +void cast_invoke_spirits(DIRECTION dir) +{ + PLAYER_LEVEL plev = p_ptr->lev; + int die = randint1(100) + plev / 5; + int vir = virtue_number(V_CHANCE); + + if (vir) + { + if (p_ptr->virtues[vir - 1] > 0) + { + while (randint1(400) < p_ptr->virtues[vir - 1]) die++; } + else + { + while (randint1(400) < (0 - p_ptr->virtues[vir - 1])) die--; + } + } - project(0, 0, y, x, 20 + randint1(30), GF_KILL_WALL, - (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1); + msg_print(_("ããªãã¯æ»è ãã¡ã®åãæéãã...", "You call on the power of the dead...")); + if (die < 26) + chg_virtue(V_CHANCE, 1); + + if (die > 100) + { + msg_print(_("ããªãã¯ãã©ããã©ãããåã®ããããæããï¼", "You feel a surge of eldritch force!")); } - else if (randint1(100) > 30) + + if (die < 8) { - earthquake(p_ptr->y, p_ptr->x, 1); + msg_print(_("ãªãã¦ãã£ãï¼ããªãã®å¨ãã®å°é¢ããæ½ã¡ã人影ãç«ã¡ä¸ãã£ã¦ããï¼", + "Oh no! Mouldering forms rise from the earth around you!")); + + (void)summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); + chg_virtue(V_UNLIFE, 1); } - else + else if (die < 14) { - int num = damroll(5, 3); + msg_print(_("åç¶ãé£ãéªæªãªåå¨ãããªãã®å¿ãéãéãã¦è¡ã£ã...", "An unnamable evil brushes against your mind...")); - for (i = 0; i < num; i++) - { - while (1) - { - scatter(&y, &x, p_ptr->y, p_ptr->x, 10, 0); + set_afraid(p_ptr->afraid + randint1(4) + 4); + } + else if (die < 26) + { + msg_print(_("ããªãã®é ã«å¤§éã®å¹½éãã¡ã®é¨ã ãã声ãæ¼ãå¯ãã¦ãã...", + "Your head is invaded by a horde of gibbering spectral voices...")); - if (!player_bold(y, x)) break; - } + set_confused(p_ptr->confused + randint1(4) + 4); + } + else if (die < 31) + { + poly_monster(dir, plev); + } + else if (die < 36) + { + fire_bolt_or_beam(beam_chance() - 10, GF_MISSILE, dir, + damroll(3 + ((plev - 1) / 5), 4)); + } + else if (die < 41) + { + confuse_monster(dir, plev); + } + else if (die < 46) + { + fire_ball(GF_POIS, dir, 20 + (plev / 2), 3); + } + else if (die < 51) + { + (void)lite_line(dir, damroll(6, 8)); + } + else if (die < 56) + { + fire_bolt_or_beam(beam_chance() - 10, GF_ELEC, dir, + damroll(3 + ((plev - 5) / 4), 8)); + } + else if (die < 61) + { + fire_bolt_or_beam(beam_chance() - 10, GF_COLD, dir, + damroll(5 + ((plev - 5) / 4), 8)); + } + else if (die < 66) + { + fire_bolt_or_beam(beam_chance(), GF_ACID, dir, + damroll(6 + ((plev - 5) / 4), 8)); + } + else if (die < 71) + { + fire_bolt_or_beam(beam_chance(), GF_FIRE, dir, + damroll(8 + ((plev - 5) / 4), 8)); + } + else if (die < 76) + { + hypodynamic_bolt(dir, 75); + } + else if (die < 81) + { + fire_ball(GF_ELEC, dir, 30 + plev / 2, 2); + } + else if (die < 86) + { + fire_ball(GF_ACID, dir, 40 + plev, 2); + } + else if (die < 91) + { + fire_ball(GF_ICE, dir, 70 + plev, 3); + } + else if (die < 96) + { + fire_ball(GF_FIRE, dir, 80 + plev, 3); + } + else if (die < 101) + { + hypodynamic_bolt(dir, 100 + plev); + } + else if (die < 104) + { + earthquake(p_ptr->y, p_ptr->x, 12); + } + else if (die < 106) + { + (void)destroy_area(p_ptr->y, p_ptr->x, 13 + randint0(5), FALSE); + } + else if (die < 108) + { + symbol_genocide(plev + 50, TRUE); + } + else if (die < 110) + { + dispel_monsters(120); + } + else + { /* RARE */ + dispel_monsters(150); + slow_monsters(plev); + sleep_monsters(plev); + hp_player(300); + } - project(0, 0, y, x, 20 + randint1(30), GF_KILL_WALL, - (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1); - } + if (die < 31) + { + msg_print(_("é°æ¬ãªå£°ãã¯ã¹ã¯ã¹ç¬ããããããããã¾ãã¯æã ã®ä»²éã«ãªãã ãããå¼±ãè ããã", + "Sepulchral voices chuckle. 'Soon you will join us, mortal.'")); } } - /*! - * @brief ãããã¯ã»ã¢ã³ã¹ã¿ã¼å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Confuse monsters - * @param dam å¹å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool confuse_monsters(int dam) +* @brief ãã©ã³ãé åã®ãã·ã£ããã«ãã®å¹æãã©ã³ãã ã«æ±ºãã¦å¦çããã +* @return ãªã +*/ +void cast_shuffle(void) { - return (project_hack(GF_OLD_CONF, dam)); -} - + PLAYER_LEVEL plev = p_ptr->lev; + DIRECTION dir; + int die; + int vir = virtue_number(V_CHANCE); + int i; -/*! - * @brief ãã£ã¼ã ã»ã¢ã³ã¹ã¿ã¼å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Charm monsters - * @param dam å¹å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool charm_monsters(int dam) -{ - return (project_hack(GF_CHARM, dam)); -} + /* Card sharks and high mages get a level bonus */ + if ((p_ptr->pclass == CLASS_ROGUE) || + (p_ptr->pclass == CLASS_HIGH_MAGE) || + (p_ptr->pclass == CLASS_SORCERER)) + die = (randint1(110)) + plev / 5; + else + die = randint1(120); -/*! - * @brief åç©é äºå¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Charm Animals - * @param dam å¹å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool charm_animals(int dam) -{ - return (project_hack(GF_CONTROL_ANIMAL, dam)); -} + if (vir) + { + if (p_ptr->virtues[vir - 1] > 0) + { + while (randint1(400) < p_ptr->virtues[vir - 1]) die++; + } + else + { + while (randint1(400) < (0 - p_ptr->virtues[vir - 1])) die--; + } + } + msg_print(_("ããªãã¯ã«ã¼ããåã£ã¦ä¸æå¼ãã...", "You shuffle the deck and draw a card...")); -/*! - * @brief ã¢ã³ã¹ã¿ã¼æ¦æ§å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Stun monsters - * @param dam å¹å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool stun_monsters(int dam) -{ - return (project_hack(GF_STUN, dam)); -} + if (die < 30) + chg_virtue(V_CHANCE, 1); + if (die < 7) + { + msg_print(_("ãªãã¦ãã£ãï¼ãæ»ãã ï¼", "Oh no! It's Death!")); -/*! - * @brief ã¢ã³ã¹ã¿ã¼åæ¢å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Stasis monsters - * @param dam å¹å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool stasis_monsters(int dam) -{ - return (project_hack(GF_STASIS, dam)); -} + for (i = 0; i < randint1(3); i++) + activate_hi_summon(p_ptr->y, p_ptr->x, FALSE); + } + else if (die < 14) + { + msg_print(_("ãªãã¦ãã£ãï¼ãæªéãã ï¼", "Oh no! It's the Devil!")); + summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); + } + else if (die < 18) + { + int count = 0; + msg_print(_("ãªãã¦ãã£ãï¼ãåãããç·ãã ï¼", "Oh no! It's the Hanged Man.")); + activate_ty_curse(FALSE, &count); + } + else if (die < 22) + { + msg_print(_("ãä¸èª¿åã®å£ãã ã", "It's the swords of discord.")); + aggravate_monsters(0); + } + else if (die < 26) + { + msg_print(_("ãæè ãã ã", "It's the Fool.")); + do_dec_stat(A_INT); + do_dec_stat(A_WIS); + } + else if (die < 30) + { + msg_print(_("å¥å¦ãªã¢ã³ã¹ã¿ã¼ã®çµµã ã", "It's the picture of a strange monster.")); + trump_summoning(1, FALSE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE); + } + else if (die < 33) + { + msg_print(_("ãæãã ã", "It's the Moon.")); + unlite_area(10, 3); + } + else if (die < 38) + { + msg_print(_("ãéå½ã®è¼ªãã ã", "It's the Wheel of Fortune.")); + wild_magic(randint0(32)); + } + else if (die < 40) + { + msg_print(_("ãã¬ãã¼ãã»ã«ã¼ãã ã", "It's a teleport trump card.")); + teleport_player(10, TELEPORT_PASSIVE); + } + else if (die < 42) + { + msg_print(_("ãæ£ç¾©ãã ã", "It's Justice.")); + set_blessed(p_ptr->lev, FALSE); + } + else if (die < 47) + { + msg_print(_("ãã¬ãã¼ãã»ã«ã¼ãã ã", "It's a teleport trump card.")); + teleport_player(100, TELEPORT_PASSIVE); + } + else if (die < 52) + { + msg_print(_("ãã¬ãã¼ãã»ã«ã¼ãã ã", "It's a teleport trump card.")); + teleport_player(200, TELEPORT_PASSIVE); + } + else if (die < 60) + { + msg_print(_("ãå¡ãã ã", "It's the Tower.")); + wall_breaker(); + } + else if (die < 72) + { + msg_print(_("ãç¯å¶ãã ã", "It's Temperance.")); + sleep_monsters_touch(); + } + else if (die < 80) + { + msg_print(_("ãå¡ãã ã", "It's the Tower.")); + earthquake(p_ptr->y, p_ptr->x, 5); + } + else if (die < 82) + { + msg_print(_("å好çãªã¢ã³ã¹ã¿ã¼ã®çµµã ã", "It's the picture of a friendly monster.")); + trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_MOLD, 0L); + } + else if (die < 84) + { + msg_print(_("å好çãªã¢ã³ã¹ã¿ã¼ã®çµµã ã", "It's the picture of a friendly monster.")); + trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_BAT, 0L); + } + else if (die < 86) + { + msg_print(_("å好çãªã¢ã³ã¹ã¿ã¼ã®çµµã ã", "It's the picture of a friendly monster.")); + trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_VORTEX, 0L); + } + else if (die < 88) + { + msg_print(_("å好çãªã¢ã³ã¹ã¿ã¼ã®çµµã ã", "It's the picture of a friendly monster.")); + trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_COIN_MIMIC, 0L); + } + else if (die < 96) + { + msg_print(_("ãæ人ãã ã", "It's the Lovers.")); -/*! - * @brief ã¢ã³ã¹ã¿ã¼ç²¾ç¥æ»æå¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Mindblast monsters - * @param dam å¹å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool mindblast_monsters(int dam) -{ - return (project_hack(GF_PSI, dam)); + if (get_aim_dir(&dir)) + charm_monster(dir, MIN(p_ptr->lev, 20)); + } + else if (die < 101) + { + msg_print(_("ãé è ãã ã", "It's the Hermit.")); + wall_stone(); + } + else if (die < 111) + { + msg_print(_("ã審å¤ãã ã", "It's the Judgement.")); + do_cmd_rerate(FALSE); + lose_all_mutations(); + } + else if (die < 120) + { + msg_print(_("ã太é½ãã ã", "It's the Sun.")); + chg_virtue(V_KNOWLEDGE, 1); + chg_virtue(V_ENLIGHTEN, 1); + wiz_lite(FALSE); + } + else + { + msg_print(_("ãä¸çãã ã", "It's the World.")); + if (p_ptr->exp < PY_MAX_EXP) + { + s32b ee = (p_ptr->exp / 25) + 1; + if (ee > 5000) ee = 5000; + msg_print(_("æ´ã«çµé¨ãç©ãã ãããªæ°ãããã", "You feel more experienced.")); + gain_exp(ee); + } + } } - -/*! - * @brief ã¢ã³ã¹ã¿ã¼è¿½æ¾å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Banish all monsters - * @param dist å¹åï¼è·é¢ï¼ - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool banish_monsters(int dist) +bool_hack life_stream(bool_hack message, bool_hack virtue) { - return (project_hack(GF_AWAY_ALL, dist)); -} + if(virtue) + { + chg_virtue(V_VITALITY, 1); + chg_virtue(V_UNLIFE, -5); + } + if(message) + { + msg_print(_("ä½ä¸ã«çå½åãæºã¡ããµãã¦ããï¼", "You feel life flow through your body!")); + } + restore_level(); + (void)set_poisoned(0); + (void)set_blind(0); + (void)set_confused(0); + (void)set_image(0); + (void)set_stun(0); + (void)set_cut(0); + (void)restore_all_status(); + (void)set_shero(0, TRUE); + handle_stuff(); + hp_player(5000); + return TRUE; +} -/*! - * @brief éªæªéæ£å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Turn evil - * @param dam å¹å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool turn_evil(int dam) +bool_hack heroism(int base) { - return (project_hack(GF_TURN_EVIL, dam)); + bool_hack ident = FALSE; + if(set_afraid(0)) ident = TRUE; + if(set_hero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE; + if(hp_player(10)) ident = TRUE; + return ident; } - -/*! - * @brief å ¨ã¢ã³ã¹ã¿ã¼éæ£å¹æ(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Turn everyone - * @param dam å¹å - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool turn_monsters(int dam) +bool_hack berserk(int base) { - return (project_hack(GF_TURN_ALL, dam)); + bool_hack ident = FALSE; + if (set_afraid(0)) ident = TRUE; + if (set_shero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE; + if (hp_player(30)) ident = TRUE; + return ident; } - -/*! - * @brief æ»ã®å ç·(ãã¬ã¤ã¤ã¼è¦çç¯å²å ) / Death-ray all monsters (note: OBSCENELY powerful) - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool deathray_monsters(void) +bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides) { - return (project_hack(GF_DEATH_RAY, p_ptr->lev * 200)); + bool_hack ident = FALSE; + if (hp_player(damroll(dice, sides))) ident = TRUE; + if (set_blind(0)) ident = TRUE; + if (set_cut(p_ptr->cut - 10)) ident = TRUE; + if (set_shero(0, TRUE)) ident = TRUE; + return ident; } -/*! - * @brief ãã£ã¼ã ã»ã¢ã³ã¹ã¿ã¼(1ä½) - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param plev ãã¯ã¼ - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool charm_monster(int dir, int plev) +bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides) { - int flg = PROJECT_STOP | PROJECT_KILL; - return (project_hook(GF_CHARM, dir, plev, flg)); + bool_hack ident = FALSE; + if (hp_player(damroll(dice, sides))) ident = TRUE; + if (set_blind(0)) ident = TRUE; + if (set_confused(0)) ident = TRUE; + if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE; + if (set_shero(0, TRUE)) ident = TRUE; + return ident; } -/*! - * @brief ã¢ã³ãããæ¯é (1ä½) - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param plev ãã¯ã¼ - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool control_one_undead(int dir, int plev) +bool_hack cure_critical_wounds(HIT_POINT pow) { - int flg = PROJECT_STOP | PROJECT_KILL; - return (project_hook(GF_CONTROL_UNDEAD, dir, plev, flg)); + bool_hack ident = FALSE; + if (hp_player(pow)) ident = TRUE; + if (set_blind(0)) ident = TRUE; + if (set_confused(0)) ident = TRUE; + if (set_poisoned(0)) ident = TRUE; + if (set_stun(0)) ident = TRUE; + if (set_cut(0)) ident = TRUE; + if (set_shero(0, TRUE)) ident = TRUE; + return ident; } -/*! - * @brief æªéæ¯é (1ä½) - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param plev ãã¯ã¼ - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool control_one_demon(int dir, int plev) +bool_hack true_healing(HIT_POINT pow) { - int flg = PROJECT_STOP | PROJECT_KILL; - return (project_hook(GF_CONTROL_DEMON, dir, plev, flg)); + bool_hack ident = FALSE; + if (hp_player(pow)) ident = TRUE; + if (set_blind(0)) ident = TRUE; + if (set_confused(0)) ident = TRUE; + if (set_poisoned(0)) ident = TRUE; + if (set_stun(0)) ident = TRUE; + if (set_cut(0)) ident = TRUE; + if (set_image(0)) ident = TRUE; + return ident; } -/*! - * @brief åç©æ¯é (1ä½) - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param plev ãã¯ã¼ - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool charm_animal(int dir, int plev) +bool_hack restore_mana(bool_hack magic_eater) { - int flg = PROJECT_STOP | PROJECT_KILL; - return (project_hook(GF_CONTROL_ANIMAL, dir, plev, flg)); + bool_hack ident = FALSE; + + if (p_ptr->pclass == CLASS_MAGIC_EATER && magic_eater) + { + int i; + for (i = 0; i < EATER_EXT * 2; i++) + { + p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_CHARGE / 3; + if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i] * EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i] * EATER_CHARGE; + } + for (; i < EATER_EXT * 3; i++) + { + KIND_OBJECT_IDX k_idx = lookup_kind(TV_ROD, i - EATER_EXT * 2); + p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_ROD_CHARGE / 3)*k_info[k_idx].pval; + if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0; + } + msg_print(_("é ãããããªã¨ããã", "You feel your head clear.")); + p_ptr->window |= (PW_PLAYER); + ident = TRUE; + } + else if (p_ptr->csp < p_ptr->msp) + { + p_ptr->csp = p_ptr->msp; + p_ptr->csp_frac = 0; + msg_print(_("é ãããããªã¨ããã", "You feel your head clear.")); + p_ptr->redraw |= (PR_MANA); + p_ptr->window |= (PW_PLAYER); + p_ptr->window |= (PW_SPELL); + ident = TRUE; + } + + return ident; } -/*! - * @brief çç©æ¯é (1ä½) - * @param dir æ¹å(5ãªãã°ã°ãã¼ãã«å¤æ° target_col/target_row ã®åº§æ¨ãç®æ¨ã«ãã) - * @param plev ãã¯ã¼ - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã - */ -bool charm_living(int dir, int plev) +bool restore_all_status(void) { - int flg = PROJECT_STOP | PROJECT_KILL; - return (project_hook(GF_CONTROL_LIVING, dir, plev, flg)); + bool ident = FALSE; + if (do_res_stat(A_STR)) ident = TRUE; + if (do_res_stat(A_INT)) ident = TRUE; + if (do_res_stat(A_WIS)) ident = TRUE; + if (do_res_stat(A_DEX)) ident = TRUE; + if (do_res_stat(A_CON)) ident = TRUE; + if (do_res_stat(A_CHR)) ident = TRUE; + return ident; } /*! - * @brief å¤ãã身å¦ç - * @param success å¤å®æåä¸ã®å¦çãªãã°TRUE - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã + * @brief å£ã使ãç¶ç¶çãªå¦çãä¸æãã + * @return ãªã */ -bool kawarimi(bool success) +void stop_mouth(void) { - object_type forge; - object_type *q_ptr = &forge; - int y, x; + if (music_singing_any()) stop_singing(); + if (hex_spelling_any()) stop_hex_spell_all(); +} - if (p_ptr->is_dead) return FALSE; - if (p_ptr->confused || p_ptr->blind || p_ptr->paralyzed || p_ptr->image) return FALSE; - if (randint0(200) < p_ptr->stun) return FALSE; - if (!success && one_in_(3)) +bool_hack vampirism(void) +{ + DIRECTION dir; + POSITION x, y; + int dummy; + cave_type *c_ptr; + + if (d_info[dungeon_type].flags1 & DF1_NO_MELEE) { - msg_print(_("失æï¼éããããªãã£ãã", "Failed! You couldn't run away.")); - p_ptr->special_defense &= ~(NINJA_KAWARIMI); - p_ptr->redraw |= (PR_STATUS); + msg_print(_("ãªããæ»æãããã¨ãã§ããªãã", "Something prevent you from attacking.")); return FALSE; } - y = p_ptr->y; - x = p_ptr->x; - - teleport_player(10 + randint1(90), 0L); - - object_wipe(q_ptr); + /* Only works on adjacent monsters */ + if (!get_direction(&dir, FALSE, FALSE)) return FALSE; + y = p_ptr->y + ddy[dir]; + x = p_ptr->x + ddx[dir]; + c_ptr = &cave[y][x]; - object_prep(q_ptr, lookup_kind(TV_STATUE, SV_WOODEN_STATUE)); + stop_mouth(); - q_ptr->pval = MON_NINJA; + if (!(c_ptr->m_idx)) + { + msg_print(_("ä½ããªãå ´æã«åã¿ã¤ããï¼", "You bite into thin air!")); + return FALSE; + } - /* Drop it in the dungeon */ - (void)drop_near(q_ptr, -1, y, x); + msg_print(_("ããªãã¯ãã¤ãªã¨ãã¦çãããã...", "You grin and bare your fangs...")); -#ifdef JP - if (success) msg_print("æ»æãåããåã«ç´ æ©ã身ãã²ãããããã"); - else msg_print("失æï¼æ»æãåãã¦ãã¾ã£ãã"); -#else - if (success) msg_print("You have turned around just before the attack hit you."); - else msg_print("Failed! You are hit by the attack."); -#endif + dummy = p_ptr->lev * 2; - p_ptr->special_defense &= ~(NINJA_KAWARIMI); - p_ptr->redraw |= (PR_STATUS); + if (hypodynamic_bolt(dir, dummy)) + { + if (p_ptr->food < PY_FOOD_FULL) + /* No heal if we are "full" */ + (void)hp_player(dummy); + else + msg_print(_("ããªãã¯ç©ºè ¹ã§ã¯ããã¾ããã", "You were not hungry.")); - /* Teleported */ + /* Gain nutritional sustenance: 150/hp drained */ + /* A Food ration gives 5000 food points (by contrast) */ + /* Don't ever get more than "Full" this way */ + /* But if we ARE Gorged, it won't cure us */ + dummy = p_ptr->food + MIN(5000, 100 * dummy); + if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */ + (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy); + } + else + msg_print(_("ããï¼ã²ã©ãå³ã ã", "Yechh. That tastes foul.")); return TRUE; } - -/*! - * @brief å ¥èº«å¦ç / "Rush Attack" routine for Samurai or Ninja - * @param mdeath ç®æ¨ã¢ã³ã¹ã¿ã¼ãæ»äº¡ããããè¿ã - * @return ä½ç¨ãå®éã«ãã£ãå ´åTRUEãè¿ã / Return value is for checking "done" - */ -bool rush_attack(bool *mdeath) +bool panic_hit(void) { - int dir; - int tx, ty; - int tm_idx = 0; - u16b path_g[32]; - int path_n, i; - bool tmp_mdeath = FALSE; - bool moved = FALSE; - - if (mdeath) *mdeath = FALSE; - - project_length = 5; - if (!get_aim_dir(&dir)) return FALSE; - - /* Use the given direction */ - tx = p_ptr->x + project_length * ddx[dir]; - ty = p_ptr->y + project_length * ddy[dir]; + DIRECTION dir; + POSITION x, y; - /* Hack -- Use an actual "target" */ - if ((dir == 5) && target_okay()) + if (!get_direction(&dir, FALSE, FALSE)) return FALSE; + y = p_ptr->y + ddy[dir]; + x = p_ptr->x + ddx[dir]; + if (cave[y][x].m_idx) { - tx = target_col; - ty = target_row; + py_attack(y, x, 0); + if (randint0(p_ptr->skill_dis) < 7) + msg_print(_("ãã¾ãéããããªãã£ãã", "You failed to run away.")); + else + teleport_player(30, 0L); + return TRUE; + } + else + { + msg_print(_("ãã®æ¹åã«ã¯ã¢ã³ã¹ã¿ã¼ã¯ãã¾ããã", "You don't see any monster in this direction")); + msg_print(NULL); + return FALSE; } - if (in_bounds(ty, tx)) tm_idx = cave[ty][tx].m_idx; +} - path_n = project_path(path_g, project_length, p_ptr->y, p_ptr->x, ty, tx, PROJECT_STOP | PROJECT_KILL); - project_length = 0; +/*! +* @brief è¶ è½åè ã®ãµã¤ã³ã¡ããªã¼å¦ç/ Forcibly pseudo-identify an object in the inventory (or on the floor) +* @return ãªã +* @note +* currently this function allows pseudo-id of any object, +* including silly ones like potions & scrolls, which always +* get '{average}'. This should be changed, either to stop such +* items from being pseudo-id'd, or to allow psychometry to +* detect whether the unidentified potion/scroll/etc is +* good (Cure Light Wounds, Restore Strength, etc) or +* bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc). +*/ +bool psychometry(void) +{ + OBJECT_IDX item; + object_type *o_ptr; + char o_name[MAX_NLEN]; + byte feel; + cptr q, s; + bool okay = FALSE; - /* No need to move */ - if (!path_n) return TRUE; + item_tester_no_ryoute = TRUE; + q = _("ã©ã®ã¢ã¤ãã ã調ã¹ã¾ããï¼", "Meditate on which item? "); + s = _("調ã¹ãã¢ã¤ãã ãããã¾ããã", "You have nothing appropriate."); - /* Use ty and tx as to-move point */ - ty = p_ptr->y; - tx = p_ptr->x; + if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE); - /* Project along the path */ - for (i = 0; i < path_n; i++) + /* Get the item (in the pack) */ + if (item >= 0) { - monster_type *m_ptr; - - int ny = GRID_Y(path_g[i]); - int nx = GRID_X(path_g[i]); - - if (cave_empty_bold(ny, nx) && player_can_enter(cave[ny][nx].feat, 0)) - { - ty = ny; - tx = nx; - - /* Go to next grid */ - continue; - } + o_ptr = &inventory[item]; + } - if (!cave[ny][nx].m_idx) - { - if (tm_idx) - { - msg_print(_("失æï¼", "Failed!")); - } - else - { - msg_print(_("ããã«ã¯å ¥èº«ã§ã¯å ¥ããªãã", "You can't move to that place.")); - } + /* Get the item (on the floor) */ + else + { + o_ptr = &o_list[0 - item]; + } - /* Exit loop */ - break; - } + /* It is fully known, no information needed */ + if (object_is_known(o_ptr)) + { + msg_print(_("ä½ãæ°ãããã¨ã¯å¤ããªãã£ãã", "You cannot find out anything more about that.")); + return TRUE; + } - /* Move player before updating the monster */ - if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL); + /* Check for a feeling */ + feel = value_check_aux1(o_ptr); - /* Update the monster */ - update_mon(cave[ny][nx].m_idx, TRUE); + /* Get an object description */ + object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); - /* Found a monster */ - m_ptr = &m_list[cave[ny][nx].m_idx]; + /* Skip non-feelings */ + if (!feel) + { + msg_format(_("%sããã¯ç¹ã«å¤ãã£ãäºã¯æãã¨ããªãã£ãã", "You do not perceive anything unusual about the %s."), o_name); + return TRUE; + } - if (tm_idx != cave[ny][nx].m_idx) - { #ifdef JP - msg_format("%s%sãç«ã¡ãµããã£ã¦ããï¼", tm_idx ? "å¥ã®" : "", - m_ptr->ml ? "ã¢ã³ã¹ã¿ã¼" : "ä½ã"); + msg_format("%sã¯%sã¨ããæãããã...", + o_name, game_inscriptions[feel]); #else - msg_format("There is %s in the way!", m_ptr->ml ? (tm_idx ? "another monster" : "a monster") : "someone"); + msg_format("You feel that the %s %s %s...", + o_name, ((o_ptr->number == 1) ? "is" : "are"), + game_inscriptions[feel]); #endif - } - else if (!player_bold(ty, tx)) - { - /* Hold the monster name */ - char m_name[80]; - - /* Get the monster name (BEFORE polymorphing) */ - monster_desc(m_name, m_ptr, 0); - msg_format(_("ç´ æ©ã%sã®æã«å ¥ãè¾¼ãã ï¼", "You quickly jump in and attack %s!"), m_name); - } - if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL); - moved = TRUE; - tmp_mdeath = py_attack(ny, nx, HISSATSU_NYUSIN); + /* We have "felt" it */ + o_ptr->ident |= (IDENT_SENSE); + + /* "Inscribe" it */ + o_ptr->feeling = feel; + + /* Player touches it */ + o_ptr->marked |= OM_TOUCHED; + + /* Combine / Reorder the pack (later) */ + p_ptr->notice |= (PN_COMBINE | PN_REORDER); + + p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER); + + /* Valid "tval" codes */ + switch (o_ptr->tval) + { + case TV_SHOT: + case TV_ARROW: + case TV_BOLT: + case TV_BOW: + case TV_DIGGING: + case TV_HAFTED: + case TV_POLEARM: + case TV_SWORD: + case TV_BOOTS: + case TV_GLOVES: + case TV_HELM: + case TV_CROWN: + case TV_SHIELD: + case TV_CLOAK: + case TV_SOFT_ARMOR: + case TV_HARD_ARMOR: + case TV_DRAG_ARMOR: + case TV_CARD: + case TV_RING: + case TV_AMULET: + case TV_LITE: + case TV_FIGURINE: + okay = TRUE; break; } - if (!moved && !player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL); - - if (mdeath) *mdeath = tmp_mdeath; - return TRUE; -} - - -/*! - * @brief å ¨é¡ã®æ¶å» / Remove all mirrors in this floor - * @param explode ççºå¦çãä¼´ããªãã°TRUE - * @return ãªã - */ -void remove_all_mirrors(bool explode) -{ - int x, y; + /* Auto-inscription/destroy */ + autopick_alter_item(item, (bool)(okay && destroy_feeling)); - for (x = 0; x < cur_wid; x++) - { - for (y = 0; y < cur_hgt; y++) - { - if (is_mirror_grid(&cave[y][x])) - { - remove_mirror(y, x); - if (explode) - project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, - (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1); - } - } - } + /* Something happened */ + return (TRUE); }