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 
34 struct hit_types {
36  const char *text;
37 };
38 
46 typedef struct attack_result (*ranged_attack) (struct player *p, struct object *obj, int y, int x);
47 
48 extern void do_cmd_fire(struct command *cmd);
49 extern void do_cmd_fire_at_nearest(void);
50 extern void do_cmd_throw(struct command *cmd);
51 
52 
53 extern int breakage_chance(const struct object *obj, bool hit_target);
54 extern bool test_hit(int chance, int ac, int vis);
55 extern void py_attack(struct player *p, int y, int x);
56 int py_attack_hit_chance(const struct player *p, const struct object *weapon);
57 
58 #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:60
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:727
A list of the different hit types and their associated special message.
Definition: player-attack.h:34
const char * text
Definition: player-attack.h:36
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:777
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:292
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:46
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:818
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:91
void py_attack(struct player *p, int y, int x)
Attack the monster at the given location.
Definition: player-attack.c:440
u32b msg_type
Definition: player-attack.h:35
Most of the "player" information goes here.
Definition: player.h:450