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

Function do_player_ranged_attack

crawl-ref/source/throw.cc:706–715  ·  view source on GitHub ↗

Make the player immediately perform a ranged attack at a given target, optionally with a specific projectile. Does not handle spending time.

Source from the content-addressed store, hash-verified

704// Make the player immediately perform a ranged attack at a given target, optionally
705// with a specific projectile. Does not handle spending time.
706bool 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.

Callers 1

fight_meleeFunction · 0.85

Tested by

no test coverage detected