OSDN Git Service

[Refactor] #40236 Renamed bldg.c/h to market/building.c/h
authorHourier <hourier@users.sourceforge.jp>
Tue, 21 Apr 2020 14:39:01 +0000 (23:39 +0900)
committerHourier <hourier@users.sourceforge.jp>
Tue, 21 Apr 2020 14:39:01 +0000 (23:39 +0900)
23 files changed:
Hengband_vcs2017/Hengband/Hengband.vcxproj
Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/birth.c
src/cmd/cmd-inn.c
src/core.c
src/dungeon-file.c
src/floor-generate.c
src/floor-save.c
src/init.c
src/load.c
src/market/building.c [moved from src/bldg.c with 99% similarity]
src/market/building.h [moved from src/bldg.h with 100% similarity]
src/monster1.c
src/player-damage.c
src/player-effects.c
src/player-status.c
src/player-status.h
src/save.c
src/spells3.c
src/targeting.c
src/view-mainwindow.c
src/wizard2.c

index c7648e9..6e3d141 100644 (file)
     <ClCompile Include="..\..\src\autopick.c" />\r
     <ClCompile Include="..\..\src\avatar.c" />\r
     <ClCompile Include="..\..\src\birth.c" />\r
-    <ClCompile Include="..\..\src\bldg.c" />\r
+    <ClCompile Include="..\..\src\market\building.c" />\r
     <ClCompile Include="..\..\src\character-dump.c" />\r
     <ClCompile Include="..\..\src\chest.c" />\r
     <ClCompile Include="..\..\src\chuukei.c" />\r
     <ClInclude Include="..\..\src\autopick.h" />\r
     <ClInclude Include="..\..\src\avatar.h" />\r
     <ClInclude Include="..\..\src\birth.h" />\r
-    <ClInclude Include="..\..\src\bldg.h" />\r
+    <ClInclude Include="..\..\src\market\building.h" />\r
     <ClInclude Include="..\..\src\character-dump.h" />\r
     <ClInclude Include="..\..\src\chest.h" />\r
     <ClInclude Include="..\..\src\chuukei.h" />\r
index 3e9d2b1..043b1fb 100644 (file)
     <ClCompile Include="..\..\src\store.c">
       <Filter>market</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\src\bldg.c">
-      <Filter>market</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\src\rumor.c">
       <Filter>market</Filter>
     </ClCompile>
     <ClCompile Include="..\..\src\cmd\cmd-inn.c">
       <Filter>cmd</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\market\building.c">
+      <Filter>market</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\gamevalue.h" />
     <ClInclude Include="..\..\src\store.h">
       <Filter>market</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\src\bldg.h">
-      <Filter>market</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\src\rumor.h">
       <Filter>market</Filter>
     </ClInclude>
     <ClInclude Include="..\..\src\cmd\cmd-inn.h">
       <Filter>cmd</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\market\building.h">
+      <Filter>market</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index f89b678..f043421 100644 (file)
@@ -21,7 +21,7 @@ hengband_SOURCES = \
        market/say-comments.c market/say-comments.h \
        market/store-util.c market/store-util.h \
        market/gold-magnification-table.c market/gold-magnification-table.h \
-       store.c store.h bldg.c bldg.h chest.c chest.h chuukei.c chuukei.h \
+       store.c store.h building.c building.h chest.c chest.h chuukei.c chuukei.h \
        \
        view/display-characteristic.c view/display-characteristic.h \
        view/display-fruit.c view/display-fruit.h \
index 283c3d1..695906f 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "angband.h"
 #include "util.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "core.h"
 #include "core/show-file.h"
 #include "io/read-pref-file.h"
index 4d42fb7..64ddc22 100644 (file)
@@ -167,6 +167,36 @@ static void display_stay_result(player_type *customer_ptr, int prev_hour)
 
 
 /*!
+ * @brief 宿屋への宿泊実行処理
+ * @param customer_ptr プレーヤーへの参照ポインタ
+ * @return 泊まれたらTRUE
+ */
+static bool stay_inn(player_type *customer_ptr)
+{
+       if (!is_healthy_stay(customer_ptr)) return FALSE;
+
+       int prev_day, prev_hour, prev_min;
+       extract_day_hour_min(customer_ptr, &prev_day, &prev_hour, &prev_min);
+       write_diary_stay_inn(customer_ptr, prev_hour);
+
+       pass_game_turn_by_stay();
+       prevent_turn_overflow(customer_ptr);
+
+       if ((prev_hour >= 18) && (prev_hour <= 23))
+               exe_write_diary(customer_ptr, DIARY_DIALY, 0, NULL);
+
+       customer_ptr->chp = customer_ptr->mhp;
+       if (have_a_nightmare(customer_ptr)) return TRUE;
+
+       back_to_health(customer_ptr);
+       charge_magic_eating_energy(customer_ptr);
+
+       display_stay_result(customer_ptr, prev_hour);
+       return TRUE;
+}
+
+
+/*!
  * todo 悪夢を見る前後に全回復しているが、何か意図がある?
  * @brief 宿屋を利用する
  * @param customer_ptr プレーヤーへの参照ポインタ
@@ -186,30 +216,9 @@ bool inn_comm(player_type *customer_ptr, int cmd)
        {
        case BACT_FOOD:
                return buy_food(customer_ptr);
-       case BACT_REST: /* Rest for the night */
-       {
-               if (!is_healthy_stay(customer_ptr)) return FALSE;
-
-               int prev_day, prev_hour, prev_min;
-               extract_day_hour_min(customer_ptr, &prev_day, &prev_hour, &prev_min);
-               write_diary_stay_inn(customer_ptr, prev_hour);
-
-               pass_game_turn_by_stay();
-               prevent_turn_overflow(customer_ptr);
-
-               if ((prev_hour >= 18) && (prev_hour <= 23))
-                       exe_write_diary(customer_ptr, DIARY_DIALY, 0, NULL);
-
-               customer_ptr->chp = customer_ptr->mhp;
-               if (have_a_nightmare(customer_ptr)) return TRUE;
-
-               back_to_health(customer_ptr);
-               charge_magic_eating_energy(customer_ptr);
-
-               display_stay_result(customer_ptr);
-               return TRUE;
-       }
-       case BACT_RUMORS: /* Listen for rumors */
+       case BACT_REST:
+               return stay_inn(customer_ptr);
+       case BACT_RUMORS:
                display_rumor(customer_ptr, TRUE);
                return TRUE;
        default:
index 2f6f45a..9ba9e42 100644 (file)
@@ -21,7 +21,7 @@
 #include "creature.h"
 
 #include "birth.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "io/write-diary.h"
 #include "cmd/cmd-activate.h"
 #include "cmd/cmd-diary.h"
index bede376..2abf934 100644 (file)
@@ -48,7 +48,7 @@
 #include "player-race.h"
 #include "dungeon.h"
 #include "floor.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "world.h"
 #include "rooms-vault.h"
 #include "objectkind.h"
index 1695c76..ce78e00 100644 (file)
@@ -99,7 +99,7 @@
 #include "angband.h"
 #include "util.h"
 #include "core.h"
-#include "bldg.h"
+#include "market/building.h"
 
 #include "io/write-diary.h"
 #include "cmd/cmd-dump.h"
index a7bd8e2..444521b 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include "angband.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "core.h"
 #include "load.h"
 #include "util.h"
index 0e27a8d..0de6126 100644 (file)
@@ -39,7 +39,7 @@
 #include "term.h"
 
 #include "artifact.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "init.h"
 #include "quest.h"
 #include "trap.h"
index a8ca931..41eb860 100644 (file)
@@ -45,7 +45,7 @@
 #include "core.h"
 
 #include "load.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "report.h"
 
 #include "dungeon.h"
similarity index 99%
rename from src/bldg.c
rename to src/market/building.c
index 87305ba..b2bd73e 100644 (file)
@@ -1,15 +1,15 @@
 /*!
@file bldg.c
- @brief 町の施設処理 / Building commands
- @date 2013/12/23
- @author
- Created by Ken Wigle for Kangband - a variant of Angband 2.8.3
- -KMW-
- Rewritten for Kangband 2.8.3i using Kamband's version of
bldg.c as written by Ivan Tkatchev
- Changed for ZAngband by Robert Ruehlmann
* @file building.c
@brief 町の施設処理 / Building commands
@date 2013/12/23
@author
Created by Ken Wigle for Kangband - a variant of Angband 2.8.3
-KMW-
+ * 
Rewritten for Kangband 2.8.3i using Kamband's version of
* building.c as written by Ivan Tkatchev
+ * 
Changed for ZAngband by Robert Ruehlmann
 */
 
 #include "angband.h"
@@ -36,7 +36,7 @@
 #include "sort.h"
 
 #include "avatar.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "dungeon.h"
 #include "mutation.h"
 #include "quest.h"
@@ -269,9 +269,6 @@ static void show_building(player_type *player_ptr, building_type* bldg)
  */
 static void arena_comm(player_type *player_ptr, int cmd)
 {
-       monster_race    *r_ptr;
-       concptr            name;
-
        switch (cmd)
        {
        case BACT_ARENA:
@@ -344,6 +341,7 @@ static void arena_comm(player_type *player_ptr, int cmd)
                player_ptr->leave_bldg = TRUE;
                break;
        case BACT_POSTER:
+       {
                if (player_ptr->arena_number == MAX_ARENA_MONS)
                {
                        msg_print(_("あなたは勝利者だ。 アリーナでのセレモニーに参加しなさい。",
@@ -357,14 +355,16 @@ static void arena_comm(player_type *player_ptr, int cmd)
                        break;
                }
 
+               monster_race *r_ptr;
                r_ptr = &r_info[arena_info[player_ptr->arena_number].r_idx];
-               name = (r_name + r_ptr->name);
+               concptr name = (r_name + r_ptr->name);
                msg_format(_("%s に挑戦するものはいないか?", "Do I hear any challenges against: %s"), name);
 
                player_ptr->monster_race_idx = arena_info[player_ptr->arena_number].r_idx;
                player_ptr->window |= (PW_MONSTER);
                handle_stuff(player_ptr);
                break;
+       }
        case BACT_ARENA_RULES:
                screen_save();
 
similarity index 100%
rename from src/bldg.h
rename to src/market/building.h
index d23df4a..bc02c8f 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "io/write-diary.h"
 #include "cmd/cmd-dump.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "cmd-pet.h"
 #include "floor.h"
 #include "objectkind-hook.h"
index 2c22ab0..da989f1 100644 (file)
@@ -4,7 +4,7 @@
 #include "term.h"
 
 #include "avatar.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "io/write-diary.h"
 #include "cmd/cmd-dump.h"
 #include "market/arena-info-table.h"
index d9361dd..9f6b5c3 100644 (file)
@@ -22,7 +22,7 @@
 #include "artifact.h"
 #include "cmd-dump.h"
 #include "floor.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "birth.h"
 #include "grid.h"
 #include "mutation.h"
index 47832cf..3b2c20f 100644 (file)
@@ -2,7 +2,7 @@
 #include "core.h"
 #include "util.h"
 
-#include "bldg.h"
+#include "market/building.h"
 #include "quest.h"
 #include "player-move.h"
 #include "player-status.h"
index 49d6b39..19c5202 100644 (file)
@@ -1,5 +1,5 @@
 #pragma once 
-#include "bldg.h"
+#include "market/building.h"
 struct floor_type;
 typedef struct floor_type floor_type;
 
index ab5cb43..0c99a59 100644 (file)
@@ -35,7 +35,7 @@
 #include "objectkind.h"
 #include "monsterrace.h"
 #include "birth.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "view-mainwindow.h"
 
  /*
index 85951bd..7823313 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 #include "angband.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "core.h"
 #include "term.h"
 #include "util.h"
index c46d530..97c49aa 100644 (file)
@@ -16,7 +16,7 @@
 #include "term.h"
 #include "targeting.h"
 
-#include "bldg.h"
+#include "market/building.h"
 #include "cmd-pet.h"
 #include "dungeon-file.h"
 #include "object-curse.h"
index 4d2aafb..7ff12a2 100644 (file)
@@ -15,7 +15,7 @@
 #include "autopick.h"
 #include "term.h"
 
-#include "bldg.h"
+#include "market/building.h"
 #include "core.h"
 #include "files.h"
 #include "world.h"
index 85a814c..a3252fa 100644 (file)
@@ -50,7 +50,7 @@
 #include "dungeon-file.h"
 #include "files.h"
 #include "monster-spell.h"
-#include "bldg.h"
+#include "market/building.h"
 #include "objectkind.h"
 #include "targeting.h"
 #include "view-mainwindow.h"