OSDN Git Service

[Refactor] #37353 コメント整理。 / Refactor comments.
[hengband/hengband.git] / src / spells1.c
index 3a5e7fe..574df6e 100644 (file)
 #include "trap.h"
 #include "object-curse.h"
 #include "player-damage.h"
+
+#include "monster.h"
+#include "monster-status.h"
+#include "spells-summon.h"
 #include "monsterrace-hook.h"
+
 #include "melee.h"
 #include "world.h"
+#include "projection.h"
+#include "mutation.h"
+#include "rooms.h"
 
 
 static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
@@ -111,9 +119,9 @@ PERCENTAGE beam_chance(void)
  * @param cury 現在の鏡のy座標
  * @param curx 現在の鏡のx座標
  */
-static void next_mirror(int* next_y, int* next_x, int cury, int curx)
+static void next_mirror(POSITION* next_y, POSITION* next_x, POSITION cury, POSITION curx)
 {
-       int mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
+       POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
        int mirror_num = 0;                       /* 鏡の数 */
        POSITION x, y;
        int num;
@@ -250,7 +258,7 @@ static TERM_COLOR spell_color(int type)
                SYMBOL_CODE c;
 
                /* Lookup the default colors for this type */
-               cptr s = quark_str(gf_color[type]);
+               concptr s = quark_str(gf_color[type]);
 
                if (!s) return (TERM_WHITE);
 
@@ -725,7 +733,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
 
        if (have_flag(f_ptr->flags, FF_TREE))
        {
-               cptr message;
+               concptr message;
                switch (typ)
                {
                case GF_POIS:
@@ -1284,7 +1292,7 @@ static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
                bool ignore = FALSE;
                bool do_kill = FALSE;
 
-               cptr note_kill = NULL;
+               concptr note_kill = NULL;
 
 #ifndef JP
                /* Get the "plural"-ness */
@@ -1293,8 +1301,6 @@ static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
 
                /* Acquire next object */
                next_o_idx = o_ptr->next_o_idx;
-
-               /* Extract the flags */
                object_flags(o_ptr, flgs);
 
                /* Check for artifact */
@@ -1693,10 +1699,10 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
        PARAMETER_VALUE photo = 0;
 
        /* Assume no note */
-       cptr note = NULL;
+       concptr note = NULL;
 
        /* Assume a default death */
-       cptr note_dies = extract_note_dies(real_r_idx(m_ptr));
+       concptr note_dies = extract_note_dies(real_r_idx(m_ptr));
 
        POSITION ty = m_ptr->fy;
        POSITION tx = m_ptr->fx;
@@ -2567,8 +2573,8 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
                        else if (dam > 0)
                        {
                                int b = damroll(5, dam) / 4;
-                               cptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
-                               cptr msg = _("あなたは%sの苦痛を%sに変換した!", 
+                               concptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
+                               concptr msg = _("あなたは%sの苦痛を%sに変換した!", 
                                         (seen ? "You convert %s's pain into %s!" : 
                                                         "You convert %ss pain into %s!"));
                                msg_format(msg, m_name, str);
@@ -5091,7 +5097,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
  * We return "TRUE" if any "obvious" effects were observed.  XXX XXX Actually,
  * we just assume that the effects were obvious, for historical reasons.
  */
-static bool project_p(MONSTER_IDX who, cptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
+static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
 {
        int k = 0;
        DEPTH rlev = 0;
@@ -5115,7 +5121,7 @@ static bool project_p(MONSTER_IDX who, cptr who_name, int r, POSITION y, POSITIO
        char killer[80];
 
        /* Hack -- messages */
-       cptr act = NULL;
+       concptr act = NULL;
 
        int get_damage = 0;
 
@@ -5402,19 +5408,21 @@ static bool project_p(MONSTER_IDX who, cptr who_name, int r, POSITION y, POSITIO
                        if (fuzzy) msg_print(_("何か湿ったもので攻撃された!", "You are hit by something wet!"));
                        if (!CHECK_MULTISHADOW())
                        {
-                               if (!p_ptr->resist_sound)
+                               if (!p_ptr->resist_sound && !p_ptr->resist_water)
                                {
                                        set_stun(p_ptr->stun + randint1(40));
                                }
-                               if (!p_ptr->resist_conf)
+                               if (!p_ptr->resist_conf && !p_ptr->resist_water)
                                {
                                        set_confused(p_ptr->confused + randint1(5) + 5);
                                }
 
-                               if (one_in_(5))
+                               if (one_in_(5) && !p_ptr->resist_water)
                                {
                                        inven_damage(set_cold_destroy, 3);
                                }
+
+                               if (p_ptr->resist_water) get_damage /= 4;
                        }
 
                        get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);