The master and develop branches track hengband.
OS X development happens on the macos-1-6-2, macos-2-2-1, and macos-develop branches.
修订版 | 2a86bb3601eeee1cf6e645068a599a540525ea6b (tree) |
---|---|
时间 | 2020-11-13 01:36:55 |
作者 | Eric Branlund <ebranlund@fast...> |
Commiter | Eric Branlund |
Merge branch 'For2.2.2-Refactoring' into For2.2.2-Refactoring-Cocoa2
@@ -307,6 +307,7 @@ | ||
307 | 307 | <ClCompile Include="..\..\src\mind\mind-power-getter.c" /> |
308 | 308 | <ClCompile Include="..\..\src\mind\mind-priest.c" /> |
309 | 309 | <ClCompile Include="..\..\src\mind\mind-weaponsmith.c" /> |
310 | + <ClCompile Include="..\..\src\monster-attack\monster-attack-lose.c" /> | |
310 | 311 | <ClCompile Include="..\..\src\monster-floor\monster-death-util.c" /> |
311 | 312 | <ClCompile Include="..\..\src\monster-floor\monster-lite-util.c" /> |
312 | 313 | <ClCompile Include="..\..\src\monster-floor\monster-lite.c" /> |
@@ -961,6 +962,7 @@ | ||
961 | 962 | <ClInclude Include="..\..\src\mind\mind-priest.h" /> |
962 | 963 | <ClInclude Include="..\..\src\mind\mind-types.h" /> |
963 | 964 | <ClInclude Include="..\..\src\mind\mind-weaponsmith.h" /> |
965 | + <ClInclude Include="..\..\src\monster-attack\monster-attack-lose.h" /> | |
964 | 966 | <ClInclude Include="..\..\src\monster-floor\monster-death-util.h" /> |
965 | 967 | <ClInclude Include="..\..\src\monster-floor\monster-lite-util.h" /> |
966 | 968 | <ClInclude Include="..\..\src\monster-floor\monster-lite.h" /> |
@@ -2177,8 +2177,13 @@ | ||
2177 | 2177 | <ClCompile Include="..\..\src\player\player-status-resist.c"> |
2178 | 2178 | <Filter>player</Filter> |
2179 | 2179 | </ClCompile> |
2180 | +<<<<<<< HEAD | |
2180 | 2181 | <ClCompile Include="..\..\src\io\record-play-movie.c"> |
2181 | 2182 | <Filter>io</Filter> |
2183 | +======= | |
2184 | + <ClCompile Include="..\..\src\monster-attack\monster-attack-lose.c"> | |
2185 | + <Filter>monster-attack</Filter> | |
2186 | +>>>>>>> 057055900... [Refactor] #37285 Separated monster-attach-lose.c/h from monster-attack-switcher.c | |
2182 | 2187 | </ClCompile> |
2183 | 2188 | </ItemGroup> |
2184 | 2189 | <ItemGroup> |
@@ -4714,8 +4719,13 @@ | ||
4714 | 4719 | <ClInclude Include="..\..\src\player\player-status-resist.h"> |
4715 | 4720 | <Filter>player</Filter> |
4716 | 4721 | </ClInclude> |
4722 | +<<<<<<< HEAD | |
4717 | 4723 | <ClInclude Include="..\..\src\io\record-play-movie.h"> |
4718 | 4724 | <Filter>io</Filter> |
4725 | +======= | |
4726 | + <ClInclude Include="..\..\src\monster-attack\monster-attack-lose.h"> | |
4727 | + <Filter>monster-attack</Filter> | |
4728 | +>>>>>>> 057055900... [Refactor] #37285 Separated monster-attach-lose.c/h from monster-attack-switcher.c | |
4719 | 4729 | </ClInclude> |
4720 | 4730 | </ItemGroup> |
4721 | 4731 | <ItemGroup> |
@@ -466,6 +466,7 @@ hengband_SOURCES = \ | ||
466 | 466 | monster-attack/insults-moans.c monster-attack/insults-moans.h \ |
467 | 467 | monster-attack/monster-attack-describer.c monster-attack/monster-attack-describer.h \ |
468 | 468 | monster-attack/monster-attack-effect.h \ |
469 | + monster-attack/monster-attack-lose.c monster-attack/monster-attack-lose.h \ | |
469 | 470 | monster-attack/monster-attack-player.c monster-attack/monster-attack-player.h \ |
470 | 471 | monster-attack/monster-attack-processor.c monster-attack/monster-attack-processor.h \ |
471 | 472 | monster-attack/monster-attack-status.c monster-attack/monster-attack-status.h \ |
@@ -5,527 +5,551 @@ | ||
5 | 5 | #include "monster-race/race-flags1.h" |
6 | 6 | #include "monster-race/race-flags3.h" |
7 | 7 | #include "monster-race/race-indice-types.h" |
8 | +#include "monster/monster-info.h" | |
8 | 9 | #include "monster/monster-status-setter.h" |
9 | 10 | #include "monster/monster-status.h" |
10 | -#include "monster/monster-info.h" | |
11 | 11 | |
12 | 12 | process_result effect_monster_void(effect_monster_type *em_ptr) |
13 | 13 | { |
14 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
14 | + if (em_ptr->seen) | |
15 | + em_ptr->obvious = TRUE; | |
15 | 16 | |
16 | - return PROCESS_CONTINUE; | |
17 | + return PROCESS_CONTINUE; | |
17 | 18 | } |
18 | 19 | |
19 | 20 | process_result effect_monster_acid(player_type *caster_ptr, effect_monster_type *em_ptr) |
20 | 21 | { |
21 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
22 | - if ((em_ptr->r_ptr->flagsr & RFR_IM_ACID) == 0) return PROCESS_CONTINUE; | |
22 | + if (em_ptr->seen) | |
23 | + em_ptr->obvious = TRUE; | |
23 | 24 | |
24 | - em_ptr->note = _("にはかなり耐性がある!", " resists a lot."); | |
25 | - em_ptr->dam /= 9; | |
26 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
27 | - em_ptr->r_ptr->r_flagsr |= (RFR_IM_ACID); | |
25 | + if ((em_ptr->r_ptr->flagsr & RFR_IM_ACID) == 0) | |
26 | + return PROCESS_CONTINUE; | |
28 | 27 | |
29 | - return PROCESS_CONTINUE; | |
30 | -} | |
28 | + em_ptr->note = _("にはかなり耐性がある!", " resists a lot."); | |
29 | + em_ptr->dam /= 9; | |
30 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
31 | + em_ptr->r_ptr->r_flagsr |= (RFR_IM_ACID); | |
31 | 32 | |
33 | + return PROCESS_CONTINUE; | |
34 | +} | |
32 | 35 | |
33 | 36 | process_result effect_monster_elec(player_type *caster_ptr, effect_monster_type *em_ptr) |
34 | 37 | { |
35 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
36 | - if ((em_ptr->r_ptr->flagsr & RFR_IM_ELEC) == 0) return PROCESS_CONTINUE; | |
38 | + if (em_ptr->seen) | |
39 | + em_ptr->obvious = TRUE; | |
37 | 40 | |
38 | - em_ptr->note = _("にはかなり耐性がある!", " resists a lot."); | |
39 | - em_ptr->dam /= 9; | |
40 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
41 | - em_ptr->r_ptr->r_flagsr |= (RFR_IM_ELEC); | |
41 | + if ((em_ptr->r_ptr->flagsr & RFR_IM_ELEC) == 0) | |
42 | + return PROCESS_CONTINUE; | |
42 | 43 | |
43 | - return PROCESS_CONTINUE; | |
44 | -} | |
44 | + em_ptr->note = _("にはかなり耐性がある!", " resists a lot."); | |
45 | + em_ptr->dam /= 9; | |
46 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
47 | + em_ptr->r_ptr->r_flagsr |= (RFR_IM_ELEC); | |
45 | 48 | |
49 | + return PROCESS_CONTINUE; | |
50 | +} | |
46 | 51 | |
47 | 52 | process_result effect_monster_fire(player_type *caster_ptr, effect_monster_type *em_ptr) |
48 | 53 | { |
49 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
50 | - if (em_ptr->r_ptr->flagsr & RFR_IM_FIRE) | |
51 | - { | |
52 | - em_ptr->note = _("にはかなり耐性がある!", " resists a lot."); | |
53 | - em_ptr->dam /= 9; | |
54 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
55 | - em_ptr->r_ptr->r_flagsr |= (RFR_IM_FIRE); | |
54 | + if (em_ptr->seen) | |
55 | + em_ptr->obvious = TRUE; | |
56 | 56 | |
57 | - return PROCESS_CONTINUE; | |
58 | - } | |
57 | + if (em_ptr->r_ptr->flagsr & RFR_IM_FIRE) { | |
58 | + em_ptr->note = _("にはかなり耐性がある!", " resists a lot."); | |
59 | + em_ptr->dam /= 9; | |
60 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
61 | + em_ptr->r_ptr->r_flagsr |= (RFR_IM_FIRE); | |
59 | 62 | |
60 | - if ((em_ptr->r_ptr->flags3 & (RF3_HURT_FIRE)) == 0) return PROCESS_CONTINUE; | |
63 | + return PROCESS_CONTINUE; | |
64 | + } | |
61 | 65 | |
62 | - em_ptr->note = _("はひどい痛手をうけた。", " is hit hard."); | |
63 | - em_ptr->dam *= 2; | |
64 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
65 | - em_ptr->r_ptr->r_flags3 |= (RF3_HURT_FIRE); | |
66 | + if ((em_ptr->r_ptr->flags3 & (RF3_HURT_FIRE)) == 0) | |
67 | + return PROCESS_CONTINUE; | |
66 | 68 | |
67 | - return PROCESS_CONTINUE; | |
68 | -} | |
69 | + em_ptr->note = _("はひどい痛手をうけた。", " is hit hard."); | |
70 | + em_ptr->dam *= 2; | |
71 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
72 | + em_ptr->r_ptr->r_flags3 |= (RF3_HURT_FIRE); | |
69 | 73 | |
74 | + return PROCESS_CONTINUE; | |
75 | +} | |
70 | 76 | |
71 | 77 | process_result effect_monster_cold(player_type *caster_ptr, effect_monster_type *em_ptr) |
72 | 78 | { |
73 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
74 | - if (em_ptr->r_ptr->flagsr & RFR_IM_COLD) | |
75 | - { | |
76 | - em_ptr->note = _("にはかなり耐性がある!", " resists a lot."); | |
77 | - em_ptr->dam /= 9; | |
78 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
79 | - em_ptr->r_ptr->r_flagsr |= (RFR_IM_COLD); | |
79 | + if (em_ptr->seen) | |
80 | + em_ptr->obvious = TRUE; | |
80 | 81 | |
81 | - return PROCESS_CONTINUE; | |
82 | - } | |
82 | + if (em_ptr->r_ptr->flagsr & RFR_IM_COLD) { | |
83 | + em_ptr->note = _("にはかなり耐性がある!", " resists a lot."); | |
84 | + em_ptr->dam /= 9; | |
85 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
86 | + em_ptr->r_ptr->r_flagsr |= (RFR_IM_COLD); | |
83 | 87 | |
84 | - if ((em_ptr->r_ptr->flags3 & (RF3_HURT_COLD)) == 0) return PROCESS_CONTINUE; | |
88 | + return PROCESS_CONTINUE; | |
89 | + } | |
85 | 90 | |
86 | - em_ptr->note = _("はひどい痛手をうけた。", " is hit hard."); | |
87 | - em_ptr->dam *= 2; | |
88 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
89 | - em_ptr->r_ptr->r_flags3 |= (RF3_HURT_COLD); | |
91 | + if ((em_ptr->r_ptr->flags3 & (RF3_HURT_COLD)) == 0) | |
92 | + return PROCESS_CONTINUE; | |
90 | 93 | |
91 | - return PROCESS_CONTINUE; | |
92 | -} | |
94 | + em_ptr->note = _("はひどい痛手をうけた。", " is hit hard."); | |
95 | + em_ptr->dam *= 2; | |
96 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
97 | + em_ptr->r_ptr->r_flags3 |= (RF3_HURT_COLD); | |
93 | 98 | |
99 | + return PROCESS_CONTINUE; | |
100 | +} | |
94 | 101 | |
95 | 102 | process_result effect_monster_pois(player_type *caster_ptr, effect_monster_type *em_ptr) |
96 | 103 | { |
97 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
98 | - if ((em_ptr->r_ptr->flagsr & RFR_IM_POIS) == 0) return PROCESS_CONTINUE; | |
104 | + if (em_ptr->seen) | |
105 | + em_ptr->obvious = TRUE; | |
99 | 106 | |
100 | - em_ptr->note = _("にはかなり耐性がある!", " resists a lot."); | |
101 | - em_ptr->dam /= 9; | |
102 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
103 | - em_ptr->r_ptr->r_flagsr |= (RFR_IM_POIS); | |
107 | + if ((em_ptr->r_ptr->flagsr & RFR_IM_POIS) == 0) | |
108 | + return PROCESS_CONTINUE; | |
104 | 109 | |
105 | - return PROCESS_CONTINUE; | |
106 | -} | |
110 | + em_ptr->note = _("にはかなり耐性がある!", " resists a lot."); | |
111 | + em_ptr->dam /= 9; | |
112 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
113 | + em_ptr->r_ptr->r_flagsr |= (RFR_IM_POIS); | |
107 | 114 | |
115 | + return PROCESS_CONTINUE; | |
116 | +} | |
108 | 117 | |
109 | 118 | process_result effect_monster_nuke(player_type *caster_ptr, effect_monster_type *em_ptr) |
110 | 119 | { |
111 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
112 | - if (em_ptr->r_ptr->flagsr & RFR_IM_POIS) | |
113 | - { | |
114 | - em_ptr->note = _("には耐性がある。", " resists."); | |
115 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
116 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
117 | - em_ptr->r_ptr->r_flagsr |= (RFR_IM_POIS); | |
120 | + if (em_ptr->seen) | |
121 | + em_ptr->obvious = TRUE; | |
118 | 122 | |
119 | - return PROCESS_CONTINUE; | |
120 | - } | |
123 | + if (em_ptr->r_ptr->flagsr & RFR_IM_POIS) { | |
124 | + em_ptr->note = _("には耐性がある。", " resists."); | |
125 | + em_ptr->dam *= 3; | |
126 | + em_ptr->dam /= randint1(6) + 6; | |
127 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
128 | + em_ptr->r_ptr->r_flagsr |= (RFR_IM_POIS); | |
121 | 129 | |
122 | - if (one_in_(3)) em_ptr->do_polymorph = TRUE; | |
130 | + return PROCESS_CONTINUE; | |
131 | + } | |
123 | 132 | |
124 | - return PROCESS_CONTINUE; | |
125 | -} | |
133 | + if (one_in_(3)) | |
134 | + em_ptr->do_polymorph = TRUE; | |
126 | 135 | |
136 | + return PROCESS_CONTINUE; | |
137 | +} | |
127 | 138 | |
128 | 139 | process_result effect_monster_hell_fire(player_type *caster_ptr, effect_monster_type *em_ptr) |
129 | 140 | { |
130 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
131 | - if ((em_ptr->r_ptr->flags3 & RF3_GOOD) == 0) return PROCESS_CONTINUE; | |
141 | + if (em_ptr->seen) | |
142 | + em_ptr->obvious = TRUE; | |
132 | 143 | |
133 | - em_ptr->note = _("はひどい痛手をうけた。", " is hit hard."); | |
134 | - em_ptr->dam *= 2; | |
135 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
136 | - em_ptr->r_ptr->r_flags3 |= RF3_GOOD; | |
144 | + if ((em_ptr->r_ptr->flags3 & RF3_GOOD) == 0) | |
145 | + return PROCESS_CONTINUE; | |
137 | 146 | |
138 | - return PROCESS_CONTINUE; | |
139 | -} | |
147 | + em_ptr->note = _("はひどい痛手をうけた。", " is hit hard."); | |
148 | + em_ptr->dam *= 2; | |
149 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
150 | + em_ptr->r_ptr->r_flags3 |= RF3_GOOD; | |
140 | 151 | |
152 | + return PROCESS_CONTINUE; | |
153 | +} | |
141 | 154 | |
142 | 155 | process_result effect_monster_holy_fire(player_type *caster_ptr, effect_monster_type *em_ptr) |
143 | 156 | { |
144 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
145 | - if ((em_ptr->r_ptr->flags3 & RF3_EVIL) == 0) | |
146 | - { | |
147 | - em_ptr->note = _("には耐性がある。", " resists."); | |
148 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
149 | - return PROCESS_CONTINUE; | |
150 | - } | |
151 | - | |
152 | - em_ptr->dam *= 2; | |
153 | - em_ptr->note = _("はひどい痛手をうけた。", " is hit hard."); | |
154 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
155 | - em_ptr->r_ptr->r_flags3 |= RF3_EVIL; | |
156 | - | |
157 | - return PROCESS_CONTINUE; | |
157 | + if (em_ptr->seen) | |
158 | + em_ptr->obvious = TRUE; | |
159 | + | |
160 | + if ((em_ptr->r_ptr->flags3 & RF3_EVIL) == 0) { | |
161 | + em_ptr->note = _("には耐性がある。", " resists."); | |
162 | + em_ptr->dam *= 3; | |
163 | + em_ptr->dam /= randint1(6) + 6; | |
164 | + return PROCESS_CONTINUE; | |
165 | + } | |
166 | + | |
167 | + em_ptr->dam *= 2; | |
168 | + em_ptr->note = _("はひどい痛手をうけた。", " is hit hard."); | |
169 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
170 | + em_ptr->r_ptr->r_flags3 |= RF3_EVIL; | |
171 | + | |
172 | + return PROCESS_CONTINUE; | |
158 | 173 | } |
159 | 174 | |
160 | - | |
161 | 175 | process_result effect_monster_plasma(player_type *caster_ptr, effect_monster_type *em_ptr) |
162 | 176 | { |
163 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
164 | - if ((em_ptr->r_ptr->flagsr & RFR_RES_PLAS) == 0) return PROCESS_CONTINUE; | |
177 | + if (em_ptr->seen) | |
178 | + em_ptr->obvious = TRUE; | |
165 | 179 | |
166 | - em_ptr->note = _("には耐性がある。", " resists."); | |
167 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
168 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
169 | - em_ptr->r_ptr->r_flagsr |= (RFR_RES_PLAS); | |
180 | + if ((em_ptr->r_ptr->flagsr & RFR_RES_PLAS) == 0) | |
181 | + return PROCESS_CONTINUE; | |
170 | 182 | |
171 | - return PROCESS_CONTINUE; | |
172 | -} | |
183 | + em_ptr->note = _("には耐性がある。", " resists."); | |
184 | + em_ptr->dam *= 3; | |
185 | + em_ptr->dam /= randint1(6) + 6; | |
186 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
187 | + em_ptr->r_ptr->r_flagsr |= (RFR_RES_PLAS); | |
173 | 188 | |
189 | + return PROCESS_CONTINUE; | |
190 | +} | |
174 | 191 | |
175 | 192 | static bool effect_monster_nether_resist(player_type *caster_ptr, effect_monster_type *em_ptr) |
176 | 193 | { |
177 | - if ((em_ptr->r_ptr->flagsr & RFR_RES_NETH) == 0) return FALSE; | |
178 | - | |
179 | - if (em_ptr->r_ptr->flags3 & RF3_UNDEAD) | |
180 | - { | |
181 | - em_ptr->note = _("には完全な耐性がある!", " is immune."); | |
182 | - em_ptr->dam = 0; | |
183 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
184 | - em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD); | |
185 | - } | |
186 | - else | |
187 | - { | |
188 | - em_ptr->note = _("には耐性がある。", " resists."); | |
189 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
190 | - } | |
191 | - | |
192 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
193 | - em_ptr->r_ptr->r_flagsr |= (RFR_RES_NETH); | |
194 | - | |
195 | - return TRUE; | |
194 | + if ((em_ptr->r_ptr->flagsr & RFR_RES_NETH) == 0) | |
195 | + return FALSE; | |
196 | + | |
197 | + if (em_ptr->r_ptr->flags3 & RF3_UNDEAD) { | |
198 | + em_ptr->note = _("には完全な耐性がある!", " is immune."); | |
199 | + em_ptr->dam = 0; | |
200 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
201 | + em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD); | |
202 | + } else { | |
203 | + em_ptr->note = _("には耐性がある。", " resists."); | |
204 | + em_ptr->dam *= 3; | |
205 | + em_ptr->dam /= randint1(6) + 6; | |
206 | + } | |
207 | + | |
208 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
209 | + em_ptr->r_ptr->r_flagsr |= (RFR_RES_NETH); | |
210 | + | |
211 | + return TRUE; | |
196 | 212 | } |
197 | 213 | |
198 | - | |
199 | 214 | process_result effect_monster_nether(player_type *caster_ptr, effect_monster_type *em_ptr) |
200 | 215 | { |
201 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
216 | + if (em_ptr->seen) | |
217 | + em_ptr->obvious = TRUE; | |
202 | 218 | |
203 | - if (effect_monster_nether_resist(caster_ptr, em_ptr)) return PROCESS_CONTINUE; | |
204 | - if ((em_ptr->r_ptr->flags3 & RF3_EVIL) == 0) return PROCESS_CONTINUE; | |
219 | + if (effect_monster_nether_resist(caster_ptr, em_ptr) || ((em_ptr->r_ptr->flags3 & RF3_EVIL) == 0)) | |
220 | + return PROCESS_CONTINUE; | |
205 | 221 | |
206 | - em_ptr->note = _("はいくらか耐性を示した。", " resists somewhat."); | |
207 | - em_ptr->dam /= 2; | |
208 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
209 | - em_ptr->r_ptr->r_flags3 |= (RF3_EVIL); | |
222 | + em_ptr->note = _("はいくらか耐性を示した。", " resists somewhat."); | |
223 | + em_ptr->dam /= 2; | |
224 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
225 | + em_ptr->r_ptr->r_flags3 |= (RF3_EVIL); | |
210 | 226 | |
211 | - return PROCESS_CONTINUE; | |
227 | + return PROCESS_CONTINUE; | |
212 | 228 | } |
213 | 229 | |
214 | - | |
215 | 230 | process_result effect_monster_water(player_type *caster_ptr, effect_monster_type *em_ptr) |
216 | 231 | { |
217 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
218 | - if ((em_ptr->r_ptr->flagsr & RFR_RES_WATE) == 0) return PROCESS_CONTINUE; | |
219 | - | |
220 | - if ((em_ptr->m_ptr->r_idx == MON_WATER_ELEM) || (em_ptr->m_ptr->r_idx == MON_UNMAKER)) | |
221 | - { | |
222 | - em_ptr->note = _("には完全な耐性がある!", " is immune."); | |
223 | - em_ptr->dam = 0; | |
224 | - } | |
225 | - else | |
226 | - { | |
227 | - em_ptr->note = _("には耐性がある。", " resists."); | |
228 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
229 | - } | |
230 | - | |
231 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
232 | - em_ptr->r_ptr->r_flagsr |= (RFR_RES_WATE); | |
233 | - | |
234 | - return PROCESS_CONTINUE; | |
235 | -} | |
232 | + if (em_ptr->seen) | |
233 | + em_ptr->obvious = TRUE; | |
234 | + | |
235 | + if ((em_ptr->r_ptr->flagsr & RFR_RES_WATE) == 0) | |
236 | + return PROCESS_CONTINUE; | |
237 | + | |
238 | + if ((em_ptr->m_ptr->r_idx == MON_WATER_ELEM) || (em_ptr->m_ptr->r_idx == MON_UNMAKER)) { | |
239 | + em_ptr->note = _("には完全な耐性がある!", " is immune."); | |
240 | + em_ptr->dam = 0; | |
241 | + } else { | |
242 | + em_ptr->note = _("には耐性がある。", " resists."); | |
243 | + em_ptr->dam *= 3; | |
244 | + em_ptr->dam /= randint1(6) + 6; | |
245 | + } | |
236 | 246 | |
247 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
248 | + em_ptr->r_ptr->r_flagsr |= (RFR_RES_WATE); | |
249 | + | |
250 | + return PROCESS_CONTINUE; | |
251 | +} | |
237 | 252 | |
238 | 253 | process_result effect_monster_chaos(player_type *caster_ptr, effect_monster_type *em_ptr) |
239 | 254 | { |
240 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
241 | - if (em_ptr->r_ptr->flagsr & RFR_RES_CHAO) | |
242 | - { | |
243 | - em_ptr->note = _("には耐性がある。", " resists."); | |
244 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
245 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
246 | - em_ptr->r_ptr->r_flagsr |= (RFR_RES_CHAO); | |
247 | - } | |
248 | - else if ((em_ptr->r_ptr->flags3 & RF3_DEMON) && one_in_(3)) | |
249 | - { | |
250 | - em_ptr->note = _("はいくらか耐性を示した。", " resists somewhat."); | |
251 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
252 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
253 | - em_ptr->r_ptr->r_flags3 |= (RF3_DEMON); | |
254 | - } | |
255 | - else | |
256 | - { | |
257 | - em_ptr->do_polymorph = TRUE; | |
258 | - em_ptr->do_conf = (5 + randint1(11) + em_ptr->r) / (em_ptr->r + 1); | |
259 | - } | |
260 | - | |
261 | - return PROCESS_CONTINUE; | |
255 | + if (em_ptr->seen) | |
256 | + em_ptr->obvious = TRUE; | |
257 | + | |
258 | + if (em_ptr->r_ptr->flagsr & RFR_RES_CHAO) { | |
259 | + em_ptr->note = _("には耐性がある。", " resists."); | |
260 | + em_ptr->dam *= 3; | |
261 | + em_ptr->dam /= randint1(6) + 6; | |
262 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
263 | + em_ptr->r_ptr->r_flagsr |= (RFR_RES_CHAO); | |
264 | + } else if ((em_ptr->r_ptr->flags3 & RF3_DEMON) && one_in_(3)) { | |
265 | + em_ptr->note = _("はいくらか耐性を示した。", " resists somewhat."); | |
266 | + em_ptr->dam *= 3; | |
267 | + em_ptr->dam /= randint1(6) + 6; | |
268 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
269 | + em_ptr->r_ptr->r_flags3 |= (RF3_DEMON); | |
270 | + } else { | |
271 | + em_ptr->do_polymorph = TRUE; | |
272 | + em_ptr->do_conf = (5 + randint1(11) + em_ptr->r) / (em_ptr->r + 1); | |
273 | + } | |
274 | + | |
275 | + return PROCESS_CONTINUE; | |
262 | 276 | } |
263 | 277 | |
264 | - | |
265 | 278 | process_result effect_monster_shards(player_type *caster_ptr, effect_monster_type *em_ptr) |
266 | 279 | { |
267 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
268 | - if ((em_ptr->r_ptr->flagsr & RFR_RES_SHAR) == 0) return PROCESS_CONTINUE; | |
280 | + if (em_ptr->seen) | |
281 | + em_ptr->obvious = TRUE; | |
269 | 282 | |
270 | - em_ptr->note = _("には耐性がある。", " resists."); | |
271 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
272 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
273 | - em_ptr->r_ptr->r_flagsr |= (RFR_RES_SHAR); | |
283 | + if ((em_ptr->r_ptr->flagsr & RFR_RES_SHAR) == 0) | |
284 | + return PROCESS_CONTINUE; | |
274 | 285 | |
275 | - return PROCESS_CONTINUE; | |
276 | -} | |
286 | + em_ptr->note = _("には耐性がある。", " resists."); | |
287 | + em_ptr->dam *= 3; | |
288 | + em_ptr->dam /= randint1(6) + 6; | |
289 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
290 | + em_ptr->r_ptr->r_flagsr |= (RFR_RES_SHAR); | |
277 | 291 | |
292 | + return PROCESS_CONTINUE; | |
293 | +} | |
278 | 294 | |
279 | 295 | process_result effect_monster_rocket(player_type *caster_ptr, effect_monster_type *em_ptr) |
280 | 296 | { |
281 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
282 | - if ((em_ptr->r_ptr->flagsr & RFR_RES_SHAR) == 0) return PROCESS_CONTINUE; | |
297 | + if (em_ptr->seen) | |
298 | + em_ptr->obvious = TRUE; | |
283 | 299 | |
284 | - em_ptr->note = _("はいくらか耐性を示した。", " resists somewhat."); | |
285 | - em_ptr->dam /= 2; | |
286 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
287 | - em_ptr->r_ptr->r_flagsr |= (RFR_RES_SHAR); | |
300 | + if ((em_ptr->r_ptr->flagsr & RFR_RES_SHAR) == 0) | |
301 | + return PROCESS_CONTINUE; | |
288 | 302 | |
289 | - return PROCESS_CONTINUE; | |
290 | -} | |
303 | + em_ptr->note = _("はいくらか耐性を示した。", " resists somewhat."); | |
304 | + em_ptr->dam /= 2; | |
305 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
306 | + em_ptr->r_ptr->r_flagsr |= (RFR_RES_SHAR); | |
291 | 307 | |
308 | + return PROCESS_CONTINUE; | |
309 | +} | |
292 | 310 | |
293 | 311 | process_result effect_monster_sound(player_type *caster_ptr, effect_monster_type *em_ptr) |
294 | 312 | { |
295 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
296 | - if ((em_ptr->r_ptr->flagsr & RFR_RES_SOUN) == 0) | |
297 | - { | |
298 | - em_ptr->do_stun = (10 + randint1(15) + em_ptr->r) / (em_ptr->r + 1); | |
299 | - return PROCESS_CONTINUE; | |
300 | - } | |
301 | - | |
302 | - em_ptr->note = _("には耐性がある。", " resists."); | |
303 | - em_ptr->dam *= 2; em_ptr->dam /= randint1(6) + 6; | |
304 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
305 | - em_ptr->r_ptr->r_flagsr |= (RFR_RES_SOUN); | |
306 | - | |
307 | - return PROCESS_CONTINUE; | |
308 | -} | |
313 | + if (em_ptr->seen) | |
314 | + em_ptr->obvious = TRUE; | |
315 | + | |
316 | + if ((em_ptr->r_ptr->flagsr & RFR_RES_SOUN) == 0) { | |
317 | + em_ptr->do_stun = (10 + randint1(15) + em_ptr->r) / (em_ptr->r + 1); | |
318 | + return PROCESS_CONTINUE; | |
319 | + } | |
309 | 320 | |
321 | + em_ptr->note = _("には耐性がある。", " resists."); | |
322 | + em_ptr->dam *= 2; | |
323 | + em_ptr->dam /= randint1(6) + 6; | |
324 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
325 | + em_ptr->r_ptr->r_flagsr |= (RFR_RES_SOUN); | |
326 | + | |
327 | + return PROCESS_CONTINUE; | |
328 | +} | |
310 | 329 | |
311 | 330 | process_result effect_monster_confusion(player_type *caster_ptr, effect_monster_type *em_ptr) |
312 | 331 | { |
313 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
314 | - if ((em_ptr->r_ptr->flags3 & RF3_NO_CONF) == 0) | |
315 | - { | |
316 | - em_ptr->do_conf = (10 + randint1(15) + em_ptr->r) / (em_ptr->r + 1); | |
317 | - return PROCESS_CONTINUE; | |
318 | - } | |
319 | - | |
320 | - em_ptr->note = _("には耐性がある。", " resists."); | |
321 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
322 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
323 | - em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF); | |
324 | - | |
325 | - return PROCESS_CONTINUE; | |
326 | -} | |
332 | + if (em_ptr->seen) | |
333 | + em_ptr->obvious = TRUE; | |
334 | + | |
335 | + if ((em_ptr->r_ptr->flags3 & RF3_NO_CONF) == 0) { | |
336 | + em_ptr->do_conf = (10 + randint1(15) + em_ptr->r) / (em_ptr->r + 1); | |
337 | + return PROCESS_CONTINUE; | |
338 | + } | |
327 | 339 | |
340 | + em_ptr->note = _("には耐性がある。", " resists."); | |
341 | + em_ptr->dam *= 3; | |
342 | + em_ptr->dam /= randint1(6) + 6; | |
343 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
344 | + em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF); | |
345 | + | |
346 | + return PROCESS_CONTINUE; | |
347 | +} | |
328 | 348 | |
329 | 349 | process_result effect_monster_disenchant(player_type *caster_ptr, effect_monster_type *em_ptr) |
330 | 350 | { |
331 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
332 | - if ((em_ptr->r_ptr->flagsr & RFR_RES_DISE) == 0) return PROCESS_CONTINUE; | |
351 | + if (em_ptr->seen) | |
352 | + em_ptr->obvious = TRUE; | |
333 | 353 | |
334 | - em_ptr->note = _("には耐性がある。", " resists."); | |
335 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
336 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
337 | - em_ptr->r_ptr->r_flagsr |= (RFR_RES_DISE); | |
354 | + if ((em_ptr->r_ptr->flagsr & RFR_RES_DISE) == 0) | |
355 | + return PROCESS_CONTINUE; | |
338 | 356 | |
339 | - return PROCESS_CONTINUE; | |
340 | -} | |
357 | + em_ptr->note = _("には耐性がある。", " resists."); | |
358 | + em_ptr->dam *= 3; | |
359 | + em_ptr->dam /= randint1(6) + 6; | |
360 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
361 | + em_ptr->r_ptr->r_flagsr |= (RFR_RES_DISE); | |
341 | 362 | |
363 | + return PROCESS_CONTINUE; | |
364 | +} | |
342 | 365 | |
343 | 366 | process_result effect_monster_nexus(player_type *caster_ptr, effect_monster_type *em_ptr) |
344 | 367 | { |
345 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
346 | - if ((em_ptr->r_ptr->flagsr & RFR_RES_NEXU) == 0) return PROCESS_CONTINUE; | |
368 | + if (em_ptr->seen) | |
369 | + em_ptr->obvious = TRUE; | |
347 | 370 | |
348 | - em_ptr->note = _("には耐性がある。", " resists."); | |
349 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
350 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
351 | - em_ptr->r_ptr->r_flagsr |= (RFR_RES_NEXU); | |
371 | + if ((em_ptr->r_ptr->flagsr & RFR_RES_NEXU) == 0) | |
372 | + return PROCESS_CONTINUE; | |
352 | 373 | |
353 | - return PROCESS_CONTINUE; | |
354 | -} | |
374 | + em_ptr->note = _("には耐性がある。", " resists."); | |
375 | + em_ptr->dam *= 3; | |
376 | + em_ptr->dam /= randint1(6) + 6; | |
377 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
378 | + em_ptr->r_ptr->r_flagsr |= (RFR_RES_NEXU); | |
355 | 379 | |
380 | + return PROCESS_CONTINUE; | |
381 | +} | |
356 | 382 | |
357 | 383 | process_result effect_monster_force(player_type *caster_ptr, effect_monster_type *em_ptr) |
358 | 384 | { |
359 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
360 | - if ((em_ptr->r_ptr->flagsr & RFR_RES_WALL) == 0) | |
361 | - { | |
362 | - em_ptr->do_stun = (randint1(15) + em_ptr->r) / (em_ptr->r + 1); | |
363 | - return PROCESS_CONTINUE; | |
364 | - } | |
365 | - | |
366 | - em_ptr->note = _("には耐性がある。", " resists."); | |
367 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
368 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
369 | - em_ptr->r_ptr->r_flagsr |= (RFR_RES_WALL); | |
370 | - | |
371 | - return PROCESS_CONTINUE; | |
372 | -} | |
385 | + if (em_ptr->seen) | |
386 | + em_ptr->obvious = TRUE; | |
387 | + | |
388 | + if ((em_ptr->r_ptr->flagsr & RFR_RES_WALL) == 0) { | |
389 | + em_ptr->do_stun = (randint1(15) + em_ptr->r) / (em_ptr->r + 1); | |
390 | + return PROCESS_CONTINUE; | |
391 | + } | |
373 | 392 | |
393 | + em_ptr->note = _("には耐性がある。", " resists."); | |
394 | + em_ptr->dam *= 3; | |
395 | + em_ptr->dam /= randint1(6) + 6; | |
396 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
397 | + em_ptr->r_ptr->r_flagsr |= (RFR_RES_WALL); | |
398 | + | |
399 | + return PROCESS_CONTINUE; | |
400 | +} | |
374 | 401 | |
375 | 402 | // Powerful monsters can resists and normal monsters slow down. |
376 | 403 | process_result effect_monster_inertial(player_type *caster_ptr, effect_monster_type *em_ptr) |
377 | 404 | { |
378 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
379 | - if (em_ptr->r_ptr->flagsr & RFR_RES_INER) | |
380 | - { | |
381 | - em_ptr->note = _("には耐性がある。", " resists."); | |
382 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
383 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
384 | - em_ptr->r_ptr->r_flagsr |= (RFR_RES_INER); | |
385 | - | |
386 | - return PROCESS_CONTINUE; | |
387 | - } | |
388 | - | |
389 | - if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || | |
390 | - (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)) | |
391 | - { | |
392 | - em_ptr->obvious = FALSE; | |
393 | - return PROCESS_CONTINUE; | |
394 | - } | |
395 | - | |
396 | - if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50)) | |
397 | - em_ptr->note = _("の動きが遅くなった。", " starts moving slower."); | |
398 | - | |
399 | - return PROCESS_CONTINUE; | |
400 | -} | |
405 | + if (em_ptr->seen) | |
406 | + em_ptr->obvious = TRUE; | |
407 | + | |
408 | + if (em_ptr->r_ptr->flagsr & RFR_RES_INER) { | |
409 | + em_ptr->note = _("には耐性がある。", " resists."); | |
410 | + em_ptr->dam *= 3; | |
411 | + em_ptr->dam /= randint1(6) + 6; | |
412 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
413 | + em_ptr->r_ptr->r_flagsr |= (RFR_RES_INER); | |
414 | + | |
415 | + return PROCESS_CONTINUE; | |
416 | + } | |
417 | + | |
418 | + if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)) { | |
419 | + em_ptr->obvious = FALSE; | |
420 | + return PROCESS_CONTINUE; | |
421 | + } | |
401 | 422 | |
423 | + if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50)) | |
424 | + em_ptr->note = _("の動きが遅くなった。", " starts moving slower."); | |
425 | + | |
426 | + return PROCESS_CONTINUE; | |
427 | +} | |
402 | 428 | |
403 | 429 | process_result effect_monster_time(player_type *caster_ptr, effect_monster_type *em_ptr) |
404 | 430 | { |
405 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
406 | - if ((em_ptr->r_ptr->flagsr & RFR_RES_TIME) == 0) | |
407 | - { | |
408 | - em_ptr->do_time = (em_ptr->dam + 1) / 2; | |
409 | - return PROCESS_CONTINUE; | |
410 | - } | |
411 | - | |
412 | - em_ptr->note = _("には耐性がある。", " resists."); | |
413 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
414 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
415 | - em_ptr->r_ptr->r_flagsr |= (RFR_RES_TIME); | |
416 | - | |
417 | - return PROCESS_CONTINUE; | |
418 | -} | |
431 | + if (em_ptr->seen) | |
432 | + em_ptr->obvious = TRUE; | |
433 | + | |
434 | + if ((em_ptr->r_ptr->flagsr & RFR_RES_TIME) == 0) { | |
435 | + em_ptr->do_time = (em_ptr->dam + 1) / 2; | |
436 | + return PROCESS_CONTINUE; | |
437 | + } | |
419 | 438 | |
439 | + em_ptr->note = _("には耐性がある。", " resists."); | |
440 | + em_ptr->dam *= 3; | |
441 | + em_ptr->dam /= randint1(6) + 6; | |
442 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
443 | + em_ptr->r_ptr->r_flagsr |= (RFR_RES_TIME); | |
444 | + | |
445 | + return PROCESS_CONTINUE; | |
446 | +} | |
420 | 447 | |
421 | 448 | static bool effect_monster_gravity_resist_teleport(player_type *caster_ptr, effect_monster_type *em_ptr) |
422 | 449 | { |
450 | + if (em_ptr->seen) | |
451 | + em_ptr->obvious = TRUE; | |
423 | 452 | |
424 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
425 | - if ((em_ptr->r_ptr->flagsr & RFR_RES_TELE) == 0) return FALSE; | |
453 | + if ((em_ptr->r_ptr->flagsr & RFR_RES_TELE) == 0) | |
454 | + return FALSE; | |
426 | 455 | |
427 | - if (em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) | |
428 | - { | |
429 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
430 | - em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE; | |
456 | + if (em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) { | |
457 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
458 | + em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE; | |
431 | 459 | |
432 | - em_ptr->note = _("には効果がなかった。", " is unaffected!"); | |
433 | - return TRUE; | |
434 | - } | |
460 | + em_ptr->note = _("には効果がなかった。", " is unaffected!"); | |
461 | + return TRUE; | |
462 | + } | |
435 | 463 | |
436 | - if (em_ptr->r_ptr->level <= randint1(100)) return FALSE; | |
464 | + if (em_ptr->r_ptr->level <= randint1(100)) | |
465 | + return FALSE; | |
437 | 466 | |
438 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
439 | - em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE; | |
467 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
468 | + em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE; | |
440 | 469 | |
441 | - em_ptr->note = _("には耐性がある!", " resists!"); | |
442 | - return TRUE; | |
470 | + em_ptr->note = _("には耐性がある!", " resists!"); | |
471 | + return TRUE; | |
443 | 472 | } |
444 | 473 | |
445 | - | |
446 | 474 | static void effect_monster_gravity_slow(player_type *caster_ptr, effect_monster_type *em_ptr) |
447 | 475 | { |
448 | - if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || | |
449 | - (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)) | |
450 | - em_ptr->obvious = FALSE; | |
476 | + if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)) | |
477 | + em_ptr->obvious = FALSE; | |
451 | 478 | |
452 | - if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50)) | |
453 | - em_ptr->note = _("の動きが遅くなった。", " starts moving slower."); | |
479 | + if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50)) | |
480 | + em_ptr->note = _("の動きが遅くなった。", " starts moving slower."); | |
454 | 481 | } |
455 | 482 | |
456 | - | |
457 | 483 | static void effect_monster_gravity_stun(effect_monster_type *em_ptr) |
458 | 484 | { |
459 | - em_ptr->do_stun = damroll((em_ptr->caster_lev / 20) + 3, (em_ptr->dam)) + 1; | |
460 | - if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || | |
461 | - (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)) | |
462 | - { | |
463 | - em_ptr->do_stun = 0; | |
464 | - em_ptr->note = _("には効果がなかった。", " is unaffected!"); | |
465 | - em_ptr->obvious = FALSE; | |
466 | - } | |
485 | + em_ptr->do_stun = damroll((em_ptr->caster_lev / 20) + 3, (em_ptr->dam)) + 1; | |
486 | + if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)) { | |
487 | + em_ptr->do_stun = 0; | |
488 | + em_ptr->note = _("には効果がなかった。", " is unaffected!"); | |
489 | + em_ptr->obvious = FALSE; | |
490 | + } | |
467 | 491 | } |
468 | 492 | |
469 | - | |
470 | 493 | /* |
471 | 494 | * Powerful monsters can resist and normal monsters slow down |
472 | 495 | * Furthermore, this magic can make non-unique monsters slow/stun. |
473 | 496 | */ |
474 | 497 | process_result effect_monster_gravity(player_type *caster_ptr, effect_monster_type *em_ptr) |
475 | 498 | { |
476 | - em_ptr->do_dist = effect_monster_gravity_resist_teleport(caster_ptr, em_ptr) ? 0 : 10; | |
477 | - if (caster_ptr->riding && (em_ptr->g_ptr->m_idx == caster_ptr->riding)) em_ptr->do_dist = 0; | |
478 | - | |
479 | - if (em_ptr->r_ptr->flagsr & RFR_RES_GRAV) | |
480 | - { | |
481 | - em_ptr->note = _("には耐性がある!", " resists!"); | |
482 | - em_ptr->dam *= 3; em_ptr->dam /= randint1(6) + 6; | |
483 | - em_ptr->do_dist = 0; | |
484 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
485 | - em_ptr->r_ptr->r_flagsr |= (RFR_RES_GRAV); | |
486 | - | |
487 | - return PROCESS_CONTINUE; | |
488 | - } | |
489 | - | |
490 | - effect_monster_gravity_slow(caster_ptr, em_ptr); | |
491 | - effect_monster_gravity_stun(em_ptr); | |
492 | - return PROCESS_CONTINUE; | |
499 | + em_ptr->do_dist = effect_monster_gravity_resist_teleport(caster_ptr, em_ptr) ? 0 : 10; | |
500 | + if (caster_ptr->riding && (em_ptr->g_ptr->m_idx == caster_ptr->riding)) | |
501 | + em_ptr->do_dist = 0; | |
502 | + | |
503 | + if (em_ptr->r_ptr->flagsr & RFR_RES_GRAV) { | |
504 | + em_ptr->note = _("には耐性がある!", " resists!"); | |
505 | + em_ptr->dam *= 3; | |
506 | + em_ptr->dam /= randint1(6) + 6; | |
507 | + em_ptr->do_dist = 0; | |
508 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
509 | + em_ptr->r_ptr->r_flagsr |= (RFR_RES_GRAV); | |
510 | + | |
511 | + return PROCESS_CONTINUE; | |
512 | + } | |
513 | + | |
514 | + effect_monster_gravity_slow(caster_ptr, em_ptr); | |
515 | + effect_monster_gravity_stun(em_ptr); | |
516 | + return PROCESS_CONTINUE; | |
493 | 517 | } |
494 | 518 | |
495 | - | |
496 | 519 | process_result effect_monster_disintegration(player_type *caster_ptr, effect_monster_type *em_ptr) |
497 | 520 | { |
498 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
499 | - if ((em_ptr->r_ptr->flags3 & RF3_HURT_ROCK) == 0) return PROCESS_CONTINUE; | |
521 | + if (em_ptr->seen) | |
522 | + em_ptr->obvious = TRUE; | |
523 | + | |
524 | + if ((em_ptr->r_ptr->flags3 & RF3_HURT_ROCK) == 0) | |
525 | + return PROCESS_CONTINUE; | |
500 | 526 | |
501 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
502 | - em_ptr->r_ptr->r_flags3 |= (RF3_HURT_ROCK); | |
527 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
528 | + em_ptr->r_ptr->r_flags3 |= (RF3_HURT_ROCK); | |
503 | 529 | |
504 | - em_ptr->note = _("の皮膚がただれた!", " loses some skin!"); | |
505 | - em_ptr->note_dies = _("は蒸発した!", " evaporates!"); | |
506 | - em_ptr->dam *= 2; | |
507 | - return PROCESS_CONTINUE; | |
530 | + em_ptr->note = _("の皮膚がただれた!", " loses some skin!"); | |
531 | + em_ptr->note_dies = _("は蒸発した!", " evaporates!"); | |
532 | + em_ptr->dam *= 2; | |
533 | + return PROCESS_CONTINUE; | |
508 | 534 | } |
509 | 535 | |
510 | 536 | process_result effect_monster_icee_bolt(player_type *caster_ptr, effect_monster_type *em_ptr) |
511 | 537 | { |
512 | - if (em_ptr->seen) em_ptr->obvious = TRUE; | |
513 | - | |
514 | - em_ptr->do_stun = (randint1(15) + 1) / (em_ptr->r + 1); | |
515 | - if (em_ptr->r_ptr->flagsr & RFR_IM_COLD) | |
516 | - { | |
517 | - em_ptr->note = _("にはかなり耐性がある!", " resists a lot."); | |
518 | - em_ptr->dam /= 9; | |
519 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
520 | - em_ptr->r_ptr->r_flagsr |= (RFR_IM_COLD); | |
521 | - } | |
522 | - else if (em_ptr->r_ptr->flags3 & (RF3_HURT_COLD)) | |
523 | - { | |
524 | - em_ptr->note = _("はひどい痛手をうけた。", " is hit hard."); | |
525 | - em_ptr->dam *= 2; | |
526 | - if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
527 | - em_ptr->r_ptr->r_flags3 |= (RF3_HURT_COLD); | |
528 | - } | |
529 | - | |
530 | - return PROCESS_CONTINUE; | |
538 | + if (em_ptr->seen) | |
539 | + em_ptr->obvious = TRUE; | |
540 | + | |
541 | + em_ptr->do_stun = (randint1(15) + 1) / (em_ptr->r + 1); | |
542 | + if (em_ptr->r_ptr->flagsr & RFR_IM_COLD) { | |
543 | + em_ptr->note = _("にはかなり耐性がある!", " resists a lot."); | |
544 | + em_ptr->dam /= 9; | |
545 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
546 | + em_ptr->r_ptr->r_flagsr |= (RFR_IM_COLD); | |
547 | + } else if (em_ptr->r_ptr->flags3 & (RF3_HURT_COLD)) { | |
548 | + em_ptr->note = _("はひどい痛手をうけた。", " is hit hard."); | |
549 | + em_ptr->dam *= 2; | |
550 | + if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) | |
551 | + em_ptr->r_ptr->r_flags3 |= (RF3_HURT_COLD); | |
552 | + } | |
553 | + | |
554 | + return PROCESS_CONTINUE; | |
531 | 555 | } |
@@ -0,0 +1,193 @@ | ||
1 | +#include "monster-attack/monster-attack-lose.h" | |
2 | +#include "mind/mind-mirror-master.h" | |
3 | +#include "monster-attack/monster-attack-status.h" | |
4 | +#include "monster-attack/monster-attack-util.h" | |
5 | +#include "player/player-damage.h" | |
6 | +#include "player/player-status-flags.h" | |
7 | +#include "player/player-status-resist.h" | |
8 | +#include "status/bad-status-setter.h" | |
9 | +#include "status/base-status.h" | |
10 | +#include "status/element-resistance.h" | |
11 | +#include "view/display-messages.h" | |
12 | + | |
13 | +/*! | |
14 | + * @brief aC_[WðvZ·é (ÅÏ«ª êÎA(1d4 + 4) / 9ÉÈéBñdÏ«ÈçXÉ(1d4 + 4) / 9) | |
15 | + * @param target_ptr v[[ÖÌQÆ|C^ | |
16 | + * @param monap_ptr X^[©çv[[Ö̼ÚU\¢ÌÖÌQÆ|C^ | |
17 | + * @return ȵ | |
18 | + * @details 10% (ÅÌêÏ«ª êÎ4%AñdÏ«ÈçÎ1.6%)Ìm¦ÅÏvªáºµAXÉ1/10Ìm¦Åivặé | |
19 | + */ | |
20 | +void calc_blow_disease(player_type *target_ptr, monap_type *monap_ptr) | |
21 | +{ | |
22 | + if (has_resist_pois(target_ptr)) | |
23 | + monap_ptr->damage = monap_ptr->damage * (randint1(4) + 4) / 9; | |
24 | + | |
25 | + if (is_oppose_pois(target_ptr)) | |
26 | + monap_ptr->damage = monap_ptr->damage * (randint1(4) + 4) / 9; | |
27 | + | |
28 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
29 | + if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
30 | + return; | |
31 | + | |
32 | + if (!(target_ptr->resist_pois || is_oppose_pois(target_ptr)) && set_poisoned(target_ptr, target_ptr->poisoned + randint1(monap_ptr->rlev) + 5)) | |
33 | + monap_ptr->obvious = TRUE; | |
34 | + | |
35 | + bool disease_possibility = randint1(100) > calc_nuke_damage_rate(target_ptr); | |
36 | + if (disease_possibility || (randint1(100) > 10) || (target_ptr->prace == RACE_ANDROID)) | |
37 | + return; | |
38 | + | |
39 | + bool perm = one_in_(10); | |
40 | + if (dec_stat(target_ptr, A_CON, randint1(10), perm)) { | |
41 | + msg_print(_("aª ȽðIñÅ¢éCª·éB", "You feel sickly.")); | |
42 | + monap_ptr->obvious = TRUE; | |
43 | + } | |
44 | +} | |
45 | + | |
46 | +/*! | |
47 | + * @brief rÍáº_[WðvZ·é (Ûª êÎA(1d4 + 4) / 9ÉÈé) | |
48 | + * @param target_ptr v[[ÖÌQÆ|C^ | |
49 | + * @param monap_ptr X^[©çv[[Ö̼ÚU\¢ÌÖÌQÆ|C^ | |
50 | + * @return ȵ | |
51 | + */ | |
52 | +void calc_blow_lose_strength(player_type *target_ptr, monap_type *monap_ptr) | |
53 | +{ | |
54 | + if (has_sustain_str(target_ptr)) | |
55 | + monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9; | |
56 | + | |
57 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
58 | + if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
59 | + return; | |
60 | + | |
61 | + if (do_dec_stat(target_ptr, A_STR)) | |
62 | + monap_ptr->obvious = TRUE; | |
63 | +} | |
64 | + | |
65 | +/*! | |
66 | + * @brief m\áº_[WðvZ·é (Ûª êÎA(1d4 + 4) / 9ÉÈé) | |
67 | + * @param target_ptr v[[ÖÌQÆ|C^ | |
68 | + * @param monap_ptr X^[©çv[[Ö̼ÚU\¢ÌÖÌQÆ|C^ | |
69 | + * @return ȵ | |
70 | + */ | |
71 | +void calc_blow_lose_intelligence(player_type *target_ptr, monap_type *monap_ptr) | |
72 | +{ | |
73 | + if (has_sustain_int(target_ptr)) | |
74 | + monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9; | |
75 | + | |
76 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
77 | + if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
78 | + return; | |
79 | + | |
80 | + if (do_dec_stat(target_ptr, A_INT)) | |
81 | + monap_ptr->obvious = TRUE; | |
82 | +} | |
83 | + | |
84 | +/*! | |
85 | + * @brief «³áº_[WðvZ·é (Ûª êÎA(1d4 + 4) / 9ÉÈé) | |
86 | + * @param target_ptr v[[ÖÌQÆ|C^ | |
87 | + * @param monap_ptr X^[©çv[[Ö̼ÚU\¢ÌÖÌQÆ|C^ | |
88 | + * @return ȵ | |
89 | + */ | |
90 | +void calc_blow_lose_wisdom(player_type *target_ptr, monap_type *monap_ptr) | |
91 | +{ | |
92 | + if (has_sustain_wis(target_ptr)) | |
93 | + monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9; | |
94 | + | |
95 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
96 | + if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
97 | + return; | |
98 | + | |
99 | + if (do_dec_stat(target_ptr, A_WIS)) | |
100 | + monap_ptr->obvious = TRUE; | |
101 | +} | |
102 | + | |
103 | +/*! | |
104 | + * @brief ípáº_[WðvZ·é (Ûª êÎA(1d4 + 4) / 9ÉÈé) | |
105 | + * @param target_ptr v[[ÖÌQÆ|C^ | |
106 | + * @param monap_ptr X^[©çv[[Ö̼ÚU\¢ÌÖÌQÆ|C^ | |
107 | + * @return ȵ | |
108 | + */ | |
109 | +void calc_blow_lose_dexterity(player_type *target_ptr, monap_type *monap_ptr) | |
110 | +{ | |
111 | + if (has_sustain_dex(target_ptr)) | |
112 | + monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9; | |
113 | + | |
114 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
115 | + if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
116 | + return; | |
117 | + | |
118 | + if (do_dec_stat(target_ptr, A_DEX)) | |
119 | + monap_ptr->obvious = TRUE; | |
120 | +} | |
121 | + | |
122 | +/*! | |
123 | + * @brief Ïváº_[WðvZ·é (Ûª êÎA(1d4 + 4) / 9ÉÈé) | |
124 | + * @param target_ptr v[[ÖÌQÆ|C^ | |
125 | + * @param monap_ptr X^[©çv[[Ö̼ÚU\¢ÌÖÌQÆ|C^ | |
126 | + * @return ȵ | |
127 | + */ | |
128 | +void calc_blow_lose_constitution(player_type *target_ptr, monap_type *monap_ptr) | |
129 | +{ | |
130 | + if (has_sustain_con(target_ptr)) | |
131 | + monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9; | |
132 | + | |
133 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
134 | + if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
135 | + return; | |
136 | + | |
137 | + if (do_dec_stat(target_ptr, A_CON)) | |
138 | + monap_ptr->obvious = TRUE; | |
139 | +} | |
140 | + | |
141 | +/*! | |
142 | + * @brief £Íáº_[WðvZ·é (Ûª êÎA(1d4 + 4) / 9ÉÈé) | |
143 | + * @param target_ptr v[[ÖÌQÆ|C^ | |
144 | + * @param monap_ptr X^[©çv[[Ö̼ÚU\¢ÌÖÌQÆ|C^ | |
145 | + * @return ȵ | |
146 | + */ | |
147 | +void calc_blow_lose_charisma(player_type *target_ptr, monap_type *monap_ptr) | |
148 | +{ | |
149 | + if (has_sustain_chr(target_ptr)) | |
150 | + monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9; | |
151 | + | |
152 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
153 | + if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
154 | + return; | |
155 | + | |
156 | + if (do_dec_stat(target_ptr, A_CHR)) | |
157 | + monap_ptr->obvious = TRUE; | |
158 | +} | |
159 | + | |
160 | +/*! | |
161 | + * @brief S\Íáº_[WðvZ·é (Ûª êÎA1ÂÉt«-3%y¸·é) | |
162 | + * @param target_ptr v[[ÖÌQÆ|C^ | |
163 | + * @param monap_ptr X^[©çv[[Ö̼ÚU\¢ÌÖÌQÆ|C^ | |
164 | + * @return ȵ | |
165 | + */ | |
166 | +void calc_blow_lose_all(player_type *target_ptr, monap_type *monap_ptr) | |
167 | +{ | |
168 | + int damage_ratio = 100; | |
169 | + if (has_sustain_str(target_ptr)) | |
170 | + damage_ratio -= 3; | |
171 | + | |
172 | + if (has_sustain_int(target_ptr)) | |
173 | + damage_ratio -= 3; | |
174 | + | |
175 | + if (has_sustain_wis(target_ptr)) | |
176 | + damage_ratio -= 3; | |
177 | + | |
178 | + if (has_sustain_dex(target_ptr)) | |
179 | + damage_ratio -= 3; | |
180 | + | |
181 | + if (has_sustain_con(target_ptr)) | |
182 | + damage_ratio -= 3; | |
183 | + | |
184 | + if (has_sustain_chr(target_ptr)) | |
185 | + damage_ratio -= 3; | |
186 | + | |
187 | + monap_ptr->damage = monap_ptr->damage * damage_ratio / 100; | |
188 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
189 | + if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
190 | + return; | |
191 | + | |
192 | + process_lose_all_attack(target_ptr, monap_ptr); | |
193 | +} |
@@ -0,0 +1,13 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +#include "system/angband.h" | |
4 | + | |
5 | +typedef struct monap_type monap_type; | |
6 | +void calc_blow_disease(player_type *target_ptr, monap_type *monap_ptr); | |
7 | +void calc_blow_lose_strength(player_type *target_ptr, monap_type *monap_ptr); | |
8 | +void calc_blow_lose_intelligence(player_type *target_ptr, monap_type *monap_ptr); | |
9 | +void calc_blow_lose_wisdom(player_type *target_ptr, monap_type *monap_ptr); | |
10 | +void calc_blow_lose_dexterity(player_type *target_ptr, monap_type *monap_ptr); | |
11 | +void calc_blow_lose_constitution(player_type *target_ptr, monap_type *monap_ptr); | |
12 | +void calc_blow_lose_charisma(player_type *target_ptr, monap_type *monap_ptr); | |
13 | +void calc_blow_lose_all(player_type *target_ptr, monap_type *monap_ptr); |
@@ -7,13 +7,16 @@ | ||
7 | 7 | |
8 | 8 | #include "monster-attack/monster-attack-switcher.h" |
9 | 9 | #include "inventory/inventory-slot-types.h" |
10 | -#include "monster-attack/monster-attack-status.h" | |
11 | -#include "monster-attack/monster-eating.h" | |
12 | 10 | #include "mind/drs-types.h" |
13 | 11 | #include "mind/mind-mirror-master.h" |
12 | +#include "monster-attack/monster-attack-lose.h" | |
13 | +#include "monster-attack/monster-attack-status.h" | |
14 | +#include "monster-attack/monster-eating.h" | |
14 | 15 | #include "monster/monster-status.h" |
15 | 16 | #include "monster/monster-update.h" |
16 | 17 | #include "player/player-damage.h" |
18 | +#include "player/player-status-flags.h" | |
19 | +#include "player/player-status-resist.h" | |
17 | 20 | #include "spell-kind/earthquake.h" |
18 | 21 | #include "spell-kind/spells-equipment.h" |
19 | 22 | #include "status/bad-status-setter.h" |
@@ -23,14 +26,237 @@ | ||
23 | 26 | #include "system/object-type-definition.h" |
24 | 27 | #include "view/display-messages.h" |
25 | 28 | |
29 | +/*! | |
30 | + * @brief 毒ダメージを計算する | |
31 | + * @param target_ptr プレーヤーへの参照ポインタ | |
32 | + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ | |
33 | + * @return なし | |
34 | + * @detail 減衰の計算式がpoisではなくnukeなのは仕様 (1/3では減衰が強すぎると判断したため) | |
35 | + */ | |
36 | +static void calc_blow_poison(player_type *target_ptr, monap_type *monap_ptr) | |
37 | +{ | |
38 | + if (monap_ptr->explode) | |
39 | + return; | |
40 | + | |
41 | + if (!(target_ptr->resist_pois || is_oppose_pois(target_ptr)) && !check_multishadow(target_ptr) | |
42 | + && set_poisoned(target_ptr, target_ptr->poisoned + randint1(monap_ptr->rlev) + 5)) | |
43 | + monap_ptr->obvious = TRUE; | |
44 | + | |
45 | + monap_ptr->damage = monap_ptr->damage * calc_nuke_damage_rate(target_ptr) / 100; | |
46 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
47 | + update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_POIS); | |
48 | +} | |
49 | + | |
50 | +/*! | |
51 | + * @brief 劣化ダメージを計算する (耐性があれば、(1d4 + 4) / 9になる) | |
52 | + * @param target_ptr プレーヤーへの参照ポインタ | |
53 | + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ | |
54 | + * @return なし | |
55 | + */ | |
56 | +static void calc_blow_disenchant(player_type *target_ptr, monap_type *monap_ptr) | |
57 | +{ | |
58 | + if (monap_ptr->explode) | |
59 | + return; | |
60 | + | |
61 | + if (!target_ptr->resist_disen && !check_multishadow(target_ptr) && apply_disenchant(target_ptr, 0)) { | |
62 | + update_creature(target_ptr); | |
63 | + monap_ptr->obvious = TRUE; | |
64 | + } | |
65 | + | |
66 | + if (has_resist_disen(target_ptr)) | |
67 | + monap_ptr->damage = monap_ptr->damage * (randint1(4) + 4) / 9; | |
68 | + | |
69 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
70 | + update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_DISEN); | |
71 | +} | |
72 | + | |
73 | +/*! | |
74 | + * @brief 盲目ダメージを計算する (耐性があれば、(1d4 + 3) / 8になる) | |
75 | + * @param target_ptr プレーヤーへの参照ポインタ | |
76 | + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ | |
77 | + * @return なし | |
78 | + */ | |
79 | +static void calc_blow_blind(player_type *target_ptr, monap_type *monap_ptr) | |
80 | +{ | |
81 | + if (has_resist_blind(target_ptr)) | |
82 | + monap_ptr->damage = monap_ptr->damage * (randint1(4) + 3) / 8; | |
83 | + | |
84 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
85 | + if (target_ptr->is_dead) | |
86 | + return; | |
87 | + | |
88 | + process_blind_attack(target_ptr, monap_ptr); | |
89 | + update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_BLIND); | |
90 | +} | |
91 | + | |
92 | +/*! | |
93 | + * @brief 混乱ダメージを計算する (耐性があれば、(1d4 + 3) / 8になる) | |
94 | + * @param target_ptr プレーヤーへの参照ポインタ | |
95 | + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ | |
96 | + * @return なし | |
97 | + */ | |
98 | +static void calc_blow_confusion(player_type *target_ptr, monap_type *monap_ptr) | |
99 | +{ | |
100 | + if (monap_ptr->explode) | |
101 | + return; | |
102 | + | |
103 | + if (has_resist_conf(target_ptr)) | |
104 | + monap_ptr->damage = monap_ptr->damage * (randint1(4) + 3) / 8; | |
105 | + | |
106 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
107 | + if (target_ptr->is_dead) | |
108 | + return; | |
109 | + | |
110 | + if (!target_ptr->resist_conf && !check_multishadow(target_ptr) && set_confused(target_ptr, target_ptr->confused + 3 + randint1(monap_ptr->rlev))) | |
111 | + monap_ptr->obvious = TRUE; | |
112 | + | |
113 | + update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_CONF); | |
114 | +} | |
115 | + | |
116 | +/*! | |
117 | + * @brief 恐怖ダメージを計算する (耐性があれば、(1d4 + 3) / 8になる) | |
118 | + * @param target_ptr プレーヤーへの参照ポインタ | |
119 | + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ | |
120 | + * @return なし | |
121 | + */ | |
122 | +static void calc_blow_fear(player_type *target_ptr, monap_type *monap_ptr) | |
123 | +{ | |
124 | + if (has_resist_fear(target_ptr)) | |
125 | + monap_ptr->damage = monap_ptr->damage * (randint1(4) + 3) / 8; | |
126 | + | |
127 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
128 | + if (target_ptr->is_dead) | |
129 | + return; | |
130 | + | |
131 | + process_terrify_attack(target_ptr, monap_ptr); | |
132 | + update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_FEAR); | |
133 | +} | |
134 | + | |
135 | +/*! | |
136 | + * @brief 麻痺ダメージを計算する (耐性があれば、(1d4 + 3) / 8になる) | |
137 | + * @param target_ptr プレーヤーへの参照ポインタ | |
138 | + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ | |
139 | + * @return なし | |
140 | + */ | |
141 | +static void calc_blow_paralysis(player_type *target_ptr, monap_type *monap_ptr) | |
142 | +{ | |
143 | + if (has_free_act(target_ptr)) | |
144 | + monap_ptr->damage = monap_ptr->damage * (randint1(4) + 3) / 8; | |
145 | + | |
146 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
147 | + if (target_ptr->is_dead) | |
148 | + return; | |
149 | + | |
150 | + process_paralyze_attack(target_ptr, monap_ptr); | |
151 | + update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_FREE); | |
152 | +} | |
153 | + | |
154 | +/*! | |
155 | + * @brief 経験値吸収ダメージを計算する (経験値保持と地獄耐性があれば、それぞれ-7.5%) | |
156 | + * @param target_ptr プレーヤーへの参照ポインタ | |
157 | + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ | |
158 | + * @return なし | |
159 | + */ | |
160 | +static void calc_blow_drain_exp(player_type *target_ptr, monap_type *monap_ptr, const int drain_value, const int hold_exp_prob) | |
161 | +{ | |
162 | + s32b d = damroll(drain_value, 6) + (target_ptr->exp / 100) * MON_DRAIN_LIFE; | |
163 | + monap_ptr->obvious = TRUE; | |
164 | + int damage_ratio = 1000; | |
165 | + if (has_hold_exp(target_ptr)) | |
166 | + damage_ratio -= 75; | |
167 | + | |
168 | + if (has_resist_neth(target_ptr)) | |
169 | + damage_ratio -= 75; | |
170 | + | |
171 | + monap_ptr->damage = monap_ptr->damage * damage_ratio / 1000; | |
172 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
173 | + if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
174 | + return; | |
175 | + | |
176 | + (void)drain_exp(target_ptr, d, d / 10, hold_exp_prob); | |
177 | +} | |
178 | + | |
179 | +/*! | |
180 | + * @brief 時間逆転ダメージを計算する (耐性があれば、(1d4 + 4) / 9になる) | |
181 | + * @param target_ptr プレーヤーへの参照ポインタ | |
182 | + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ | |
183 | + * @return なし | |
184 | + */ | |
185 | +static void calc_blow_time(player_type *target_ptr, monap_type *monap_ptr) | |
186 | +{ | |
187 | + if (monap_ptr->explode) | |
188 | + return; | |
189 | + | |
190 | + process_monster_attack_time(target_ptr, monap_ptr); | |
191 | + if (has_resist_time(target_ptr)) | |
192 | + monap_ptr->damage = monap_ptr->damage * (randint1(4) + 4) / 9; | |
193 | + | |
194 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
195 | +} | |
196 | + | |
197 | +/*! | |
198 | + * @brief 生命力吸収ダメージを計算する (経験値維持があれば9/10になる) | |
199 | + * @param target_ptr プレーヤーへの参照ポインタ | |
200 | + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ | |
201 | + * @return なし | |
202 | + */ | |
203 | +static void calc_blow_drain_life(player_type *target_ptr, monap_type *monap_ptr) | |
204 | +{ | |
205 | + s32b d = damroll(60, 6) + (target_ptr->exp / 100) * MON_DRAIN_LIFE; | |
206 | + monap_ptr->obvious = TRUE; | |
207 | + if (target_ptr->hold_exp) | |
208 | + monap_ptr->damage = monap_ptr->damage * 9 / 10; | |
209 | + | |
210 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
211 | + if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
212 | + return; | |
213 | + | |
214 | + bool resist_drain = check_drain_hp(target_ptr, d); | |
215 | + process_drain_life(target_ptr, monap_ptr, resist_drain); | |
216 | +} | |
217 | + | |
218 | +/*! | |
219 | + * todo 魔道具使用能力向上フラグの取得関数は未定義、後ほど実施する | |
220 | + * @brief MPダメージを計算する (消費魔力減少、呪文失敗率減少、魔道具使用能力向上があればそれぞれ-5%) | |
221 | + * @param target_ptr プレーヤーへの参照ポインタ | |
222 | + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ | |
223 | + * @return なし | |
224 | + */ | |
225 | +static void calc_blow_drain_mana(player_type *target_ptr, monap_type *monap_ptr) | |
226 | +{ | |
227 | + monap_ptr->obvious = TRUE; | |
228 | + int damage_ratio = 100; | |
229 | + if (has_dec_mana(target_ptr)) | |
230 | + damage_ratio -= 5; | |
231 | + | |
232 | + if (has_easy_spell(target_ptr)) | |
233 | + damage_ratio -= 5; | |
234 | + | |
235 | + monap_ptr->damage = monap_ptr->damage * damage_ratio / 100; | |
236 | + process_drain_mana(target_ptr, monap_ptr); | |
237 | + update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_MANA); | |
238 | +} | |
239 | + | |
240 | +static void calc_blow_inertia(player_type *target_ptr, monap_type *monap_ptr) | |
241 | +{ | |
242 | + if ((target_ptr->fast > 0) || (target_ptr->pspeed >= 130)) | |
243 | + monap_ptr->damage = monap_ptr->damage * (randint1(4) + 4) / 9; | |
244 | + | |
245 | + monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
246 | + if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
247 | + return; | |
248 | + | |
249 | + if (set_slow(target_ptr, (target_ptr->slow + 4 + randint0(monap_ptr->rlev / 10)), FALSE)) | |
250 | + monap_ptr->obvious = TRUE; | |
251 | +} | |
252 | + | |
26 | 253 | void switch_monster_blow_to_player(player_type *target_ptr, monap_type *monap_ptr) |
27 | 254 | { |
28 | 255 | switch (monap_ptr->effect) { |
29 | - case RBE_NONE: { | |
256 | + case RBE_NONE: | |
30 | 257 | monap_ptr->obvious = TRUE; |
31 | 258 | monap_ptr->damage = 0; |
32 | 259 | break; |
33 | - } | |
34 | 260 | case RBE_SUPERHURT: { /* AC軽減あり / Player armor reduces total damage */ |
35 | 261 | if (((randint1(monap_ptr->rlev * 2 + 300) > (monap_ptr->ac + 200)) || one_in_(13)) && !check_multishadow(target_ptr)) { |
36 | 262 | int tmp_damage = monap_ptr->damage - (monap_ptr->damage * ((monap_ptr->ac < 150) ? monap_ptr->ac : 150) / 250); |
@@ -47,35 +273,12 @@ void switch_monster_blow_to_player(player_type *target_ptr, monap_type *monap_pt | ||
47 | 273 | monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); |
48 | 274 | break; |
49 | 275 | } |
50 | - case RBE_POISON: { | |
51 | - if (monap_ptr->explode) | |
52 | - break; | |
53 | - | |
54 | - if (!(target_ptr->resist_pois || is_oppose_pois(target_ptr)) && !check_multishadow(target_ptr)) { | |
55 | - if (set_poisoned(target_ptr, target_ptr->poisoned + randint1(monap_ptr->rlev) + 5)) { | |
56 | - monap_ptr->obvious = TRUE; | |
57 | - } | |
58 | - } | |
59 | - | |
60 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
61 | - update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_POIS); | |
276 | + case RBE_POISON: | |
277 | + calc_blow_poison(target_ptr, monap_ptr); | |
62 | 278 | break; |
63 | - } | |
64 | - case RBE_UN_BONUS: { | |
65 | - if (monap_ptr->explode) | |
66 | - break; | |
67 | - | |
68 | - if (!target_ptr->resist_disen && !check_multishadow(target_ptr)) { | |
69 | - if (apply_disenchant(target_ptr, 0)) { | |
70 | - update_creature(target_ptr); | |
71 | - monap_ptr->obvious = TRUE; | |
72 | - } | |
73 | - } | |
74 | - | |
75 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
76 | - update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_DISEN); | |
279 | + case RBE_UN_BONUS: | |
280 | + calc_blow_disenchant(target_ptr, monap_ptr); | |
77 | 281 | break; |
78 | - } | |
79 | 282 | case RBE_UN_POWER: { |
80 | 283 | monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); |
81 | 284 | if (target_ptr->is_dead || check_multishadow(target_ptr)) |
@@ -145,6 +348,7 @@ void switch_monster_blow_to_player(player_type *target_ptr, monap_type *monap_pt | ||
145 | 348 | case RBE_ELEC: { |
146 | 349 | if (monap_ptr->explode) |
147 | 350 | break; |
351 | + | |
148 | 352 | monap_ptr->obvious = TRUE; |
149 | 353 | msg_print(_("電撃を浴びせられた!", "You are struck by electricity!")); |
150 | 354 | monap_ptr->get_damage += elec_dam(target_ptr, monap_ptr->damage, monap_ptr->ddesc, -1, FALSE); |
@@ -154,6 +358,7 @@ void switch_monster_blow_to_player(player_type *target_ptr, monap_type *monap_pt | ||
154 | 358 | case RBE_FIRE: { |
155 | 359 | if (monap_ptr->explode) |
156 | 360 | break; |
361 | + | |
157 | 362 | monap_ptr->obvious = TRUE; |
158 | 363 | msg_print(_("全身が炎に包まれた!", "You are enveloped in flames!")); |
159 | 364 | monap_ptr->get_damage += fire_dam(target_ptr, monap_ptr->damage, monap_ptr->ddesc, -1, FALSE); |
@@ -163,125 +368,46 @@ void switch_monster_blow_to_player(player_type *target_ptr, monap_type *monap_pt | ||
163 | 368 | case RBE_COLD: { |
164 | 369 | if (monap_ptr->explode) |
165 | 370 | break; |
371 | + | |
166 | 372 | monap_ptr->obvious = TRUE; |
167 | 373 | msg_print(_("全身が冷気で覆われた!", "You are covered with frost!")); |
168 | 374 | monap_ptr->get_damage += cold_dam(target_ptr, monap_ptr->damage, monap_ptr->ddesc, -1, FALSE); |
169 | 375 | update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_COLD); |
170 | 376 | break; |
171 | 377 | } |
172 | - case RBE_BLIND: { | |
173 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
174 | - if (target_ptr->is_dead) | |
175 | - break; | |
176 | - | |
177 | - process_blind_attack(target_ptr, monap_ptr); | |
178 | - update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_BLIND); | |
378 | + case RBE_BLIND: | |
379 | + calc_blow_blind(target_ptr, monap_ptr); | |
179 | 380 | break; |
180 | - } | |
181 | - case RBE_CONFUSE: { | |
182 | - if (monap_ptr->explode) | |
183 | - break; | |
184 | - | |
185 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
186 | - if (target_ptr->is_dead) | |
187 | - break; | |
188 | - | |
189 | - if (!target_ptr->resist_conf && !check_multishadow(target_ptr)) { | |
190 | - if (set_confused(target_ptr, target_ptr->confused + 3 + randint1(monap_ptr->rlev))) { | |
191 | - monap_ptr->obvious = TRUE; | |
192 | - } | |
193 | - } | |
194 | - | |
195 | - update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_CONF); | |
381 | + case RBE_CONFUSE: | |
382 | + calc_blow_confusion(target_ptr, monap_ptr); | |
196 | 383 | break; |
197 | - } | |
198 | - case RBE_TERRIFY: { | |
199 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
200 | - if (target_ptr->is_dead) | |
201 | - break; | |
202 | - | |
203 | - process_terrify_attack(target_ptr, monap_ptr); | |
204 | - update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_FEAR); | |
384 | + case RBE_TERRIFY: | |
385 | + calc_blow_fear(target_ptr, monap_ptr); | |
205 | 386 | break; |
206 | - } | |
207 | - case RBE_PARALYZE: { | |
208 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
209 | - | |
210 | - if (target_ptr->is_dead) | |
211 | - break; | |
212 | - | |
213 | - process_paralyze_attack(target_ptr, monap_ptr); | |
214 | - update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_FREE); | |
387 | + case RBE_PARALYZE: | |
388 | + calc_blow_paralysis(target_ptr, monap_ptr); | |
215 | 389 | break; |
216 | - } | |
217 | - case RBE_LOSE_STR: { | |
218 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
219 | - if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
220 | - break; | |
221 | - | |
222 | - if (do_dec_stat(target_ptr, A_STR)) | |
223 | - monap_ptr->obvious = TRUE; | |
224 | - | |
390 | + case RBE_LOSE_STR: | |
391 | + calc_blow_lose_strength(target_ptr, monap_ptr); | |
225 | 392 | break; |
226 | - } | |
227 | - case RBE_LOSE_INT: { | |
228 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
229 | - if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
230 | - break; | |
231 | - | |
232 | - if (do_dec_stat(target_ptr, A_INT)) | |
233 | - monap_ptr->obvious = TRUE; | |
234 | - | |
393 | + case RBE_LOSE_INT: | |
394 | + calc_blow_lose_intelligence(target_ptr, monap_ptr); | |
235 | 395 | break; |
236 | - } | |
237 | - case RBE_LOSE_WIS: { | |
238 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
239 | - if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
240 | - break; | |
241 | - | |
242 | - if (do_dec_stat(target_ptr, A_WIS)) | |
243 | - monap_ptr->obvious = TRUE; | |
244 | - | |
396 | + case RBE_LOSE_WIS: | |
397 | + calc_blow_lose_wisdom(target_ptr, monap_ptr); | |
245 | 398 | break; |
246 | - } | |
247 | - case RBE_LOSE_DEX: { | |
248 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
249 | - if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
250 | - break; | |
251 | - | |
252 | - if (do_dec_stat(target_ptr, A_DEX)) | |
253 | - monap_ptr->obvious = TRUE; | |
254 | - | |
399 | + case RBE_LOSE_DEX: | |
400 | + calc_blow_lose_dexterity(target_ptr, monap_ptr); | |
255 | 401 | break; |
256 | - } | |
257 | - case RBE_LOSE_CON: { | |
258 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
259 | - if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
260 | - break; | |
261 | - | |
262 | - if (do_dec_stat(target_ptr, A_CON)) | |
263 | - monap_ptr->obvious = TRUE; | |
264 | - | |
402 | + case RBE_LOSE_CON: | |
403 | + calc_blow_lose_constitution(target_ptr, monap_ptr); | |
265 | 404 | break; |
266 | - } | |
267 | - case RBE_LOSE_CHR: { | |
268 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
269 | - if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
270 | - break; | |
271 | - | |
272 | - if (do_dec_stat(target_ptr, A_CHR)) | |
273 | - monap_ptr->obvious = TRUE; | |
274 | - | |
405 | + case RBE_LOSE_CHR: | |
406 | + calc_blow_lose_charisma(target_ptr, monap_ptr); | |
275 | 407 | break; |
276 | - } | |
277 | - case RBE_LOSE_ALL: { | |
278 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
279 | - if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
280 | - break; | |
281 | - | |
282 | - process_lose_all_attack(target_ptr, monap_ptr); | |
408 | + case RBE_LOSE_ALL: | |
409 | + calc_blow_lose_all(target_ptr, monap_ptr); | |
283 | 410 | break; |
284 | - } | |
285 | 411 | case RBE_SHATTER: { /* AC軽減あり / Player armor reduces total damage */ |
286 | 412 | monap_ptr->obvious = TRUE; |
287 | 413 | monap_ptr->damage -= (monap_ptr->damage * ((monap_ptr->ac < 150) ? monap_ptr->ac : 150) / 250); |
@@ -291,107 +417,33 @@ void switch_monster_blow_to_player(player_type *target_ptr, monap_type *monap_pt | ||
291 | 417 | |
292 | 418 | break; |
293 | 419 | } |
294 | - case RBE_EXP_10: { | |
295 | - s32b d = damroll(10, 6) + (target_ptr->exp / 100) * MON_DRAIN_LIFE; | |
296 | - monap_ptr->obvious = TRUE; | |
297 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
298 | - if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
299 | - break; | |
300 | - | |
301 | - (void)drain_exp(target_ptr, d, d / 10, 95); | |
420 | + case RBE_EXP_10: | |
421 | + calc_blow_drain_exp(target_ptr, monap_ptr, 10, 95); | |
302 | 422 | break; |
303 | - } | |
304 | - case RBE_EXP_20: { | |
305 | - s32b d = damroll(20, 6) + (target_ptr->exp / 100) * MON_DRAIN_LIFE; | |
306 | - monap_ptr->obvious = TRUE; | |
307 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
308 | - if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
309 | - break; | |
310 | - | |
311 | - (void)drain_exp(target_ptr, d, d / 10, 90); | |
423 | + case RBE_EXP_20: | |
424 | + calc_blow_drain_exp(target_ptr, monap_ptr, 20, 90); | |
312 | 425 | break; |
313 | - } | |
314 | - case RBE_EXP_40: { | |
315 | - s32b d = damroll(40, 6) + (target_ptr->exp / 100) * MON_DRAIN_LIFE; | |
316 | - monap_ptr->obvious = TRUE; | |
317 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
318 | - if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
319 | - break; | |
320 | - | |
321 | - (void)drain_exp(target_ptr, d, d / 10, 75); | |
426 | + case RBE_EXP_40: | |
427 | + calc_blow_drain_exp(target_ptr, monap_ptr, 40, 75); | |
322 | 428 | break; |
323 | - } | |
324 | - case RBE_EXP_80: { | |
325 | - s32b d = damroll(80, 6) + (target_ptr->exp / 100) * MON_DRAIN_LIFE; | |
326 | - monap_ptr->obvious = TRUE; | |
327 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
328 | - if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
329 | - break; | |
330 | - | |
331 | - (void)drain_exp(target_ptr, d, d / 10, 50); | |
429 | + case RBE_EXP_80: | |
430 | + calc_blow_drain_exp(target_ptr, monap_ptr, 80, 50); | |
332 | 431 | break; |
333 | - } | |
334 | - case RBE_DISEASE: { | |
335 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
336 | - if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
337 | - break; | |
338 | - | |
339 | - if (!(target_ptr->resist_pois || is_oppose_pois(target_ptr))) { | |
340 | - if (set_poisoned(target_ptr, target_ptr->poisoned + randint1(monap_ptr->rlev) + 5)) { | |
341 | - monap_ptr->obvious = TRUE; | |
342 | - } | |
343 | - } | |
344 | - | |
345 | - if ((randint1(100) < 11) && (target_ptr->prace != RACE_ANDROID)) { | |
346 | - bool perm = one_in_(10); | |
347 | - if (dec_stat(target_ptr, A_CON, randint1(10), perm)) { | |
348 | - msg_print(_("病があなたを蝕んでいる気がする。", "You feel sickly.")); | |
349 | - monap_ptr->obvious = TRUE; | |
350 | - } | |
351 | - } | |
352 | - | |
432 | + case RBE_DISEASE: | |
433 | + calc_blow_disease(target_ptr, monap_ptr); | |
353 | 434 | break; |
354 | - } | |
355 | - case RBE_TIME: { | |
356 | - if (monap_ptr->explode) | |
357 | - break; | |
358 | - | |
359 | - process_monster_attack_time(target_ptr, monap_ptr); | |
360 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
435 | + case RBE_TIME: | |
436 | + calc_blow_time(target_ptr, monap_ptr); | |
361 | 437 | break; |
362 | - } | |
363 | - case RBE_DR_LIFE: { | |
364 | - s32b d = damroll(60, 6) + (target_ptr->exp / 100) * MON_DRAIN_LIFE; | |
365 | - monap_ptr->obvious = TRUE; | |
366 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
367 | - if (target_ptr->is_dead || check_multishadow(target_ptr)) | |
368 | - break; | |
369 | - | |
370 | - bool resist_drain = check_drain_hp(target_ptr, d); | |
371 | - process_drain_life(target_ptr, monap_ptr, resist_drain); | |
438 | + case RBE_DR_LIFE: | |
439 | + calc_blow_drain_life(target_ptr, monap_ptr); | |
372 | 440 | break; |
373 | - } | |
374 | - case RBE_DR_MANA: { | |
375 | - monap_ptr->obvious = TRUE; | |
376 | - process_drain_mana(target_ptr, monap_ptr); | |
377 | - update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_MANA); | |
441 | + case RBE_DR_MANA: | |
442 | + calc_blow_drain_mana(target_ptr, monap_ptr); | |
378 | 443 | break; |
379 | - } | |
380 | - case RBE_INERTIA: { | |
381 | - monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); | |
382 | - if (target_ptr->is_dead) | |
383 | - break; | |
384 | - | |
385 | - if (check_multishadow(target_ptr)) { | |
386 | - /* Do nothing */ | |
387 | - } else { | |
388 | - if (set_slow(target_ptr, (target_ptr->slow + 4 + randint0(monap_ptr->rlev / 10)), FALSE)) { | |
389 | - monap_ptr->obvious = TRUE; | |
390 | - } | |
391 | - } | |
392 | - | |
444 | + case RBE_INERTIA: | |
445 | + calc_blow_inertia(target_ptr, monap_ptr); | |
393 | 446 | break; |
394 | - } | |
395 | 447 | case RBE_STUN: { |
396 | 448 | monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1); |
397 | 449 | if (target_ptr->is_dead) |
@@ -47,10 +47,8 @@ static bool summon_specific_okay(player_type *player_ptr, MONRACE_IDX r_idx) | ||
47 | 47 | if (monster_has_hostile_align(player_ptr, m_ptr, 0, 0, r_ptr)) |
48 | 48 | return FALSE; |
49 | 49 | } else if (summon_specific_who < 0) { |
50 | - if (monster_has_hostile_align(player_ptr, NULL, 10, -10, r_ptr)) { | |
51 | - if (!one_in_(ABS(player_ptr->align) / 2 + 1)) | |
52 | - return FALSE; | |
53 | - } | |
50 | + if (monster_has_hostile_align(player_ptr, NULL, 10, -10, r_ptr) && !one_in_(ABS(player_ptr->align) / 2 + 1)) | |
51 | + return FALSE; | |
54 | 52 | } |
55 | 53 | |
56 | 54 | if (!summon_unique_okay && ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))) |
@@ -59,13 +57,14 @@ static bool summon_specific_okay(player_type *player_ptr, MONRACE_IDX r_idx) | ||
59 | 57 | if (!summon_specific_type) |
60 | 58 | return TRUE; |
61 | 59 | |
62 | - if ((summon_specific_who < 0) && ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) && monster_has_hostile_align(player_ptr, NULL, 10, -10, r_ptr)) | |
60 | + if ((summon_specific_who < 0) && ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) | |
61 | + && monster_has_hostile_align(player_ptr, NULL, 10, -10, r_ptr)) | |
63 | 62 | return FALSE; |
64 | 63 | |
65 | 64 | if ((r_ptr->flags7 & RF7_CHAMELEON) && (d_info[player_ptr->dungeon_idx].flags1 & DF1_CHAMELEON)) |
66 | 65 | return TRUE; |
67 | 66 | |
68 | - return (check_summon_specific(player_ptr, m_ptr->r_idx, r_idx)); | |
67 | + return check_summon_specific(player_ptr, m_ptr->r_idx, r_idx); | |
69 | 68 | } |
70 | 69 | |
71 | 70 | /*! |
@@ -142,10 +141,7 @@ bool summon_named_creature(player_type *player_ptr, MONSTER_IDX who, POSITION oy | ||
142 | 141 | return FALSE; |
143 | 142 | |
144 | 143 | POSITION x, y; |
145 | - if (player_ptr->current_floor_ptr->inside_arena) | |
146 | - return FALSE; | |
147 | - | |
148 | - if (!mon_scatter(player_ptr, r_idx, &y, &x, oy, ox, 2)) | |
144 | + if (player_ptr->current_floor_ptr->inside_arena || !mon_scatter(player_ptr, r_idx, &y, &x, oy, ox, 2)) | |
149 | 145 | return FALSE; |
150 | 146 | |
151 | 147 | return place_monster_aux(player_ptr, who, y, x, r_idx, (mode | PM_NO_KAGE)); |
@@ -10,7 +10,7 @@ typedef enum tr_type { | ||
10 | 10 | TR_DEX = 3, /* DEX += "pval" */ |
11 | 11 | TR_CON = 4, /* CON += "pval" */ |
12 | 12 | TR_CHR = 5, /* CHR += "pval" */ |
13 | - TR_MAGIC_MASTERY = 6, /* Later */ | |
13 | + TR_MAGIC_MASTERY = 6, /* 魔道具使用能力向上 */ | |
14 | 14 | TR_FORCE_WEAPON = 7, /* Later */ |
15 | 15 | TR_STEALTH = 8, /* Stealth += "pval" */ |
16 | 16 | TR_SEARCH = 9, /* Search += "pval" */ |
@@ -44,15 +44,15 @@ typedef enum tr_type { | ||
44 | 44 | TR_SUST_CON = 36, |
45 | 45 | TR_SUST_CHR = 37, |
46 | 46 | TR_RIDING = 38, |
47 | - TR_EASY_SPELL = 39, | |
47 | + TR_EASY_SPELL = 39, /* 呪文失敗率減少 */ | |
48 | 48 | TR_IM_ACID = 40, |
49 | 49 | TR_IM_ELEC = 41, |
50 | 50 | TR_IM_FIRE = 42, |
51 | 51 | TR_IM_COLD = 43, |
52 | - TR_THROW = 44, /* Later */ | |
52 | + TR_THROW = 44, /* 強力投擲 */ | |
53 | 53 | TR_REFLECT = 45, /* Reflect 'bolts' */ |
54 | - TR_FREE_ACT = 46, /* Free Action */ | |
55 | - TR_HOLD_EXP = 47, /* Hold EXP */ | |
54 | + TR_FREE_ACT = 46, /* 耐麻痺 */ | |
55 | + TR_HOLD_EXP = 47, /* 経験値維持 */ | |
56 | 56 | TR_RES_ACID = 48, |
57 | 57 | TR_RES_ELEC = 49, |
58 | 58 | TR_RES_FIRE = 50, |
@@ -74,8 +74,8 @@ typedef enum tr_type { | ||
74 | 74 | TR_SH_ELEC = 65, /* Electric Sheath */ |
75 | 75 | TR_SLAY_HUMAN = 66, /* Slay human */ |
76 | 76 | TR_SH_COLD = 67, /* cold aura */ |
77 | - TR_NO_TELE = 68, /* Anti-teleportation */ | |
78 | - TR_NO_MAGIC = 69, /* Anti-magic */ | |
77 | + TR_NO_TELE = 68, /* 反テレポート */ | |
78 | + TR_NO_MAGIC = 69, /* 反魔法 */ | |
79 | 79 | TR_DEC_MANA = 70, /* 消費魔力減少 */ |
80 | 80 | TR_TY_CURSE = 71, /* The Ancient Curse */ |
81 | 81 | TR_WARNING = 72, /* Warning */ |
@@ -290,7 +290,6 @@ WEIGHT calc_inventory_weight(player_type *creature_ptr) | ||
290 | 290 | WEIGHT weight = 0; |
291 | 291 | |
292 | 292 | object_type *o_ptr; |
293 | - BIT_FLAGS flgs[TR_FLAG_SIZE]; | |
294 | 293 | for (inventory_slot_type i = 0; i < INVEN_TOTAL; i++) { |
295 | 294 | o_ptr = &creature_ptr->inventory_list[i]; |
296 | 295 | if (!o_ptr->k_idx) |
@@ -137,7 +137,6 @@ bool mundane_spell(player_type *owner_ptr, bool only_equip) | ||
137 | 137 | POSITION ix = o_ptr->ix; |
138 | 138 | OBJECT_IDX next_o_idx = o_ptr->next_o_idx; |
139 | 139 | byte marked = o_ptr->marked; |
140 | - WEIGHT weight = o_ptr->number * o_ptr->weight; | |
141 | 140 | u16b inscription = o_ptr->inscription; |
142 | 141 | |
143 | 142 | object_prep(owner_ptr, o_ptr, o_ptr->k_idx); |
@@ -151,10 +151,10 @@ static void describe_target(player_type *subject_ptr, eg_type *eg_ptr) | ||
151 | 151 | #endif |
152 | 152 | } |
153 | 153 | |
154 | -static bool describe_hallucinated_target(player_type *subject_ptr, eg_type *eg_ptr) | |
154 | +static process_result describe_hallucinated_target(player_type *subject_ptr, eg_type *eg_ptr) | |
155 | 155 | { |
156 | 156 | if (!subject_ptr->image) |
157 | - return FALSE; | |
157 | + return PROCESS_CONTINUE; | |
158 | 158 | |
159 | 159 | concptr name = _("何か奇妙な物", "something strange"); |
160 | 160 | #ifdef JP |
@@ -166,9 +166,9 @@ static bool describe_hallucinated_target(player_type *subject_ptr, eg_type *eg_p | ||
166 | 166 | move_cursor_relative(eg_ptr->y, eg_ptr->x); |
167 | 167 | eg_ptr->query = inkey(); |
168 | 168 | if ((eg_ptr->query != '\r') && (eg_ptr->query != '\n')) |
169 | - return eg_ptr->query; | |
169 | + return PROCESS_TRUE; | |
170 | 170 | |
171 | - return TRUE; | |
171 | + return PROCESS_FALSE; | |
172 | 172 | } |
173 | 173 | |
174 | 174 | static bool describe_grid_lore(player_type *subject_ptr, eg_type *eg_ptr) |
@@ -444,16 +444,16 @@ static concptr decide_target_floor(player_type *subject_ptr, eg_type *eg_ptr) | ||
444 | 444 | return format( |
445 | 445 | _("クエスト「%s」(%d階相当)", "the entrance to the quest '%s'(level %d)"), quest[eg_ptr->g_ptr->special].name, quest[eg_ptr->g_ptr->special].level); |
446 | 446 | } |
447 | - | |
447 | + | |
448 | 448 | if (has_flag(eg_ptr->f_ptr->flags, FF_BLDG) && !subject_ptr->current_floor_ptr->inside_arena) |
449 | 449 | return building[eg_ptr->f_ptr->subtype].name; |
450 | - | |
450 | + | |
451 | 451 | if (has_flag(eg_ptr->f_ptr->flags, FF_ENTRANCE)) |
452 | 452 | return format(_("%s(%d階相当)", "%s(level %d)"), d_text + d_info[eg_ptr->g_ptr->special].text, d_info[eg_ptr->g_ptr->special].mindepth); |
453 | - | |
453 | + | |
454 | 454 | if (has_flag(eg_ptr->f_ptr->flags, FF_TOWN)) |
455 | 455 | return town_info[eg_ptr->g_ptr->special].name; |
456 | - | |
456 | + | |
457 | 457 | if (subject_ptr->wild_mode && (eg_ptr->feat == feat_floor)) |
458 | 458 | return _("道", "road"); |
459 | 459 |
@@ -483,8 +483,7 @@ static void describe_grid_monster_all(eg_type *eg_ptr) | ||
483 | 483 | travel.cost[eg_ptr->y][eg_ptr->x]); |
484 | 484 | #else |
485 | 485 | sprintf(eg_ptr->out_val, "%s%s%s%s [%s] %x %s %d %d %d (%d,%d)", eg_ptr->s1, eg_ptr->s2, eg_ptr->s3, eg_ptr->name, eg_ptr->info, eg_ptr->g_ptr->info, |
486 | - f_idx_str, | |
487 | - eg_ptr->g_ptr->dist, eg_ptr->g_ptr->cost, eg_ptr->g_ptr->when, (int)eg_ptr->y, (int)eg_ptr->x); | |
486 | + f_idx_str, eg_ptr->g_ptr->dist, eg_ptr->g_ptr->cost, eg_ptr->g_ptr->when, (int)eg_ptr->y, (int)eg_ptr->x); | |
488 | 487 | #endif |
489 | 488 | } |
490 | 489 |
@@ -504,9 +503,16 @@ char examine_grid(player_type *subject_ptr, const POSITION y, const POSITION x, | ||
504 | 503 | eg_type *eg_ptr = initialize_eg_type(subject_ptr, &tmp_eg, y, x, mode, info); |
505 | 504 | describe_scan_result(subject_ptr, eg_ptr); |
506 | 505 | describe_target(subject_ptr, eg_ptr); |
507 | - if (describe_hallucinated_target(subject_ptr, eg_ptr)) | |
506 | + process_result next_target = describe_hallucinated_target(subject_ptr, eg_ptr); | |
507 | + switch (next_target) { | |
508 | + case PROCESS_FALSE: | |
508 | 509 | return 0; |
509 | - | |
510 | + case PROCESS_TRUE: | |
511 | + return eg_ptr->query; | |
512 | + case PROCESS_CONTINUE: | |
513 | + break; | |
514 | + } | |
515 | + | |
510 | 516 | s16b description_grid = describe_grid(subject_ptr, eg_ptr); |
511 | 517 | if (within_char_util(description_grid)) |
512 | 518 | return (char)description_grid; |