• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisione660c9c8e83cde2b3d646699fa9ac3f27d6dfe54 (tree)
Time2019-02-25 00:27:36
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 蛸召喚を cast_summon_octopus() に分離。 / Separate cast_summon_octopus().

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1298,21 +1298,8 @@ bool activate_artifact(object_type *o_ptr)
12981298 }
12991299
13001300 case ACT_SUMMON_OCTOPUS:
1301- {
1302- BIT_FLAGS mode = PM_ALLOW_GROUP;
1303- bool pet = !one_in_(5);
1304- if (pet) mode |= PM_FORCE_PET;
1305-
1306- if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_JIZOTAKO, mode))
1307- {
1308- if (pet)
1309- msg_print(_("蛸があなたの下僕として出現した。", "A group of octopuses appear as your servant."));
1310- else
1311- msg_print(_("蛸はあなたを睨んでいる!", "A group of octopuses appear as your enemy!"));
1312- }
1313-
1301+ if(!cast_summon_octopus(p_ptr)) return FALSE;
13141302 break;
1315- }
13161303
13171304 /* Activate for healing */
13181305
--- a/src/spells-object.c
+++ b/src/spells-object.c
@@ -804,33 +804,33 @@ bool perilous_secrets(player_type *creature_ptr)
804804 if (mp_ptr->spell_book)
805805 {
806806 /* Sufficient mana */
807- if (20 <= p_ptr->csp)
807+ if (20 <= creature_ptr->csp)
808808 {
809809 /* Use some mana */
810- p_ptr->csp -= 20;
810+ creature_ptr->csp -= 20;
811811 }
812812
813813 /* Over-exert the player */
814814 else
815815 {
816- int oops = 20 - p_ptr->csp;
816+ int oops = 20 - creature_ptr->csp;
817817
818818 /* No mana left */
819- p_ptr->csp = 0;
820- p_ptr->csp_frac = 0;
819+ creature_ptr->csp = 0;
820+ creature_ptr->csp_frac = 0;
821821
822822 msg_print(_("石を制御できない!", "You are too weak to control the stone!"));
823823 /* Hack -- Bypass free action */
824- (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
824+ (void)set_paralyzed(creature_ptr->paralyzed + randint1(5 * oops + 1));
825825
826826 /* Confusing. */
827- (void)set_confused(p_ptr->confused + randint1(5 * oops + 1));
827+ (void)set_confused(creature_ptr->confused + randint1(5 * oops + 1));
828828 }
829- p_ptr->redraw |= (PR_MANA);
829+ creature_ptr->redraw |= (PR_MANA);
830830 }
831831 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), _("危険な秘密", "perilous secrets"), -1);
832832 /* Confusing. */
833- if (one_in_(5)) (void)set_confused(p_ptr->confused + randint1(10));
833+ if (one_in_(5)) (void)set_confused(creature_ptr->confused + randint1(10));
834834
835835 /* Exercise a little care... */
836836 if (one_in_(20)) take_hit(DAMAGE_LOSELIFE, damroll(4, 10), _("危険な秘密", "perilous secrets"), -1);
--- a/src/spells-summon.c
+++ b/src/spells-summon.c
@@ -88,6 +88,22 @@ bool cast_summon_demon(int power)
8888 return TRUE;
8989 }
9090
91+bool cast_summon_octopus(player_type *creature_ptr)
92+{
93+ BIT_FLAGS mode = PM_ALLOW_GROUP;
94+ bool pet = !one_in_(5);
95+ if (pet) mode |= PM_FORCE_PET;
96+
97+ if (summon_named_creature(0, creature_ptr->y, creature_ptr->x, MON_JIZOTAKO, mode))
98+ {
99+ if (pet)
100+ msg_print(_("蛸があなたの下僕として出現した。", "A group of octopuses appear as your servant."));
101+ else
102+ msg_print(_("蛸はあなたを睨んでいる!", "A group of octopuses appear as your enemy!"));
103+ }
104+
105+ return TRUE;
106+}
91107
92108 /*!
93109 * @brief 悪魔領域のグレーターデーモン召喚に利用可能な死体かどうかを返す。 / An "item_tester_hook" for offer
--- 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_octopus(player_type *creature_ptr);
910 extern bool item_tester_offer(object_type *o_ptr);
1011 extern bool cast_summon_greater_demon(void);
1112 extern bool summon_kin_player(DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode);
Show on old repository browser