Make the player immediately perform a ranged attack at a given target, optionally with a specific projectile. Does not handle spending time.
| 704 | // Make the player immediately perform a ranged attack at a given target, optionally |
| 705 | // with a specific projectile. Does not handle spending time. |
| 706 | bool do_player_ranged_attack(const coord_def& targ, item_def* thrown_projectile, bool auto_abort) |
| 707 | { |
| 708 | vector<ranged_attack_beam> atks = _construct_player_ranged_beams(thrown_projectile); |
| 709 | for (ranged_attack_beam& atk : atks) |
| 710 | atk.beam.target = targ; |
| 711 | if (_trace_player_ranged_attacks(atks, auto_abort)) |
| 712 | return false; |
| 713 | _fire_player_ranged_attacks(atks); |
| 714 | return true; |
| 715 | } |
| 716 | |
| 717 | // Once the player has committed to a target, shoot/throw/toss at it. |
| 718 | // Handles conducts, action counts, ammunition use, etc. |
no test coverage detected