If needs_tracer is true, we need to check the beam path for friendly monsters.
| 210 | // If needs_tracer is true, we need to check the beam path for friendly |
| 211 | // monsters. |
| 212 | spret zapping(zap_type ztype, int power, bolt &pbolt, |
| 213 | bool needs_tracer, const char* msg, bool fail) |
| 214 | { |
| 215 | dprf(DIAG_BEAM, "zapping: power=%d", power); |
| 216 | |
| 217 | pbolt.thrower = KILL_YOU_MISSILE; |
| 218 | |
| 219 | // Check whether tracer goes through friendlies. |
| 220 | // NOTE: Whenever zapping() is called with a randomised value for power |
| 221 | // (or effect), player_tracer should be called directly with the highest |
| 222 | // power possible respecting current skill, experience level, etc. |
| 223 | if (needs_tracer && !player_tracer(ztype, power, pbolt)) |
| 224 | return spret::abort; |
| 225 | |
| 226 | fail_check(); |
| 227 | // Fill in the bolt structure. |
| 228 | zappy(ztype, power, false, pbolt); |
| 229 | |
| 230 | if (msg) |
| 231 | mpr(msg); |
| 232 | |
| 233 | if (ztype == ZAP_DIG) |
| 234 | pbolt.aimed_at_spot = false; |
| 235 | // XXX: Not an explosion internally, which would do this automatically, |
| 236 | // but is aimed like one and should behavior like one UI-wise. |
| 237 | else if (ztype == ZAP_RUST_BREATH) |
| 238 | pbolt.aimed_at_spot = true; |
| 239 | |
| 240 | pbolt.fire(); |
| 241 | |
| 242 | return spret::success; |
| 243 | } |
| 244 | |
| 245 | void fire_partial_player_tracer(zap_type ztype, int power, |
| 246 | player_beam_tracer& tracer, |
no test coverage detected