• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisionc2d13e1614e9a7184375bcb602968076961c09b3 (tree)
Time2019-02-23 18:29:12
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 黄門様のいつものアレを mitokohmon() に分離して spell-summon.c/h に移動。 / Separate and move the Inrou's effect to mitokohmon() in spell-summon.c/h.

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1924,51 +1924,7 @@ bool activate_artifact(object_type *o_ptr)
19241924
19251925 case ACT_INROU:
19261926 {
1927- int count = 0, i;
1928- monster_type *m_ptr;
1929- concptr kakusan = "";
1930-
1931- if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_SUKE, PM_FORCE_PET))
1932- {
1933- msg_print(_("『助さん』が現れた。", "Suke-san apperars."));
1934- kakusan = "Suke-san";
1935- count++;
1936- }
1937- if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_KAKU, PM_FORCE_PET))
1938- {
1939- msg_print(_("『格さん』が現れた。", "Kaku-san appears."));
1940- kakusan = "Kaku-san";
1941- count++;
1942- }
1943- if (!count)
1944- {
1945- for (i = m_max - 1; i > 0; i--)
1946- {
1947- m_ptr = &m_list[i];
1948- if (!m_ptr->r_idx) continue;
1949- if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
1950- if (!los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) continue;
1951- if (!projectable(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) continue;
1952- count++;
1953- break;
1954- }
1955- }
1956-
1957- if (count)
1958- {
1959- msg_format(_("「者ども、ひかえおろう!!!このお方をどなたとこころえる。」",
1960- "%^s says 'WHO do you think this person is! Bow your head, down your knees!'"), kakusan);
1961- sukekaku = TRUE;
1962- stun_monsters(120);
1963- confuse_monsters(120);
1964- turn_monsters(120);
1965- stasis_monsters(120);
1966- sukekaku = FALSE;
1967- }
1968- else
1969- {
1970- msg_print(_("しかし、何も起きなかった。", "Nothing happen."));
1971- }
1927+ mitokohmon();
19721928 break;
19731929 }
19741930
--- a/src/spells-summon.c
+++ b/src/spells-summon.c
@@ -301,4 +301,54 @@ int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x)
301301 }
302302
303303 return count;
304-}
\ No newline at end of file
304+}
305+
306+
307+void mitokohmon(void)
308+{
309+ int count = 0, i;
310+ monster_type *m_ptr;
311+ concptr kakusan = "";
312+
313+ if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_SUKE, PM_FORCE_PET))
314+ {
315+ msg_print(_("『助さん』が現れた。", "Suke-san apperars."));
316+ kakusan = "Suke-san";
317+ count++;
318+ }
319+ if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_KAKU, PM_FORCE_PET))
320+ {
321+ msg_print(_("『格さん』が現れた。", "Kaku-san appears."));
322+ kakusan = "Kaku-san";
323+ count++;
324+ }
325+ if (!count)
326+ {
327+ for (i = m_max - 1; i > 0; i--)
328+ {
329+ m_ptr = &m_list[i];
330+ if (!m_ptr->r_idx) continue;
331+ if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
332+ if (!los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) continue;
333+ if (!projectable(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) continue;
334+ count++;
335+ break;
336+ }
337+ }
338+
339+ if (count)
340+ {
341+ msg_format(_("「者ども、ひかえおろう!!!このお方をどなたとこころえる。」",
342+ "%^s says 'WHO do you think this person is! Bow your head, down your knees!'"), kakusan);
343+ sukekaku = TRUE;
344+ stun_monsters(120);
345+ confuse_monsters(120);
346+ turn_monsters(120);
347+ stasis_monsters(120);
348+ sukekaku = FALSE;
349+ }
350+ else
351+ {
352+ msg_print(_("しかし、何も起きなかった。", "Nothing happen."));
353+ }
354+}
--- a/src/spells-summon.h
+++ b/src/spells-summon.h
@@ -11,3 +11,5 @@ extern bool cast_summon_greater_demon(void);
1111 extern bool summon_kin_player(DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode);
1212 extern int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x);
1313
14+extern void mitokohmon(void);
15+
Show on old repository browser