OSDN Git Service

[feature] ソースファイルをC++に対応
[hengbandforosx/hengbandosx.git] / src / object-use / quaff-execution.c
index ba85507..ca5cfda 100644 (file)
 #include "object/object-info.h"
 #include "object/object-kind.h"
 #include "perception/object-perception.h"
+#include "player-info/self-info.h"
 #include "player/attack-defense-types.h"
-#include "player/avatar.h"
+#include "player-info/avatar.h"
+#include "player/player-status-flags.h"
 #include "player/digestion-processor.h"
 #include "player/eldritch-horror.h"
 #include "player/mimic-info-table.h"
 #include "player/player-damage.h"
-#include "player/selfinfo.h"
 #include "realm/realm-hex-numbers.h"
 #include "spell-kind/spells-detection.h"
 #include "spell-kind/spells-floor.h"
@@ -57,14 +58,14 @@ static bool booze(player_type *creature_ptr)
     bool ident = FALSE;
     if (creature_ptr->pclass != CLASS_MONK)
         chg_virtue(creature_ptr, V_HARMONY, -1);
-    else if (!creature_ptr->resist_conf)
+    else if (!has_resist_conf(creature_ptr))
         creature_ptr->special_attack |= ATTACK_SUIKEN;
 
-    if (!creature_ptr->resist_conf && set_confused(creature_ptr, randint0(20) + 15)) {
+    if (!has_resist_conf(creature_ptr) && set_confused(creature_ptr, randint0(20) + 15)) {
         ident = TRUE;
     }
 
-    if (creature_ptr->resist_chaos) {
+    if (has_resist_chaos(creature_ptr)) {
         return ident;
     }
 
@@ -79,7 +80,7 @@ static bool booze(player_type *creature_ptr)
         else
             wiz_dark(creature_ptr);
 
-        (void)teleport_player_aux(creature_ptr, 100, FALSE, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
+        (void)teleport_player_aux(creature_ptr, 100, FALSE, static_cast<teleport_flags>(TELEPORT_NONMAGICAL | TELEPORT_PASSIVE));
         wiz_dark(creature_ptr);
         msg_print(_("知らない場所で目が醒めた。頭痛がする。", "You wake up somewhere with a sore head..."));
         msg_print(_("何も思い出せない。どうやってここへ来たのかも分からない!", "You can't remember a thing or how you got here!"));
@@ -144,19 +145,19 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
         switch (q_ptr->sval) {
             /* 飲みごたえをオリジナルより細かく表現 */
         case SV_POTION_WATER:
-            msg_print(_("口の中がさっぱりした。", ""));
+            msg_print(_("口の中がさっぱりした。", "That was refreshing."));
             msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
             ident = TRUE;
             break;
 
         case SV_POTION_APPLE_JUICE:
-            msg_print(_("甘くてサッパリとしていて、とてもおいしい。", ""));
+            msg_print(_("甘くてサッパリとしていて、とてもおいしい。", "It's sweet, refreshing and very tasty."));
             msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
             ident = TRUE;
             break;
 
         case SV_POTION_SLIME_MOLD:
-            msg_print(_("なんとも不気味な味だ。", ""));
+            msg_print(_("なんとも不気味な味だ。", "That was strange."));
             msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
             ident = TRUE;
             break;
@@ -182,7 +183,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
             break;
 
         case SV_POTION_POISON:
-            if (!(creature_ptr->resist_pois || is_oppose_pois(creature_ptr))) {
+            if (!(has_resist_pois(creature_ptr) || is_oppose_pois(creature_ptr))) {
                 if (set_poisoned(creature_ptr, creature_ptr->poisoned + randint0(15) + 10)) {
                     ident = TRUE;
                 }
@@ -190,7 +191,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
             break;
 
         case SV_POTION_BLINDNESS:
-            if (!creature_ptr->resist_blind) {
+            if (!has_resist_blind(creature_ptr)) {
                 if (set_blind(creature_ptr, creature_ptr->blind + randint0(100) + 100)) {
                     ident = TRUE;
                 }
@@ -514,7 +515,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
             break;
 
         case SV_POTION_NEW_LIFE:
-            roll_hitdice(creature_ptr, 0L);
+            roll_hitdice(creature_ptr, SPOP_NONE);
             get_max_stats(creature_ptr);
             creature_ptr->update |= PU_BONUS;
             lose_all_mutations(creature_ptr);
@@ -532,7 +533,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
             msg_print(NULL);
             creature_ptr->tsuyoshi = 1;
             (void)set_tsuyoshi(creature_ptr, 0, TRUE);
-            if (!creature_ptr->resist_chaos) {
+            if (!has_resist_chaos(creature_ptr)) {
                 (void)set_image(creature_ptr, 50 + randint1(50));
             }
             ident = TRUE;
@@ -575,7 +576,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
         gain_exp(creature_ptr, (lev + (creature_ptr->lev >> 1)) / creature_ptr->lev);
     }
 
-    creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
+    creature_ptr->window_flags |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 
     /* Potions can feed the player */
     switch (creature_ptr->mimic_form) {