OSDN Git Service

[Refactor] #40466 Moved hp_player() from player-effects.c/h to hp-mp-processor.c/h
authorHourier <hourier@users.sourceforge.jp>
Wed, 1 Jul 2020 11:47:44 +0000 (20:47 +0900)
committerHourier <hourier@users.sourceforge.jp>
Wed, 1 Jul 2020 11:47:44 +0000 (20:47 +0900)
24 files changed:
src/cmd-action/cmd-mane.c
src/cmd-item/cmd-activate.c
src/cmd-item/cmd-eat.c
src/core/hp-mp-processor.c
src/core/hp-mp-processor.h
src/effect/effect-monster-spirit.c
src/effect/effect-player-oldies.c
src/effect/effect-player-resist-hurt.c
src/mind/mind-warrior-mage.c
src/mind/mind.c
src/mind/racial-vampire.c
src/mspell/mspells3.c
src/mutation/mutation-processor.c
src/player-attack/blood-sucking-processor.c
src/player/player-effects.c
src/player/player-effects.h
src/realm/realm-crusade.c
src/realm/realm-death.c
src/realm/realm-nature.c
src/realm/realm-song.c
src/spell-kind/spells-random.c
src/spell/spells-staff-only.c
src/spell/spells-status.c
src/spell/spells-summon.c

index 46f5950..aa47589 100644 (file)
@@ -12,6 +12,7 @@
 #include "cmd-action/cmd-spell.h"
 #include "cmd/cmd-basic.h"
 #include "core/asking-player.h"
+#include "core/hp-mp-processor.h"
 #include "core/stuff-handler.h"
 #include "floor/floor.h"
 #include "game-option/disturbance-options.h"
 #include "monster/monster-status.h"
 #include "mspell/monster-power-table.h"
 #include "mspell/mspell-type.h"
-#include "status/bad-status-setter.h"
-#include "status/body-improvement.h"
-#include "status/buff-setter.h"
-#include "player/player-effects.h"
 #include "player/player-status.h"
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-lite.h"
@@ -45,6 +42,9 @@
 #include "spell/spells-summon.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell/spell-types.h"
+#include "status/bad-status-setter.h"
+#include "status/body-improvement.h"
+#include "status/buff-setter.h"
 #include "term/screen-processor.h"
 #include "util/int-char-converter.h"
 #include "view/display-messages.h"
index 399899f..badf554 100644 (file)
@@ -12,6 +12,7 @@
 #include "cmd-io/cmd-save.h"
 #include "cmd/cmd-basic.h"
 #include "core/asking-player.h"
+#include "core/hp-mp-processor.h"
 #include "util/sort.h"
 #include "effect/effect-characteristics.h"
 #include "effect/spells-effect-util.h"
index a4952fe..b9b46f9 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include "cmd-item/cmd-eat.h"
+#include "core/hp-mp-processor.h"
 #include "floor/floor-object.h"
 #include "floor/floor.h"
 #include "inventory/inventory-object.h"
@@ -23,7 +24,6 @@
 #include "object/object-info.h"
 #include "perception/object-perception.h"
 #include "player/avatar.h"
-#include "status/bad-status-setter.h"
 #include "player/digestion-processor.h"
 #include "player/mimic-info-table.h"
 #include "player/player-class.h"
@@ -33,6 +33,7 @@
 #include "player/special-defense-types.h"
 #include "spell-realm/spells-hex.h"
 #include "spell/spells-status.h"
+#include "status/bad-status-setter.h"
 #include "status/base-status.h"
 #include "status/element-resistance.h"
 #include "status/experience.h"
index 3d6d868..6fea07b 100644 (file)
@@ -11,6 +11,7 @@
 #include "object-enchant/object-ego.h"
 #include "object-enchant/trc-types.h"
 #include "object/object-flavor.h"
+#include "player/avatar.h"
 #include "player/player-damage.h"
 #include "player/player-race-types.h"
 #include "player/player-race.h"
@@ -396,3 +397,46 @@ void process_player_hp_mp(player_type *creature_ptr)
         regenhp(creature_ptr, regen_amount);
     }
 }
+
+/*
+ * Increase players hit points, notice effects
+ */
+bool hp_player(player_type *creature_ptr, int num)
+{
+    int vir;
+    vir = virtue_number(creature_ptr, V_VITALITY);
+
+    if (num <= 0)
+        return FALSE;
+
+    if (vir) {
+        num = num * (creature_ptr->virtues[vir - 1] + 1250) / 1250;
+    }
+
+    if (creature_ptr->chp < creature_ptr->mhp) {
+        if ((num > 0) && (creature_ptr->chp < (creature_ptr->mhp / 3)))
+            chg_virtue(creature_ptr, V_TEMPERANCE, 1);
+
+        creature_ptr->chp += num;
+        if (creature_ptr->chp >= creature_ptr->mhp) {
+            creature_ptr->chp = creature_ptr->mhp;
+            creature_ptr->chp_frac = 0;
+        }
+
+        creature_ptr->redraw |= (PR_HP);
+        creature_ptr->window |= (PW_PLAYER);
+        if (num < 5) {
+            msg_print(_("少し気分が良くなった。", "You feel a little better."));
+        } else if (num < 15) {
+            msg_print(_("気分が良くなった。", "You feel better."));
+        } else if (num < 35) {
+            msg_print(_("とても気分が良くなった。", "You feel much better."));
+        } else {
+            msg_print(_("ひじょうに気分が良くなった。", "You feel very good."));
+        }
+
+        return TRUE;
+    }
+
+    return FALSE;
+}
index 297901b..9efd214 100644 (file)
@@ -3,3 +3,4 @@
 #include "system/angband.h"
 
 void process_player_hp_mp(player_type* creature_ptr);
+bool hp_player(player_type *creature_ptr, int num);
index 5bc66fb..83a1cb2 100644 (file)
@@ -1,4 +1,5 @@
 #include "effect/effect-monster-spirit.h"
+#include "core/hp-mp-processor.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags1.h"
 #include "monster-race/race-flags2.h"
@@ -10,7 +11,6 @@
 #include "monster/monster-status.h"
 #include "monster/monster-info.h"
 #include "mspell/mspell-mask-definitions.h"
-#include "player/player-effects.h"
 #include "view/display-messages.h"
 
 gf_switch_result effect_monster_drain_mana(player_type *caster_ptr, effect_monster_type *em_ptr)
index 417860e..1ccca7a 100644 (file)
@@ -1,10 +1,10 @@
 #include "effect/effect-player-oldies.h"
+#include "core/hp-mp-processor.h"
 #include "game-option/birth-options.h"
 #include "monster-race/race-indice-types.h"
+#include "player/eldritch-horror.h"
 #include "status/bad-status-setter.h"
 #include "status/buff-setter.h"
-#include "player/eldritch-horror.h"
-#include "player/player-effects.h"
 #include "view/display-messages.h"
 
 void effect_player_old_heal(player_type *target_ptr, effect_player_type *ep_ptr)
index 40034ce..bceb9b7 100644 (file)
@@ -1,12 +1,12 @@
 #include "effect/effect-player-resist-hurt.h"
 #include "art-definition/art-sword-types.h"
+#include "core/hp-mp-processor.h"
 #include "inventory/inventory-damage.h"
 #include "mind/mind-mirror-master.h"
 #include "monster-race/race-indice-types.h"
 #include "mspell/mspells3.h"
 #include "mutation/mutation.h"
 #include "object/object-broken.h"
-#include "status/bad-status-setter.h"
 #include "player/player-damage.h"
 #include "player/player-effects.h"
 #include "player/player-race-types.h"
@@ -14,6 +14,7 @@
 #include "spell-kind/spells-teleport.h"
 #include "spell/spells-status.h"
 #include "spell/spells3.h"
+#include "status/bad-status-setter.h"
 #include "status/base-status.h"
 #include "status/element-resistance.h"
 #include "status/experience.h"
index fa0f631..ea11915 100644 (file)
@@ -1,6 +1,6 @@
 #include "mind/mind-warrior-mage.h"
+#include "core/hp-mp-processor.h"
 #include "player/player-damage.h"
-#include "player/player-effects.h"
 #include "view/display-messages.h"
 
 bool comvert_hp_to_mp(player_type *creature_ptr)
index bc5a563..eb8c83f 100644 (file)
@@ -19,6 +19,7 @@
 #include "cmd-action/cmd-spell.h"
 #include "cmd/cmd-basic.h"
 #include "core/asking-player.h"
+#include "core/hp-mp-processor.h"
 #include "core/stuff-handler.h"
 #include "effect/effect-characteristics.h"
 #include "effect/spells-effect-util.h"
@@ -45,7 +46,6 @@
 #include "player/avatar.h"
 #include "player/player-class.h"
 #include "player/player-damage.h"
-#include "player/player-effects.h"
 #include "player/player-move.h"
 #include "player/special-defense-types.h"
 #include "spell/process-effect.h"
index 9ccb4da..595b924 100644 (file)
@@ -1,10 +1,10 @@
 #include "mind/racial-vampire.h"
+#include "core/hp-mp-processor.h"
 #include "dungeon/dungeon.h"
 #include "floor/floor.h"
 #include "grid/grid.h"
 #include "io/targeting.h"
 #include "player/digestion-processor.h"
-#include "player/player-effects.h"
 #include "spell-kind/spells-specific-bolt.h"
 #include "view/display-messages.h"
 
index 54683ef..157760f 100644 (file)
@@ -13,6 +13,7 @@
 #include "cmd-action/cmd-spell.h"
 #include "cmd/cmd-basic.h"
 #include "core/asking-player.h"
+#include "core/hp-mp-processor.h"
 #include "core/stuff-handler.h"
 #include "floor/floor.h"
 #include "game-option/disturbance-options.h"
@@ -43,7 +44,6 @@
 #include "mspell/mspell-mask-definitions.h"
 #include "mspell/mspell-type.h"
 #include "player/avatar.h"
-#include "player/player-effects.h"
 #include "player/player-status.h"
 #include "realm/realm-types.h"
 #include "spell-kind/spells-launcher.h"
index 254be86..21f9ab6 100644 (file)
@@ -1,4 +1,5 @@
 #include "mutation/mutation-processor.h"
+#include "core/hp-mp-processor.h"
 #include "grid/grid.h"
 #include "inventory/inventory-object.h"
 #include "io/targeting.h"
index 0b9d8da..57a9153 100644 (file)
@@ -6,10 +6,10 @@
 
 #include "player-attack/blood-sucking-processor.h"
 #include "art-definition/art-sword-types.h"
+#include "core/hp-mp-processor.h"
 #include "game-option/cheat-options.h"
 #include "monster-race/monster-race-hook.h"
 #include "object-enchant/tr-types.h"
-#include "player/player-effects.h"
 #include "realm/realm-hex-numbers.h"
 #include "spell-realm/spells-hex.h"
 #include "util/bit-flags-calculator.h"
index 2417a01..7ce6778 100644 (file)
@@ -18,6 +18,7 @@
 #include "birth/character-builder.h"
 #include "cmd-building/cmd-building.h"
 #include "cmd-io/cmd-dump.h"
+#include "core/hp-mp-processor.h"
 #include "core/speed-table.h"
 #include "core/stuff-handler.h"
 #include "dungeon/quest.h"
@@ -240,49 +241,6 @@ void dispel_player(player_type *creature_ptr)
     }
 }
 
-/*
- * Increase players hit points, notice effects
- */
-bool hp_player(player_type *creature_ptr, int num)
-{
-    int vir;
-    vir = virtue_number(creature_ptr, V_VITALITY);
-
-    if (num <= 0)
-        return FALSE;
-
-    if (vir) {
-        num = num * (creature_ptr->virtues[vir - 1] + 1250) / 1250;
-    }
-
-    if (creature_ptr->chp < creature_ptr->mhp) {
-        if ((num > 0) && (creature_ptr->chp < (creature_ptr->mhp / 3)))
-            chg_virtue(creature_ptr, V_TEMPERANCE, 1);
-
-        creature_ptr->chp += num;
-        if (creature_ptr->chp >= creature_ptr->mhp) {
-            creature_ptr->chp = creature_ptr->mhp;
-            creature_ptr->chp_frac = 0;
-        }
-
-        creature_ptr->redraw |= (PR_HP);
-        creature_ptr->window |= (PW_PLAYER);
-        if (num < 5) {
-            msg_print(_("少し気分が良くなった。", "You feel a little better."));
-        } else if (num < 15) {
-            msg_print(_("気分が良くなった。", "You feel better."));
-        } else if (num < 35) {
-            msg_print(_("とても気分が良くなった。", "You feel much better."));
-        } else {
-            msg_print(_("ひじょうに気分が良くなった。", "You feel very good."));
-        }
-
-        return TRUE;
-    }
-
-    return FALSE;
-}
-
 void do_poly_wounds(player_type *creature_ptr)
 {
     s16b wounds = creature_ptr->cut;
index 6daafb2..ff33871 100644 (file)
@@ -4,7 +4,6 @@
 
 void set_action(player_type *creature_ptr, ACTION_IDX typ);
 void dispel_player(player_type *creature_ptr);
-bool hp_player(player_type *creature_ptr, int num);
 void do_poly_self(player_type *creature_ptr);
 void do_poly_wounds(player_type *creature_ptr);
 void change_race(player_type *creature_ptr, player_race_type new_race, concptr effect_msg);
index 45595a4..01994bb 100644 (file)
@@ -1,5 +1,6 @@
 #include "realm/realm-crusade.h"
 #include "cmd-action/cmd-spell.h"
+#include "core/hp-mp-processor.h"
 #include "effect/effect-characteristics.h"
 #include "floor/floor.h"
 #include "io/targeting.h"
@@ -8,7 +9,6 @@
 #include "status/bad-status-setter.h"
 #include "status/buff-setter.h"
 #include "player/player-class.h"
-#include "player/player-effects.h"
 #include "spell-kind/spells-beam.h"
 #include "spell-kind/spells-curse-removal.h"
 #include "spell-kind/spells-detection.h"
index ad04113..85f3540 100644 (file)
@@ -1,12 +1,12 @@
 #include "realm/realm-death.h"
 #include "cmd-action/cmd-spell.h"
+#include "core/hp-mp-processor.h"
 #include "effect/effect-characteristics.h"
 #include "io/targeting.h"
 #include "player/avatar.h"
 #include "player/digestion-processor.h"
 #include "player/player-class.h"
 #include "player/player-damage.h"
-#include "player/player-effects.h"
 #include "player/player-race.h"
 #include "spell-kind/spells-charm.h"
 #include "spell-kind/spells-detection.h"
index 1eecd7e..2f766e1 100644 (file)
@@ -1,5 +1,6 @@
 #include "realm/realm-nature.h"
 #include "cmd-action/cmd-spell.h"
+#include "core/hp-mp-processor.h"
 #include "effect/effect-characteristics.h"
 #include "effect/spells-effect-util.h"
 #include "floor/floor-object.h"
@@ -10,7 +11,6 @@
 #include "object/object-kind-hook.h"
 #include "player/avatar.h"
 #include "player/player-damage.h"
-#include "player/player-effects.h"
 #include "player/player-race-types.h"
 #include "player/player-race.h"
 #include "spell-kind/earthquake.h"
index 884a624..36dea65 100644 (file)
@@ -1,4 +1,5 @@
 #include "cmd-action/cmd-spell.h"
+#include "core/hp-mp-processor.h"
 #include "effect/effect-characteristics.h"
 #include "io/targeting.h"
 #include "status/bad-status-setter.h"
index 166be76..d59ea5a 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include "spell-kind/spells-random.h"
+#include "core/hp-mp-processor.h"
 #include "effect/effect-characteristics.h"
 #include "floor/floor.h"
 #include "io/targeting.h"
@@ -16,7 +17,6 @@
 #include "player/avatar.h"
 #include "status/bad-status-setter.h"
 #include "player/player-damage.h"
-#include "player/player-effects.h"
 #include "spell-kind/earthquake.h"
 #include "spell-kind/spells-floor.h"
 #include "spell-kind/spells-genocide.h"
index aae5f44..1e68ce2 100644 (file)
@@ -1,11 +1,11 @@
 #include "spell/spells-staff-only.h"
+#include "core/hp-mp-processor.h"
 #include "effect/effect-characteristics.h"
-#include "status/bad-status-setter.h"
 #include "player/player-damage.h"
-#include "player/player-effects.h"
 #include "spell/process-effect.h"
 #include "spell-kind/spells-sight.h"
 #include "spell/spell-types.h"
+#include "status/bad-status-setter.h"
 #include "status/body-improvement.h"
 #include "view/display-messages.h"
 
index b38a740..e15993a 100644 (file)
@@ -7,6 +7,7 @@
 #include "spell/spells-status.h"
 #include "cmd-action/cmd-spell.h"
 #include "cmd-item/cmd-magiceat.h"
+#include "core/hp-mp-processor.h"
 #include "core/stuff-handler.h"
 #include "effect/effect-characteristics.h"
 #include "floor/floor-object.h"
 #include "object/object-kind-hook.h"
 #include "object/object-kind.h"
 #include "player/avatar.h"
-#include "status/bad-status-setter.h"
-#include "status/buff-setter.h"
 #include "player/player-class.h"
 #include "player/player-effects.h"
 #include "player/player-status.h"
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell/spell-types.h"
+#include "status/bad-status-setter.h"
 #include "status/base-status.h"
 #include "status/body-improvement.h"
+#include "status/buff-setter.h"
 #include "status/experience.h"
 #include "status/form-changer.h"
 #include "status/sight-setter.h"
index 99cdc19..1084a2a 100644 (file)
@@ -1,4 +1,5 @@
 #include "spell/spells-summon.h"
+#include "core/hp-mp-processor.h"
 #include "effect/spells-effect-util.h"
 #include "floor/floor.h"
 #include "game-option/birth-options.h"
@@ -14,8 +15,6 @@
 #include "object/item-use-flags.h"
 #include "object/item-tester-hooker.h"
 #include "player/avatar.h"
-#include "status/bad-status-setter.h"
-#include "player/player-effects.h"
 #include "spell/spells-diceroll.h"
 #include "spell-kind/earthquake.h"
 #include "spell-kind/spells-floor.h"
@@ -26,6 +25,7 @@
 #include "spell-kind/spells-specific-bolt.h"
 #include "spell/spells-status.h"
 #include "spell/spell-types.h"
+#include "status/bad-status-setter.h"
 #include "sv-definition/sv-other-types.h"
 #include "util/string-processor.h"
 #include "view/display-messages.h"