OSDN Git Service

character_xtra時でもプレイヤーの善悪を計算するようにした. 種族別で善
[hengband/hengband.git] / src / mind.c
index 195e9e0..8849711 100644 (file)
@@ -524,15 +524,18 @@ void mindcraft_info(char *p, int use_mind, int power)
 
 #ifdef ALLOW_REPEAT /* TNB */
 
-      /* Get the spell, if available */
-      if (repeat_pull(sn))
+       /* Get the spell, if available */
+       if (repeat_pull(sn))
        {
-         /* Verify the spell */
-         if (mind_ptr->info[*sn].min_lev <= plev)
-           {
-             /* Success */
-             return (TRUE);
-           }
+               /* Hack -- If requested INVEN_FORCE(1111), pull again */
+               if (*sn == INVEN_FORCE) repeat_pull(sn);
+
+               /* Verify the spell */
+               if (mind_ptr->info[*sn].min_lev <= plev)
+               {
+                       /* Success */
+                       return (TRUE);
+               }
        }
 
 #endif /* ALLOW_REPEAT -- TNB */
@@ -588,7 +591,6 @@ void mindcraft_info(char *p, int use_mind, int power)
                                {
                                        if (!only_browse) screen_load();
                                        return (FALSE);
-                                       break;
                                }
 
                                case '8':
@@ -807,14 +809,10 @@ put_str(format("Lv   %s   Fail Info", ((use_mind == MIND_BERSERKER) || (use_mind
        if (redraw && !only_browse) screen_load();
 
        /* Show choices */
-       if (show_choices)
-       {
-               /* Update */
-               p_ptr->window |= (PW_SPELL);
+       p_ptr->window |= (PW_SPELL);
 
-               /* Window stuff */
-               window_stuff();
-       }
+       /* Window stuff */
+       window_stuff();
 
        /* Abort if needed */
        if (!flag) return (FALSE);
@@ -932,7 +930,6 @@ if (!b) msg_print("
                        return psychometry();
                else
                        return ident_spell(FALSE);
-               break;
        case 8:
                /* Mindwave */
 #ifdef JP
@@ -956,7 +953,7 @@ msg_print("
                 * Only heal when Adrenalin Channeling is not active. We check
                 * that by checking if the player isn't fast and 'heroed' atm.
                 */
-               if (!p_ptr->fast || !p_ptr->hero)
+               if (!IS_FAST() || !IS_HERO())
                {
                        hp_player(plev);
                }
@@ -1114,11 +1111,12 @@ static bool cast_force_spell(int spell)
                        int oy = y, ox = x;
                        int 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_info[m_ptr->r_idx].level * 3 / 2) > randint0(dam / 2) + dam/2)
+                       if (randint1(r_ptr->level * 3 / 2) > randint0(dam / 2) + dam/2)
                        {
 #ifdef JP
                                msg_format("%s¤ÏÈô¤Ð¤µ¤ì¤Ê¤«¤Ã¤¿¡£", m_name);
@@ -1154,6 +1152,9 @@ static bool cast_force_spell(int spell)
                                        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);
                                }
                        }
                }
@@ -1181,6 +1182,7 @@ msg_format("%s
 #else
                        msg_format("%^s is no longer invulnerable.", m_name);
 #endif
+                       m_ptr->energy_need += ENERGY_NEED();
                }
                if (m_ptr->fast)
                {
@@ -1404,11 +1406,11 @@ msg_format("There are too many mirrors to control!");
 #else
          msg_print("Go through the world of mirror...");
 #endif
-         return dimension_door();
+         return mirror_tunnel();
+
        /* mirror of recall */
        case 17:
-         if(!word_of_recall())return FALSE;
-         break;
+               return word_of_recall();
        /* multi-shadow */
        case 18:
          set_multishadow(6+randint1(6),FALSE);
@@ -1484,13 +1486,13 @@ static bool cast_berserk_spell(int spell)
 
                py_attack(y, x, 0);
 
-               if (!player_can_enter(cave[y][x].feat) || is_trap(cave[y][x].feat))
+               if (!player_can_enter(cave[y][x].feat, 0) || is_trap(cave[y][x].feat))
                        break;
 
                y += ddy[dir];
                x += ddx[dir];
 
-               if (player_can_enter(cave[y][x].feat) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
+               if (player_can_enter(cave[y][x].feat, 0) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
                {
                        int oy, ox;
 
@@ -1516,7 +1518,7 @@ static bool cast_berserk_spell(int spell)
                        verify_panel();
 
                        /* Update stuff */
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
+                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
 
                        /* Update the monsters */
                        p_ptr->update |= (PU_DISTANCE);
@@ -1676,7 +1678,6 @@ msg_print("
        }
        case 7:
                return ident_spell(FALSE);
-               break;
        case 8:
                set_tim_ffall(randint1(20) + 20, FALSE);
                break;
@@ -1688,11 +1689,7 @@ msg_print("
                set_oppose_fire(plev, FALSE);
                break;
        case 10:
-               project_length = 5;
-               if (!get_aim_dir(&dir)) return FALSE;
-               project_hook(GF_ATTACK, dir, HISSATSU_NYUSIN, PROJECT_STOP | PROJECT_KILL);
-
-               break;
+               return rush_attack(NULL);
        case 11:
        {
                int i;
@@ -1755,8 +1752,7 @@ msg_print("
 
                        if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) &&
                            !(c_ptr->info & CAVE_OBJECT) &&
-                           !(c_ptr->feat >= FEAT_PATTERN_START &&
-                             c_ptr->feat <= FEAT_PATTERN_XTRA2))
+                               !pattern_tile(ny, nx))
                        {
                                ty = ny;
                                tx = nx;
@@ -1784,7 +1780,8 @@ msg_print("
                /* Redraw the new grid */
                lite_spot(ty, tx);
 
-               p_ptr->update |= (PU_MON_LITE);
+               if (r_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
+                       p_ptr->update |= (PU_MON_LITE);
 
                break;
        }
@@ -1828,11 +1825,11 @@ msg_print("
                        int typ = one_in_(2) ? GF_FIRE : one_in_(3) ? GF_NETHER : GF_PLASMA;
                        int attempts = 1000;
 
-                       while(attempts--)
+                       while (attempts--)
                        {
                                scatter(&y, &x, py, px, 4, 0);
 
-                               if ((y != py) || (x != px)) break;
+                               if (!player_bold(y, x)) break;
                        }
                        project(0, 0, y, x, damroll(6 + plev / 8, 10), typ,
                                (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
@@ -2300,6 +2297,4 @@ void do_cmd_mind_browse(void)
                  (void)inkey();
                }
        }
-
-       screen_load();
 }