• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision124bd8e69189adc63ed5dd704c04db8b93f27142 (tree)
Time2019-02-25 13:34:00
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 発動のエレメンタル召喚を cast_summon_elemental() に分離。 / Separate summon elemental by activation to cast_summon_elemental().

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1216,25 +1216,8 @@ bool activate_artifact(object_type *o_ptr)
12161216 }
12171217
12181218 case ACT_SUMMON_ELEMENTAL:
1219- {
1220- bool pet = one_in_(3);
1221- BIT_FLAGS mode = 0L;
1222-
1223- if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
1224- if (pet) mode |= PM_FORCE_PET;
1225- else mode |= PM_NO_PET;
1226-
1227- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, ((plev * 3) / 2), SUMMON_ELEMENTAL, mode, '\0'))
1228- {
1229- msg_print(_("エレメンタルが現れた...", "An elemental materializes..."));
1230- if (pet)
1231- msg_print(_("あなたに服従しているようだ。", "It seems obedient to you."));
1232- else
1233- msg_print(_("それをコントロールできなかった!", "You fail to control it!"));
1234- }
1235-
1219+ if (!cast_summon_elemental(p_ptr, (plev * 3) / 2)) return FALSE;
12361220 break;
1237- }
12381221
12391222 case ACT_SUMMON_DEMON:
12401223 {
--- a/src/realm-arcane.c
+++ b/src/realm-arcane.c
@@ -420,7 +420,6 @@ concptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
420420 case 25:
421421 if (name) return _("エレメンタル召喚", "Conjure Elemental");
422422 if (desc) return _("1体のエレメンタルを召喚する。", "Summons an elemental.");
423-
424423 {
425424 if (cast)
426425 {
--- a/src/spells-summon.c
+++ b/src/spells-summon.c
@@ -132,6 +132,27 @@ bool cast_summon_hound(player_type *creature_ptr, int power)
132132 return TRUE;
133133 }
134134
135+bool cast_summon_elemental(player_type *creature_ptr, int power)
136+{
137+ bool pet = one_in_(3);
138+ BIT_FLAGS mode = 0L;
139+
140+ if (!(pet && (creature_ptr->lev < 50))) mode |= PM_ALLOW_GROUP;
141+ if (pet) mode |= PM_FORCE_PET;
142+ else mode |= PM_NO_PET;
143+
144+ if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, SUMMON_ELEMENTAL, mode, '\0'))
145+ {
146+ msg_print(_("エレメンタルが現れた...", "An elemental materializes..."));
147+ if (pet)
148+ msg_print(_("あなたに服従しているようだ。", "It seems obedient to you."));
149+ else
150+ msg_print(_("それをコントロールできなかった!", "You fail to control it!"));
151+ }
152+
153+ return TRUE;
154+}
155+
135156
136157 bool cast_summon_octopus(player_type *creature_ptr)
137158 {
--- a/src/spells-summon.h
+++ b/src/spells-summon.h
@@ -8,6 +8,7 @@ extern bool trump_summoning(int num, bool pet, POSITION y, POSITION x, DEPTH lev
88 extern bool cast_summon_demon(int power);
99 extern bool cast_summon_undead(player_type *creature_ptr, int power);
1010 extern bool cast_summon_hound(player_type *creature_ptr, int power);
11+extern bool cast_summon_elemental(player_type *creature_ptr, int power);
1112 extern bool cast_summon_octopus(player_type *creature_ptr);
1213 extern bool item_tester_offer(object_type *o_ptr);
1314 extern bool cast_summon_greater_demon(void);
Show on old repository browser