Attacks (both throwing and melee) by the player. More...
|typedef struct attack_result(*||ranged_attack )(object_type *o_ptr, int y, int x)|
|ranged_attack is a function pointer, used to execute a kind of attack. |
|void||do_cmd_fire (struct command *cmd)|
|Fire an object from the quiver, pack or floor at a target. |
|Front-end command which fires at the nearest target with default ammo. |
|void||do_cmd_throw (struct command *cmd)|
|Throw an object from the quiver, pack or floor. |
|int||breakage_chance (const object_type *o_ptr, bool hit_target)|
|bool||test_hit (int chance, int ac, int vis)|
|Determine if the player "hits" a monster. |
|void||py_attack (int y, int x)|
|Attack the monster at the given location. |
|int||py_attack_hit_chance (const object_type *weapon)|
|Return the player's chance to hit with a particular weapon. |
Attacks (both throwing and melee) by the player.
Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
This work is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation, version 2, or
b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.
ranged_attack is a function pointer, used to execute a kind of attack.
This allows us to abstract details of throwing, shooting, etc. out while keeping the core projectile tracking, monster cleanup, and display code in common.
Fire an object from the quiver, pack or floor at a target.
References player_state::ammo_mult, player_state::ammo_tval, cmd_get_item(), cmd_get_target(), CMD_OK, equipped_item_by_slot_name(), FALSE, item_is_available(), make_ranged_shot(), angband_constants::max_range, MIN, msg, player_state::num_shots, obj_can_fire(), player_confuse_dir(), QUIVER_TAGS, ranged_helper(), player::state, object::tval, USE_FLOOR, USE_INVEN, USE_QUIVER, and z_info.
Referenced by do_cmd_use().
Front-end command which fires at the nearest target with default ammo.
References player_state::ammo_tval, CMD_FIRE, cmd_set_arg_item(), cmd_set_arg_target(), cmdq_peek(), cmdq_push(), DIR_TARGET, equipped_item_by_slot_name(), i, msg, player_upkeep::quiver, angband_constants::quiver_size, player::state, TARGET_KILL, TARGET_QUIET, target_set_closest(), object::tval, player::upkeep, and z_info.
Throw an object from the quiver, pack or floor.
References adj_str_blow, player::body, cmd_get_item(), cmd_get_target(), CMD_OK, FALSE, make_ranged_throw(), MAX, MIN, msg, object_is_equipped(), player_confuse_dir(), ranged_helper(), player_state::stat_ind, player::state, USE_FLOOR, USE_INVEN, USE_QUIVER, and object::weight.
Attack the monster at the given location.
We get blows until energy drops below that required for another blow, or until the target monster dies. Each blow is handled by py_attack_real(). We don't allow @ to spend more than 100 energy in one go, to avoid slower monsters getting double moves.
References add_monster_message(), cave, disturb(), player::energy, player_upkeep::energy_use, FALSE, MDESC_DEFAULT, monster::mflag, mflag_has, monster_desc(), angband_constants::move_energy, player_state::num_blows, py_attack_real(), square_monster(), player::state, TRUE, player::upkeep, and z_info.