Hengband  2.2.1
monster.h
[詳解]
1 #pragma once
2 #include "monsterrace.h"
3 
5 
8 
9 /* Maximum "Nazguls" number */
10 #define MAX_NAZGUL_NUM 5
11 
12 #define MTIMED_CSLEEP 0 /* Monster is sleeping */
13 #define MTIMED_FAST 1 /* Monster is temporarily fast */
14 #define MTIMED_SLOW 2 /* Monster is temporarily slow */
15 #define MTIMED_STUNNED 3 /* Monster is stunned */
16 #define MTIMED_CONFUSED 4 /* Monster is confused */
17 #define MTIMED_MONFEAR 5 /* Monster is afraid */
18 #define MTIMED_INVULNER 6 /* Monster is temporarily invulnerable */
19 
20 #define MAX_MTIMED 7
21 
22 #define MON_CSLEEP(M_PTR) ((M_PTR)->mtimed[MTIMED_CSLEEP])
23 #define MON_FAST(M_PTR) ((M_PTR)->mtimed[MTIMED_FAST])
24 #define MON_SLOW(M_PTR) ((M_PTR)->mtimed[MTIMED_SLOW])
25 #define MON_STUNNED(M_PTR) ((M_PTR)->mtimed[MTIMED_STUNNED])
26 #define MON_CONFUSED(M_PTR) ((M_PTR)->mtimed[MTIMED_CONFUSED])
27 #define MON_MONFEAR(M_PTR) ((M_PTR)->mtimed[MTIMED_MONFEAR])
28 #define MON_INVULNER(M_PTR) ((M_PTR)->mtimed[MTIMED_INVULNER])
29 
30 /*
31  * Monster information, for a specific monster.
32  * Note: fy, fx constrain dungeon size to 256x256
33  * The "hold_o_idx" field points to the first object of a stack
34  * of objects (if any) being carried by the monster (see above).
35  */
36 
37 typedef struct monster_type monster_type;
38 
40 {
41  MONRACE_IDX r_idx; /* Monster race index 0 = dead. */
42  MONRACE_IDX ap_r_idx; /* Monster race appearance index */
43 
44  /* Sub-alignment flags for neutral monsters */
45  #define SUB_ALIGN_NEUTRAL 0x0000
46  #define SUB_ALIGN_EVIL 0x0001
47  #define SUB_ALIGN_GOOD 0x0002
48  BIT_FLAGS8 sub_align; /* Sub-alignment for a neutral monster */
49 
50  POSITION fy; /* Y location on map */
51  POSITION fx; /* X location on map */
52 
53  HIT_POINT hp; /* Current Hit points */
54  HIT_POINT maxhp; /* Max Hit points */
55  HIT_POINT max_maxhp; /* Max Max Hit points */
56  HIT_POINT dealt_damage; /* Sum of damages dealt by player */
57 
58  TIME_EFFECT mtimed[MAX_MTIMED]; /* Timed status counter */
59 
60  SPEED mspeed; /* Monster "speed" */
61  ACTION_ENERGY energy_need; /* Monster "energy" */
62 
63  POSITION cdis; /* Current dis from player */
64 
65  BIT_FLAGS8 mflag; /* Extra monster flags */
66 #define MFLAG_VIEW 0x01 /* Monster is in line of sight */
67 #define MFLAG_LOS 0x02 /* Monster is marked for project_all_los() */
68 #define MFLAG_XXX2 0x04 /* (unused) */
69 #define MFLAG_ETF 0x08 /* Monster is entering the field. */
70 #define MFLAG_BORN 0x10 /* Monster is still being born */
71 #define MFLAG_NICE 0x20 /* Monster is still being nice */
72 
73  BIT_FLAGS8 mflag2; /* Extra monster flags */
74 #define MFLAG2_KAGE 0x01 /* Monster is kage */
75 #define MFLAG2_NOPET 0x02 /* Cannot make monster pet */
76 #define MFLAG2_NOGENO 0x04 /* Cannot genocide */
77 #define MFLAG2_CHAMELEON 0x08 /* Monster is chameleon */
78 #define MFLAG2_NOFLOW 0x10 /* Monster is in no_flow_by_smell mode */
79 #define MFLAG2_SHOW 0x20 /* Monster is recently memorized */
80 #define MFLAG2_MARK 0x40 /* Monster is currently memorized */
81 
82  bool ml; /* Monster is "visible" */
83 
84  OBJECT_IDX hold_o_idx; /* Object being held (if any) */
85 
86  POSITION target_y; /* Can attack !los player */
87  POSITION target_x; /* Can attack !los player */
88 
89  STR_OFFSET nickname; /* Monster's Nickname */
90 
92 
93  /* TODO: クローン、ペット、有効化は意義が異なるので別変数に切り離すこと。save/loadのバージョン更新が面倒そうだけど */
94  BIT_FLAGS smart; /*!< Field for "smart_learn" - Some bit-flags for the "smart" field */
95 #define SM_RES_ACID 0x00000001 /*!< モンスターの学習フラグ: プレイヤーに酸耐性あり */
96 #define SM_RES_ELEC 0x00000002 /*!< モンスターの学習フラグ: プレイヤーに電撃耐性あり */
97 #define SM_RES_FIRE 0x00000004 /*!< モンスターの学習フラグ: プレイヤーに火炎耐性あり */
98 #define SM_RES_COLD 0x00000008 /*!< モンスターの学習フラグ: プレイヤーに冷気耐性あり */
99 #define SM_RES_POIS 0x00000010 /*!< モンスターの学習フラグ: プレイヤーに毒耐性あり */
100 #define SM_RES_NETH 0x00000020 /*!< モンスターの学習フラグ: プレイヤーに地獄耐性あり */
101 #define SM_RES_LITE 0x00000040 /*!< モンスターの学習フラグ: プレイヤーに閃光耐性あり */
102 #define SM_RES_DARK 0x00000080 /*!< モンスターの学習フラグ: プレイヤーに暗黒耐性あり */
103 #define SM_RES_FEAR 0x00000100 /*!< モンスターの学習フラグ: プレイヤーに恐怖耐性あり */
104 #define SM_RES_CONF 0x00000200 /*!< モンスターの学習フラグ: プレイヤーに混乱耐性あり */
105 #define SM_RES_CHAOS 0x00000400 /*!< モンスターの学習フラグ: プレイヤーにカオス耐性あり */
106 #define SM_RES_DISEN 0x00000800 /*!< モンスターの学習フラグ: プレイヤーに劣化耐性あり */
107 #define SM_RES_BLIND 0x00001000 /*!< モンスターの学習フラグ: プレイヤーに盲目耐性あり */
108 #define SM_RES_NEXUS 0x00002000 /*!< モンスターの学習フラグ: プレイヤーに因果混乱耐性あり */
109 #define SM_RES_SOUND 0x00004000 /*!< モンスターの学習フラグ: プレイヤーに轟音耐性あり */
110 #define SM_RES_SHARD 0x00008000 /*!< モンスターの学習フラグ: プレイヤーに破片耐性あり */
111 #define SM_OPP_ACID 0x00010000 /*!< モンスターの学習フラグ: プレイヤーに二重酸耐性あり */
112 #define SM_OPP_ELEC 0x00020000 /*!< モンスターの学習フラグ: プレイヤーに二重電撃耐性あり */
113 #define SM_OPP_FIRE 0x00040000 /*!< モンスターの学習フラグ: プレイヤーに二重火炎耐性あり */
114 #define SM_OPP_COLD 0x00080000 /*!< モンスターの学習フラグ: プレイヤーに二重冷気耐性あり */
115 #define SM_OPP_POIS 0x00100000 /*!< モンスターの学習フラグ: プレイヤーに二重毒耐性あり */
116 #define SM_OPP_XXX1 0x00200000 /*!< 未使用 / (unused) */
117 #define SM_CLONED 0x00400000 /*!< クローンである / Cloned */
118 #define SM_PET 0x00800000 /*!< ペットである / Pet */
119 #define SM_IMM_ACID 0x01000000 /*!< モンスターの学習フラグ: プレイヤーに酸免疫あり */
120 #define SM_IMM_ELEC 0x02000000 /*!< モンスターの学習フラグ: プレイヤーに電撃免疫あり */
121 #define SM_IMM_FIRE 0x04000000 /*!< モンスターの学習フラグ: プレイヤーに火炎免疫あり */
122 #define SM_IMM_COLD 0x08000000 /*!< モンスターの学習フラグ: プレイヤーに冷気免疫あり */
123 #define SM_FRIENDLY 0x10000000 /*!< 友好的である / Friendly */
124 #define SM_IMM_REFLECT 0x20000000 /*!< モンスターの学習フラグ: プレイヤーに反射あり */
125 #define SM_IMM_FREE 0x40000000 /*!< モンスターの学習フラグ: プレイヤーに麻痺耐性あり */
126 #define SM_IMM_MANA 0x80000000 /*!< モンスターの学習フラグ: プレイヤーにMPがない */
127 
129 };
130 
131 #define MON_BEGGAR 12
132 #define MON_LEPER 13
133 #define MON_BLACK_MARKET 14
134 #define MON_LION_HEART 19
135 #define MON_GHB 39
136 #define MON_NOV_PRIEST 45
137 #define MON_GRIP 53
138 #define MON_WOLF 54
139 #define MON_FANG 55
140 #define MON_LOUSE 69
141 #define MON_PIRANHA 70
142 #define MON_COPPER_COINS 85
143 #define MON_NOV_PALADIN 97
144 #define MON_GREEN_G 100
145 #define MON_NOV_PRIEST_G 109
146 #define MON_SILVER_COINS 117
147 #define MON_D_ELF 122
148 #define MON_MANES 128
149 #define MON_LOST_SOUL 133
150 #define MON_ROBIN_HOOD 138
151 #define MON_NOV_PALADIN_G 147
152 #define MON_PHANTOM_W 152
153 #define MON_WOUNDED_BEAR 159
154 #define MON_D_ELF_MAGE 178
155 #define MON_D_ELF_WARRIOR 182
156 #define MON_BLUE_HORROR 189
157 #define MON_GOLD_COINS 195
158 #define MON_VORPAL_BUNNY 205
159 #define MON_MASTER_YEEK 224
160 #define MON_PRIEST 225
161 #define MON_D_ELF_PRIEST 226
162 #define MON_TIGER 230
163 #define MON_MITHRIL_COINS 239
164 #define MON_DRUID 241
165 #define MON_PINK_HORROR 242
166 #define MON_HILL_GIANT 255
167 #define MON_WERERAT 270
168 #define MON_UMBER_HULK 283
169 #define MON_ORC_CAPTAIN 285
170 #define MON_BERSERKER 293
171 #define MON_IMP 296
172 #define MON_SHAGRAT 314
173 #define MON_GORBAG 315
174 #define MON_STONE_GIANT 321
175 #define MON_LIZARD_KING 332
176 #define MON_WYVERN 334
177 #define MON_SABRE_TIGER 339
178 #define MON_D_ELF_LORD 348
179 #define MON_FIRE_VOR 354
180 #define MON_WATER_VOR 355
181 #define MON_ARCH_VILE 357
182 #define MON_COLD_VOR 358
183 #define MON_ENERGY_VOR 359
184 #define MON_IRON_GOLEM 367
185 #define MON_JADE_MONK 370
186 #define MON_D_ELF_WARLOCK 375
187 #define MON_HAGEN 383
188 #define MON_MENELDOR 384
189 #define MON_PHANTOM_B 385
190 #define MON_C_CRAWLER 395
191 #define MON_XICLOTLAN 396
192 #define MON_D_ELF_DRUID 400
193 #define MON_TROLL_PRIEST 403
194 #define MON_GWAIHIR 410
195 #define MON_ANGEL 417
196 #define MON_ADAMANT_COINS 423
197 #define MON_COLBRAN 435
198 #define MON_SPIRIT_NAGA 436
199 #define MON_GACHAPIN 441
200 #define MON_BASILISK 453
201 #define MON_ARCHANGEL 456
202 #define MON_MITHRIL_GOLEM 464
203 #define MON_THORONDOR 468
204 #define MON_SHADOW_DRAKE 471
205 #define MON_GHOST 477
206 #define MON_OGRE_SHAMAN 479
207 #define MON_GHOUL_KING 483
208 #define MON_NINJA 485
209 #define MON_BICLOPS 490
210 #define MON_IVORY_MONK 492
211 #define MON_LOG_MASTER 498
212 #define MON_ETHER_DRAKE 504
213 #define MON_GOEMON 505
214 #define MON_CHERUB 511
215 #define MON_WATER_ELEM 512
216 #define MON_JURT 517
217 #define MON_LICH 518
218 #define MON_BLOODLETTER 523
219 #define MON_HALFLING_S 539
220 #define MON_GRAV_HOUND 540
221 #define MON_REVENANT 555
222 #define MON_RAAL 557
223 #define MON_COLOSSUS 558
224 #define MON_NIGHTBLADE 564
225 #define MON_ELDER_THING 569
226 #define MON_CRYPT_THING 577
227 #define MON_NEXUS_VOR 587
228 #define MON_PLASMA_VOR 588
229 #define MON_TIME_VOR 589
230 #define MON_M_MH_DRAGON 593
231 #define MON_MANDOR 598
232 #define MON_SHIM_VOR 600
233 #define MON_SERAPH 605
234 #define MON_BARON_HELL 609
235 #define MON_KAVLAX 616
236 #define MON_ETTIN 621
237 #define MON_VAMPIRE_LORD 623
238 #define MON_JUBJUB 640
239 #define MON_G_C_DRAKE 646
240 #define MON_CLUB_DEMON 648
241 #define MON_F_ANGEL 652
242 #define MON_D_ELF_SORC 657
243 #define MON_MASTER_LICH 658
244 #define MON_RINALDO 660
245 #define MON_ARCHON 661
246 #define MON_UND_BEHOLDER 664
247 #define MON_IRON_LICH 666
248 #define MON_JACK_SHADOWS 670
249 #define MON_LLOIGOR 682
250 #define MON_DREADMASTER 690
251 #define MON_DROLEM 691
252 #define MON_DAWN 693
253 #define MON_NAZGUL 696
254 #define MON_SMAUG 697
255 #define MON_STORMBRINGER 698
256 #define MON_ULTRA_PALADIN 699
257 #define MON_G_TITAN 702
258 #define MON_S_TYRANNO 705
259 #define MON_FAFNER 712
260 #define MON_G_BALROG 720
261 #define MON_TIME_HOUND 725
262 #define MON_PLASMA_HOUND 726
263 #define MON_BULLGATES 732
264 #define MON_SANTACLAUS 733
265 #define MON_LORD_CHAOS 737
266 #define MON_TINDALOS 739
267 #define MON_DEMILICH 742
268 #define MON_NIGHTCRAWLER 744
269 #define MON_CHAOS_VOR 751
270 #define MON_AETHER_VOR 752
271 #define MON_FUNDIN 762
272 #define MON_DWORKIN 763
273 #define MON_NIGHTWALKER 768
274 #define MON_RAPHAEL 769
275 #define MON_SARUMAN 771
276 #define MON_GANDALF 772
277 #define MON_BRAND 773
278 #define MON_SHADOWLORD 774
279 #define MON_ARCHLICH 776
280 #define MON_JABBERWOCK 778
281 #define MON_CHAOS_HOUND 779
282 #define MON_ULT_BEHOLDER 781
283 #define MON_SHAMBLER 786
284 #define MON_BLEYS 789
285 #define MON_FIONA 791
286 #define MON_SKY_DRAKE 793
287 #define MON_JULIAN 794
288 #define MON_BLACK_REAVER 798
289 #define MON_CAINE 799
290 #define MON_GERARD 807
291 #define MON_UNGOLIANT 808
292 #define MON_ATLACH_NACHA 809
293 #define MON_Y_GOLONAC 810
294 #define MON_AETHER_HOUND 811
295 #define MON_WARP_DEMON 812
296 #define MON_ERIC 813
297 #define MON_UNMAKER 815
298 #define MON_CYBER 816
299 #define MON_KLING 819
300 #define MON_CORWIN 820
301 #define MON_ANGMAR 825
302 #define MON_CANTORAS 830
303 #define MON_GODZILLA 832
304 #define MON_SPAWN_CTH 836
305 #define MON_SURTUR 837
306 #define MON_TARRASQUE 838
307 #define MON_LUNGORTHIN 839
308 #define MON_CYBER_KING 843
309 #define MON_WYRM_POWER 847
310 #define MON_NODENS 849
311 #define MON_JORMUNGAND 854
312 #define MON_DESTROYER 855
313 #define MON_GOTHMOG 856
314 #define MON_G_CTHULHU 857
315 #define MON_SAURON 858
316 #define MON_UNICORN_ORD 859
317 #define MON_OBERON 860
318 #define MON_MORGOTH 861
319 #define MON_SERPENT 862
320 #define MON_ONE_RING 864
321 #define MON_CAAWS 866
322 #define MON_CULVERIN 867
323 #define MON_EBONY_MONK 870
324 #define MON_HAGURE 871
325 #define MON_OROCHI 872
326 #define MON_ECHIZEN 873
327 #define MON_SPECT_WYRM 874
328 #define MON_DIO 878
329 #define MON_OHMU 879
330 #define MON_WONG 880
331 #define MON_ZOMBI_SERPENT 883
332 #define MON_D_ELF_SHADE 886
333 #define MON_MANA_HOUND 887
334 #define MON_VENOM_WYRM 890
335 #define MON_TROLL_KING 894
336 #define MON_BAZOOKER 896
337 #define MON_SHARD_VOR 897
338 #define MON_ELF_LORD 900
339 #define MON_MASTER_MYS 916
340 #define MON_G_MASTER_MYS 917
341 #define MON_IE 921
342 #define MON_TSUCHINOKO 926
343 #define MON_GCWADL 929
344 #define MON_LOCKE_CLONE 930
345 #define MON_CALDARM 931
346 #define MON_BANORLUPART 932
347 #define MON_BANOR 933
348 #define MON_LUPART 934
349 #define MON_KENSHIROU 936
350 #define MON_W_KNIGHT 938
351 #define MON_PLANETAR 942
352 #define MON_SOLAR 943
353 #define MON_BIKETAL 945
354 #define MON_RICH 948
355 #define MON_IKETA 949
356 #define MON_B_DEATH_SWORD 953
357 #define MON_YASE_HORSE 955
358 #define MON_HORSE 956
359 #define MON_BOTEI 963
360 #define MON_KAGE 964
361 #define MON_JAIAN 967
362 #define MON_BELD 973
363 #define MON_THAT_BAT 975
364 #define MON_SHUTEN 979
365 #define MON_FENGHUANG 988
366 #define MON_KIRIN 989
367 #define MON_BAHAMUT 1000
368 #define MON_SUKE 1001
369 #define MON_KAKU 1002
370 #define MON_GHOST_Q 1003
371 #define MON_PIP 1004
372 #define MON_A_GOLD 1010
373 #define MON_A_SILVER 1011
374 #define MON_ROLENTO 1013
375 #define MON_RAOU 1018
376 #define MON_SHURYUUDAN 1023
377 #define MON_WAHHA 1031
378 #define MON_DEBBY 1032
379 #define MON_KNI_TEMPLAR 1037
380 #define MON_PALADIN 1038
381 #define MON_CHAMELEON 1040
382 #define MON_CHAMELEON_K 1041
383 #define MON_TOPAZ_MONK 1047
384 #define MON_M_MINDCRAFTER 1056
385 #define MON_ELDER_VAMPIRE 1058
386 #define MON_NOBORTA 1059
387 #define MON_MORI_TROLL 1060
388 #define MON_BARNEY 1061
389 #define MON_GROO 1062
390 #define MON_LOUSY 1063
391 #define MON_WYRM_SPACE 1064
392 #define MON_JIZOTAKO 1065
393 #define MON_TANUKI 1067
394 #define MON_ALIEN_JURAL 1082
395 #define MON_HATOPOPPO 1083
396 #define MON_KOGAN 1096
397 
398 /*
399  * Bit flags for the place_monster_???() (etc)
400  */
401 #define PM_ALLOW_SLEEP 0x00000001 /*!< モンスター生成フラグ: 眠っている状態で生成されても良い */
402 #define PM_ALLOW_GROUP 0x00000002 /*!< モンスター生成フラグ: 集団生成されても良い */
403 #define PM_FORCE_FRIENDLY 0x00000004 /*!< モンスター生成フラグ: 必ず友好的に生成される */
404 #define PM_FORCE_PET 0x00000008 /*!< モンスター生成フラグ: 必ずペットとして生成される */
405 #define PM_NO_KAGE 0x00000010 /*!< モンスター生成フラグ: 必ずあやしい影としては生成されない */
406 #define PM_NO_PET 0x00000020 /*!< モンスター生成フラグ: 必ずペットとして生成されない */
407 #define PM_ALLOW_UNIQUE 0x00000040 /*!< モンスター生成フラグ: ユニークの選択生成を許可する */
408 #define PM_IGNORE_TERRAIN 0x00000080 /*!< モンスター生成フラグ: 侵入可能地形を考慮せずに生成する */
409 #define PM_HASTE 0x00000100 /*!< モンスター生成フラグ: 加速状態で生成する */
410 #define PM_KAGE 0x00000200 /*!< モンスター生成フラグ: 必ずあやしい影として生成する */
411 #define PM_MULTIPLY 0x00000400 /*!< モンスター生成フラグ: 増殖処理時として生成する */
412 
413 extern bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode);
414 extern bool place_monster(POSITION y, POSITION x, BIT_FLAGS mode);
415 extern bool alloc_horde(POSITION y, POSITION x);
416 extern bool alloc_guardian(bool def_val);
417 extern bool alloc_monster(POSITION dis, BIT_FLAGS mode);
418 
419 extern void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode);
420 /* Bit flags for monster_desc() */
421 #define MD_OBJECTIVE 0x00000001 /* Objective (or Reflexive) */
422 #define MD_POSSESSIVE 0x00000002 /* Possessive (or Reflexive) */
423 #define MD_INDEF_HIDDEN 0x00000004 /* Use indefinites for hidden monsters ("something") */
424 #define MD_INDEF_VISIBLE 0x00000008 /* Use indefinites for visible monsters ("a kobold") */
425 #define MD_PRON_HIDDEN 0x00000010 /* Pronominalize hidden monsters */
426 #define MD_PRON_VISIBLE 0x00000020 /* Pronominalize visible monsters */
427 #define MD_ASSUME_HIDDEN 0x00000040 /* Assume the monster is hidden */
428 #define MD_ASSUME_VISIBLE 0x00000080 /* Assume the monster is visible */
429 #define MD_TRUE_NAME 0x00000100 /* Chameleon's true name */
430 #define MD_IGNORE_HALLU 0x00000200 /* Ignore hallucination, and penetrate shape change */
431 
432 #define MD_WRONGDOER_NAME (MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE) /* 加害明記向け */
433 
434 extern void monster_name(MONSTER_IDX m_idx, char* m_name);
435 
436 extern void roff_top(MONRACE_IDX r_idx);
437 extern void screen_roff(MONRACE_IDX r_idx, BIT_FLAGS mode);
438 extern void display_roff(MONRACE_IDX r_idx);
439 extern void output_monster_spoiler(MONRACE_IDX r_idx, void(*roff_func)(TERM_COLOR attr, concptr str));
441 extern void monster_death(MONSTER_IDX m_idx, bool drop_item);
444 extern void set_friendly(monster_type *m_ptr);
445 extern void set_pet(monster_type *m_ptr);
446 extern void set_hostile(monster_type *m_ptr);
447 extern void anger_monster(monster_type *m_ptr);
448 
449 /*
450  * Bit flags for the *_can_enter() and monster_can_cross_terrain()
451  */
452 #define CEM_RIDING 0x0001
453 #define CEM_P_CAN_ENTER_PATTERN 0x0002
454 extern bool monster_can_cross_terrain(FEAT_IDX feat, monster_race *r_ptr, BIT_FLAGS16 mode);
455 extern bool monster_can_enter(POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode);
456 
457 extern bool are_enemies(monster_type *m_ptr1, monster_type *m_ptr2);
458 extern bool monster_has_hostile_align(monster_type *m_ptr, int pa_good, int pa_evil, monster_race *r_ptr);
459 extern void dice_to_string(int base_damage, int dice_num, int dice_side, int dice_mult, int dice_div, char* msg);
460 extern concptr look_mon_desc(monster_type *m_ptr, BIT_FLAGS mode);
461 extern int get_monster_crowd_number(MONSTER_IDX m_idx);
462 extern void message_pain(MONSTER_IDX m_idx, HIT_POINT dam);
463 
464 /* monster2.c */
465 extern void set_target(monster_type *m_ptr, POSITION y, POSITION x);
466 extern void reset_target(monster_type *m_ptr);
467 extern monster_race *real_r_ptr(monster_type *m_ptr);
468 extern MONRACE_IDX real_r_idx(monster_type *m_ptr);
469 extern void delete_monster_idx(MONSTER_IDX i);
470 extern void delete_monster(POSITION y, POSITION x);
471 extern void compact_monsters(int size);
472 extern void wipe_m_list(void);
473 extern MONSTER_IDX m_pop(void);
474 extern errr get_mon_num_prep(monsterrace_hook_type monster_hook, monsterrace_hook_type monster_hook2);
475 extern MONRACE_IDX get_mon_num(DEPTH level);
476 extern int lore_do_probe(MONRACE_IDX r_idx);
477 extern void lore_treasure(MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold);
478 extern void update_monster(MONSTER_IDX m_idx, bool full);
479 extern void update_monsters(bool full);
480 extern bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
481 
482 
483 /*
484  * Some things which induce learning
485  */
486 #define DRS_ACID 1
487 #define DRS_ELEC 2
488 #define DRS_FIRE 3
489 #define DRS_COLD 4
490 #define DRS_POIS 5
491 #define DRS_NETH 6
492 #define DRS_LITE 7
493 #define DRS_DARK 8
494 #define DRS_FEAR 9
495 #define DRS_CONF 10
496 #define DRS_CHAOS 11
497 #define DRS_DISEN 12
498 #define DRS_BLIND 13
499 #define DRS_NEXUS 14
500 #define DRS_SOUND 15
501 #define DRS_SHARD 16
502 #define DRS_FREE 30
503 #define DRS_MANA 31
504 #define DRS_REFLECT 32
505 extern void update_smart_learn(MONSTER_IDX m_idx, int what);
506 
507 extern void choose_new_monster(MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx);
508 extern SPEED get_mspeed(monster_race *r_ptr);
509 extern void monster_drop_carried_objects(monster_type *m_ptr);
510 
511 #define is_friendly(A) \
512  (bool)(((A)->smart & SM_FRIENDLY) ? TRUE : FALSE)
513 
514 #define is_friendly_idx(MONSTER_IDX) \
515  (bool)((MONSTER_IDX) > 0 && is_friendly(&p_ptr->current_floor_ptr->m_list[(MONSTER_IDX)]))
516 
517 #define is_pet(A) \
518  (bool)(((A)->smart & SM_PET) ? TRUE : FALSE)
519 
520 #define is_hostile(A) \
521  (bool)((is_friendly(A) || is_pet(A)) ? FALSE : TRUE)
522 
523 /* Hack -- Determine monster race appearance index is same as race index */
524 #define is_original_ap(A) \
525  (bool)(((A)->ap_r_idx == (A)->r_idx) ? TRUE : FALSE)
526 
527 #define is_original_ap_and_seen(A) \
528  (bool)((A)->ml && !p_ptr->image && ((A)->ap_r_idx == (A)->r_idx))
s16b OBJECT_IDX
ゲーム中のアイテムID型を定義
Definition: h-type.h:140
STR_OFFSET nickname
Definition: monster.h:89
MONSTER_IDX hack_m_idx
Definition: monster2.c:49
void output_monster_spoiler(MONRACE_IDX r_idx, void(*roff_func)(TERM_COLOR attr, concptr str))
モンスター詳細情報を自動スポイラー向けに出力する / Hack – output description of the given monster race
Definition: monster1.c:2119
Definition: monsterrace.h:48
bool monster_can_cross_terrain(FEAT_IDX feat, monster_race *r_ptr, BIT_FLAGS16 mode)
モンスターが地形を踏破できるかどうかを返す Check if monster can cross terrain
Definition: monster1.c:2275
void message_pain(MONSTER_IDX m_idx, HIT_POINT dam)
ダメージを受けたモンスターの様子を記述する / Dump a message describing a monster's reaction to damage
Definition: monster2.c:3595
void monster_name(MONSTER_IDX m_idx, char *m_name)
モンスターIDを取り、モンスター名をm_nameに代入する /
Definition: monster2.c:1622
const char * concptr
文字列定数用ポインタ定義 / A simple pointer (to unmodifiable strings)
Definition: h-type.h:47
void screen_roff(MONRACE_IDX r_idx, BIT_FLAGS mode)
モンスター情報の表示と共に画面を一時消去するサブルーチン / Hack – describe the given monster race at the top of the screen
Definition: monster1.c:2063
bool alloc_monster(POSITION dis, BIT_FLAGS mode)
ダンジョンの初期配置モンスターを生成1回生成する / Attempt to allocate a random monster in the dungeon.
Definition: monster2.c:3346
concptr look_mon_desc(monster_type *m_ptr, BIT_FLAGS mode)
Definition: monster1.c:3143
monsterrace_hook_type get_monster_hook(void)
プレイヤーの現在の広域マップ座標から得た地勢を元にモンスターの生成条件関数を返す
Definition: monster1.c:2133
MONRACE_IDX r_idx
Definition: monster.h:41
bool alloc_guardian(bool def_val)
ダンジョンの主生成を試みる / Put the Guardian
Definition: monster2.c:3301
static void roff_func(TERM_COLOR attr, concptr str)
関数ポインタ用の出力関数 / Hook function used in spoil_mon_info()
Definition: wizard1.c:1991
HIT_POINT max_maxhp
Definition: monster.h:55
s16b SPEED
ゲーム中の加速値の型定義
Definition: h-type.h:184
SPEED get_mspeed(monster_race *r_ptr)
モンスターの個体加速を設定する / Get initial monster speed
Definition: monster2.c:2469
Definition: monster.h:39
MONRACE_IDX ap_r_idx
Definition: monster.h:42
s32b EXP
ゲーム中の主経験値の型定義
Definition: h-type.h:199
void reset_target(monster_type *m_ptr)
モンスターの目標地点をリセットする / Reset the target of counter attack
Definition: monster2.c:71
void update_monster(MONSTER_IDX m_idx, bool full)
モンスターの各情報を更新する / This function updates the monster record of the given monster
Definition: monster2.c:1840
void monster_drop_carried_objects(monster_type *m_ptr)
モンスターが盗みや拾いで確保していたアイテムを全てドロップさせる / Drop all items carried by a monster
Definition: monster2.c:4034
POSITION fy
Definition: monster.h:50
void set_hostile(monster_type *m_ptr)
モンスターを敵に回す Makes the monster hostile towards the player
Definition: monster1.c:2233
HIT_POINT maxhp
Definition: monster.h:54
POSITION cdis
Definition: monster.h:63
HIT_POINT hp
Definition: monster.h:53
void wipe_m_list(void)
プレイヤーのフロア離脱に伴う全モンスター配列の消去 / Delete/Remove all the monsters when the player leaves the level
Definition: monster2.c:379
BIT_FLAGS8 mflag
Definition: monster.h:65
void delete_monster_idx(MONSTER_IDX i)
モンスター配列からモンスターを消去する / Delete a monster by index.
Definition: monster2.c:114
#define MAX_MTIMED
Definition: monster.h:20
s32b DEPTH
ゲーム中の階層レベルの型定義
Definition: h-type.h:216
POSITION target_x
Definition: monster.h:87
MONSTER_IDX hack_m_idx_ii
Definition: monster2.c:50
s16b MONRACE_IDX
ゲーム中のモンスター種族ID型を定義
Definition: h-type.h:128
SPEED mspeed
Definition: monster.h:60
s32b ITEM_NUMBER
ゲーム中のアイテム数型を定義
Definition: h-type.h:178
s32b HIT_POINT
HPとその増減量の型定義
Definition: h-type.h:161
MONRACE_IDX get_mon_num(DEPTH level)
生成モンスター種族を1種生成テーブルから選択する
Definition: monster2.c:1125
u32b BIT_FLAGS
32ビットのフラグ配列の型定義
Definition: h-type.h:225
int lore_do_probe(MONRACE_IDX r_idx)
モンスターの調査による思い出補完処理 / Learn about a monster (by "probing" it)
Definition: monster2.c:1636
int errr
エラーコードの定義 / Error codes for function return values
Definition: h-type.h:57
void roff_top(MONRACE_IDX r_idx)
モンスター情報のヘッダを記述する Hack – Display the "name" and "attr/chars" of a monster race
Definition: monster1.c:1997
bool alloc_horde(POSITION y, POSITION x)
指定地点に1種類のモンスター種族による群れを生成する
Definition: monster2.c:3241
s32b POSITION
ゲーム中の座標型を定義
Definition: h-type.h:146
void dice_to_string(int base_damage, int dice_num, int dice_side, int dice_mult, int dice_div, char *msg)
ダイス目を文字列に変換する
Definition: monster1.c:153
concptr extract_note_dies(MONRACE_IDX r_idx)
モンスターを撃破した際の述語メッセージを返す / Return monster death string
Definition: monster1.c:3119
int get_monster_crowd_number(MONSTER_IDX m_idx)
指定したモンスターに隣接しているモンスターの数を返す。 / Count number of adjacent monsters
Definition: monster2.c:4070
errr get_mon_num_prep(monsterrace_hook_type monster_hook, monsterrace_hook_type monster_hook2)
モンスター生成制限関数最大2つから / Apply a "monster restriction function" to the "monster allocation table"
Definition: monster2.c:1039
bool are_enemies(monster_type *m_ptr1, monster_type *m_ptr2)
モンスターの属性の基づいた敵対関係の有無を返す Check if two monsters are enemies
Definition: monster1.c:2403
u16b BIT_FLAGS16
16ビットのフラグ配列の型定義
Definition: h-type.h:226
OBJECT_IDX hold_o_idx
Definition: monster.h:84
bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode)
モンスターを増殖生成する / Let the given monster attempt to reproduce.
Definition: monster2.c:3561
void monster_death(MONSTER_IDX m_idx, bool drop_item)
モンスターが死亡した時の処理 / Handle the "death" of a monster.
Definition: monster1.c:2517
void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode)
モンスターの呼称を作成する / Build a string describing a monster in some way.
Definition: monster2.c:1339
void compact_monsters(int size)
モンスター情報配列を圧縮する / Compact and Reorder the monster list
Definition: monster2.c:290
bool ml
Definition: monster.h:82
byte BIT_FLAGS8
8ビットのフラグ配列の型定義
Definition: h-type.h:227
u32b STR_OFFSET
テキストオフセットの型定義
Definition: h-type.h:212
byte TERM_COLOR
テキスト表示色の型定義
Definition: h-type.h:237
void display_roff(MONRACE_IDX r_idx)
モンスター情報の現在のウィンドウに表示する / Hack – describe the given monster race in the current "term" window
Definition: monster1.c:2088
POSITION target_y
Definition: monster.h:86
void set_friendly(monster_type *m_ptr)
モンスターを友好的にする
Definition: monster1.c:2208
MONSTER_IDX m_pop(void)
モンスター配列の空きを探す / Acquires and returns the index of a "free" monster.
Definition: monster2.c:452
TERM_COLOR attr
Definition: view-mainwindow.c:342
MONRACE_IDX real_r_idx(monster_type *m_ptr)
Definition: monster2.c:87
void update_monsters(bool full)
単純に生存している全モンスターの更新処理を行う / This function simply updates all the (non-dead) monsters (see above).
Definition: monster2.c:2213
bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
一般的なモンスター生成処理のサブルーチン / Attempt to place a monster of the given race at the given location
Definition: monster2.c:3133
void delete_monster(POSITION y, POSITION x)
指定位置に存在するモンスターを削除する / Delete the monster, if any, at a given location
Definition: monster2.c:184
s16b MONSTER_IDX
ゲーム中のモンスター個体ID型を定義
Definition: h-type.h:129
HIT_POINT dealt_damage
Definition: monster.h:56
void update_smart_learn(MONSTER_IDX m_idx, int what)
SMART(適格に攻撃を行う)モンスターの学習状況を更新する / Learn about an "observed" resistance.
Definition: monster2.c:3923
BIT_FLAGS smart
Field for "smart_learn" - Some bit-flags for the "smart" field
Definition: monster.h:94
char bool
bool型をcharとして定義 / Note that a bool is smaller than a full "int" / Simple True/False type
Definition: h-type.h:83
void choose_new_monster(MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx)
モンスターの変身処理
Definition: monster2.c:2308
BIT_FLAGS8 sub_align
Definition: monster.h:48
s16b TIME_EFFECT
ゲーム中の時限期間の型を定義
Definition: h-type.h:182
BIT_FLAGS8 mflag2
Definition: monster.h:73
MONSTER_IDX parent_m_idx
Definition: monster.h:128
monsterrace_hook_type get_monster_hook2(POSITION y, POSITION x)
指定された広域マップ座標の地勢を元にモンスターの生成条件関数を返す
Definition: monster1.c:2172
bool(* monsterrace_hook_type)(MONRACE_IDX r_idx)
Definition: monster.h:4
s16b ACTION_ENERGY
ゲーム中の行動エネルギー型を定義
Definition: h-type.h:180
void set_target(monster_type *m_ptr, POSITION y, POSITION x)
モンスターの目標地点をセットする / Set the target of counter attack
Definition: monster2.c:59
void set_pet(monster_type *m_ptr)
モンスターをペットにする
Definition: monster1.c:2218
bool monster_can_enter(POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode)
指定された座標の地形をモンスターが踏破できるかどうかを返す Strictly check if monster can enter the grid
Definition: monster1.c:2363
POSITION fx
Definition: monster.h:51
void anger_monster(monster_type *m_ptr)
モンスターを怒らせる Anger the monster
Definition: monster1.c:2247
monster_race * real_r_ptr(monster_type *m_ptr)
モンスターの真の種族を返す / Extract monster race pointer of a monster's true form
Definition: monster2.c:82
bool place_monster(POSITION y, POSITION x, BIT_FLAGS mode)
一般的なモンスター生成処理のメインルーチン / Attempt to place a monster of the given race at the given location
Definition: monster2.c:3218
EXP exp
Definition: monster.h:91
TIME_EFFECT mtimed[MAX_MTIMED]
Definition: monster.h:58
void lore_treasure(MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold)
モンスターの撃破に伴うドロップ情報の保管処理 / Take note that the given monster just dropped some treasure
Definition: monster2.c:1753
bool monster_has_hostile_align(monster_type *m_ptr, int pa_good, int pa_evil, monster_race *r_ptr)
モンスターがプレイヤーに対して敵意を抱くかどうかを返す Check if this monster race has "hostile" alignment
Definition: monster1.c:2448
ACTION_ENERGY energy_need
Definition: monster.h:61
s16b FEAT_IDX
ゲーム中の地形ID型を定義
Definition: h-type.h:115