Hengband  2.2.1
monster-spell.h
[詳解]
1 #pragma once
2 
3 
4 /* Imitator */
5 typedef struct monster_power monster_power;
7 {
11  int manedam;
12  int manefail;
13  int use_stat;
15 };
16 
17 /* Spell Type flag */
18 #define MONSTER_TO_PLAYER 0x01
19 #define MONSTER_TO_MONSTER 0x02
20 
21 /* summoning number */
22 #define S_NUM_6 (easy_band ? 2 : 6)
23 #define S_NUM_4 (easy_band ? 1 : 4)
24 
25 /* monster spell number */
26 #define RF4_SPELL_START 32 * 3
27 #define RF5_SPELL_START 32 * 4
28 #define RF6_SPELL_START 32 * 5
29 
30 #define RF4_SPELL_SIZE 32
31 #define RF5_SPELL_SIZE 32
32 #define RF6_SPELL_SIZE 32
33 
34 /* Spell Damage Calc Flag*/
35 #define DAM_ROLL 1
36 #define DAM_MAX 2
37 #define DAM_MIN 3
38 #define DICE_NUM 4
39 #define DICE_SIDE 5
40 #define DICE_MULT 6
41 #define DICE_DIV 7
42 #define BASE_DAM 8
43 
44 #define MAX_MONSPELLS 96
45 #define MONSPELL_TYPE_BOLT 1
46 #define MONSPELL_TYPE_BALL 2
47 #define MONSPELL_TYPE_BREATH 3
48 #define MONSPELL_TYPE_SUMMON 4
49 #define MONSPELL_TYPE_OTHER 5
50 
51 /* Monster Spells */
52 #define MS_SHRIEK 0
53 #define MS_XXX1 1
54 #define MS_DISPEL 2
55 #define MS_ROCKET 3
56 #define MS_SHOOT 4
57 #define MS_XXX2 5
58 #define MS_XXX3 6
59 #define MS_XXX4 7
60 #define MS_BR_ACID 8
61 #define MS_BR_ELEC 9
62 #define MS_BR_FIRE 10
63 #define MS_BR_COLD 11
64 #define MS_BR_POIS 12
65 #define MS_BR_NETHER 13
66 #define MS_BR_LITE 14
67 #define MS_BR_DARK 15
68 #define MS_BR_CONF 16
69 #define MS_BR_SOUND 17
70 #define MS_BR_CHAOS 18
71 #define MS_BR_DISEN 19
72 #define MS_BR_NEXUS 20
73 #define MS_BR_TIME 21
74 #define MS_BR_INERTIA 22
75 #define MS_BR_GRAVITY 23
76 #define MS_BR_SHARDS 24
77 #define MS_BR_PLASMA 25
78 #define MS_BR_FORCE 26
79 #define MS_BR_MANA 27
80 #define MS_BALL_NUKE 28
81 #define MS_BR_NUKE 29
82 #define MS_BALL_CHAOS 30
83 #define MS_BR_DISI 31
84 #define MS_BALL_ACID 32
85 #define MS_BALL_ELEC 33
86 #define MS_BALL_FIRE 34
87 #define MS_BALL_COLD 35
88 #define MS_BALL_POIS 36
89 #define MS_BALL_NETHER 37
90 #define MS_BALL_WATER 38
91 #define MS_BALL_MANA 39
92 #define MS_BALL_DARK 40
93 #define MS_DRAIN_MANA 41
94 #define MS_MIND_BLAST 42
95 #define MS_BRAIN_SMASH 43
96 #define MS_CAUSE_1 44
97 #define MS_CAUSE_2 45
98 #define MS_CAUSE_3 46
99 #define MS_CAUSE_4 47
100 #define MS_BOLT_ACID 48
101 #define MS_BOLT_ELEC 49
102 #define MS_BOLT_FIRE 50
103 #define MS_BOLT_COLD 51
104 #define MS_STARBURST 52
105 #define MS_BOLT_NETHER 53
106 #define MS_BOLT_WATER 54
107 #define MS_BOLT_MANA 55
108 #define MS_BOLT_PLASMA 56
109 #define MS_BOLT_ICE 57
110 #define MS_MAGIC_MISSILE 58
111 #define MS_SCARE 59
112 #define MS_BLIND 60
113 #define MS_CONF 61
114 #define MS_SLOW 62
115 #define MS_SLEEP 63
116 #define MS_SPEED 64
117 #define MS_HAND_DOOM 65
118 #define MS_HEAL 66
119 #define MS_INVULNER 67
120 #define MS_BLINK 68
121 #define MS_TELEPORT 69
122 #define MS_WORLD 70
123 #define MS_SPECIAL 71
124 #define MS_TELE_TO 72
125 #define MS_TELE_AWAY 73
126 #define MS_TELE_LEVEL 74
127 #define MS_PSY_SPEAR 75
128 #define MS_DARKNESS 76
129 #define MS_MAKE_TRAP 77
130 #define MS_FORGET 78
131 #define MS_RAISE_DEAD 79
132 #define MS_S_KIN 80
133 #define MS_S_CYBER 81
134 #define MS_S_MONSTER 82
135 #define MS_S_MONSTERS 83
136 #define MS_S_ANT 84
137 #define MS_S_SPIDER 85
138 #define MS_S_HOUND 86
139 #define MS_S_HYDRA 87
140 #define MS_S_ANGEL 88
141 #define MS_S_DEMON 89
142 #define MS_S_UNDEAD 90
143 #define MS_S_DRAGON 91
144 #define MS_S_HI_UNDEAD 92
145 #define MS_S_HI_DRAGON 93
146 #define MS_S_AMBERITE 94
147 #define MS_S_UNIQUE 95
148 
149 /*
150  * Hack -- choose "intelligent" spells when desperate
151  * Including "summon" spells
152  */
153 #define RF4_INT_MASK \
154  (RF4_SUMMON_MASK | RF4_DISPEL)
155 
156 #define RF5_INT_MASK \
157  (RF5_SUMMON_MASK | \
158  RF5_HOLD | RF5_SLOW | RF5_CONF | RF5_BLIND | RF5_SCARE)
159 
160 #define RF6_INT_MASK \
161  (RF6_SUMMON_MASK | \
162  RF6_BLINK | RF6_TPORT | RF6_TELE_LEVEL | RF6_TELE_AWAY | \
163  RF6_HEAL | RF6_INVULNER | RF6_HASTE | RF6_TRAPS)
164 
165  /*
166  * Hack -- spells that cannot be used while player riding on the monster
167  */
168 #define RF4_RIDING_MASK \
169  (RF4_SHRIEK)
170 
171 #define RF5_RIDING_MASK 0UL
172 
173 #define RF6_RIDING_MASK \
174  (RF6_BLINK | RF6_TPORT | RF6_TRAPS | RF6_DARKNESS | RF6_SPECIAL)
175 
176  /*
177  * Hack -- "bolt" spells that may hurt fellow monsters
178  * Currently "bolt" spells are included in "attack"
179  */
180 #define RF4_BOLT_MASK \
181  (RF4_ROCKET | RF4_SHOOT)
182 
183 #define RF5_BOLT_MASK \
184  (RF5_BO_ACID | RF5_BO_ELEC | RF5_BO_FIRE | RF5_BO_COLD | \
185  RF5_BO_NETH | RF5_BO_WATE | RF5_BO_MANA | RF5_BO_PLAS | \
186  RF5_BO_ICEE | RF5_MISSILE)
187 
188 #define RF6_BOLT_MASK 0UL
189 
190  /*
191  * Hack -- "beam" spells that may hurt fellow monsters
192  * Currently "beam" spells are included in "attack"
193  */
194 #define RF4_BEAM_MASK 0UL
195 
196 #define RF5_BEAM_MASK 0UL
197 
198 #define RF6_BEAM_MASK (RF6_PSY_SPEAR)
199 
200  /*
201  * Hack -- "ball" spells that may hurt friends
202  * Including "radius 4 ball" and "breath" spells
203  * Currently "ball" spells are included in "attack"
204  */
205 #define RF4_BALL_MASK \
206  (RF4_BIG_BALL_MASK | RF4_BREATH_MASK | \
207  RF4_ROCKET | RF4_BA_NUKE)
208 
209 #define RF5_BALL_MASK \
210  (RF5_BIG_BALL_MASK | RF5_BREATH_MASK | \
211  RF5_BA_ACID | RF5_BA_ELEC | RF5_BA_FIRE | RF5_BA_COLD | \
212  RF5_BA_POIS | RF5_BA_NETH)
213 
214 #define RF6_BALL_MASK \
215  (RF6_BIG_BALL_MASK | RF6_BREATH_MASK)
216 
217  /*
218  * Hack -- "ball" spells with radius 4 that may hurt friends
219  * Currently "radius 4 ball" spells are included in "ball"
220  */
221 #define RF4_BIG_BALL_MASK \
222  (RF4_BA_CHAO)
223 
224 #define RF5_BIG_BALL_MASK \
225  (RF5_BA_LITE | RF5_BA_DARK | RF5_BA_WATE | RF5_BA_MANA)
226 
227 #define RF6_BIG_BALL_MASK 0UL
228 
229  /*
230  * Hack -- "breath" spells that may hurt friends
231  * Currently "breath" spells are included in "ball" and "non-magic"
232  */
233 #define RF4_BREATH_MASK \
234  (RF4_BR_ACID | RF4_BR_ELEC | RF4_BR_FIRE | RF4_BR_COLD | \
235  RF4_BR_POIS | RF4_BR_NETH | RF4_BR_LITE | RF4_BR_DARK | \
236  RF4_BR_CONF | RF4_BR_SOUN | RF4_BR_CHAO | RF4_BR_DISE | \
237  RF4_BR_NEXU | RF4_BR_SHAR | RF4_BR_TIME | RF4_BR_INER | \
238  RF4_BR_GRAV | RF4_BR_PLAS | RF4_BR_WALL | RF4_BR_MANA | \
239  RF4_BR_NUKE | RF4_BR_DISI)
240 
241 #define RF5_BREATH_MASK 0UL
242 
243 #define RF6_BREATH_MASK 0UL
244 
245  /*
246  * Hack -- "summon" spells
247  * Currently "summon" spells are included in "intelligent" and "indirect"
248  */
249 #define RF4_SUMMON_MASK 0UL
250 
251 #define RF5_SUMMON_MASK 0UL
252 
253 #define RF6_SUMMON_MASK \
254  (RF6_S_KIN | RF6_S_CYBER | RF6_S_MONSTER | RF6_S_MONSTERS | RF6_S_ANT | \
255  RF6_S_SPIDER | RF6_S_HOUND | RF6_S_HYDRA | RF6_S_ANGEL | RF6_S_DEMON | \
256  RF6_S_UNDEAD | RF6_S_DRAGON | RF6_S_HI_UNDEAD | RF6_S_HI_DRAGON | \
257  RF6_S_AMBERITES | RF6_S_UNIQUE)
258 
259  /*
260  * Hack -- "attack" spells
261  * Including "bolt", "beam" and "ball" spells
262  */
263 #define RF4_ATTACK_MASK \
264  (RF4_BOLT_MASK | RF4_BEAM_MASK | RF4_BALL_MASK | RF4_DISPEL)
265 
266 #define RF5_ATTACK_MASK \
267  (RF5_BOLT_MASK | RF5_BEAM_MASK | RF5_BALL_MASK | \
268  RF5_DRAIN_MANA | RF5_MIND_BLAST | RF5_BRAIN_SMASH | \
269  RF5_CAUSE_1 | RF5_CAUSE_2 | RF5_CAUSE_3 | RF5_CAUSE_4 | \
270  RF5_SCARE | RF5_BLIND | RF5_CONF | RF5_SLOW | RF5_HOLD)
271 
272 #define RF6_ATTACK_MASK \
273  (RF6_BOLT_MASK | RF6_BEAM_MASK | RF6_BALL_MASK | \
274  RF6_HAND_DOOM | RF6_TELE_TO | RF6_TELE_AWAY | RF6_TELE_LEVEL | \
275  RF6_DARKNESS | RF6_TRAPS | RF6_FORGET)
276 
277  /*
278  * Hack -- "indirect" spells
279  * Including "summon" spells
280  */
281 #define RF4_INDIRECT_MASK \
282  (RF4_SUMMON_MASK | RF4_SHRIEK)
283 
284 #define RF5_INDIRECT_MASK \
285  (RF5_SUMMON_MASK)
286 
287 #define RF6_INDIRECT_MASK \
288  (RF6_SUMMON_MASK | \
289  RF6_HASTE | RF6_HEAL | RF6_INVULNER | RF6_BLINK | RF6_WORLD | \
290  RF6_TPORT | RF6_RAISE_DEAD)
291 
292  /*
293  * Hack -- "non-magic" spells
294  * Including "breath" spells
295  */
296 #define RF4_NOMAGIC_MASK \
297  (RF4_BREATH_MASK | RF4_SHRIEK | RF4_ROCKET | RF4_SHOOT)
298 
299 #define RF5_NOMAGIC_MASK \
300  (RF5_BREATH_MASK)
301 
302 #define RF6_NOMAGIC_MASK \
303  (RF6_BREATH_MASK | RF6_SPECIAL)
304 
307 
308 /* mspells1.c */
309 extern bool clean_shot(POSITION y1, POSITION x1, POSITION y2, POSITION x2, bool is_friend);
310 extern bool summon_possible(POSITION y1, POSITION x1);
311 extern bool raise_possible(monster_type *m_ptr);
312 extern bool dispel_check(MONSTER_IDX m_idx);
313 extern bool spell_is_inate(SPELL_IDX spell);
314 extern bool make_attack_spell(MONSTER_IDX m_idx);
315 extern void beam(MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int monspell, int target_type);
316 extern void bolt(MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int monspell, int target_type);
317 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);
318 
319 /* mspells2.c */
320 extern void get_project_point(POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg);
321 extern bool monst_spell_monst(MONSTER_IDX m_idx);
322 
323 /* mspells3.c */
324 extern bool do_cmd_cast_learned(void);
325 extern void learn_spell(int monspell);
326 extern void set_rf_masks(BIT_FLAGS *f4, BIT_FLAGS *f5, BIT_FLAGS *f6, BIT_FLAGS mode);
327 
328 /* mspells4.c */
329 extern bool spell_learnable(MONSTER_IDX m_idx);
330 extern HIT_POINT monspell_to_player(int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx);
331 extern HIT_POINT monspell_to_monster(int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx);
332 extern HIT_POINT monspell_damage(int SPELL_NUM, MONSTER_IDX m_idx, int TYPE);
333 extern HIT_POINT monspell_race_damage(int SPELL_NUM, MONRACE_IDX r_idx, int TYPE);
334 extern HIT_POINT monspell_bluemage_damage(int SPELL_NUM, PLAYER_LEVEL plev, int TYPE);
bool clean_shot(POSITION y1, POSITION x1, POSITION y2, POSITION x2, bool is_friend)
モンスターにとってボルト型魔法が有効な状態かを返す / Determine if a bolt spell will hit the player.
Definition: mspells1.c:470
void beam(MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int monspell, int target_type)
モンスターのビーム型魔法処理 /
Definition: mspells1.c:559
void get_project_point(POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg)
モンスターが特殊能力の目標地点を決める処理 / Get the actual center point of ball spells (rad > 1) (originally from TOband)
Definition: mspells2.c:209
void bolt(MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int monspell, int target_type)
モンスターのボルト型魔法処理 / Cast a bolt at the player Stop if we hit a monster Affect monsters and the player
Definition: mspells1.c:528
const char * concptr
文字列定数用ポインタ定義 / A simple pointer (to unmodifiable strings)
Definition: h-type.h:47
int manedam
Definition: monster-spell.h:11
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)
モンスターのボール型&ブレス型魔法処理 / Cast a breath (or ball) attack at the player Pass over any monsters that may be...
Definition: mspells1.c:593
Definition: monster.h:39
bool do_cmd_cast_learned(void)
青魔法コマンドのメインルーチン / do_cmd_cast calls this function if the player's class is 'Blue-Mage'.
Definition: mspells3.c:1649
HIT_POINT monspell_damage(int SPELL_NUM, MONSTER_IDX m_idx, int TYPE)
モンスターの使う呪文の威力を返す /
Definition: mspells4.c:4077
s32b SPELL_IDX
各魔法領域/職業能力ごとの呪文ID型定義
Definition: h-type.h:243
concptr name
Definition: monster-spell.h:14
bool raise_possible(monster_type *m_ptr)
モンスターにとって死者復活を行うべき状態かどうかを返す / Determine if there is a space near the player in which a summoned creat...
Definition: mspells1.c:415
s16b MONRACE_IDX
ゲーム中のモンスター種族ID型を定義
Definition: h-type.h:128
void learn_spell(int monspell)
青魔法のラーニング判定と成功した場合のラーニング処理
Definition: mspells3.c:1776
s32b HIT_POINT
HPとその増減量の型定義
Definition: h-type.h:161
u32b BIT_FLAGS
32ビットのフラグ配列の型定義
Definition: h-type.h:225
MANA_POINT smana
Definition: monster-spell.h:9
s32b POSITION
ゲーム中の座標型を定義
Definition: h-type.h:146
s16b PLAYER_LEVEL
ゲーム中のプレイヤーレベルの型を定義
Definition: h-type.h:197
bool make_attack_spell(MONSTER_IDX m_idx)
モンスターの特殊技能メインルーチン / Creatures can cast spells, shoot missiles, and breathe.
Definition: mspells1.c:1353
int manefail
Definition: monster-spell.h:12
int EFFECT_ID
効果属性ID
Definition: h-type.h:252
PERCENTAGE fail
Definition: monster-spell.h:10
void set_rf_masks(BIT_FLAGS *f4, BIT_FLAGS *f5, BIT_FLAGS *f6, BIT_FLAGS mode)
モンスター特殊能力のフラグ配列から特定条件の魔法だけを抜き出す処理 Extract monster spells mask for the given mode
Definition: mspells3.c:1807
HIT_POINT monspell_to_monster(int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx)
モンスターからモンスターへの呪文の振り分け関数。 /
Definition: mspells4.c:3517
HIT_POINT monspell_bluemage_damage(int SPELL_NUM, PLAYER_LEVEL plev, int TYPE)
青魔導師の使う呪文の威力を返す /
Definition: mspells4.c:4123
const concptr monster_powers_short[MAX_MONSPELLS]
モンスター魔法名テーブル
Definition: mspells3.c:243
s32b PERCENTAGE
ゲーム中のパーセント表記の型定義(/100倍)
Definition: h-type.h:222
bool spell_learnable(MONSTER_IDX m_idx)
モンスターの唱えた呪文を青魔法で学習できるか判定する /
Definition: mspells4.c:61
const monster_power monster_powers[MAX_MONSPELLS]
青魔法テーブル
Definition: mspells3.c:40
s16b MONSTER_IDX
ゲーム中のモンスター個体ID型を定義
Definition: h-type.h:129
bool spell_is_inate(SPELL_IDX spell)
ID値が非魔術的な特殊技能かどうかを返す / Return TRUE if a spell is inate spell.
Definition: mspells1.c:1219
PLAYER_LEVEL level
Definition: monster-spell.h:8
s32b MANA_POINT
ゲーム中のMP型を定義
Definition: h-type.h:169
#define MAX_MONSPELLS
Definition: monster-spell.h:44
HIT_POINT monspell_to_player(int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx)
モンスターからプレイヤーへの呪文の振り分け関数。 /
Definition: mspells4.c:3404
int use_stat
Definition: monster-spell.h:13
bool dispel_check(MONSTER_IDX m_idx)
モンスターがプレイヤーに魔力消去を与えるべきかを判定するルーチン Check should monster cast dispel spell.
Definition: mspells1.c:874
HIT_POINT monspell_race_damage(int SPELL_NUM, MONRACE_IDX r_idx, int TYPE)
モンスターの使う呪文の威力を返す /
Definition: mspells4.c:4104
bool monst_spell_monst(MONSTER_IDX m_idx)
モンスターが敵モンスターに特殊能力を使う処理のメインルーチン / Monster tries to 'cast a spell' (or breath, etc) at another monster.
Definition: mspells2.c:269
Definition: monster-spell.h:6
bool summon_possible(POSITION y1, POSITION x1)
モンスターにとって所定の地点が召還に相応しい地点かどうかを返す。 / Determine if there is a space near the player in which a summoned ...
Definition: mspells1.c:382