MCPcopy Create free account
hub / github.com/crawl/crawl / _fire_player_ranged_attacks

Function _fire_player_ranged_attacks

crawl-ref/source/throw.cc:620–655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620static 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.
658void aim_player_ranged_attack(quiver::action &a)

Callers 2

aim_player_ranged_attackFunction · 0.85
do_player_ranged_attackFunction · 0.85

Calls 10

shuffle_arrayFunction · 0.85
_player_shootFunction · 0.85
will_have_passiveFunction · 0.85
dithmenos_shadow_shootFunction · 0.85
paragon_attack_triggerFunction · 0.85
has_mutationMethod · 0.80
rev_upMethod · 0.80
sizeMethod · 0.45
rollMethod · 0.45
attack_delayMethod · 0.45

Tested by

no test coverage detected