OSDN Git Service

[Refactor] #37353 cmd4.c を cmd-dump.c に改名して関数整理.
[hengband/hengband.git] / src / spells1.c
index fc62542..ba455db 100644 (file)
  */
 
 #include "angband.h"
+#include "util.h"
+
 #include "cmd-pet.h"
+#include "cmd-dump.h"
+#include "floor.h"
 #include "trap.h"
+#include "autopick.h"
 #include "object-curse.h"
 #include "player-damage.h"
+#include "player-effects.h"
+#include "player-race.h"
 
 #include "monster.h"
 #include "monster-status.h"
 #include "monster-spell.h"
+#include "spells.h"
 #include "spells-status.h"
 #include "spells-diceroll.h"
 #include "spells-summon.h"
@@ -27,7 +35,6 @@
 
 #include "melee.h"
 #include "world.h"
-#include "projection.h"
 #include "mutation.h"
 #include "rooms.h"
 #include "artifact.h"
 #include "realm-hex.h"
 #include "object-hook.h"
 #include "object-broken.h"
+#include "object-flavor.h"
+#include "quest.h"
 #include "term.h"
 #include "grid.h"
 #include "feature.h"
+#include "view-mainwindow.h"
+#include "dungeon.h"
 
 
 static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
@@ -48,6 +59,130 @@ static int rakubadam_p; /*!< 落馬した際のダメージ量 */
 int project_length = 0; /*!< 投射の射程距離 */
 
 
+/*!
+ * @brief 歌、剣術、呪術領域情報テーブル
+ */
+const magic_type technic_info[NUM_TECHNIC][32] =
+{
+       {
+               /* Music */
+               { 1,  1,  10,   2},
+               { 2,  1,  10,   2},
+               { 3,  2,  20,   3},
+               { 4,  2,  20,   4},
+               { 5,  2,  20,   6},
+               { 7,  4,  30,   8},
+               { 9,  3,  30,   10},
+               { 10, 2,  30,   12},
+
+               { 12,  3,   40,   20},
+               { 15, 16,  42,   35},
+               { 17, 18,  40,   25},
+               { 18,  2,  45,   30},
+               { 23,  8,  50,   38},
+               { 28, 30,  50,   41},
+               { 33, 35,  60,   42},
+               { 38, 35,  70,   46},
+
+               { 10,  4,  20,   13},
+               { 22,  5,  30,   26},
+               { 23,  3,  35,   27},
+               { 26,  28,  37,   29},
+               { 32,  37,  41,   36},
+               { 33,  22,  43,   40},
+               { 37,  35,  46,   42},
+               { 45,  60,  50,   56},
+
+               { 23,  18,  20,   23},
+               { 30,  30,  30,   26},
+               { 33,  65,  41,   30},
+               { 37,  35,  43,   35},
+               { 40,  30,  46,   50},
+               { 42,  75,  50,   68},
+               { 45,  58,  62,   73},
+               { 49,  48,  70,  200}
+       },
+
+       {
+               /* Hissatsu */
+               { 1,   15,   0,   0},
+               { 3,   10,   0,   0},
+               { 6,   15,   0,   0},
+               { 9,    8,   0,   0},
+               { 10,  12,   0,   0},
+               { 12,  25,   0,   0},
+               { 14,   7,   0,   0},
+               { 17,  20,   0,   0},
+
+               { 19,  10,   0,   0},
+               { 22,  20,   0,   0},
+               { 24,  30,   0,   0},
+               { 25,  10,   0,   0},
+               { 27,  15,   0,   0},
+               { 29,  45,   0,   0},
+               { 32,  70,   0,   0},
+               { 35,  50,   0,   0},
+
+               { 18,  40,   0,   0},
+               { 22,  22,   0,   0},
+               { 24,  30,   0,   0},
+               { 26,  35,   0,   0},
+               { 30,  30,   0,   0},
+               { 32,  60,   0,   0},
+               { 36,  40,   0,   0},
+               { 39,  80,   0,   0},
+
+               { 26,  20,   0,   0},
+               { 29,  40,   0,   0},
+               { 31,  35,   0,   0},
+               { 36,  80,   0,   0},
+               { 39, 100,   0,   0},
+               { 42, 110,   0,   0},
+               { 45, 130,   0,   0},
+               { 50, 255,   0,   0}
+       },
+
+       {
+               /* Hex */
+               {  1,  2, 20,   2},
+               {  1,  2, 20,   2},
+               {  3,  2, 30,   3},
+               {  5,  3, 30,   4},
+               {  7,  3, 40,   6},
+               {  8, 10, 60,   8},
+               {  9,  3, 30,  10},
+               { 10,  5, 40,  12},
+
+               { 12,  8, 40,  15},
+               { 12,  9, 35,  15},
+               { 15, 10, 50,  20},
+               { 20, 12, 45,  35},
+               { 25, 15, 50,  50},
+               { 30, 12, 60,  70},
+               { 35, 10, 60,  80},
+               { 40, 16, 70, 100},
+
+               { 15,  8, 20,  20},
+               { 18, 15, 50,  20},
+               { 22, 10, 65,  35},
+               { 25, 28, 70,  50},
+               { 28, 10, 70,  60},
+               { 30, 20, 60,  60},
+               { 36, 22, 70,  80},
+               { 40, 28, 70, 100},
+
+               {  5,  6, 35,   5},
+               { 22, 24, 70,  40},
+               { 25,  2, 65,  50},
+               { 32, 20, 50,  70},
+               { 35, 35, 70,  80},
+               { 38, 32, 70,  90},
+               { 42, 24, 70, 120},
+               { 46, 45, 80, 200}
+       },
+};
+
+
 
 /*!
  * @brief 配置した鏡リストの次を取得する /
@@ -1593,7 +1728,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
                                                else
                                                {
                                                        /* Injure +/- confusion */
-                                                       monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
+                                                       monster_desc(killer, m_ptr, MD_WRONGDOER_NAME);
                                                        take_hit(DAMAGE_ATTACK, dam, killer, -1);  /* has already been /3 */
                                                        if (one_in_(4) && !CHECK_MULTISHADOW())
                                                        {
@@ -1683,7 +1818,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
                                                else
                                                {
                                                        /* Injure + mana drain */
-                                                       monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
+                                                       monster_desc(killer, m_ptr, MD_WRONGDOER_NAME);
                                                        if (!CHECK_MULTISHADOW())
                                                        {
                                                                msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
@@ -3973,7 +4108,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
        /* Analyze the damage */
        switch (typ)
        {
-               /* Standard damage -- hurts inventory too */
+               /* Standard damage -- hurts p_ptr->inventory_list too */
                case GF_ACID:
                {
                        if (fuzzy) msg_print(_("酸で攻撃された!", "You are hit by acid!"));                    
@@ -3981,7 +4116,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
                        break;
                }
 
-               /* Standard damage -- hurts inventory too */
+               /* Standard damage -- hurts p_ptr->inventory_list too */
                case GF_FIRE:
                {
                        if (fuzzy) msg_print(_("火炎で攻撃された!", "You are hit by fire!"));
@@ -3989,7 +4124,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
                        break;
                }
 
-               /* Standard damage -- hurts inventory too */
+               /* Standard damage -- hurts p_ptr->inventory_list too */
                case GF_COLD:
                {
                        if (fuzzy) msg_print(_("冷気で攻撃された!", "You are hit by cold!"));
@@ -3997,7 +4132,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
                        break;
                }
 
-               /* Standard damage -- hurts inventory too */
+               /* Standard damage -- hurts p_ptr->inventory_list too */
                case GF_ELEC:
                {
                        if (fuzzy) msg_print(_("電撃で攻撃された!", "You are hit by lightning!"));
@@ -4094,7 +4229,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
                        {
                                msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
                        }
-                       else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
+                       else if ((p_ptr->inventory_list[INVEN_RARM].name1 == ART_ZANTETSU) || (p_ptr->inventory_list[INVEN_LARM].name1 == ART_ZANTETSU))
                        {
                                msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
                                break;
@@ -5499,7 +5634,7 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
        {
                x1 = current_floor_ptr->m_list[who].fx;
                y1 = current_floor_ptr->m_list[who].fy;
-               monster_desc(who_name, &current_floor_ptr->m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
+               monster_desc(who_name, &current_floor_ptr->m_list[who], MD_WRONGDOER_NAME);
        }
 
        else