• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionf1a878c3131857601b3d8ee6356516e696a34d5a (tree)
Time2019-02-25 13:24:55
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 ハウンド召喚を cast_summon_hound() に分離。 / Separate cast_summon_hound().

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1247,25 +1247,8 @@ bool activate_artifact(object_type *o_ptr)
12471247 break;
12481248
12491249 case ACT_SUMMON_HOUND:
1250- {
1251- BIT_FLAGS mode = PM_ALLOW_GROUP;
1252- bool pet = !one_in_(5);
1253- if (pet) mode |= PM_FORCE_PET;
1254- else mode |= PM_NO_PET;
1255-
1256- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, mode, '\0'))
1257- {
1258-
1259- if (pet)
1260- msg_print(_("ハウンドがあなたの下僕として出現した。",
1261- "A group of hounds appear as your servant."));
1262- else
1263- msg_print(_("ハウンドはあなたに牙を向けている!",
1264- "A group of hounds appear as your enemy!"));
1265- }
1266-
1250+ if (!cast_summon_hound(p_ptr, (plev * 3) / 2)) return FALSE;
12671251 break;
1268- }
12691252
12701253 case ACT_SUMMON_DAWN:
12711254 {
--- a/src/spells-summon.c
+++ b/src/spells-summon.c
@@ -114,6 +114,25 @@ bool cast_summon_undead(player_type *creature_ptr, int power)
114114 return TRUE;
115115 }
116116
117+
118+bool cast_summon_hound(player_type *creature_ptr, int power)
119+{
120+ BIT_FLAGS mode = PM_ALLOW_GROUP;
121+ bool pet = !one_in_(5);
122+ if (pet) mode |= PM_FORCE_PET;
123+ else mode |= PM_NO_PET;
124+
125+ if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, SUMMON_HOUND, mode, '\0'))
126+ {
127+ if (pet)
128+ msg_print(_("ハウンドがあなたの下僕として出現した。", "A group of hounds appear as your servant."));
129+ else
130+ msg_print(_("ハウンドはあなたに牙を向けている!", "A group of hounds appear as your enemy!"));
131+ }
132+ return TRUE;
133+}
134+
135+
117136 bool cast_summon_octopus(player_type *creature_ptr)
118137 {
119138 BIT_FLAGS mode = PM_ALLOW_GROUP;
--- a/src/spells-summon.h
+++ b/src/spells-summon.h
@@ -7,6 +7,7 @@ extern bool summon_named_creature(MONSTER_IDX who, POSITION oy, POSITION ox, MON
77 extern bool trump_summoning(int num, bool pet, POSITION y, POSITION x, DEPTH lev, int type, BIT_FLAGS mode);
88 extern bool cast_summon_demon(int power);
99 extern bool cast_summon_undead(player_type *creature_ptr, int power);
10+extern bool cast_summon_hound(player_type *creature_ptr, int power);
1011 extern bool cast_summon_octopus(player_type *creature_ptr);
1112 extern bool item_tester_offer(object_type *o_ptr);
1213 extern bool cast_summon_greater_demon(void);
Show on old repository browser