Angband
player-attack.h
Go to the documentation of this file.
1 
19 #ifndef PLAYER_ATTACK_H
20 #define PLAYER_ATTACK_H
21 
22 #include "cmd-core.h"
23 
24 struct attack_result {
25  bool success;
26  int dmg;
28  char *hit_verb;
29 };
30 
38 typedef struct attack_result (*ranged_attack) (struct player *p, struct object *obj, int y, int x);
39 
40 extern void do_cmd_fire(struct command *cmd);
41 extern void do_cmd_fire_at_nearest(void);
42 extern void do_cmd_throw(struct command *cmd);
43 
44 
45 extern int breakage_chance(const struct object *obj, bool hit_target);
46 extern bool test_hit(int chance, int ac, int vis);
47 extern void py_attack(struct player *p, int y, int x);
48 int py_attack_hit_chance(const struct player *p, const struct object *weapon);
49 
50 #endif /* !PLAYER_ATTACK_H */
int dmg
Definition: player-attack.h:26
int breakage_chance(const struct object *obj, bool hit_target)
Returns percent chance of an object breaking after throwing or shooting.
Definition: player-attack.c:59
bool success
Definition: player-attack.h:25
uint32_t u32b
Definition: h-basic.h:172
The struct command type is used to return details of the command the game should carry out...
Definition: cmd-core.h:188
void do_cmd_fire(struct command *cmd)
Fire an object from the quiver, pack or floor at a target.
Definition: player-attack.c:741
u32b msg_type
Definition: player-attack.h:27
void do_cmd_throw(struct command *cmd)
Throw an object from the quiver, pack or floor.
Definition: player-attack.c:790
Handles the queueing of game commands.
const char ** p[]
Definition: name.c:40
int py_attack_hit_chance(const struct player *p, const struct object *weapon)
Return the player's chance to hit with a particular weapon.
Definition: player-attack.c:302
struct attack_result(* ranged_attack)(struct player *p, struct object *obj, int y, int x)
ranged_attack is a function pointer, used to execute a kind of attack.
Definition: player-attack.h:38
Definition: player-attack.h:24
void do_cmd_fire_at_nearest(void)
Front-end command which fires at the nearest target with default ammo.
Definition: player-attack.c:830
char * hit_verb
Definition: player-attack.h:28
bool test_hit(int chance, int ac, int vis)
Determine if the player "hits" a monster.
Definition: player-attack.c:90
void py_attack(struct player *p, int y, int x)
Attack the monster at the given location.
Definition: player-attack.c:452
Most of the "player" information goes here.
Definition: player.h:454