From 50c52b041921df85b19a4b0c073093bc137bb93c Mon Sep 17 00:00:00 2001 From: nothere Date: Fri, 4 Jul 2003 19:15:31 +0000 Subject: [PATCH] =?utf8?q?=E3=83=A2=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=BC?= =?utf8?q?=E3=81=AE=E6=AD=BB=E4=BA=A1=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC?= =?utf8?q?=E3=82=B8=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE=E4=B8=80?= =?utf8?q?=E9=83=A8=E3=82=92=E9=96=A2=E6=95=B0=E3=81=AB=E3=81=BE=E3=81=A8?= =?utf8?q?=E3=82=81=E3=81=9F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd2.c | 74 ++-------------------------------------------------------- src/externs.h | 1 + src/mspells1.c | 2 +- src/mspells2.c | 2 +- src/spells1.c | 32 +------------------------ src/xtra2.c | 39 +++++++++++++++++++++++++++++++ 6 files changed, 45 insertions(+), 105 deletions(-) diff --git a/src/cmd2.c b/src/cmd2.c index 5df67ac43..570a2f209 100644 --- a/src/cmd2.c +++ b/src/cmd2.c @@ -3851,40 +3851,6 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) { bool fear = FALSE; - /* Assume a default death */ -#ifdef JP - cptr note_dies = "¤Ï»à¤ó¤À¡£"; -#else - cptr note_dies = " dies."; -#endif - - /* Some monsters get "destroyed" */ - if (!monster_living(r_ptr)) - { - int i; - bool explode = FALSE; - - for (i = 0; i < 4; i++) - { - if (r_ptr->blow[i].method == RBM_EXPLODE) explode = TRUE; - } - - /* Special note at death */ - if (explode) -#ifdef JP -note_dies = "¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£"; -#else - note_dies = " explodes into tiny shreds."; -#endif - else -#ifdef JP - note_dies = "¤òÅݤ·¤¿¡£"; -#else - note_dies = " is destroyed."; -#endif - - } - /* Handle unseen monster */ if (!visible) { @@ -3944,7 +3910,7 @@ note_dies = " } /* Hit the monster, check for death */ - if (mon_take_hit(c_ptr->m_idx, tdam, &fear, note_dies)) + if (mon_take_hit(c_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_ptr(m_ptr)))) { /* Dead monster */ } @@ -4429,42 +4395,6 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) { bool fear = FALSE; - /* Assume a default death */ -#ifdef JP - cptr note_dies = "¤Ï»à¤ó¤À¡£"; -#else - cptr note_dies = " dies."; -#endif - - - /* Some monsters get "destroyed" */ - if (!monster_living(r_ptr)) - { - int i; - bool explode = FALSE; - - for (i = 0; i < 4; i++) - { - if (r_ptr->blow[i].method == RBM_EXPLODE) explode = TRUE; - } - - /* Special note at death */ - if (explode) -#ifdef JP -note_dies = "¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£"; -#else - note_dies = " explodes into tiny shreds."; -#endif - else -#ifdef JP - note_dies = "¤òÅݤ·¤¿¡£"; -#else - note_dies = " is destroyed."; -#endif - - } - - /* Handle unseen monster */ if (!visible) { @@ -4549,7 +4479,7 @@ note_dies = " } /* Hit the monster, check for death */ - if (mon_take_hit(c_ptr->m_idx, tdam, &fear, note_dies)) + if (mon_take_hit(c_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_ptr(m_ptr)))) { /* Dead monster */ } diff --git a/src/externs.h b/src/externs.h index c78b03134..80e4b4d24 100644 --- a/src/externs.h +++ b/src/externs.h @@ -1332,6 +1332,7 @@ extern bool set_superstealth(bool set); /* xtra2.c */ extern void check_experience(void); extern void check_quest_completion(monster_type *m_ptr); +extern cptr extract_note_dies(monster_race *r_ptr); extern void monster_death(int m_idx, bool drop_item); extern bool mon_take_hit(int m_idx, int dam, bool *fear, cptr note); extern void get_screen_size(int *wid_p, int *hgt_p); diff --git a/src/mspells1.c b/src/mspells1.c index 7fe195c05..3c18aa693 100644 --- a/src/mspells1.c +++ b/src/mspells1.c @@ -3618,7 +3618,7 @@ msg_format("%^s set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE); } - if (p_ptr->riding) mon_take_hit_mon(p_ptr->riding, dam, &fear, NULL, m_idx); + if (p_ptr->riding) mon_take_hit_mon(p_ptr->riding, dam, &fear, extract_note_dies(real_r_ptr(&m_list[p_ptr->riding])), m_idx); } break; } diff --git a/src/mspells2.c b/src/mspells2.c index 512984db2..09686f939 100644 --- a/src/mspells2.c +++ b/src/mspells2.c @@ -3333,7 +3333,7 @@ bool monst_spell_monst(int m_idx) } } - mon_take_hit_mon(t_idx, dam, &fear, NULL, m_idx); + mon_take_hit_mon(t_idx, dam, &fear, extract_note_dies(real_r_ptr(t_ptr)), m_idx); } break; } diff --git a/src/spells1.c b/src/spells1.c index 236ffacb8..3e444e943 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -1791,11 +1791,7 @@ static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg) cptr note = NULL; /* Assume a default death */ -#ifdef JP - cptr note_dies = "¤Ï»à¤ó¤À¡£"; -#else - cptr note_dies = " dies."; -#endif + cptr note_dies = extract_note_dies(real_r_ptr(m_ptr)); int ty = m_ptr->fy; int tx = m_ptr->fx; @@ -1827,32 +1823,6 @@ static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg) #endif - /* Some monsters get "destroyed" */ - if (!monster_living(r_ptr)) - { - int i; - bool explode = FALSE; - - for (i = 0; i < 4; i++) - { - if (r_ptr->blow[i].method == RBM_EXPLODE) explode = TRUE; - } - - /* Special note at death */ - if (explode) -#ifdef JP -note_dies = "¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£"; -#else - note_dies = " explodes into tiny shreds."; -#endif - else -#ifdef JP -note_dies = "¤òÅݤ·¤¿¡£"; -#else - note_dies = " is destroyed."; -#endif - } - if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0); /* Analyze the damage type */ diff --git a/src/xtra2.c b/src/xtra2.c index 550bfc2ea..7e3c72e8b 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -614,6 +614,45 @@ msg_print(" } } + +/* + * Return monster death string + */ +cptr extract_note_dies(monster_race *r_ptr) +{ + /* Some monsters get "destroyed" */ + if (!monster_living(r_ptr)) + { + int i; + + for (i = 0; i < 4; i++) + { + if (r_ptr->blow[i].method == RBM_EXPLODE) + { +#ifdef JP + return "¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£"; +#else + return " explodes into tiny shreds."; +#endif + } + } + +#ifdef JP + return "¤òÅݤ·¤¿¡£"; +#else + return " is destroyed."; +#endif + } + + /* Assume a default death */ +#ifdef JP + return "¤Ï»à¤ó¤À¡£"; +#else + return " dies."; +#endif +} + + /* * Handle the "death" of a monster. * -- 2.11.0