OSDN Git Service

[Refactor] #37353 wreck_the_pattern() to player-status.c.
authordeskull <deskull@users.sourceforge.jp>
Wed, 6 Mar 2019 14:40:24 +0000 (23:40 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 6 Mar 2019 14:40:24 +0000 (23:40 +0900)
src/dungeon.c
src/player-status.c
src/player-status.h

index b5e83d8..0ad8256 100644 (file)
@@ -611,42 +611,6 @@ static void pattern_teleport(void)
 }
 
 /*!
- * @brief 種族アンバライトが出血時パターンの上に乗った際のペナルティ処理
- * @return なし
- */
-static void wreck_the_pattern(void)
-{
-       int to_ruin = 0;
-       POSITION r_y, r_x;
-       int pattern_type = f_info[current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat].subtype;
-
-       if (pattern_type == PATTERN_TILE_WRECKED)
-       {
-               /* Ruined already */
-               return;
-       }
-
-       msg_print(_("パターンを血で汚してしまった!", "You bleed on the Pattern!"));
-       msg_print(_("何か恐ろしい事が起こった!", "Something terrible happens!"));
-
-       if (!IS_INVULN()) take_hit(DAMAGE_NOESCAPE, damroll(10, 8), _("パターン損壊", "corrupting the Pattern"), -1);
-       to_ruin = randint1(45) + 35;
-
-       while (to_ruin--)
-       {
-               scatter(&r_y, &r_x, p_ptr->y, p_ptr->x, 4, 0);
-
-               if (pattern_tile(r_y, r_x) &&
-                   (f_info[current_floor_ptr->grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
-               {
-                       cave_set_feat(r_y, r_x, feat_pattern_corrupted);
-               }
-       }
-
-       cave_set_feat(p_ptr->y, p_ptr->x, feat_pattern_corrupted);
-}
-
-/*!
  * @brief 各種パターン地形上の特別な処理 / Returns TRUE if we are on the Pattern...
  * @return 実際にパターン地形上にプレイヤーが居た場合はTRUEを返す。
  */
index 277fae2..ec60387 100644 (file)
@@ -3842,3 +3842,39 @@ bool player_place(POSITION y, POSITION x)
        /* Success */
        return TRUE;
 }
+
+/*!
+ * @brief 種族アンバライトが出血時パターンの上に乗った際のペナルティ処理
+ * @return なし
+ */
+void wreck_the_pattern(void)
+{
+       int to_ruin = 0;
+       POSITION r_y, r_x;
+       int pattern_type = f_info[current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat].subtype;
+
+       if (pattern_type == PATTERN_TILE_WRECKED)
+       {
+               /* Ruined already */
+               return;
+       }
+
+       msg_print(_("パターンを血で汚してしまった!", "You bleed on the Pattern!"));
+       msg_print(_("何か恐ろしい事が起こった!", "Something terrible happens!"));
+
+       if (!IS_INVULN()) take_hit(DAMAGE_NOESCAPE, damroll(10, 8), _("パターン損壊", "corrupting the Pattern"), -1);
+       to_ruin = randint1(45) + 35;
+
+       while (to_ruin--)
+       {
+               scatter(&r_y, &r_x, p_ptr->y, p_ptr->x, 4, 0);
+
+               if (pattern_tile(r_y, r_x) &&
+                       (f_info[current_floor_ptr->grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
+               {
+                       cave_set_feat(r_y, r_x, feat_pattern_corrupted);
+               }
+       }
+
+       cave_set_feat(p_ptr->y, p_ptr->x, feat_pattern_corrupted);
+}
index 5719638..8734962 100644 (file)
@@ -17,3 +17,5 @@ extern void take_turn(player_type *creature_ptr, PERCENTAGE need_cost);
 extern void free_turn(player_type *creature_ptr);
 
 extern bool player_place(POSITION y, POSITION x);
+
+extern void wreck_the_pattern(void);