OSDN Git Service

レベル15以上のハーフトロル狂戦士も戦士同様に遅消化が得られるのに, 'C'
[hengband/hengband.git] / src / cmd1.c
index 3b0056b..f16b037 100644 (file)
@@ -1074,8 +1074,8 @@ static void hit_trap(bool break_trap)
 
        /* Get the cave grid */
        cave_type *c_ptr = &cave[y][x];
-
-       int trap_feat = c_ptr->feat;
+       feature_type *f_ptr = &f_info[c_ptr->feat];
+       int trap_feat_type = have_flag(f_ptr->flags, FF_TRAP) ? f_ptr->subtype : NOT_TRAP;
 
 #ifdef JP
        cptr name = "¥È¥é¥Ã¥×";
@@ -1089,9 +1089,9 @@ static void hit_trap(bool break_trap)
        cave_alter_feat(y, x, FF_HIT_TRAP);
 
        /* Analyze XXX XXX XXX */
-       switch (trap_feat)
+       switch (trap_feat_type)
        {
-               case FEAT_TRAP_TRAPDOOR:
+               case TRAP_TRAPDOOR:
                {
                        if (p_ptr->levitation)
                        {
@@ -1139,7 +1139,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_PIT:
+               case TRAP_PIT:
                {
                        if (p_ptr->levitation)
                        {
@@ -1170,7 +1170,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_SPIKED_PIT:
+               case TRAP_SPIKED_PIT:
                {
                        if (p_ptr->levitation)
                        {
@@ -1225,7 +1225,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_POISON_PIT:
+               case TRAP_POISON_PIT:
                {
                        if (p_ptr->levitation)
                        {
@@ -1299,7 +1299,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_TY_CURSE:
+               case TRAP_TY_CURSE:
                {
 #ifdef JP
                        msg_print("²¿¤«¤¬¥Ô¥«¥Ã¤È¸÷¤Ã¤¿¡ª");
@@ -1327,7 +1327,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_TELEPORT:
+               case TRAP_TELEPORT:
                {
 #ifdef JP
                        msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥È¥é¥Ã¥×¤Ë¤Ò¤Ã¤«¤«¤Ã¤¿¡ª");
@@ -1339,7 +1339,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_FIRE:
+               case TRAP_FIRE:
                {
 #ifdef JP
                        msg_print("±ê¤ËÊñ¤Þ¤ì¤¿¡ª");
@@ -1357,7 +1357,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_ACID:
+               case TRAP_ACID:
                {
 #ifdef JP
                        msg_print("»À¤¬¿á¤­¤«¤±¤é¤ì¤¿¡ª");
@@ -1375,7 +1375,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_SLOW:
+               case TRAP_SLOW:
                {
                        if (check_hit(125))
                        {
@@ -1401,7 +1401,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_LOSE_STR:
+               case TRAP_LOSE_STR:
                {
                        if (check_hit(125))
                        {
@@ -1432,7 +1432,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_LOSE_DEX:
+               case TRAP_LOSE_DEX:
                {
                        if (check_hit(125))
                        {
@@ -1463,7 +1463,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_LOSE_CON:
+               case TRAP_LOSE_CON:
                {
                        if (check_hit(125))
                        {
@@ -1494,7 +1494,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_BLIND:
+               case TRAP_BLIND:
                {
 #ifdef JP
                        msg_print("¹õ¤¤¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª");
@@ -1509,7 +1509,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_CONFUSE:
+               case TRAP_CONFUSE:
                {
 #ifdef JP
                        msg_print("¤­¤é¤á¤¯¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª");
@@ -1524,7 +1524,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_POISON:
+               case TRAP_POISON:
                {
 #ifdef JP
                        msg_print("»É·ãŪ¤ÊÎп§¤Î¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª");
@@ -1539,7 +1539,7 @@ static void hit_trap(bool break_trap)
                        break;
                }
 
-               case FEAT_TRAP_SLEEP:
+               case TRAP_SLEEP:
                {
 #ifdef JP
                        msg_print("´ñ̯¤ÊÇò¤¤Ì¸¤ËÊñ¤Þ¤ì¤¿¡ª");
@@ -1579,7 +1579,7 @@ msg_print("
                        break;
                }
 
-               case FEAT_TRAP_TRAPS:
+               case TRAP_TRAPS:
                {
 #ifdef JP
 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
@@ -1593,7 +1593,7 @@ msg_print("
                        break;
                }
 
-               case FEAT_TRAP_ALARM:
+               case TRAP_ALARM:
                {
 #ifdef JP
                        msg_print("¤±¤¿¤¿¤Þ¤·¤¤²»¤¬ÌĤê¶Á¤¤¤¿¡ª");
@@ -1606,7 +1606,7 @@ msg_print("
                        break;
                }
 
-               case FEAT_TRAP_OPEN:
+               case TRAP_OPEN:
                {
 #ifdef JP
                        msg_print("Âç²»¶Á¤È¶¦¤Ë¤Þ¤ï¤ê¤ÎÊɤ¬Êø¤ì¤¿¡ª");
@@ -1621,7 +1621,7 @@ msg_print("
                        break;
                }
 
-               case FEAT_TRAP_ARMAGEDDON:
+               case TRAP_ARMAGEDDON:
                {
                        static int levs[10] = {0, 0, 20, 10, 5, 3, 2, 1, 1, 1};
                        int evil_idx = 0, good_idx = 0;
@@ -1671,7 +1671,7 @@ msg_print("
                        break;
                }
 
-               case FEAT_TRAP_PIRANHA:
+               case TRAP_PIRANHA:
                {
 #ifdef JP
                        msg_print("ÆÍÁ³Êɤ«¤é¿å¤¬°î¤ì½Ð¤·¤¿¡ª¥Ô¥é¥Ë¥¢¤¬¤¤¤ë¡ª");
@@ -2029,7 +2029,7 @@ static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int
        case CLASS_MONK:
        case CLASS_FORCETRAINER:
        case CLASS_BERSERKER:
-               if (empty_hands(TRUE) & EMPTY_HAND_RARM) monk_attack = TRUE;
+               if ((empty_hands(TRUE) & EMPTY_HAND_RARM) && !p_ptr->riding) monk_attack = TRUE;
                break;
        }
 
@@ -2726,6 +2726,7 @@ static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int
                                }
                                m_ptr->maxhp -= (k+7)/8;
                                if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
+                               if (m_ptr->maxhp < 1) m_ptr->maxhp = 1;
                                weak = TRUE;
                        }
                        can_drain = FALSE;
@@ -3283,8 +3284,8 @@ bool pattern_seq(int c_y, int c_x, int n_y, int n_x)
 
        if (!is_pattern_tile_cur && !is_pattern_tile_new) return TRUE;
 
-       pattern_type_cur = is_pattern_tile_cur ? cur_f_ptr->power : NOT_PATTERN_TILE;
-       pattern_type_new = is_pattern_tile_new ? new_f_ptr->power : NOT_PATTERN_TILE;
+       pattern_type_cur = is_pattern_tile_cur ? cur_f_ptr->subtype : NOT_PATTERN_TILE;
+       pattern_type_new = is_pattern_tile_new ? new_f_ptr->subtype : NOT_PATTERN_TILE;
 
        if (pattern_type_new == PATTERN_TILE_START)
        {
@@ -3689,33 +3690,37 @@ bool move_player_effect(int ny, int nx, u32b mpe_mode)
 
 bool trap_can_be_ignored(int feat)
 {
-       switch (feat)
+       feature_type *f_ptr = &f_info[feat];
+
+       if (!have_flag(f_ptr->flags, FF_TRAP)) return TRUE;
+
+       switch (f_ptr->subtype)
        {
-       case FEAT_TRAP_TRAPDOOR:
-       case FEAT_TRAP_PIT:
-       case FEAT_TRAP_SPIKED_PIT:
-       case FEAT_TRAP_POISON_PIT:
+       case TRAP_TRAPDOOR:
+       case TRAP_PIT:
+       case TRAP_SPIKED_PIT:
+       case TRAP_POISON_PIT:
                if (p_ptr->levitation) return TRUE;
                break;
-       case FEAT_TRAP_TELEPORT:
+       case TRAP_TELEPORT:
                if (p_ptr->anti_tele) return TRUE;
                break;
-       case FEAT_TRAP_FIRE:
+       case TRAP_FIRE:
                if (p_ptr->immune_fire) return TRUE;
                break;
-       case FEAT_TRAP_ACID:
+       case TRAP_ACID:
                if (p_ptr->immune_acid) return TRUE;
                break;
-       case FEAT_TRAP_BLIND:
+       case TRAP_BLIND:
                if (p_ptr->resist_blind) return TRUE;
                break;
-       case FEAT_TRAP_CONFUSE:
+       case TRAP_CONFUSE:
                if (p_ptr->resist_conf) return TRUE;
                break;
-       case FEAT_TRAP_POISON:
+       case TRAP_POISON:
                if (p_ptr->resist_pois) return TRUE;
                break;
-       case FEAT_TRAP_SLEEP:
+       case TRAP_SLEEP:
                if (p_ptr->free_act) return TRUE;
                break;
        }
@@ -3864,7 +3869,7 @@ void move_player(int dir, bool do_pickup, bool break_trap)
 
        /* Player can not walk through "walls"... */
        /* unless in Shadow Form */
-       p_can_kill_walls = p_ptr->kill_wall && have_flag(f_ptr->flags, FF_TUNNEL) &&
+       p_can_kill_walls = p_ptr->kill_wall && have_flag(f_ptr->flags, FF_HURT_DISI) &&
                (!p_can_enter || !have_flag(f_ptr->flags, FF_LOS)) &&
                !have_flag(f_ptr->flags, FF_PERMANENT);