OSDN Git Service

[Refactor] #37353 爆発の薬の効果を detonation() に分離。 / Separate implementation of 'potion...
[hengband/hengband.git] / src / spells3.c
index 9425130..367d9c8 100644 (file)
@@ -18,6 +18,7 @@
 #include "player-status.h"
 #include "projection.h"
 #include "spells-summon.h"
+#include "quest.h"
 
 
 /*! テレポート先探索の試行数 / Maximum number of tries for teleporting */
@@ -1974,12 +1975,8 @@ bool alchemy(void)
                msg_format(_("%sを$%d の金に変えた。", "You turn %s to %ld coins worth of gold."), o_name, price);
 
                p_ptr->au += price;
-
-               /* Redraw gold */
                p_ptr->redraw |= (PR_GOLD);
-
                p_ptr->window |= (PW_PLAYER);
-
        }
 
        /* Eliminate the item (from the pack) */
@@ -2333,7 +2330,6 @@ bool identify_item(object_type *o_ptr)
 
        /* Player touches it */
        o_ptr->marked |= OM_TOUCHED;
-
        p_ptr->update |= (PU_BONUS | PU_COMBINE | PU_REORDER);
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 
@@ -3132,7 +3128,7 @@ bool potion_smash_effect(MONSTER_IDX who, POSITION y, POSITION x, KIND_OBJECT_ID
                        dt = GF_DARK;
                        angry = TRUE;
                        break;
-               case SV_POTION_CONFUSION: /* Booze */
+               case SV_POTION_BOOZE: /* Booze */
                        dt = GF_OLD_CONF;
                        angry = TRUE;
                        break;
@@ -3196,8 +3192,7 @@ bool potion_smash_effect(MONSTER_IDX who, POSITION y, POSITION x, KIND_OBJECT_ID
                        /* Do nothing */  ;
        }
 
-       (void)project(who, radius, y, x, dam, dt,
-           (PROJECT_JUMP | PROJECT_ITEM | PROJECT_KILL), -1);
+       (void)project(who, radius, y, x, dam, dt, (PROJECT_JUMP | PROJECT_ITEM | PROJECT_KILL), -1);
 
        /* XXX  those potions that explode need to become "known" */
        return angry;
@@ -3221,8 +3216,6 @@ void display_spell_list(void)
        GAME_TEXT name[MAX_NLEN];
        char out_val[160];
 
-
-       /* Erase window */
        clear_from(0);
 
        /* They have too many spells to list */
@@ -3915,7 +3908,6 @@ bool curse_armor(void)
 
        GAME_TEXT o_name[MAX_NLEN];
 
-
        /* Curse the body armor */
        o_ptr = &inventory[INVEN_BODY];
 
@@ -3929,11 +3921,11 @@ bool curse_armor(void)
        {
                /* Cool */
 #ifdef JP
-msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
-"恐怖の暗黒オーラ", "防具", o_name);
+               msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
+                       "恐怖の暗黒オーラ", "防具", o_name);
 #else
                msg_format("A %s tries to %s, but your %s resists the effects!",
-                          "terrible black aura", "surround your armor", o_name);
+                       "terrible black aura", "surround your armor", o_name);
 #endif
 
        }
@@ -3962,11 +3954,7 @@ msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返し
 
                /* Break it */
                o_ptr->ident |= (IDENT_BROKEN);
-               p_ptr->update |= (PU_BONUS);
-
-               /* Recalculate mana */
-               p_ptr->update |= (PU_MANA);
-
+               p_ptr->update |= (PU_BONUS | PU_MANA);
                p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
        }
 
@@ -4026,11 +4014,7 @@ bool curse_weapon_object(bool force, object_type *o_ptr)
 
                /* Break it */
                o_ptr->ident |= (IDENT_BROKEN);
-               p_ptr->update |= (PU_BONUS);
-
-               /* Recalculate mana */
-               p_ptr->update |= (PU_MANA);
-
+               p_ptr->update |= (PU_BONUS | PU_MANA);
                p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
        }
 
@@ -4112,8 +4096,7 @@ static MONRACE_IDX poly_r_idx(MONRACE_IDX r_idx)
        DEPTH lev1, lev2;
 
        /* Hack -- Uniques/Questors never polymorph */
-       if ((r_ptr->flags1 & RF1_UNIQUE) ||
-           (r_ptr->flags1 & RF1_QUESTOR))
+       if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags1 & RF1_QUESTOR))
                return (r_idx);
 
        /* Allowable range of "levels" for resulting monster */
@@ -4231,12 +4214,10 @@ bool polymorph_monster(POSITION y, POSITION x)
                }
                else if (back_m.hold_o_idx) /* Failed (paranoia) */
                {
-                       /* Delete objects */
                        for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
                        {
                                /* Acquire next object */
                                next_o_idx = o_list[this_o_idx].next_o_idx;
-
                                delete_object_idx(this_o_idx);
                        }
                }
@@ -4741,4 +4722,49 @@ bool shock_power(void)
                }
        }
        return TRUE;
+}
+
+bool booze(player_type *creature_ptr)
+{
+       bool ident = FALSE;
+       if (creature_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
+       else if (!creature_ptr->resist_conf) creature_ptr->special_attack |= ATTACK_SUIKEN;
+       if (!creature_ptr->resist_conf)
+       {
+               if (set_confused(randint0(20) + 15))
+               {
+                       ident = TRUE;
+               }
+       }
+
+       if (!creature_ptr->resist_chaos)
+       {
+               if (one_in_(2))
+               {
+                       if (set_image(creature_ptr->image + randint0(150) + 150))
+                       {
+                               ident = TRUE;
+                       }
+               }
+               if (one_in_(13) && (creature_ptr->pclass != CLASS_MONK))
+               {
+                       ident = TRUE;
+                       if (one_in_(3)) lose_all_info();
+                       else wiz_dark();
+                       (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
+                       wiz_dark();
+                       msg_print(_("知らない場所で目が醒めた。頭痛がする。", "You wake up somewhere with a sore head..."));
+                       msg_print(_("何も思い出せない。どうやってここへ来たのかも分からない!", "You can't remember a thing, or how you got here!"));
+               }
+       }
+       return ident;
+}
+
+bool detonation(player_type *creature_ptr)
+{
+       msg_print(_("体の中で激しい爆発が起きた!", "Massive explosions rupture your body!"));
+       take_hit(DAMAGE_NOESCAPE, damroll(50, 20), _("爆発の薬", "a potion of Detonation"), -1);
+       (void)set_stun(creature_ptr->stun + 75);
+       (void)set_cut(creature_ptr->cut + 5000);
+       return TRUE;
 }
\ No newline at end of file