• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision82f77fea6a745c28c5b603755e15eee60489f976 (tree)
Time2019-02-25 13:19:26
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 死者召喚を cast_summon_undead() に分離。 / Separate cast_summon_undead().

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1243,31 +1243,8 @@ bool activate_artifact(object_type *o_ptr)
12431243 }
12441244
12451245 case ACT_SUMMON_UNDEAD:
1246- {
1247- bool pet = one_in_(3);
1248- int type;
1249- BIT_FLAGS mode = 0L;
1250-
1251- type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
1252-
1253- if (!pet || ((plev > 24) && one_in_(3))) mode |= PM_ALLOW_GROUP;
1254- if (pet) mode |= PM_FORCE_PET;
1255- else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
1256-
1257- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, ((plev * 3) / 2), type, mode, '\0'))
1258- {
1259- msg_print(_("冷たい風があなたの周りに吹き始めた。それは腐敗臭を運んでいる...",
1260- "Cold winds begin to blow around you, carrying with them the stench of decay..."));
1261- if (pet)
1262- msg_print(_("古えの死せる者共があなたに仕えるため土から甦った!",
1263- "Ancient, long-dead forms arise from the ground to serve you!"));
1264- else
1265- msg_print(_("死者が甦った。眠りを妨げるあなたを罰するために!",
1266- "'The dead arise... to punish you for disturbing them!'"));
1267- }
1268-
1246+ if (!cast_summon_undead(p_ptr, (plev * 3) / 2)) return FALSE;
12691247 break;
1270- }
12711248
12721249 case ACT_SUMMON_HOUND:
12731250 {
--- a/src/realm-death.c
+++ b/src/realm-death.c
@@ -522,43 +522,7 @@ concptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
522522 case 25:
523523 if (name) return _("死者召喚", "Raise the Dead");
524524 if (desc) return _("1体のアンデッドを召喚する。", "Summons an undead monster.");
525-
526- {
527- if (cast)
528- {
529- int type;
530- bool pet = one_in_(3);
531- u32b flg = 0L;
532-
533- type = (plev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
534-
535- if (!pet || (pet && (plev > 24) && one_in_(3)))
536- flg |= PM_ALLOW_GROUP;
537-
538- if (pet) flg |= PM_FORCE_PET;
539- else flg |= (PM_ALLOW_UNIQUE | PM_NO_PET);
540-
541- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, (plev * 3) / 2, type, flg, '\0'))
542- {
543- msg_print(_("冷たい風があなたの周りに吹き始めた。それは腐敗臭を運んでいる...",
544- "Cold winds begin to blow around you, carrying with them the stench of decay..."));
545-
546-
547- if (pet)
548- {
549- msg_print(_("古えの死せる者共があなたに仕えるため土から甦った!",
550- "Ancient, long-dead forms arise from the ground to serve you!"));
551- }
552- else
553- {
554- msg_print(_("死者が甦った。眠りを妨げるあなたを罰するために!",
555- "'The dead arise... to punish you for disturbing them!'"));
556- }
557-
558- chg_virtue(V_UNLIFE, 1);
559- }
560- }
561- }
525+ if (cast) cast_summon_undead(p_ptr, (plev * 3) / 2);
562526 break;
563527
564528 case 26:
--- a/src/spells-summon.c
+++ b/src/spells-summon.c
@@ -88,6 +88,32 @@ bool cast_summon_demon(int power)
8888 return TRUE;
8989 }
9090
91+bool cast_summon_undead(player_type *creature_ptr, int power)
92+{
93+ bool pet = one_in_(3);
94+ int type;
95+ BIT_FLAGS mode = 0L;
96+
97+ type = (creature_ptr->lev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
98+
99+ if (!pet || ((creature_ptr->lev > 24) && one_in_(3))) mode |= PM_ALLOW_GROUP;
100+ if (pet) mode |= PM_FORCE_PET;
101+ else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
102+
103+ if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, type, mode, '\0'))
104+ {
105+ msg_print(_("冷たい風があなたの周りに吹き始めた。それは腐敗臭を運んでいる...",
106+ "Cold winds begin to blow around you, carrying with them the stench of decay..."));
107+ if (pet)
108+ msg_print(_("古えの死せる者共があなたに仕えるため土から甦った!",
109+ "Ancient, long-dead forms arise from the ground to serve you!"));
110+ else
111+ msg_print(_("死者が甦った。眠りを妨げるあなたを罰するために!",
112+ "'The dead arise... to punish you for disturbing them!'"));
113+ }
114+ return TRUE;
115+}
116+
91117 bool cast_summon_octopus(player_type *creature_ptr)
92118 {
93119 BIT_FLAGS mode = PM_ALLOW_GROUP;
--- a/src/spells-summon.h
+++ b/src/spells-summon.h
@@ -6,6 +6,7 @@ extern bool summon_named_creature(MONSTER_IDX who, POSITION oy, POSITION ox, MON
66
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);
9+extern bool cast_summon_undead(player_type *creature_ptr, int power);
910 extern bool cast_summon_octopus(player_type *creature_ptr);
1011 extern bool item_tester_offer(object_type *o_ptr);
1112 extern bool cast_summon_greater_demon(void);
Show on old repository browser