1 #include "mspell/summon-checker.h"
2 #include "monster-attack/monster-attack-types.h"
3 #include "monster-race/monster-race-hook.h"
4 #include "monster-race/monster-race.h"
5 #include "monster-race/race-flags1.h"
6 #include "monster-race/race-flags2.h"
7 #include "monster-race/race-flags3.h"
8 #include "monster-race/race-flags4.h"
9 #include "monster-race/race-flags7.h"
10 #include "monster-race/race-flags8.h"
11 #include "monster-race/race-indice-types.h"
12 #include "monster/monster-util.h"
13 #include "player/player-race.h"
14 #include "spell/summon-types.h"
15 #include "util/string-processor.h"
18 * @brief 指定されたモンスター種族がsummon_specific_typeで指定された召喚条件に合うかどうかを返す
19 * @param player_ptr プレーヤーへの参照ポインタ
20 * @return 召喚条件が一致するならtrue
23 bool check_summon_specific(player_type *player_ptr, MONRACE_IDX summoner_idx, MONRACE_IDX r_idx)
25 monster_race *r_ptr = &r_info[r_idx];
26 bool is_match = FALSE;
27 switch (summon_specific_type) {
29 is_match = r_ptr->d_char == 'a';
32 is_match = r_ptr->d_char == 'S';
35 is_match = (r_ptr->d_char == 'C') || (r_ptr->d_char == 'Z');
38 is_match = r_ptr->d_char == 'M';
41 is_match = (r_ptr->d_char == 'A') && (((r_ptr->flags3 & RF3_EVIL) != 0) || ((r_ptr->flags3 & RF3_GOOD) != 0));
44 is_match = (r_ptr->flags3 & RF3_DEMON) != 0;
47 is_match = (r_ptr->flags3 & RF3_UNDEAD) != 0;
50 is_match = (r_ptr->flags3 & RF3_DRAGON) != 0;
52 case SUMMON_HI_UNDEAD:
53 is_match = (r_ptr->d_char == 'L') || (r_ptr->d_char == 'V') || (r_ptr->d_char == 'W');
55 case SUMMON_HI_DRAGON:
56 is_match = (r_ptr->d_char == 'D');
59 is_match = ((r_ptr->d_char == 'U') || (r_ptr->d_char == 'H') || (r_ptr->d_char == 'B')) && ((r_ptr->flags3 & RF3_DEMON) != 0);
61 case SUMMON_AMBERITES:
62 is_match = (r_ptr->flags3 & RF3_AMBERITE) != 0;
65 is_match = (r_ptr->flags1 & RF1_UNIQUE) != 0;
68 is_match = r_ptr->d_char == 'm';
71 is_match = r_ptr->d_char == 'b';
73 case SUMMON_QUYLTHULG:
74 is_match = r_ptr->d_char == 'Q';
76 case SUMMON_COIN_MIMIC:
77 is_match = r_ptr->d_char == '$';
80 is_match = ((r_ptr->d_char == '!') || (r_ptr->d_char == '?') || (r_ptr->d_char == '=') || (r_ptr->d_char == '$') || (r_ptr->d_char == '|'));
83 is_match = (r_ptr->d_char == 'g');
86 is_match = (r_ptr->d_char == 'U') && ((r_ptr->flags4 & RF4_ROCKET) != 0);
89 SYMBOL_CODE summon_kin_type = summoner_idx > 0 ? r_info[summoner_idx].d_char : get_summon_symbol_from_player(player_ptr);
90 is_match = (r_ptr->d_char == summon_kin_type) && (r_idx != MON_HAGURE);
94 is_match = r_idx == MON_DAWN;
97 is_match = (r_ptr->flags3 & RF3_ANIMAL) != 0;
99 case SUMMON_ANIMAL_RANGER:
100 is_match = ((r_ptr->flags3 & (RF3_ANIMAL)) && (angband_strchr("abcflqrwBCHIJKMRS", r_ptr->d_char)) && !(r_ptr->flags3 & (RF3_DRAGON))
101 && !(r_ptr->flags3 & (RF3_EVIL)) && !(r_ptr->flags3 & (RF3_UNDEAD)) && !(r_ptr->flags3 & (RF3_DEMON)) && !(r_ptr->flags2 & (RF2_MULTIPLY))
102 && !(r_ptr->flags4 || r_ptr->a_ability_flags1 || r_ptr->a_ability_flags2));
104 case SUMMON_SMALL_MOAI:
105 is_match = r_idx == MON_SMALL_MOAI;
108 is_match = one_in_(16) ? r_ptr->d_char == 'z' : r_idx == MON_SCARAB;
111 is_match = (r_idx == MON_PHANTOM_B) || (r_idx == MON_PHANTOM_W);
113 case SUMMON_BLUE_HORROR:
114 is_match = r_idx == MON_BLUE_HORROR;
116 case SUMMON_TOTEM_MOAI:
117 is_match = r_idx == MON_TOTEM_MOAI;
120 is_match = monster_living(r_idx);
122 case SUMMON_HI_DRAGON_LIVING:
123 is_match = ((r_ptr->d_char == 'D') && monster_living(r_idx));
125 case SUMMON_ELEMENTAL:
126 is_match = r_ptr->d_char == 'E';
129 is_match = r_ptr->d_char == 'v';
132 is_match = r_ptr->d_char == 'H';
135 is_match = r_ptr->d_char == 'B';
137 case SUMMON_KAMIKAZE:
138 for (int i = 0; i < 4; i++)
139 if (r_ptr->blow[i].method == RBM_EXPLODE)
143 case SUMMON_KAMIKAZE_LIVING:
144 for (int i = 0; i < 4; i++)
145 if (r_ptr->blow[i].method == RBM_EXPLODE)
148 is_match &= monster_living(r_idx);
151 is_match = r_idx == MON_MANES;
154 is_match = r_idx == MON_LOUSE;
156 case SUMMON_GUARDIANS:
157 is_match = (r_ptr->flags7 & RF7_GUARDIAN) != 0;
160 is_match = ((r_idx == MON_NOV_PALADIN) || (r_idx == MON_NOV_PALADIN_G) || (r_idx == MON_PALADIN) || (r_idx == MON_W_KNIGHT)
161 || (r_idx == MON_ULTRA_PALADIN) || (r_idx == MON_KNI_TEMPLAR));
164 is_match = (r_ptr->d_char == 'B') && ((r_ptr->flags8 & RF8_WILD_MOUNTAIN) != 0) && ((r_ptr->flags8 & RF8_WILD_ONLY) != 0);
166 case SUMMON_PIRANHAS:
167 is_match = r_idx == MON_PIRANHA;
169 case SUMMON_ARMAGE_GOOD:
170 is_match = (r_ptr->d_char == 'A') && ((r_ptr->flags3 & RF3_GOOD) != 0);
172 case SUMMON_ARMAGE_EVIL:
173 is_match = ((r_ptr->flags3 & RF3_DEMON) != 0) || ((r_ptr->d_char == 'A') && ((r_ptr->flags3 & RF3_EVIL) != 0));
175 case SUMMON_APOCRYPHA_FOLLOWERS:
176 is_match = (r_idx == MON_FOLLOWER_WARRIOR) || (r_idx == MON_FOLLOWER_MAGE);
178 case SUMMON_APOCRYPHA_DRAGONS:
179 is_match = (r_ptr->d_char == 'D') && (r_ptr->level >= 60) && (r_idx != MON_WYRM_COLOURS) && (r_idx != MON_ALDUIN);
182 is_match = r_idx == MON_VESPOID;