OSDN Git Service

[Refactor] has_*でboolでないため修正
authordis- <dis.rogue@gmail.com>
Wed, 20 Jan 2021 04:18:05 +0000 (13:18 +0900)
committerdis- <dis.rogue@gmail.com>
Wed, 20 Jan 2021 04:18:05 +0000 (13:18 +0900)
src/player/player-status-flags.c
src/player/player-status-flags.h
src/player/player-status.c

index 94aeabe..10a6307 100644 (file)
@@ -1716,7 +1716,7 @@ bool has_not_monk_weapon(player_type *creature_ptr, int i)
 
 bool has_good_luck(player_type *creature_ptr) { return (creature_ptr->pseikaku == PERSONALITY_LUCKY) || (creature_ptr->muta3 & MUT3_GOOD_LUCK); }
 
-BIT_FLAGS has_aggravate(player_type *creature_ptr)
+BIT_FLAGS player_aggravate_state(player_type *creature_ptr)
 {
     if (creature_ptr->cursed & TRC_AGGRAVATE) {
         if ((is_specific_player_race(creature_ptr, RACE_S_FAIRY)) && (creature_ptr->pseikaku != PERSONALITY_SEXY)) {
@@ -1728,3 +1728,5 @@ BIT_FLAGS has_aggravate(player_type *creature_ptr)
     return AGGRAVATE_NONE; 
 }
 
+bool has_aggravate(player_type *creature_ptr) { return player_aggravate_state(creature_ptr) == AGGRAVATE_NORMAL; }
+
index 6a7d394..1a6ec63 100644 (file)
@@ -22,10 +22,10 @@ enum flag_cause {
     FLAG_CAUSE_MAX = 18
 };
 
-enum status_aggravate {
+enum aggravate_state {
     AGGRAVATE_NONE = 0x00000000L,
-    AGGRAVATE_NORMAL = 0x00000001L,
-    AGGRAVATE_S_FAIRY = 0x00000002L,
+    AGGRAVATE_S_FAIRY = 0x00000001L,
+    AGGRAVATE_NORMAL = 0x00000002L,
 };
 
 bool has_pass_wall(player_type *creature_ptr);
@@ -118,4 +118,5 @@ bool has_not_monk_weapon(player_type *creature_ptr, int i);
 bool has_icky_wield_weapon(player_type *creature_ptr, int i);
 bool has_riding_wield_weapon(player_type *creature_ptr, int i);
 bool has_good_luck(player_type *creature_ptr);
-BIT_FLAGS has_aggravate(player_type *creature_ptr);
+BIT_FLAGS player_aggravate_state(player_type *creature_ptr);
+bool has_aggravate(player_type *creature_ptr);
index 7425ceb..e6eaaa1 100644 (file)
@@ -1260,7 +1260,7 @@ static ACTION_SKILL_POWER calc_stealth(player_type *creature_ptr)
         if (hex_spelling_any(creature_ptr))
             pow -= (1 + casting_hex_num(creature_ptr));
     }
-    if (has_aggravate(creature_ptr) == AGGRAVATE_S_FAIRY) {
+    if (player_aggravate_state(creature_ptr) == AGGRAVATE_S_FAIRY) {
         pow = MIN(pow - 3, (pow + 2) / 2);
     }