OSDN Git Service

[Refactor] #39963 Moved SPOP_* from spells.h to spells-util.h
authorHourier <hourier@users.sourceforge.jp>
Wed, 29 Apr 2020 13:28:02 +0000 (22:28 +0900)
committerHourier <hourier@users.sourceforge.jp>
Wed, 29 Apr 2020 13:28:02 +0000 (22:28 +0900)
src/birth.c
src/h-type.h
src/spell/spells-util.h
src/spells-status.c
src/spells-status.h
src/spells.h
src/wizard2.c

index 1a17aa6..3818774 100644 (file)
@@ -40,7 +40,7 @@
 #include "player-personality.h"
 #include "player-sex.h"
 #include "player/race-info-table.h"
-#include "spells.h"
+#include "spell/spells-util.h"
 #include "spells-status.h"
 #include "wild.h"
 #include "floor.h"
index 1743b38..3c63b1e 100644 (file)
@@ -243,8 +243,6 @@ typedef byte FF_FLAGS_IDX;   /*!< 地形特性ID */
 
 typedef s16b FEAT_PRIORITY; /*!< 地形の縮小表示優先順位 */
 
-typedef BIT_FLAGS SPOP_FLAGS; /*!< スペル用オプション */
-
 /*** Pointers to all the basic types defined above ***/
 typedef real *real_ptr;
 typedef errr *errr_ptr;
index 80b409f..15b92d5 100644 (file)
@@ -10,3 +10,10 @@ typedef enum
        SPELL_STOP = 5,
        SPELL_CONT = 6
 } spell_type;
+
+typedef enum
+{
+       SPOP_DISPLAY_MES = 0x0001,              // !< スペル処理オプション … メッセージを表示する
+       SPOP_NO_UPDATE = 0x0002,                // !< スペル処理オプション … ステータス更新を解決後行う
+       SPOP_DEBUG = 0x8000,                    // !< スペル処理オプション … デバッグ処理あり
+} spell_operation;
index 5773591..c973b9c 100644 (file)
@@ -200,7 +200,7 @@ bool time_walk(player_type *creature_ptr)
  * @param options スペル共通オプション
  * @return なし
  */
-void roll_hitdice(player_type *creature_ptr, SPOP_FLAGS options)
+void roll_hitdice(player_type *creature_ptr, spell_operation options)
 {
        HIT_POINT min_value = creature_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (creature_ptr->hitdie + 1)) * 3 / 8;
        HIT_POINT max_value = creature_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (creature_ptr->hitdie + 1)) * 5 / 8;
@@ -251,7 +251,7 @@ void roll_hitdice(player_type *creature_ptr, SPOP_FLAGS options)
 }
 
 
-bool_hack life_stream(player_type *creature_ptr, bool_hack message, bool_hack virtue_change)
+bool life_stream(player_type *creature_ptr, bool message, bool virtue_change)
 {
        if (virtue_change)
        {
@@ -280,9 +280,9 @@ bool_hack life_stream(player_type *creature_ptr, bool_hack message, bool_hack vi
 }
 
 
-bool_hack heroism(player_type *creature_ptr, int base)
+bool heroism(player_type *creature_ptr, int base)
 {
-       bool_hack ident = FALSE;
+       bool ident = FALSE;
        if (set_afraid(creature_ptr, 0)) ident = TRUE;
        if (set_hero(creature_ptr, creature_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
        if (hp_player(creature_ptr, 10)) ident = TRUE;
@@ -290,9 +290,9 @@ bool_hack heroism(player_type *creature_ptr, int base)
 }
 
 
-bool_hack berserk(player_type *creature_ptr, int base)
+bool berserk(player_type *creature_ptr, int base)
 {
-       bool_hack ident = FALSE;
+       bool ident = FALSE;
        if (set_afraid(creature_ptr, 0)) ident = TRUE;
        if (set_shero(creature_ptr, creature_ptr->shero + randint1(base) + base, FALSE)) ident = TRUE;
        if (hp_player(creature_ptr, 30)) ident = TRUE;
@@ -300,9 +300,9 @@ bool_hack berserk(player_type *creature_ptr, int base)
 }
 
 
-bool_hack cure_light_wounds(player_type *creature_ptr, DICE_NUMBER dice, DICE_SID sides)
+bool cure_light_wounds(player_type *creature_ptr, DICE_NUMBER dice, DICE_SID sides)
 {
-       bool_hack ident = FALSE;
+       bool ident = FALSE;
        if (hp_player(creature_ptr, damroll(dice, sides))) ident = TRUE;
        if (set_blind(creature_ptr, 0)) ident = TRUE;
        if (set_cut(creature_ptr,creature_ptr->cut - 10)) ident = TRUE;
@@ -311,9 +311,9 @@ bool_hack cure_light_wounds(player_type *creature_ptr, DICE_NUMBER dice, DICE_SI
 }
 
 
-bool_hack cure_serious_wounds(player_type *creature_ptr, DICE_NUMBER dice, DICE_SID sides)
+bool cure_serious_wounds(player_type *creature_ptr, DICE_NUMBER dice, DICE_SID sides)
 {
-       bool_hack ident = FALSE;
+       bool ident = FALSE;
        if (hp_player(creature_ptr, damroll(dice, sides))) ident = TRUE;
        if (set_blind(creature_ptr, 0)) ident = TRUE;
        if (set_confused(creature_ptr, 0)) ident = TRUE;
@@ -323,9 +323,9 @@ bool_hack cure_serious_wounds(player_type *creature_ptr, DICE_NUMBER dice, DICE_
 }
 
 
-bool_hack cure_critical_wounds(player_type *creature_ptr, HIT_POINT pow)
+bool cure_critical_wounds(player_type *creature_ptr, HIT_POINT pow)
 {
-       bool_hack ident = FALSE;
+       bool ident = FALSE;
        if (hp_player(creature_ptr, pow)) ident = TRUE;
        if (set_blind(creature_ptr, 0)) ident = TRUE;
        if (set_confused(creature_ptr, 0)) ident = TRUE;
@@ -337,9 +337,9 @@ bool_hack cure_critical_wounds(player_type *creature_ptr, HIT_POINT pow)
 }
 
 
-bool_hack true_healing(player_type *creature_ptr, HIT_POINT pow)
+bool true_healing(player_type *creature_ptr, HIT_POINT pow)
 {
-       bool_hack ident = FALSE;
+       bool ident = FALSE;
        if (hp_player(creature_ptr, pow)) ident = TRUE;
        if (set_blind(creature_ptr, 0)) ident = TRUE;
        if (set_confused(creature_ptr, 0)) ident = TRUE;
@@ -351,7 +351,7 @@ bool_hack true_healing(player_type *creature_ptr, HIT_POINT pow)
 }
 
 
-bool_hack restore_mana(player_type *creature_ptr, bool_hack magic_eater)
+bool restore_mana(player_type *creature_ptr, bool magic_eater)
 {
        if (creature_ptr->pclass == CLASS_MAGIC_EATER && magic_eater)
        {
index a7c4d81..40e1c7f 100644 (file)
@@ -1,28 +1,31 @@
-
-extern bool heal_monster(player_type *caster_ptr, DIRECTION dir, HIT_POINT dam);
-extern bool speed_monster(player_type *caster_ptr, DIRECTION dir, int power);
-extern bool slow_monster(player_type *caster_ptr, DIRECTION dir, int power);
-extern bool sleep_monster(player_type *caster_ptr, DIRECTION dir, int power);
-extern bool stasis_monster(player_type *caster_ptr, DIRECTION dir);    /* Like sleep, affects undead as well */
-extern bool stasis_evil(player_type *caster_ptr, DIRECTION dir);    /* Like sleep, affects undead as well */
-extern bool confuse_monster(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev);
-extern bool stun_monster(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev);
-extern bool fear_monster(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev);
-extern bool poly_monster(player_type *caster_ptr, DIRECTION dir, int power);
-extern bool clone_monster(player_type *caster_ptr, DIRECTION dir);
-extern bool time_walk(player_type *creature_ptr);
-extern void roll_hitdice(player_type *creature_ptr, SPOP_FLAGS options);
-extern bool_hack life_stream(player_type *creature_ptr, bool_hack message, bool_hack virtue_change);
-extern bool_hack heroism(player_type *creature_ptr, int base);
-extern bool_hack berserk(player_type *creature_ptr, int base);
-extern bool_hack cure_light_wounds(player_type *creature_ptr, DICE_NUMBER dice, DICE_SID sides);
-extern bool_hack cure_serious_wounds(player_type *creature_ptr, DICE_NUMBER dice, DICE_SID sides);
-extern bool_hack cure_critical_wounds(player_type *creature_ptr, HIT_POINT pow);
-extern bool_hack true_healing(player_type *creature_ptr, HIT_POINT pow);
-extern bool_hack restore_mana(player_type *creature_ptr, bool_hack magic_eater);
-extern bool restore_all_status(player_type *creature_ptr);
+#pragma once
 
-extern bool fishing(player_type *creature_ptr);
-extern bool cosmic_cast_off(player_type *creature_ptr, object_type *o_ptr);
-extern void apply_nexus(monster_type *m_ptr, player_type *target_ptr);
-extern void status_shuffle(player_type *creature_ptr);
+#include "spell/spells-util.h"
+
+bool heal_monster(player_type *caster_ptr, DIRECTION dir, HIT_POINT dam);
+bool speed_monster(player_type *caster_ptr, DIRECTION dir, int power);
+bool slow_monster(player_type *caster_ptr, DIRECTION dir, int power);
+bool sleep_monster(player_type *caster_ptr, DIRECTION dir, int power);
+bool stasis_monster(player_type *caster_ptr, DIRECTION dir);    /* Like sleep, affects undead as well */
+bool stasis_evil(player_type *caster_ptr, DIRECTION dir);    /* Like sleep, affects undead as well */
+bool confuse_monster(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev);
+bool stun_monster(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev);
+bool fear_monster(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev);
+bool poly_monster(player_type *caster_ptr, DIRECTION dir, int power);
+bool clone_monster(player_type *caster_ptr, DIRECTION dir);
+bool time_walk(player_type *creature_ptr);
+void roll_hitdice(player_type *creature_ptr, spell_operation options);
+bool life_stream(player_type *creature_ptr, bool message, bool virtue_change);
+bool heroism(player_type *creature_ptr, int base);
+bool berserk(player_type *creature_ptr, int base);
+bool cure_light_wounds(player_type *creature_ptr, DICE_NUMBER dice, DICE_SID sides);
+bool cure_serious_wounds(player_type *creature_ptr, DICE_NUMBER dice, DICE_SID sides);
+bool cure_critical_wounds(player_type *creature_ptr, HIT_POINT pow);
+bool true_healing(player_type *creature_ptr, HIT_POINT pow);
+bool restore_mana(player_type *creature_ptr, bool magic_eater);
+bool restore_all_status(player_type *creature_ptr);
+
+bool fishing(player_type *creature_ptr);
+bool cosmic_cast_off(player_type *creature_ptr, object_type *o_ptr);
+void apply_nexus(monster_type *m_ptr, player_type *target_ptr);
+void status_shuffle(player_type *creature_ptr);
index 690cc7b..eb75f0c 100644 (file)
@@ -5,10 +5,6 @@
 #define DETECT_RAD_MAP     30
 #define DETECT_RAD_ALL     255
 
-#define SPOP_DISPLAY_MES    0x0001 // !< スペル処理オプション … メッセージを表示する
-#define SPOP_NO_UPDATE      0x0002 // !< スペル処理オプション … ステータス更新を解決後行う
-#define SPOP_DEBUG          0x8000 // !< スペル処理オプション … デバッグ処理あり
-
 /* spells1.c */
 extern bool in_disintegration_range(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
 extern void breath_shape(player_type *caster_ptr, u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, EFFECT_ID typ);
index 16facc6..2b1ea61 100644 (file)
@@ -33,7 +33,7 @@
 #include "player-class.h"
 #include "player-inventory.h"
 
-#include "spells.h"
+#include "spell/spells-util.h"
 #include "spells-object.h"
 #include "spells-summon.h"
 #include "spells-status.h"