OSDN Git Service

[Refactor] #37353 コメント整理。 / Refactor comments.
[hengband/hengband.git] / src / dungeon.c
index 2f77d8b..99a9adf 100644 (file)
@@ -37,9 +37,9 @@ static int wild_regen = 20; /*!<広域マップ移動時の自然回復処理カ
  */
 static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy)
 {
-       byte        feel;
+       byte feel;
        object_type *o_ptr = &inventory[slot];
-       char        o_name[MAX_NLEN];
+       char o_name[MAX_NLEN];
 
        /* We know about it already, do not tell us again */
        if (o_ptr->ident & (IDENT_SENSE))return;
@@ -1502,6 +1502,160 @@ static void process_world_aux_hp_and_sp(void)
                }
        }
 
+       if (have_flag(f_ptr->flags, FF_COLD_PUDDLE) && !IS_INVULN() && !p_ptr->immune_cold)
+       {
+               int damage = 0;
+
+               if (have_flag(f_ptr->flags, FF_DEEP))
+               {
+                       damage = 6000 + randint0(4000);
+               }
+               else if (!p_ptr->levitation)
+               {
+                       damage = 3000 + randint0(2000);
+               }
+
+               if (damage)
+               {
+                       if (p_ptr->resist_cold) damage = damage / 3;
+                       if (IS_OPPOSE_COLD()) damage = damage / 3;
+                       if (p_ptr->levitation) damage = damage / 5;
+
+                       damage = damage / 100 + (randint0(100) < (damage % 100));
+
+                       if (p_ptr->levitation)
+                       {
+                               msg_print(_("冷気に覆われた!", "The cold engulfs you!"));
+                               take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
+                                       f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+                       }
+                       else
+                       {
+                               cptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+                               msg_format(_("%sに凍えた!", "The %s frostbites you!"), name);
+                               take_hit(DAMAGE_NOESCAPE, damage, name, -1);
+                       }
+
+                       cave_no_regen = TRUE;
+               }
+       }
+
+       if (have_flag(f_ptr->flags, FF_ELEC_PUDDLE) && !IS_INVULN() && !p_ptr->immune_elec)
+       {
+               int damage = 0;
+
+               if (have_flag(f_ptr->flags, FF_DEEP))
+               {
+                       damage = 6000 + randint0(4000);
+               }
+               else if (!p_ptr->levitation)
+               {
+                       damage = 3000 + randint0(2000);
+               }
+
+               if (damage)
+               {
+                       if (p_ptr->resist_elec) damage = damage / 3;
+                       if (IS_OPPOSE_ELEC()) damage = damage / 3;
+                       if (p_ptr->levitation) damage = damage / 5;
+
+                       damage = damage / 100 + (randint0(100) < (damage % 100));
+
+                       if (p_ptr->levitation)
+                       {
+                               msg_print(_("電撃を受けた!", "The electric shocks you!"));
+                               take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
+                                       f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+                       }
+                       else
+                       {
+                               cptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+                               msg_format(_("%sに感電した!", "The %s shocks you!"), name);
+                               take_hit(DAMAGE_NOESCAPE, damage, name, -1);
+                       }
+
+                       cave_no_regen = TRUE;
+               }
+       }
+
+       if (have_flag(f_ptr->flags, FF_ACID_PUDDLE) && !IS_INVULN() && !p_ptr->immune_acid)
+       {
+               int damage = 0;
+
+               if (have_flag(f_ptr->flags, FF_DEEP))
+               {
+                       damage = 6000 + randint0(4000);
+               }
+               else if (!p_ptr->levitation)
+               {
+                       damage = 3000 + randint0(2000);
+               }
+
+               if (damage)
+               {
+                       if (p_ptr->resist_acid) damage = damage / 3;
+                       if (IS_OPPOSE_ACID()) damage = damage / 3;
+                       if (p_ptr->levitation) damage = damage / 5;
+
+                       damage = damage / 100 + (randint0(100) < (damage % 100));
+
+                       if (p_ptr->levitation)
+                       {
+                               msg_print(_("酸が飛び散った!", "The acid melt you!"));
+                               take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
+                                       f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+                       }
+                       else
+                       {
+                               cptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+                               msg_format(_("%sに溶かされた!", "The %s melts you!"), name);
+                               take_hit(DAMAGE_NOESCAPE, damage, name, -1);
+                       }
+
+                       cave_no_regen = TRUE;
+               }
+       }
+
+       if (have_flag(f_ptr->flags, FF_POISON_PUDDLE) && !IS_INVULN())
+       {
+               int damage = 0;
+
+               if (have_flag(f_ptr->flags, FF_DEEP))
+               {
+                       damage = 6000 + randint0(4000);
+               }
+               else if (!p_ptr->levitation)
+               {
+                       damage = 3000 + randint0(2000);
+               }
+
+               if (damage)
+               {
+                       if (p_ptr->resist_pois) damage = damage / 3;
+                       if (IS_OPPOSE_POIS()) damage = damage / 3;
+                       if (p_ptr->levitation) damage = damage / 5;
+
+                       damage = damage / 100 + (randint0(100) < (damage % 100));
+
+                       if (p_ptr->levitation)
+                       {
+                               msg_print(_("毒気を吸い込んだ!", "The gas poisons you!"));
+                               take_hit(DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
+                                       f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1);
+                               if (p_ptr->resist_pois) (void)set_poisoned(p_ptr->poisoned + 1);
+                       }
+                       else
+                       {
+                               cptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name;
+                               msg_format(_("%sに毒された!", "The %s poisons you!"), name);
+                               take_hit(DAMAGE_NOESCAPE, damage, name, -1);
+                               if (p_ptr->resist_pois) (void)set_poisoned(p_ptr->poisoned + 3);
+                       }
+
+                       cave_no_regen = TRUE;
+               }
+       }
+
        if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) &&
            !p_ptr->levitation && !p_ptr->can_swim)
        {
@@ -4664,7 +4818,6 @@ static void process_player(void)
 
                        if (!m_ptr->r_idx) continue;
 
-                       /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
                        update_monster(i, FALSE);
                }
@@ -5256,8 +5409,7 @@ static void dungeon(bool load_game)
        /* Verify the panel */
        verify_panel();
 
-       /* Flush messages */
-       msg_print(NULL);
+       msg_erase();
 
 
        /* Enter "xtra" mode */