OSDN Git Service

[Refactor] #39963 Moved TELEPORT_* from spells.h to spells-util.h and made them enum...
[hengband/hengband.git] / src / spells2.c
index 347b31c..038a135 100644 (file)
 #include "angband.h"
 #include "core.h"
 #include "util.h"
+#include "main/sound-definitions-table.h"
 
 #include "creature.h"
 
 #include "artifact.h"
-#include "cmd-pet.h"
-#include "cmd-dump.h"
+#include "io/write-diary.h"
+#include "cmd/cmd-pet.h"
+#include "cmd/cmd-dump.h"
 #include "floor.h"
 #include "grid.h"
 #include "trap.h"
@@ -35,8 +37,8 @@
 #include "spells-status.h"
 #include "spells-floor.h"
 #include "spells-diceroll.h"
-#include "realm-hex.h"
-#include "autopick.h"
+#include "realm/realm-hex.h"
+#include "autopick/autopick.h"
 #include "object-flavor.h"
 #include "object-hook.h"
 #include "monster-status.h"
 #include "dungeon.h"
 #include "floor-events.h"
 #include "feature.h"
-#include "view-mainwindow.h"
-#include "objectkind.h"
+#include "view/display-main-window.h"
+#include "object/object-kind.h"
 #include "monsterrace.h"
 #include "targeting.h"
-#include "realm-song.h"
+#include "realm/realm-song.h"
 #include "english.h"
+#include "effect/spells-effect-util.h"
+#include "spell/spells-type.h"
 
  /*!
   * @brief プレイヤー周辺の地形を感知する
@@ -292,7 +296,7 @@ bool detect_objects_normal(player_type *caster_ptr, POSITION range)
  * @details
  * <pre>
  * This will light up all spaces with "magic" items, including artifacts,
- * ego-items, potions, scrolls, books, rods, wands, staves, amulets, rings,
+ * ego-items, potions, scrolls, books, rods, wands, staffs, amulets, rings,
  * and "enchanted" items of the "good" variety.
  *
  * It can probably be argued that this function is now too powerful.
@@ -2408,7 +2412,7 @@ bool activate_ty_curse(player_type *target_ptr, bool stop_ty, int *count)
        BIT_FLAGS flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
        bool is_first_curse = TRUE;
        floor_type *floor_ptr = target_ptr->current_floor_ptr;
-       while (is_first_curse || one_in_(3) && !stop_ty)
+       while (is_first_curse || (one_in_(3) && !stop_ty))
        {
                is_first_curse = FALSE;
                switch (randint1(34))
@@ -2420,6 +2424,7 @@ bool activate_ty_curse(player_type *target_ptr, bool stop_ty, int *count)
                                earthquake(target_ptr, target_ptr->y, target_ptr->x, 5 + randint0(10), 0);
                                if (!one_in_(6)) break;
                        }
+                       /* Fall through */
                case 30: case 31:
                        if (!(*count))
                        {
@@ -2429,6 +2434,7 @@ bool activate_ty_curse(player_type *target_ptr, bool stop_ty, int *count)
                                take_hit(target_ptr, DAMAGE_NOESCAPE, dam, _("純粋な魔力の解放", "released pure mana"), -1);
                                if (!one_in_(6)) break;
                        }
+                       /* Fall through */
                case 32: case 33:
                        if (!(*count))
                        {
@@ -2437,6 +2443,7 @@ bool activate_ty_curse(player_type *target_ptr, bool stop_ty, int *count)
                                if (randint0(13)) (*count) += activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, FALSE);
                                if (!one_in_(6)) break;
                        }
+                       /* Fall through */
                case 34:
                        msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
                        wall_breaker(target_ptr);
@@ -2447,19 +2454,24 @@ bool activate_ty_curse(player_type *target_ptr, bool stop_ty, int *count)
                        }
 
                        if (!one_in_(6)) break;
+                       /* Fall through */
                case 1: case 2: case 3: case 16: case 17:
                        aggravate_monsters(target_ptr, 0);
                        if (!one_in_(6)) break;
+                       /* Fall through */
                case 4: case 5: case 6:
                        (*count) += activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, FALSE);
                        if (!one_in_(6)) break;
+                       /* Fall through */
                case 7: case 8: case 9: case 18:
                        (*count) += summon_specific(target_ptr, 0, target_ptr->y, target_ptr->x, floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                        if (!one_in_(6)) break;
+                       /* Fall through */
                case 10: case 11: case 12:
                        msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
                        lose_exp(target_ptr, target_ptr->exp / 16);
                        if (!one_in_(6)) break;
+                       /* Fall through */
                case 13: case 14: case 15: case 19: case 20:
                {
                        bool is_statue = stop_ty;
@@ -2477,13 +2489,16 @@ bool activate_ty_curse(player_type *target_ptr, bool stop_ty, int *count)
 
                        if (!one_in_(6)) break;
                }
+                       /* Fall through */
                case 21: case 22: case 23:
                        (void)do_dec_stat(target_ptr, randint0(6));
                        if (!one_in_(6)) break;
+                       /* Fall through */
                case 24:
                        msg_print(_("ほえ?私は誰?ここで何してる?", "Huh? Who am I? What am I doing here?"));
                        lose_all_info(target_ptr);
                        if (!one_in_(6)) break;
+                       /* Fall through */
                case 25:
                        if ((floor_ptr->dun_level > 65) && !stop_ty)
                        {
@@ -2493,6 +2508,7 @@ bool activate_ty_curse(player_type *target_ptr, bool stop_ty, int *count)
                        }
 
                        if (!one_in_(6)) break;
+                       /* Fall through */
                default:
                        for (int i = 0; i < A_MAX; i++)
                        {
@@ -2846,7 +2862,7 @@ bool kawarimi(player_type *caster_ptr, bool success)
        POSITION y = caster_ptr->y;
        POSITION x = caster_ptr->x;
 
-       teleport_player(caster_ptr, 10 + randint1(90), 0L);
+       teleport_player(caster_ptr, 10 + randint1(90), TELEPORT_SPONTANEOUS);
        object_wipe(q_ptr);
        object_prep(q_ptr, lookup_kind(TV_STATUE, SV_WOODEN_STATUE));
 
@@ -3088,6 +3104,7 @@ void wild_magic(player_type *caster_ptr, int spell)
                break;
        case 16: case 17:
                wall_breaker(caster_ptr);
+               break;
        case 18:
                sleep_monsters_touch(caster_ptr);
                break;
@@ -3828,18 +3845,6 @@ void cast_shuffle(player_type *caster_ptr)
 }
 
 
-/*!
- * @brief 口を使う継続的な処理を中断する
- * @param caster_ptr プレーヤーへの参照ポインタ
- * @return なし
- */
-void stop_mouth(player_type *caster_ptr)
-{
-       if (music_singing_any(caster_ptr)) stop_singing(caster_ptr);
-       if (hex_spelling_any(caster_ptr)) stop_hex_spell_all(caster_ptr);
-}
-
-
 bool_hack vampirism(player_type *caster_ptr)
 {
        if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
@@ -3904,7 +3909,7 @@ bool hit_and_away(player_type *caster_ptr)
                if (randint0(caster_ptr->skill_dis) < 7)
                        msg_print(_("うまく逃げられなかった。", "You failed to run away."));
                else
-                       teleport_player(caster_ptr, 30, 0L);
+                       teleport_player(caster_ptr, 30, TELEPORT_SPONTANEOUS);
                return TRUE;
        }
 
@@ -4261,7 +4266,7 @@ bool double_attack(player_type *creature_ptr)
 
 bool comvert_hp_to_mp(player_type *creature_ptr)
 {
-       int gain_sp = take_hit(creature_ptr, DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless convertion from HP to SP"), -1) / 5;
+       int gain_sp = take_hit(creature_ptr, DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless conversion from HP to SP"), -1) / 5;
        if (!gain_sp)
        {
                msg_print(_("変換に失敗した。", "You failed to convert."));
@@ -4446,7 +4451,7 @@ bool clear_mind(player_type *creature_ptr)
 {
        if (total_friends)
        {
-               msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
+               msg_print(_("今はペットを操ることに集中していないと。", "Your pets demand all of your attention."));
                return FALSE;
        }