OSDN Git Service

サーペントに乗馬できる複合バグ(1)+(2)+(3)修正。
[hengband/hengband.git] / src / mind.c
index a4b5298..6323c66 100644 (file)
@@ -322,9 +322,9 @@ void mindcraft_info(char *p, int use_mind, int power)
        case 11: sprintf(p, " %s%dd6", s_dam, plev / 2);  break;
        case 12: sprintf(p, " %sd%d+%d", s_dam, plev * 3, plev * 3); break;
 #ifdef JP
-       case 13: sprintf(p, " ¹ÔÆ°:%d²ó", (p_ptr->csp + p_ptr->energy - 50)/100); break;
+       case 13: sprintf(p, " ¹ÔÆ°:%d²ó", (p_ptr->csp + 100-p_ptr->energy_need - 50)/100); break;
 #else
-       case 13: sprintf(p, " %d acts.", (p_ptr->csp + p_ptr->energy - 50)/100); break;
+       case 13: sprintf(p, " %d acts.", (p_ptr->csp + 100-p_ptr->energy_need - 50)/100); break;
 #endif
        }
       break;
@@ -568,15 +568,15 @@ void mindcraft_info(char *p, int use_mind, int power)
 #else
                (void)strnfmt(out_val, 78, "(%^ss %c-%c, *=List, ESC=exit) Use which %s? ",
 #endif
-               p, I2A(0), I2A(num - 1), p);
+               p, I2A(0), I2A(num - 1), p);
        }
 
        if (use_menu && !only_browse) screen_save();
        /* Get a spell from the user */
 
-        choice= (always_show_list || use_menu) ? ESCAPE:1 ;
-        while (!flag)
-        {
+       choice= (always_show_list || use_menu) ? ESCAPE:1 ;
+       while (!flag)
+       {
                if(choice==ESCAPE) choice = ' '; 
                else if( !get_com(out_val, &choice, TRUE) )break;
 
@@ -610,6 +610,7 @@ void mindcraft_info(char *p, int use_mind, int power)
                                case 'x':
                                case 'X':
                                case '\r':
+                               case '\n':
                                {
                                        i = menu_line - 1;
                                        ask = FALSE;
@@ -692,9 +693,7 @@ put_str(format("Lv   %s   Fail Info", ((use_mind == MIND_BERSERKER) || (use_mind
                                                        chance += 5 * (mana_cost - p_ptr->csp);
                                                }
 
-                                               if (p_ptr->pseikaku == SEIKAKU_NAMAKE) chance += 10;
-                                               if (p_ptr->pseikaku == SEIKAKU_KIREMONO) chance -= 3;
-                                               if ((p_ptr->pseikaku == SEIKAKU_GAMAN) || (p_ptr->pseikaku == SEIKAKU_CHIKARA)) chance++;
+                                               chance += p_ptr->to_m_chance;
 
                                                /* Extract the minimum failure rate */
                                                minfail = adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]];
@@ -862,7 +861,7 @@ static bool cast_mindcrafter_spell(int spell)
                        b = detect_monsters_normal(DETECT_RAD_DEFAULT);
                        if (plev > 14) b |= detect_monsters_invis(DETECT_RAD_DEFAULT);
                        if (plev > 4)  {
-                               b |= detect_traps(DETECT_RAD_DEFAULT);
+                               b |= detect_traps(DETECT_RAD_DEFAULT, TRUE);
                                b |= detect_doors(DETECT_RAD_DEFAULT);
                        }
                }
@@ -982,7 +981,7 @@ msg_print("
 
                /* This is always a radius-0 ball now */
                if (fire_ball(GF_PSI_DRAIN, dir, b, 0))
-                       p_ptr->energy -= randint1(150);
+                       p_ptr->energy_need += randint1(150);
                break;
        case 12:
                /* psycho-spear */
@@ -1009,7 +1008,8 @@ msg_print("
 #endif
                msg_print(NULL);
 
-               p_ptr->energy += (p_ptr->csp + 950);
+               /* Hack */
+               p_ptr->energy_need -= 1000 + (100 + p_ptr->csp - 50)*TURNS_PER_TICK/10;
 
                /* Redraw map */
                p_ptr->redraw |= (PR_MAP);
@@ -1077,6 +1077,7 @@ static bool cast_force_spell(int spell)
                msg_print("You improved the Force.");
 #endif
                p_ptr->magic_num1[0] += (70 + plev);
+               p_ptr->update |= (PU_BONUS);
                if (randint1(p_ptr->magic_num1[0]) > (plev * 4 + 120))
                {
 #ifdef JP
@@ -1210,7 +1211,7 @@ msg_format("%s
                bool success = FALSE;
 
                for (i = 0; i < 1 + boost/100; i++)
-                       if (summon_specific(-1, py, px, plev, SUMMON_PHANTOM, FALSE, TRUE, TRUE, FALSE, FALSE))
+                       if (summon_specific(-1, py, px, plev, SUMMON_PHANTOM, PM_FORCE_PET))
                                success = TRUE;
                if (success)
                {
@@ -1250,6 +1251,7 @@ msg_print("
 
        }
        p_ptr->magic_num1[0] = 0;
+       p_ptr->update |= (PU_BONUS);
 
        return TRUE;
 }
@@ -1262,7 +1264,7 @@ static int number_of_mirrors( void )
   int val=0;
   for( x=0 ; x < cur_wid ; x++ ){
     for( y=0 ; y < cur_hgt ; y++ ){
-      if( cave[y][x].feat == FEAT_MIRROR )val++;
+      if (is_mirror_grid(&cave[y][x])) val++;
     }
   }
   return val;
@@ -1280,7 +1282,7 @@ static bool cast_mirror_spell(int spell)
        {
        /* mirror of seeing */
        case 0:
-         tmp = cave[py][px].feat == FEAT_MIRROR ? 4 : 0;
+         tmp = is_mirror_grid(&cave[py][px]) ? 4 : 0;
          if( plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
          if( plev + tmp > 18 )detect_monsters_invis(DETECT_RAD_DEFAULT);
          if( plev + tmp > 28 )set_tim_esp(plev,FALSE);
@@ -1308,7 +1310,7 @@ msg_format("There are too many mirrors to control!");
          break;
        case 2:
          if (!get_aim_dir(&dir)) return FALSE;
-         if ( plev > 9 && cave[py][px].feat == FEAT_MIRROR ){
+         if ( plev > 9 && is_mirror_grid(&cave[py][px]) ) {
            fire_beam(GF_LITE, dir,damroll(3+((plev-1)/5),4));
          }
          else {
@@ -1346,8 +1348,8 @@ msg_format("There are too many mirrors to control!");
        case 9:
          for(x=0;x<cur_wid;x++){
            for(y=0;y<cur_hgt;y++){
-             if(cave[y][x].feat == FEAT_MIRROR){
-               project(0,2,y,x,plev,GF_OLD_SLEEP,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_REF|PROJECT_NO_HANGEKI),-1);
+             if (is_mirror_grid(&cave[y][x])) {
+               project(0,2,y,x,plev,GF_OLD_SLEEP,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_HANGEKI),-1);
              }
            }
          }
@@ -1375,7 +1377,7 @@ msg_format("There are too many mirrors to control!");
          break;
        /* illusion light */
        case 14:
-         tmp = cave[py][px].feat == FEAT_MIRROR ? 4 : 3;
+         tmp = is_mirror_grid(&cave[py][px]) ? 4 : 3;
          slow_monsters();
          stun_monsters(plev*tmp);
          confuse_monsters(plev*tmp);
@@ -1385,7 +1387,7 @@ msg_format("There are too many mirrors to control!");
          break;
        /* mirror shift */
        case 15:
-         if(  cave[py][px].feat != FEAT_MIRROR ){
+         if( !is_mirror_grid(&cave[py][px]) ){
 #ifdef JP
                msg_print("¶À¤Î¹ñ¤Î¾ì½ê¤¬¤ï¤«¤é¤Ê¤¤¡ª");
 #else
@@ -1595,7 +1597,7 @@ static bool cast_ninja_spell(int spell)
                detect_monsters_normal(DETECT_RAD_DEFAULT);
                if (plev > 4)
                {
-                       detect_traps(DETECT_RAD_DEFAULT);
+                       detect_traps(DETECT_RAD_DEFAULT, TRUE);
                        detect_doors(DETECT_RAD_DEFAULT);
                        detect_stairs(DETECT_RAD_DEFAULT);
                }
@@ -1688,7 +1690,7 @@ msg_print("
        case 10:
                project_length = 5;
                if (!get_aim_dir(&dir)) return FALSE;
-               project_hook(GF_ATTACK, dir, HISSATSU_NYUSIN, PROJECT_STOP | PROJECT_KILL | PROJECT_NO_REF);
+               project_hook(GF_ATTACK, dir, HISSATSU_NYUSIN, PROJECT_STOP | PROJECT_KILL);
 
                break;
        case 11:
@@ -1749,12 +1751,12 @@ msg_print("
                {
                        int ny = GRID_Y(path_g[i]);
                        int nx = GRID_X(path_g[i]);
-                       
+                       cave_type *c_ptr = &cave[ny][nx];
+
                        if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) &&
-                           cave[ny][nx].feat != FEAT_GLYPH &&
-                           cave[ny][nx].feat != FEAT_MINOR_GLYPH &&
-                           !(cave[ny][nx].feat >= FEAT_PATTERN_START &&
-                             cave[ny][nx].feat <= FEAT_PATTERN_XTRA2))
+                           !(c_ptr->info & CAVE_OBJECT) &&
+                           !(c_ptr->feat >= FEAT_PATTERN_START &&
+                             c_ptr->feat <= FEAT_PATTERN_XTRA2))
                        {
                                ty = ny;
                                tx = nx;
@@ -1763,7 +1765,7 @@ msg_print("
                /* Update the old location */
                cave[target_row][target_col].m_idx = 0;
 
-               /* Update the new location */
+               /* Update the new location */
                cave[ty][tx].m_idx = m_idx;
 
                /* Move the monster */
@@ -1968,9 +1970,7 @@ if (!get_check("
                /* Reduce failure rate by "effective" level adjustment */
                chance -= 3 * (plev - spell.min_lev);
 
-               if (p_ptr->pseikaku == SEIKAKU_NAMAKE) chance += 10;
-               if (p_ptr->pseikaku == SEIKAKU_KIREMONO) chance -= 3;
-               if ((p_ptr->pseikaku == SEIKAKU_GAMAN) || (p_ptr->pseikaku == SEIKAKU_CHIKARA)) chance++;
+               chance += p_ptr->to_m_chance;
 
                /* Reduce failure rate by INT/WIS adjustment */
                chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
@@ -2142,7 +2142,7 @@ msg_format("%s
                        break;
                case MIND_MIRROR_MASTER:
                        /* Cast the spell */
-                       if( cave[py][px].feat == FEAT_MIRROR )on_mirror = TRUE;
+                       if( is_mirror_grid(&cave[py][px]) )on_mirror = TRUE;
                        cast = cast_mirror_spell(n);
                        break;
                case MIND_NINJUTSU:
@@ -2167,7 +2167,7 @@ msg_format("%s
        /* teleport from mirror costs small energy */
        if( on_mirror && p_ptr->pclass == CLASS_MIRROR_MASTER )
        {
-         if( n==2 || n==4 || n==6 || n==15 )energy_use = 50;
+         if( n==3 || n==5 || n==7 || n==16 )energy_use = 50;
        }
 
        if ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU))
@@ -2282,7 +2282,7 @@ void do_cmd_mind_browse(void)
                Term_erase(12, 17, 255);
                Term_erase(12, 16, 255);
 
-               roff_to_buf( mind_tips[use_mind][n],62,temp);
+               roff_to_buf(mind_tips[use_mind][n], 62, temp, sizeof(temp));
                for(j=0, line = 17;temp[j];j+=(1+strlen(&temp[j])))
                {
                        prt(&temp[j], line, 15);