| 618 | } |
| 619 | |
| 620 | static void _fire_player_ranged_attacks(vector<ranged_attack_beam>& atks) |
| 621 | { |
| 622 | // If attacking with more than one weapon, do so in a random order. |
| 623 | if (atks.size() > 1) |
| 624 | shuffle_array(atks); |
| 625 | |
| 626 | // XXX: We must save this before the ranged attack itself is fired, since |
| 627 | // consuming the last of a stack of missiles will erase all information |
| 628 | // about what type of missile was just thrown. |
| 629 | const missile_type missile = atks[0].atk.weapon->base_type == OBJ_MISSILES |
| 630 | ? static_cast<missile_type>(atks[0].atk.weapon->sub_type) |
| 631 | : NUM_MISSILES; |
| 632 | |
| 633 | bool shot_at_enemy = false; |
| 634 | for (ranged_attack_beam& atk : atks) |
| 635 | { |
| 636 | _player_shoot(atk); |
| 637 | if (atk.beam.foes_hurt) |
| 638 | shot_at_enemy = true; |
| 639 | } |
| 640 | |
| 641 | if (shot_at_enemy) |
| 642 | { |
| 643 | if (will_have_passive(passive_t::shadow_attacks) |
| 644 | && (missile != MI_DART && missile != MI_THROWING_NET)) |
| 645 | { |
| 646 | dithmenos_shadow_shoot(atks[0].beam.target, missile); |
| 647 | } |
| 648 | |
| 649 | if (you.duration[DUR_PARAGON_ACTIVE] && !you.triggers_done[DID_PARAGON]) |
| 650 | paragon_attack_trigger(); |
| 651 | |
| 652 | if (you.has_mutation(MUT_WARMUP_STRIKES) && !you.triggers_done[DID_REV_UP] && missile == NUM_MISSILES) |
| 653 | you.rev_up(you.attack_delay().roll()); |
| 654 | } |
| 655 | } |
| 656 | |
| 657 | // Aim and then perform a standard ranged attack, either by autofight or the quiver interface. |
| 658 | void aim_player_ranged_attack(quiver::action &a) |
no test coverage detected