OSDN Git Service

[Refactor] #37353 敵呪文ダメージ計算用定義を monster-spell.h へ移動.
[hengband/hengband.git] / src / monster-spell.h
1 #pragma once
2
3
4 /* Imitator */
5 typedef struct monster_power monster_power;
6 struct monster_power
7 {
8         PLAYER_LEVEL level;
9         MANA_POINT smana;
10         PERCENTAGE fail;
11         int     manedam;
12         int     manefail;
13         int     use_stat;
14         concptr    name;
15 };
16
17 /* Spell Damage Calc Flag*/
18 #define DAM_ROLL 1
19 #define DAM_MAX 2
20 #define DAM_MIN 3
21 #define DICE_NUM 4
22 #define DICE_SIDE 5
23 #define DICE_MULT 6
24 #define DICE_DIV 7
25 #define BASE_DAM 8
26
27 #define MAX_MONSPELLS 96
28 #define MONSPELL_TYPE_BOLT 1
29 #define MONSPELL_TYPE_BALL 2
30 #define MONSPELL_TYPE_BREATH 3
31 #define MONSPELL_TYPE_SUMMON 4
32 #define MONSPELL_TYPE_OTHER 5
33
34 /* Monster Spells */
35 #define MS_SHRIEK         0
36 #define MS_XXX1           1
37 #define MS_DISPEL         2
38 #define MS_ROCKET         3
39 #define MS_SHOOT          4
40 #define MS_XXX2           5
41 #define MS_XXX3           6
42 #define MS_XXX4           7
43 #define MS_BR_ACID        8
44 #define MS_BR_ELEC        9
45 #define MS_BR_FIRE        10
46 #define MS_BR_COLD        11
47 #define MS_BR_POIS        12
48 #define MS_BR_NETHER      13
49 #define MS_BR_LITE        14
50 #define MS_BR_DARK        15
51 #define MS_BR_CONF        16
52 #define MS_BR_SOUND       17
53 #define MS_BR_CHAOS       18
54 #define MS_BR_DISEN       19
55 #define MS_BR_NEXUS       20
56 #define MS_BR_TIME        21
57 #define MS_BR_INERTIA     22
58 #define MS_BR_GRAVITY     23
59 #define MS_BR_SHARDS      24
60 #define MS_BR_PLASMA      25
61 #define MS_BR_FORCE       26
62 #define MS_BR_MANA        27
63 #define MS_BALL_NUKE      28
64 #define MS_BR_NUKE        29
65 #define MS_BALL_CHAOS     30
66 #define MS_BR_DISI        31
67 #define MS_BALL_ACID      32
68 #define MS_BALL_ELEC      33
69 #define MS_BALL_FIRE      34
70 #define MS_BALL_COLD      35
71 #define MS_BALL_POIS      36
72 #define MS_BALL_NETHER    37
73 #define MS_BALL_WATER     38
74 #define MS_BALL_MANA      39
75 #define MS_BALL_DARK      40
76 #define MS_DRAIN_MANA     41
77 #define MS_MIND_BLAST     42
78 #define MS_BRAIN_SMASH    43
79 #define MS_CAUSE_1        44
80 #define MS_CAUSE_2        45
81 #define MS_CAUSE_3        46
82 #define MS_CAUSE_4        47
83 #define MS_BOLT_ACID      48
84 #define MS_BOLT_ELEC      49
85 #define MS_BOLT_FIRE      50
86 #define MS_BOLT_COLD      51
87 #define MS_STARBURST      52
88 #define MS_BOLT_NETHER    53
89 #define MS_BOLT_WATER     54
90 #define MS_BOLT_MANA      55
91 #define MS_BOLT_PLASMA    56
92 #define MS_BOLT_ICE       57
93 #define MS_MAGIC_MISSILE  58
94 #define MS_SCARE          59
95 #define MS_BLIND          60
96 #define MS_CONF           61
97 #define MS_SLOW           62
98 #define MS_SLEEP          63
99 #define MS_SPEED          64
100 #define MS_HAND_DOOM      65
101 #define MS_HEAL           66
102 #define MS_INVULNER       67
103 #define MS_BLINK          68
104 #define MS_TELEPORT       69
105 #define MS_WORLD          70
106 #define MS_SPECIAL        71
107 #define MS_TELE_TO        72
108 #define MS_TELE_AWAY      73
109 #define MS_TELE_LEVEL     74
110 #define MS_PSY_SPEAR      75
111 #define MS_DARKNESS       76
112 #define MS_MAKE_TRAP      77
113 #define MS_FORGET         78
114 #define MS_RAISE_DEAD     79
115 #define MS_S_KIN          80
116 #define MS_S_CYBER        81
117 #define MS_S_MONSTER      82
118 #define MS_S_MONSTERS     83
119 #define MS_S_ANT          84
120 #define MS_S_SPIDER       85
121 #define MS_S_HOUND        86
122 #define MS_S_HYDRA        87
123 #define MS_S_ANGEL        88
124 #define MS_S_DEMON        89
125 #define MS_S_UNDEAD       90
126 #define MS_S_DRAGON       91
127 #define MS_S_HI_UNDEAD    92
128 #define MS_S_HI_DRAGON    93
129 #define MS_S_AMBERITE     94
130 #define MS_S_UNIQUE       95
131
132 /*
133  * Hack -- choose "intelligent" spells when desperate
134  * Including "summon" spells
135  */
136 #define RF4_INT_MASK \
137         (RF4_SUMMON_MASK | RF4_DISPEL)
138
139 #define RF5_INT_MASK \
140         (RF5_SUMMON_MASK | \
141          RF5_HOLD | RF5_SLOW | RF5_CONF | RF5_BLIND | RF5_SCARE)
142
143 #define RF6_INT_MASK \
144         (RF6_SUMMON_MASK | \
145          RF6_BLINK | RF6_TPORT | RF6_TELE_LEVEL | RF6_TELE_AWAY | \
146          RF6_HEAL | RF6_INVULNER | RF6_HASTE | RF6_TRAPS)
147
148  /*
149   * Hack -- spells that cannot be used while player riding on the monster
150   */
151 #define RF4_RIDING_MASK \
152         (RF4_SHRIEK)
153
154 #define RF5_RIDING_MASK 0UL
155
156 #define RF6_RIDING_MASK \
157         (RF6_BLINK | RF6_TPORT | RF6_TRAPS | RF6_DARKNESS | RF6_SPECIAL)
158
159   /*
160    * Hack -- "bolt" spells that may hurt fellow monsters
161    * Currently "bolt" spells are included in "attack"
162    */
163 #define RF4_BOLT_MASK \
164         (RF4_ROCKET | RF4_SHOOT)
165
166 #define RF5_BOLT_MASK \
167         (RF5_BO_ACID | RF5_BO_ELEC | RF5_BO_FIRE | RF5_BO_COLD | \
168          RF5_BO_NETH | RF5_BO_WATE | RF5_BO_MANA | RF5_BO_PLAS | \
169          RF5_BO_ICEE | RF5_MISSILE)
170
171 #define RF6_BOLT_MASK 0UL
172
173    /*
174         * Hack -- "beam" spells that may hurt fellow monsters
175         * Currently "beam" spells are included in "attack"
176         */
177 #define RF4_BEAM_MASK 0UL
178
179 #define RF5_BEAM_MASK 0UL
180
181 #define RF6_BEAM_MASK (RF6_PSY_SPEAR)
182
183         /*
184          * Hack -- "ball" spells that may hurt friends
185          * Including "radius 4 ball" and "breath" spells
186          * Currently "ball" spells are included in "attack"
187          */
188 #define RF4_BALL_MASK \
189         (RF4_BIG_BALL_MASK | RF4_BREATH_MASK | \
190          RF4_ROCKET | RF4_BA_NUKE)
191
192 #define RF5_BALL_MASK \
193         (RF5_BIG_BALL_MASK | RF5_BREATH_MASK | \
194          RF5_BA_ACID | RF5_BA_ELEC | RF5_BA_FIRE | RF5_BA_COLD | \
195          RF5_BA_POIS | RF5_BA_NETH)
196
197 #define RF6_BALL_MASK \
198         (RF6_BIG_BALL_MASK | RF6_BREATH_MASK)
199
200          /*
201           * Hack -- "ball" spells with radius 4 that may hurt friends
202           * Currently "radius 4 ball" spells are included in "ball"
203           */
204 #define RF4_BIG_BALL_MASK \
205         (RF4_BA_CHAO)
206
207 #define RF5_BIG_BALL_MASK \
208         (RF5_BA_LITE | RF5_BA_DARK | RF5_BA_WATE | RF5_BA_MANA)
209
210 #define RF6_BIG_BALL_MASK 0UL
211
212           /*
213            * Hack -- "breath" spells that may hurt friends
214            * Currently "breath" spells are included in "ball" and "non-magic"
215            */
216 #define RF4_BREATH_MASK \
217         (RF4_BR_ACID | RF4_BR_ELEC | RF4_BR_FIRE | RF4_BR_COLD | \
218          RF4_BR_POIS | RF4_BR_NETH | RF4_BR_LITE | RF4_BR_DARK | \
219          RF4_BR_CONF | RF4_BR_SOUN | RF4_BR_CHAO | RF4_BR_DISE | \
220          RF4_BR_NEXU | RF4_BR_SHAR | RF4_BR_TIME | RF4_BR_INER | \
221          RF4_BR_GRAV | RF4_BR_PLAS | RF4_BR_WALL | RF4_BR_MANA | \
222          RF4_BR_NUKE | RF4_BR_DISI)
223
224 #define RF5_BREATH_MASK 0UL
225
226 #define RF6_BREATH_MASK 0UL
227
228            /*
229                 * Hack -- "summon" spells
230                 * Currently "summon" spells are included in "intelligent" and "indirect"
231                 */
232 #define RF4_SUMMON_MASK 0UL
233
234 #define RF5_SUMMON_MASK 0UL
235
236 #define RF6_SUMMON_MASK \
237         (RF6_S_KIN | RF6_S_CYBER | RF6_S_MONSTER | RF6_S_MONSTERS | RF6_S_ANT | \
238          RF6_S_SPIDER | RF6_S_HOUND | RF6_S_HYDRA | RF6_S_ANGEL | RF6_S_DEMON | \
239          RF6_S_UNDEAD | RF6_S_DRAGON | RF6_S_HI_UNDEAD | RF6_S_HI_DRAGON | \
240          RF6_S_AMBERITES | RF6_S_UNIQUE)
241
242                 /*
243                  * Hack -- "attack" spells
244                  * Including "bolt", "beam" and "ball" spells
245                  */
246 #define RF4_ATTACK_MASK \
247         (RF4_BOLT_MASK | RF4_BEAM_MASK | RF4_BALL_MASK | RF4_DISPEL)
248
249 #define RF5_ATTACK_MASK \
250         (RF5_BOLT_MASK | RF5_BEAM_MASK | RF5_BALL_MASK | \
251          RF5_DRAIN_MANA | RF5_MIND_BLAST | RF5_BRAIN_SMASH | \
252          RF5_CAUSE_1 | RF5_CAUSE_2 | RF5_CAUSE_3 | RF5_CAUSE_4 | \
253          RF5_SCARE | RF5_BLIND | RF5_CONF | RF5_SLOW | RF5_HOLD)
254
255 #define RF6_ATTACK_MASK \
256         (RF6_BOLT_MASK | RF6_BEAM_MASK | RF6_BALL_MASK | \
257          RF6_HAND_DOOM | RF6_TELE_TO | RF6_TELE_AWAY | RF6_TELE_LEVEL | \
258          RF6_DARKNESS | RF6_TRAPS | RF6_FORGET)
259
260                  /*
261                   * Hack -- "indirect" spells
262                   * Including "summon" spells
263                   */
264 #define RF4_INDIRECT_MASK \
265         (RF4_SUMMON_MASK | RF4_SHRIEK)
266
267 #define RF5_INDIRECT_MASK \
268         (RF5_SUMMON_MASK)
269
270 #define RF6_INDIRECT_MASK \
271         (RF6_SUMMON_MASK | \
272          RF6_HASTE | RF6_HEAL | RF6_INVULNER | RF6_BLINK | RF6_WORLD | \
273          RF6_TPORT | RF6_RAISE_DEAD)
274
275                   /*
276                    * Hack -- "non-magic" spells
277                    * Including "breath" spells
278                    */
279 #define RF4_NOMAGIC_MASK \
280         (RF4_BREATH_MASK | RF4_SHRIEK | RF4_ROCKET | RF4_SHOOT)
281
282 #define RF5_NOMAGIC_MASK \
283         (RF5_BREATH_MASK)
284
285 #define RF6_NOMAGIC_MASK \
286         (RF6_BREATH_MASK | RF6_SPECIAL)
287
288 extern const monster_power monster_powers[MAX_MONSPELLS];
289 extern const concptr monster_powers_short[MAX_MONSPELLS];
290
291 /* mspells1.c */
292 extern bool clean_shot(POSITION y1, POSITION x1, POSITION y2, POSITION x2, bool is_friend);
293 extern bool summon_possible(POSITION y1, POSITION x1);
294 extern bool raise_possible(monster_type *m_ptr);
295 extern bool dispel_check(MONSTER_IDX m_idx);
296 extern bool spell_is_inate(SPELL_IDX spell);
297 extern bool make_attack_spell(MONSTER_IDX m_idx);
298 extern void beam(MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int monspell, int target_type);
299 extern void bolt(MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int monspell, int target_type);
300 extern void breath(POSITION y, POSITION x, MONSTER_IDX m_idx, EFFECT_ID typ, int dam_hp, POSITION rad, bool breath, int monspell, int target_type);
301
302 /* mspells2.c */
303 extern void get_project_point(POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg);
304 extern bool monst_spell_monst(MONSTER_IDX m_idx);
305
306 /* mspells3.c */
307 extern bool do_cmd_cast_learned(void);
308 extern void learn_spell(int monspell);
309 extern void set_rf_masks(BIT_FLAGS *f4, BIT_FLAGS *f5, BIT_FLAGS *f6, BIT_FLAGS mode);
310
311 /* mspells4.c */
312 extern bool spell_learnable(MONSTER_IDX m_idx);
313 extern HIT_POINT monspell_to_player(int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx);
314 extern HIT_POINT monspell_to_monster(int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx);
315 extern HIT_POINT monspell_damage(int SPELL_NUM, MONSTER_IDX m_idx, int TYPE);
316 extern HIT_POINT monspell_race_damage(int SPELL_NUM, MONRACE_IDX r_idx, int TYPE);
317 extern HIT_POINT monspell_bluemage_damage(int SPELL_NUM, PLAYER_LEVEL plev, int TYPE);