From 297520a798935f4caf1c53844ab8bad881258bbe Mon Sep 17 00:00:00 2001 From: _nothere <_nothere@0568b783-4c39-0410-ac80-bf13821ea2a2> Date: Thu, 16 May 2002 11:30:05 +0000 Subject: [PATCH] =?utf8?q?=E3=82=AB=E3=83=A1=E3=83=AC=E3=82=AA=E3=83=B3?= =?utf8?q?=E3=81=AF=E6=9C=80=E5=88=9D=E3=81=AB=E6=B1=BA=E3=81=BE=E3=81=A3?= =?utf8?q?=E3=81=9F=E5=B1=9E=E6=80=A7=E3=81=AE=E3=83=A2=E3=83=B3=E3=82=B9?= =?utf8?q?=E3=82=BF=E3=83=BC=E3=81=AB=E3=81=97=E3=81=8B=E5=8C=96=E3=81=91?= =?utf8?q?=E3=81=AA=E3=81=84=E3=81=AE=E3=81=A7,=20=E7=94=9F=E6=88=90?= =?utf8?q?=E6=99=82=E3=81=ABsub=5Falign=E3=82=82=E4=B8=80=E8=87=B4?= =?utf8?q?=E3=81=95=E3=81=9B=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97?= =?utf8?q?=E3=81=9F.=20=E3=81=BE=E3=81=9F,=20=E3=83=80=E3=83=B3=E3=82=B8?= =?utf8?q?=E3=83=A7=E3=83=B3=E3=81=AE=E4=B8=BB=E5=8F=AC=E5=96=9A=E3=81=A7?= =?utf8?q?=E3=81=AF=E3=81=AA=E3=81=8F=E8=87=AA=E7=84=B6=E7=94=9F=E6=88=90?= =?utf8?q?=E3=81=95=E3=82=8C=E3=81=9F=E3=82=AB=E3=83=A1=E3=83=AC=E3=82=AA?= =?utf8?q?=E3=83=B3=E3=81=AE=E7=8E=8B=E3=81=AEsub=5Falign=E3=82=92?= =?utf8?q?=E5=A4=96=E8=A6=8B=E3=81=AB=E3=82=88=E3=82=89=E3=81=9A=E4=B8=AD?= =?utf8?q?=E7=AB=8B=E3=81=A8=E3=81=97=E3=81=9F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/monster2.c | 69 +++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 15 deletions(-) diff --git a/src/monster2.c b/src/monster2.c index ffc7a8f3e..11166f07b 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -2485,6 +2485,11 @@ void update_monsters(bool full) } +/* + * Hack -- the index of the summoning monster + */ +static int summon_specific_who_for_chameleons = 0; + static bool monster_hook_chameleon_lord(int r_idx) { monster_race *r_ptr = &r_info[r_idx]; @@ -2556,11 +2561,26 @@ void choose_new_monster(int m_idx, bool born, int r_idx) r_ptr = &r_info[r_idx]; if (!monster_can_cross_terrain(cave[m_ptr->fy][m_ptr->fx].feat, r_ptr)) continue; - if (!born && !old_unique) + if (!born) + { + if (!old_unique) + { + if ((r_info[old_r_idx].flags3 & RF3_GOOD) && !(r_ptr->flags3 & RF3_GOOD)) continue; + if ((r_info[old_r_idx].flags3 & RF3_EVIL) && !(r_ptr->flags3 & RF3_EVIL)) continue; + if (!(r_info[old_r_idx].flags3 & (RF3_GOOD | RF3_EVIL)) && (r_ptr->flags3 & (RF3_GOOD | RF3_EVIL))) continue; + } + else + { + if ((m_ptr->sub_align & SUB_ALIGN_EVIL) && (r_ptr->flags3 & RF3_GOOD)) continue; + if ((m_ptr->sub_align & SUB_ALIGN_GOOD) && (r_ptr->flags3 & RF3_EVIL)) continue; + } + } + else if (summon_specific_who_for_chameleons > 0) { - if ((r_info[old_r_idx].flags3 & RF3_GOOD) && !(r_ptr->flags3 & RF3_GOOD)) continue; - if ((r_info[old_r_idx].flags3 & RF3_EVIL) && !(r_ptr->flags3 & RF3_EVIL)) continue; - if (!(r_info[old_r_idx].flags3 & (RF3_GOOD | RF3_EVIL)) && (r_ptr->flags3 & (RF3_GOOD | RF3_EVIL))) continue; + monster_type *sm_ptr = &m_list[summon_specific_who_for_chameleons]; + + if ((sm_ptr->sub_align & SUB_ALIGN_EVIL) && (r_ptr->flags3 & RF3_GOOD)) continue; + if ((sm_ptr->sub_align & SUB_ALIGN_GOOD) && (r_ptr->flags3 & RF3_EVIL)) continue; } break; } @@ -2572,7 +2592,17 @@ void choose_new_monster(int m_idx, bool born, int r_idx) m_ptr->ap_r_idx = r_idx; update_mon(m_idx, FALSE); lite_spot(m_ptr->fy, m_ptr->fx); - if (born) return; + if (born) + { + /* Sub-alignment of a chameleon */ + if (r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) + { + m_ptr->sub_align = SUB_ALIGN_NEUTRAL; + if (r_ptr->flags3 & RF3_EVIL) m_ptr->sub_align |= SUB_ALIGN_EVIL; + if (r_ptr->flags3 & RF3_GOOD) m_ptr->sub_align |= SUB_ALIGN_GOOD; + } + return; + } if (m_idx == p_ptr->riding) { @@ -2857,6 +2887,16 @@ msg_print(" m_ptr->r_idx = r_idx; m_ptr->ap_r_idx = initial_r_appearance(r_idx); + /* Sub-alignment of a monster */ + if ((who > 0) && !(r_ptr->flags3 & (RF3_EVIL | RF3_GOOD))) + m_ptr->sub_align = m_list[who].sub_align; + else + { + m_ptr->sub_align = SUB_ALIGN_NEUTRAL; + if (r_ptr->flags3 & RF3_EVIL) m_ptr->sub_align |= SUB_ALIGN_EVIL; + if (r_ptr->flags3 & RF3_GOOD) m_ptr->sub_align |= SUB_ALIGN_GOOD; + } + /* Place the monster at the location */ m_ptr->fy = y; m_ptr->fx = x; @@ -2882,10 +2922,19 @@ msg_print(" if (r_ptr->flags7 & RF7_CHAMELEON) { + if (who > 0) summon_specific_who_for_chameleons = who; + else summon_specific_who_for_chameleons = 0; + choose_new_monster(c_ptr->m_idx, TRUE, 0); r_ptr = &r_info[m_ptr->r_idx]; m_ptr->mflag2 |= MFLAG_CHAMELEON; rating++; + + /* Hack - Set sub_align to neutral when the Chameleon Lord is generated as "GUARDIAN" */ + if ((r_ptr->flags1 & RF1_UNIQUE) && (who <= 0)) + m_ptr->sub_align = SUB_ALIGN_NEUTRAL; + + summon_specific_who_for_chameleons = 0; } else if (is_kage) { @@ -2893,16 +2942,6 @@ msg_print(" m_ptr->mflag2 |= MFLAG_KAGE; } - /* Sub-alignment of a monster */ - if ((who > 0) && !(r_ptr->flags3 & (RF3_EVIL | RF3_GOOD))) - m_ptr->sub_align = m_list[who].sub_align; - else - { - m_ptr->sub_align = SUB_ALIGN_NEUTRAL; - if (r_ptr->flags3 & RF3_EVIL) m_ptr->sub_align |= SUB_ALIGN_EVIL; - if (r_ptr->flags3 & RF3_GOOD) m_ptr->sub_align |= SUB_ALIGN_GOOD; - } - if (no_pet) m_ptr->mflag2 |= MFLAG_NOPET; /* Not visible */ -- 2.11.0