OSDN Git Service

[Refactor] #37353 回復処理関数を spells-status.c に移動。 / Move some healing functions to spell...
authorDeskull <deskull@users.sourceforge.jp>
Mon, 4 Feb 2019 15:08:07 +0000 (00:08 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Mon, 4 Feb 2019 15:08:07 +0000 (00:08 +0900)
14 files changed:
src/bldg.c
src/cmd-usestaff.c
src/externs.h
src/mutation.c
src/patron.c
src/player-status.c
src/realm-arcane.c
src/realm-craft.c
src/realm-hex.c
src/realm-life.c
src/realm-nature.c
src/spells-status.c
src/spells-status.h
src/spells2.c

index 3a36eef..46e20b4 100644 (file)
@@ -27,6 +27,7 @@
 #include "cmd-spell.h"
 #include "rumor.h"
 #include "player-status.h"
+#include "spells-status.h"
 
 /*!
  * ループ中で / hack as in leave_store in store.c
index ed1e964..aa088d1 100644 (file)
@@ -3,6 +3,7 @@
 #include "spells-summon.h"\r
 #include "avatar.h"\r
 #include "player-status.h"\r
+#include "spells-status.h"\r
 \r
 \r
 \r
index 9120320..ac3cf1e 100644 (file)
@@ -973,15 +973,6 @@ extern bool cast_wrath_of_the_god(HIT_POINT dam, POSITION rad);
 extern void cast_wonder(DIRECTION dir);
 extern void cast_invoke_spirits(DIRECTION dir);
 extern void cast_shuffle(void);
-extern bool_hack life_stream(bool_hack message, bool_hack virtue_change);
-extern bool_hack heroism(int base);
-extern bool_hack berserk(int base);
-extern bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides);
-extern bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides);
-extern bool_hack cure_critical_wounds(HIT_POINT pow);
-extern bool_hack true_healing(HIT_POINT pow);
-extern bool_hack restore_mana(bool_hack magic_eater);
-extern bool restore_all_status(void);
 extern void stop_mouth(void);
 extern bool_hack vampirism(void);
 extern bool panic_hit(void);
index 9295874..ffdf682 100644 (file)
@@ -18,6 +18,7 @@
 #include "spells-summon.h"
 #include "avatar.h"
 #include "player-status.h"
+#include "spells-status.h"
 
 /*!
  * @brief プレイヤーに突然変異を与える
index a804b03..37ec343 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "spells-summon.h"
 #include "spells-object.h"
+#include "spells-status.h"
 
 #ifdef JP
 /*!
index a86c463..42399d5 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "artifact.h"
 #include "avatar.h"
+#include "spells-status.h"
 
 /*
  * Return alignment title
index 10cc1c9..027b7c9 100644 (file)
@@ -1,6 +1,7 @@
 #include "angband.h"
 #include "cmd-spell.h"
 #include "spells-summon.h"
+#include "spells-status.h"
 #include "projection.h"
 #include "avatar.h"
 
index f5c5257..c6d68fa 100644 (file)
@@ -3,6 +3,7 @@
 #include "selfinfo.h"
 #include "projection.h"
 #include "spells-summon.h"
+#include "spells-status.h"
 #include "mutation.h"
 
 
index 7a614eb..60951d6 100644 (file)
@@ -21,6 +21,7 @@
 #include "object-hook.h"
 #include "object-curse.h"
 #include "projection.h"
+#include "spells-status.h"
 
 #define MAX_KEEP 4 /*!<呪術の最大詠唱数 */
 
index f772d4f..1e67dd8 100644 (file)
@@ -1,6 +1,7 @@
 #include "angband.h"
 #include "cmd-spell.h"
 #include "projection.h"
+#include "spells-status.h"
 
 /*!
 * @brief 生命領域魔法の各処理を行う
index 836a69e..a2195f9 100644 (file)
@@ -2,6 +2,7 @@
 #include "cmd-spell.h"\r
 #include "projection.h"\r
 #include "spells-summon.h"\r
+#include "spells-status.h"\r
 #include "avatar.h"\r
 \r
 \r
index 24c3966..72f521c 100644 (file)
@@ -250,3 +250,142 @@ void roll_hitdice(SPOP_FLAGS options)
                }
        }
 }
+
+bool_hack life_stream(bool_hack message, bool_hack virtue_change)
+{
+       if (virtue_change)
+       {
+               chg_virtue(V_VITALITY, 1);
+               chg_virtue(V_UNLIFE, -5);
+       }
+       if (message)
+       {
+               msg_print(_("\91Ì\92\86\82É\90\96½\97Í\82ª\96\9e\82¿\82 \82Ó\82ê\82Ä\82«\82½\81I", "You feel life flow through your body!"));
+       }
+       restore_level();
+       (void)set_poisoned(0);
+       (void)set_blind(0);
+       (void)set_confused(0);
+       (void)set_image(0);
+       (void)set_stun(0);
+       (void)set_cut(0);
+       (void)restore_all_status();
+       (void)set_shero(0, TRUE);
+       handle_stuff();
+       hp_player(5000);
+
+       return TRUE;
+}
+
+bool_hack heroism(int base)
+{
+       bool_hack ident = FALSE;
+       if (set_afraid(0)) ident = TRUE;
+       if (set_hero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
+       if (hp_player(10)) ident = TRUE;
+       return ident;
+}
+
+bool_hack berserk(int base)
+{
+       bool_hack ident = FALSE;
+       if (set_afraid(0)) ident = TRUE;
+       if (set_shero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
+       if (hp_player(30)) ident = TRUE;
+       return ident;
+}
+
+bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(damroll(dice, sides))) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_cut(p_ptr->cut - 10)) ident = TRUE;
+       if (set_shero(0, TRUE)) ident = TRUE;
+       return ident;
+}
+
+bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(damroll(dice, sides))) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_confused(0)) ident = TRUE;
+       if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
+       if (set_shero(0, TRUE)) ident = TRUE;
+       return ident;
+}
+
+bool_hack cure_critical_wounds(HIT_POINT pow)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(pow)) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_confused(0)) ident = TRUE;
+       if (set_poisoned(0)) ident = TRUE;
+       if (set_stun(0)) ident = TRUE;
+       if (set_cut(0)) ident = TRUE;
+       if (set_shero(0, TRUE)) ident = TRUE;
+       return ident;
+}
+
+bool_hack true_healing(HIT_POINT pow)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(pow)) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_confused(0)) ident = TRUE;
+       if (set_poisoned(0)) ident = TRUE;
+       if (set_stun(0)) ident = TRUE;
+       if (set_cut(0)) ident = TRUE;
+       if (set_image(0)) ident = TRUE;
+       return ident;
+}
+
+bool_hack restore_mana(bool_hack magic_eater)
+{
+       bool_hack ident = FALSE;
+
+       if (p_ptr->pclass == CLASS_MAGIC_EATER && magic_eater)
+       {
+               int i;
+               for (i = 0; i < EATER_EXT * 2; i++)
+               {
+                       p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_CHARGE / 3;
+                       if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i] * EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i] * EATER_CHARGE;
+               }
+               for (; i < EATER_EXT * 3; i++)
+               {
+                       KIND_OBJECT_IDX k_idx = lookup_kind(TV_ROD, i - EATER_EXT * 2);
+                       p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_ROD_CHARGE / 3)*k_info[k_idx].pval;
+                       if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
+               }
+               msg_print(_("\93ª\82ª\83n\83b\83L\83\8a\82Æ\82µ\82½\81B", "You feel your head clear."));
+               p_ptr->window |= (PW_PLAYER);
+               ident = TRUE;
+       }
+       else if (p_ptr->csp < p_ptr->msp)
+       {
+               p_ptr->csp = p_ptr->msp;
+               p_ptr->csp_frac = 0;
+               msg_print(_("\93ª\82ª\83n\83b\83L\83\8a\82Æ\82µ\82½\81B", "You feel your head clear."));
+               p_ptr->redraw |= (PR_MANA);
+               p_ptr->window |= (PW_PLAYER);
+               p_ptr->window |= (PW_SPELL);
+               ident = TRUE;
+       }
+
+       return ident;
+}
+
+bool restore_all_status(void)
+{
+       bool ident = FALSE;
+       if (do_res_stat(A_STR)) ident = TRUE;
+       if (do_res_stat(A_INT)) ident = TRUE;
+       if (do_res_stat(A_WIS)) ident = TRUE;
+       if (do_res_stat(A_DEX)) ident = TRUE;
+       if (do_res_stat(A_CON)) ident = TRUE;
+       if (do_res_stat(A_CHR)) ident = TRUE;
+       return ident;
+}
index 62a0d8d..697a030 100644 (file)
@@ -13,4 +13,13 @@ extern bool clone_monster(DIRECTION dir);
 extern void stop_singing(void);
 extern bool time_walk(player_type *creature_ptr);
 extern void roll_hitdice(SPOP_FLAGS options);
+extern bool_hack life_stream(bool_hack message, bool_hack virtue_change);
+extern bool_hack heroism(int base);
+extern bool_hack berserk(int base);
+extern bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides);
+extern bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides);
+extern bool_hack cure_critical_wounds(HIT_POINT pow);
+extern bool_hack true_healing(HIT_POINT pow);
+extern bool_hack restore_mana(bool_hack magic_eater);
+extern bool restore_all_status(void);
 
index 39955b5..e2ac7cc 100644 (file)
@@ -4645,145 +4645,6 @@ void cast_shuffle(void)
        }
 }
 
-bool_hack life_stream(bool_hack message, bool_hack virtue_change)
-{
-       if(virtue_change)
-       {
-               chg_virtue(V_VITALITY, 1);
-               chg_virtue(V_UNLIFE, -5);
-       }
-       if(message)
-       {
-               msg_print(_("体中に生命力が満ちあふれてきた!", "You feel life flow through your body!"));
-       }
-       restore_level();
-       (void)set_poisoned(0);
-       (void)set_blind(0);
-       (void)set_confused(0);
-       (void)set_image(0);
-       (void)set_stun(0);
-       (void)set_cut(0);
-       (void)restore_all_status();
-       (void)set_shero(0, TRUE);
-       handle_stuff();
-       hp_player(5000);
-
-       return TRUE;
-}
-
-bool_hack heroism(int base)
-{
-       bool_hack ident = FALSE;
-       if(set_afraid(0)) ident = TRUE;
-       if(set_hero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
-       if(hp_player(10)) ident = TRUE;
-       return ident;
-}
-
-bool_hack berserk(int base)
-{
-       bool_hack ident = FALSE;
-       if (set_afraid(0)) ident = TRUE;
-       if (set_shero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
-       if (hp_player(30)) ident = TRUE;
-       return ident;
-}
-
-bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides)
-{
-       bool_hack ident = FALSE;
-       if (hp_player(damroll(dice, sides))) ident = TRUE;
-       if (set_blind(0)) ident = TRUE;
-       if (set_cut(p_ptr->cut - 10)) ident = TRUE;
-       if (set_shero(0, TRUE)) ident = TRUE;
-       return ident;
-}
-
-bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides)
-{
-       bool_hack ident = FALSE;
-       if (hp_player(damroll(dice, sides))) ident = TRUE;
-       if (set_blind(0)) ident = TRUE;
-       if (set_confused(0)) ident = TRUE;
-       if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
-       if (set_shero(0, TRUE)) ident = TRUE;
-       return ident;
-}
-
-bool_hack cure_critical_wounds(HIT_POINT pow)
-{
-       bool_hack ident = FALSE;
-       if (hp_player(pow)) ident = TRUE;
-       if (set_blind(0)) ident = TRUE;
-       if (set_confused(0)) ident = TRUE;
-       if (set_poisoned(0)) ident = TRUE;
-       if (set_stun(0)) ident = TRUE;
-       if (set_cut(0)) ident = TRUE;
-       if (set_shero(0, TRUE)) ident = TRUE;
-       return ident;
-}
-
-bool_hack true_healing(HIT_POINT pow)
-{
-       bool_hack ident = FALSE;
-       if (hp_player(pow)) ident = TRUE;
-       if (set_blind(0)) ident = TRUE;
-       if (set_confused(0)) ident = TRUE;
-       if (set_poisoned(0)) ident = TRUE;
-       if (set_stun(0)) ident = TRUE;
-       if (set_cut(0)) ident = TRUE;
-       if (set_image(0)) ident = TRUE;
-       return ident;
-}
-
-bool_hack restore_mana(bool_hack magic_eater)
-{
-       bool_hack ident = FALSE;
-
-       if (p_ptr->pclass == CLASS_MAGIC_EATER && magic_eater)
-       {
-               int i;
-               for (i = 0; i < EATER_EXT * 2; i++)
-               {
-                       p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_CHARGE / 3;
-                       if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i] * EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i] * EATER_CHARGE;
-               }
-               for (; i < EATER_EXT * 3; i++)
-               {
-                       KIND_OBJECT_IDX k_idx = lookup_kind(TV_ROD, i - EATER_EXT * 2);
-                       p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_ROD_CHARGE / 3)*k_info[k_idx].pval;
-                       if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
-               }
-               msg_print(_("頭がハッキリとした。", "You feel your head clear."));
-               p_ptr->window |= (PW_PLAYER);
-               ident = TRUE;
-       }
-       else if (p_ptr->csp < p_ptr->msp)
-       {
-               p_ptr->csp = p_ptr->msp;
-               p_ptr->csp_frac = 0;
-               msg_print(_("頭がハッキリとした。", "You feel your head clear."));
-               p_ptr->redraw |= (PR_MANA);
-               p_ptr->window |= (PW_PLAYER);
-               p_ptr->window |= (PW_SPELL);
-               ident = TRUE;
-       }
-
-       return ident;
-}
-
-bool restore_all_status(void)
-{
-       bool ident = FALSE; 
-       if (do_res_stat(A_STR)) ident = TRUE;
-       if (do_res_stat(A_INT)) ident = TRUE;
-       if (do_res_stat(A_WIS)) ident = TRUE;
-       if (do_res_stat(A_DEX)) ident = TRUE;
-       if (do_res_stat(A_CON)) ident = TRUE;
-       if (do_res_stat(A_CHR)) ident = TRUE;
-       return ident;
-}
-
 /*!
  * @brief 口を使う継続的な処理を中断する
  * @return なし