OSDN Git Service

ハルマゲドントラップで堕天使はデーモン側としてちゃんと戦うように変更。
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 24 Jan 2003 23:13:48 +0000 (23:13 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 24 Jan 2003 23:13:48 +0000 (23:13 +0000)
ターゲットがあるときに、呪文だけでなく殴りもちゃんとターゲットを狙うように変更。

src/cmd1.c
src/defines.h
src/melee2.c
src/monster2.c

index 6c9791e..d569865 100644 (file)
@@ -1626,7 +1626,7 @@ msg_print("
                case FEAT_TRAP_ARMAGEDDON:
                {
                        static int levs[10] = {0, 0, 20, 10, 5, 3, 2, 1, 1, 1};
-                       int demon_idx = 0, angel_idx = 0;
+                       int evil_idx = 0, good_idx = 0;
 
                        int lev;
 #ifdef JP
@@ -1653,21 +1653,23 @@ msg_print("
                                        /* Require line of sight */
                                        if (!player_has_los_bold(y1, x1)) continue;
 
-                                       if (summon_specific(0, y1, x1, lev, SUMMON_DEMON, (PM_NO_PET)))
-                                               demon_idx = hack_m_idx_ii;
+                                       if (summon_specific(0, y1, x1, lev, SUMMON_ARMAGE_EVIL, (PM_NO_PET)))
+                                               evil_idx = hack_m_idx_ii;
 
-                                       if (summon_specific(0, y1, x1, lev, SUMMON_ANGEL, (PM_NO_PET)))
-                                               angel_idx = hack_m_idx_ii;
+                                       if (summon_specific(0, y1, x1, lev, SUMMON_ARMAGE_GOOD, (PM_NO_PET)))
+                                       {
+                                               good_idx = hack_m_idx_ii;
+                                       }
 
                                        /* Let them fight each other */
-                                       if (demon_idx && angel_idx)
+                                       if (evil_idx && good_idx)
                                        {
-                                               monster_type *demon_ptr = &m_list[demon_idx];
-                                               monster_type *angel_ptr = &m_list[angel_idx];
-                                               demon_ptr->target_y = angel_ptr->fy;
-                                               demon_ptr->target_x = angel_ptr->fx;
-                                               angel_ptr->target_y = demon_ptr->fy;
-                                               angel_ptr->target_x = demon_ptr->fx;
+                                               monster_type *evil_ptr = &m_list[evil_idx];
+                                               monster_type *good_ptr = &m_list[good_idx];
+                                               evil_ptr->target_y = good_ptr->fy;
+                                               evil_ptr->target_x = good_ptr->fx;
+                                               good_ptr->target_y = evil_ptr->fy;
+                                               good_ptr->target_x = evil_ptr->fx;
                                        }
                                }
                        }
index b7f6595..2693ac3 100644 (file)
 #define SUMMON_KNIGHTS              63
 #define SUMMON_EAGLES               64
 #define SUMMON_PIRANHAS             65
+#define SUMMON_ARMAGE_GOOD          66
+#define SUMMON_ARMAGE_EVIL          67
 
 
 /*
index ae14484..e73684f 100644 (file)
@@ -1112,7 +1112,23 @@ static bool get_moves(int m_idx, int *mm)
        y = m_ptr->fy - y2;
        x = m_ptr->fx - x2;
 
-       if (!will_run && is_hostile(m_ptr) &&
+       /* Counter attack to an enemy monster */
+       if (!will_run && m_ptr->target_y)
+       {
+               int t_m_idx = cave[m_ptr->target_y][m_ptr->target_x].m_idx;
+
+               /* The monster must be an enemy, and in LOS */
+               if (t_m_idx &&
+                   are_enemies(m_ptr, &m_list[t_m_idx]) &&
+                   los(m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
+               {
+                       y = m_ptr->target_y;
+                       x = m_ptr->target_x;
+                       done = TRUE;
+               }
+       }
+
+       if (!done && !will_run && is_hostile(m_ptr) &&
            (r_ptr->flags1 & RF1_FRIENDS) &&
            (los(m_ptr->fy, m_ptr->fx, py, px) ||
            (cave[m_ptr->fy][m_ptr->fx].dist < MAX_SIGHT / 2)))
index 482001c..be964ae 100644 (file)
@@ -863,6 +863,7 @@ static bool summon_specific_aux(int r_idx)
                                (r_idx == MON_KNI_TEMPLAR));
                        break;
                }
+
                case SUMMON_EAGLES:
                {
                        okay = (r_ptr->d_char == 'B' &&
@@ -870,11 +871,25 @@ static bool summon_specific_aux(int r_idx)
                                (r_ptr->flags8 & RF8_WILD_ONLY));
                        break;
                }
+
                case SUMMON_PIRANHAS:
                {
                        okay = (r_idx == MON_PIRANHA);
                        break;
                }
+
+               case SUMMON_ARMAGE_GOOD:
+               {
+                       okay = (r_ptr->d_char == 'A' && (r_ptr->flags3 & RF3_GOOD));
+                       break;
+               }
+
+               case SUMMON_ARMAGE_EVIL:
+               {
+                       okay = ((r_ptr->flags3 & RF3_DEMON) ||
+                               (r_ptr->d_char == 'A' && (r_ptr->flags3 & RF3_EVIL)));
+                       break;
+               }
        }
 
        /* Result */