X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fmind.c;h=4eef34b083c54988fc3a331a3fccd8c809da5cb7;hb=e11d638b260e9641c3691822b55e8e54f9e96024;hp=e153684746ac982a69ff2e680b72cf83631a6cf5;hpb=e9c891aaa0e67f1032e4a966d29b57aa0dbdbc1c;p=hengband%2Fhengband.git diff --git a/src/mind.c b/src/mind.c index e15368474..4eef34b08 100644 --- a/src/mind.c +++ b/src/mind.c @@ -402,7 +402,7 @@ static cptr const mind_tips[5][MAX_MIND_POWERS] = "1体のモンスターと位置を交換する。", "自分のいる床の上に、モンスターが通ると爆発してダメージを与えるルーンを描く。", "一定時間、半物質化し壁を通り抜けられるようになる。さらに、一定時間酸への耐性を得る。装備による耐性に累積する。", - "自分を中心とした超巨大な毒、生命力吸収、混乱の球を発生させ、テレポートする。", + "自分を中心とした超巨大な毒、衰弱、混乱の球を発生させ、テレポートする。", "ランダムな方向に何回か炎か地獄かプラズマのビームを放つ。", "全ての攻撃が、1/2の確率で無効になる。", "", @@ -420,7 +420,7 @@ static cptr const mind_tips[5][MAX_MIND_POWERS] = "Generate a ball centered on you which inflict monster with PSI damage. Or inflict all monsters with PSI damage at level 25.", "Removes fear and stun. Gives heroism and speed. Heals HP a little unless you already have heroism and temporal speed boost.", "Pulls a distant item close to you.", - "Fires a ball which damages monsters and absorbs monsters' mind power. Absorbing is takes more turns which from 0 to 1.5.", + "Fires a ball which damages, co. Absorbing is takes more turns which from 0 to 1.5.", "Fires a beam of pure energy which penetrate the invulnerability barrier.", "Stops time. Consumes all of your SP. The more consumes SP, the longer duration of spell.", "", @@ -545,7 +545,7 @@ void mindcraft_info(char *p, int use_mind, int power) cptr s_dur = "dur "; cptr s_range = "range "; #endif - int plev = p_ptr->lev; + PLAYER_LEVEL plev = p_ptr->lev; strcpy(p, ""); @@ -589,7 +589,7 @@ void mindcraft_info(char *p, int use_mind, int power) case 4: sprintf(p, " %s%d+d20", s_dur, 20 + boost / 5); break; case 5: break; case 6: sprintf(p, " %s%d+d%d", s_dur, 15 + boost / 7, plev / 2); break; - case 7: sprintf(p, " %s%dd8", s_dam, 8 + ((plev - 5) / 5) + boost / 12); break; + case 7: sprintf(p, " %s%dd8", s_dam, 8 + ((plev - 5) / 4) + boost / 12); break; case 8: sprintf(p, " %s10d6+%d", s_dam, plev * 3 / 2 + boost * 3 / 5); break; case 9: break; case 10: sprintf(p, _(" 最大%d体", " max %d"), 1+boost/100); break; @@ -679,17 +679,17 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse) { SPELL_IDX i; int num = 0; - int y = 1; - int x = 10; + TERM_LEN y = 1; + TERM_LEN x = 10; int minfail = 0; - int plev = p_ptr->lev; + PLAYER_LEVEL plev = p_ptr->lev; int chance = 0; int ask = TRUE; char choice; char out_val[160]; char comment[80]; cptr p; - + COMMAND_CODE code; mind_type spell; const mind_power *mind_ptr; bool flag, redraw; @@ -740,13 +740,14 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse) /* Assume cancelled */ *sn = (-1); -#ifdef ALLOW_REPEAT /* TNB */ - /* Get the spell, if available */ - if (repeat_pull(sn)) + + if (repeat_pull(&code)) { + *sn = (SPELL_IDX)code; /* Hack -- If requested INVEN_FORCE(1111), pull again */ - if (*sn == INVEN_FORCE) repeat_pull(sn); + if (*sn == INVEN_FORCE) repeat_pull(&code); + *sn = (SPELL_IDX)code; /* Verify the spell */ if (mind_ptr->info[*sn].min_lev <= plev) @@ -756,8 +757,6 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse) } } -#endif /* ALLOW_REPEAT -- TNB */ - /* Nothing chosen yet */ flag = FALSE; @@ -852,11 +851,9 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse) prt("", y, x); put_str(_("名前", "Name"), y, x + 5); -#ifdef JP -put_str(format("Lv %s 失率 効果", ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35); -#else -put_str(format("Lv %s Fail Info", ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35); -#endif + put_str(format(_("Lv %s 失率 効果", "Lv %s Fail Info"), + ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35); + has_weapon[0] = buki_motteruka(INVEN_RARM); has_weapon[1] = buki_motteruka(INVEN_LARM); @@ -939,11 +936,7 @@ put_str(format("Lv %s Fail Info", ((use_mind == MIND_BERSERKER) || (use_mind strcat(psi_desc, format("%-30s%2d %4d%s %3d%%%s", spell.name, spell.min_lev, mana_cost, -#ifdef JP - (((use_mind == MIND_MINDCRAFTER) && (i == 13)) ? "~" : " "), -#else - (((use_mind == MIND_MINDCRAFTER) && (i == 13)) ? "~ " : " "), -#endif + (((use_mind == MIND_MINDCRAFTER) && (i == 13)) ? _("~", "~ ") : " "), chance, comment)); prt(psi_desc, y + i + 1, x); } @@ -1010,7 +1003,6 @@ put_str(format("Lv %s Fail Info", ((use_mind == MIND_BERSERKER) || (use_mind /* Show choices */ p_ptr->window |= (PW_SPELL); - /* Window stuff */ window_stuff(); /* Abort if needed */ @@ -1019,11 +1011,7 @@ put_str(format("Lv %s Fail Info", ((use_mind == MIND_BERSERKER) || (use_mind /* Save the choice */ (*sn) = i; -#ifdef ALLOW_REPEAT /* TNB */ - - repeat_push(*sn); - -#endif /* ALLOW_REPEAT -- TNB */ + repeat_push((COMMAND_CODE)i); /* Success */ return (TRUE); @@ -1193,13 +1181,11 @@ static bool cast_mindcrafter_spell(int spell) /* Hack */ p_ptr->energy_need -= 1000 + (100 + p_ptr->csp - 50)*TURNS_PER_TICK/10; - /* Redraw map */ p_ptr->redraw |= (PR_MAP); /* Update monsters */ p_ptr->update |= (PU_MONSTERS); - /* Window stuff */ p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); handle_stuff(); @@ -1221,7 +1207,7 @@ static bool cast_mindcrafter_spell(int spell) static bool cast_force_spell(int spell) { DIRECTION dir; - int plev = p_ptr->lev; + PLAYER_LEVEL plev = p_ptr->lev; int boost = P_PTR_KI; if (heavy_armor()) boost /= 2; @@ -1264,63 +1250,8 @@ static bool cast_force_spell(int spell) set_tim_sh_touki(randint1(plev / 2) + 15 + boost / 7, FALSE); break; case 7: - { - int y, x, dam; - project_length = 1; - if (!get_aim_dir(&dir)) return FALSE; - - y = p_ptr->y + ddy[dir]; - x = p_ptr->x + ddx[dir]; - dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8); - fire_beam(GF_MISSILE, dir, dam); - if (cave[y][x].m_idx) - { - int i; - int ty = y, tx = x; - int oy = y, ox = x; - MONSTER_IDX m_idx = cave[y][x].m_idx; - monster_type *m_ptr = &m_list[m_idx]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; - char m_name[80]; - - monster_desc(m_name, m_ptr, 0); - - if (randint1(r_ptr->level * 3 / 2) > randint0(dam / 2) + dam/2) - { - msg_format(_("%sは飛ばされなかった。", "%^s was not blown away."), m_name); - } - else - { - for (i = 0; i < 5; i++) - { - y += ddy[dir]; - x += ddx[dir]; - if (cave_empty_bold(y, x)) - { - ty = y; - tx = x; - } - else break; - } - if ((ty != oy) || (tx != ox)) - { - msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name); - cave[oy][ox].m_idx = 0; - cave[ty][tx].m_idx = (s16b)m_idx; - m_ptr->fy = (byte_hack)ty; - m_ptr->fx = (byte_hack)tx; - - update_mon(m_idx, TRUE); - lite_spot(oy, ox); - lite_spot(ty, tx); - - if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) - p_ptr->update |= (PU_MON_LITE); - } - } - } + return shock_power(); break; - } case 8: if (!get_aim_dir(&dir)) return FALSE; fire_ball(GF_MISSILE, dir, damroll(10, 6) + plev * 3 / 2 + boost * 3 / 5, (plev < 30) ? 2 : 3); @@ -1380,16 +1311,16 @@ static bool cast_force_spell(int spell) * @brief 現在フロアに存在している鏡の数を数える / calculate mirrors * @return 鏡の枚数 */ -static int number_of_mirrors( void ) +static int number_of_mirrors(void) { - int x,y; - int val=0; - for( x=0 ; x < cur_wid ; x++ ){ - for( y=0 ; y < cur_hgt ; y++ ){ - if (is_mirror_grid(&cave[y][x])) val++; - } - } - return val; + POSITION x, y; + int val = 0; + for (x = 0; x < cur_wid; x++) { + for (y = 0; y < cur_hgt; y++) { + if (is_mirror_grid(&cave[y][x])) val++; + } + } + return val; } /*! @@ -1568,7 +1499,7 @@ static bool cast_berserk_spell(int spell) return FALSE; } - if (!get_rep_dir2(&dir)) return FALSE; + if (!get_direction(&dir, FALSE, FALSE)) return FALSE; if (dir == 5) return FALSE; y = p_ptr->y + ddy[dir]; @@ -1599,7 +1530,7 @@ static bool cast_berserk_spell(int spell) } case 2: { - if (!get_rep_dir2(&dir)) return FALSE; + if (!get_direction(&dir, FALSE, FALSE)) return FALSE; y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; move_player(dir, easy_disarm, TRUE); @@ -1627,8 +1558,8 @@ static bool cast_berserk_spell(int spell) static bool cast_ninja_spell(int spell) { POSITION x, y; - int dir; - int plev = p_ptr->lev; + DIRECTION dir; + PLAYER_LEVEL plev = p_ptr->lev; /* spell code */ switch (spell) @@ -1675,22 +1606,7 @@ static bool cast_ninja_spell(int spell) } case 5: { - if (!get_rep_dir(&dir, FALSE)) return FALSE; - y = p_ptr->y + ddy[dir]; - x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) - { - py_attack(y, x, 0); - if (randint0(p_ptr->skill_dis) < 7) - msg_print(_("うまく逃げられなかった。", "You failed to run away.")); - else - teleport_player(30, 0L); - } - else - { - msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction")); - msg_print(NULL); - } + if(!panic_hit()) return FALSE; break; } case 6: @@ -1735,7 +1651,7 @@ static bool cast_ninja_spell(int spell) } /* Gives a multiplier of 2 at first, up to 3 at 40th */ - do_cmd_throw_aux(1, FALSE, slot); + do_cmd_throw(1, FALSE, slot); p_ptr->energy_use = 100; } @@ -1790,7 +1706,7 @@ static bool cast_ninja_spell(int spell) (void)set_monster_csleep(m_idx, 0); /* Update the monster (new location) */ - update_mon(m_idx, TRUE); + update_monster(m_idx, TRUE); /* Redraw the old grid */ lite_spot(target_row, target_col); @@ -1836,7 +1752,7 @@ static bool cast_ninja_spell(int spell) break; case 17: fire_ball(GF_POIS, 0, 75+plev*2/3, plev/5+2); - fire_ball(GF_OLD_DRAIN, 0, 75+plev*2/3, plev/5+2); + fire_ball(GF_HYPODYNAMIA, 0, 75+plev*2/3, plev/5+2); fire_ball(GF_CONFUSION, 0, 75+plev*2/3, plev/5+2); teleport_player(30, 0L); break; @@ -1847,7 +1763,7 @@ static bool cast_ninja_spell(int spell) for (k = 0; k < num; k++) { - int typ = one_in_(2) ? GF_FIRE : one_in_(3) ? GF_NETHER : GF_PLASMA; + EFFECT_ID typ = one_in_(2) ? GF_FIRE : one_in_(3) ? GF_NETHER : GF_PLASMA; int attempts = 1000; while (attempts--) @@ -1881,7 +1797,7 @@ void do_cmd_mind(void) int b = 0; int chance; int minfail = 0; - int plev = p_ptr->lev; + PLAYER_LEVEL plev = p_ptr->lev; int old_csp = p_ptr->csp; mind_type spell; bool cast; @@ -2114,7 +2030,6 @@ void do_cmd_mind(void) } - /* Take a turn */ p_ptr->energy_use = 100; /* teleport from mirror costs small energy */ if( on_mirror && p_ptr->pclass == CLASS_MIRROR_MASTER ) @@ -2155,7 +2070,6 @@ void do_cmd_mind(void) if ((p_ptr->csp - mana_cost) < 0) p_ptr->csp_frac = 0; p_ptr->csp = MAX(0, p_ptr->csp - mana_cost); - /* Message */ msg_format(_("%sを集中しすぎて気を失ってしまった!", "You faint from the effort!"),p); /* Hack -- Bypass free action */ @@ -2166,7 +2080,6 @@ void do_cmd_mind(void) { bool perm = (randint0(100) < 25); - /* Message */ msg_print(_("自分の精神を攻撃してしまった!", "You have damaged your mind!")); /* Reduce constitution */ @@ -2177,7 +2090,6 @@ void do_cmd_mind(void) /* Redraw mana */ p_ptr->redraw |= (PR_MANA); - /* Window stuff */ p_ptr->window |= (PW_PLAYER); p_ptr->window |= (PW_SPELL); }