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 player;
25 
26 struct attack_result {
27  bool success;
28  int dmg;
30  char *hit_verb;
31 };
32 
36 struct hit_types {
38  const char *text;
39 };
40 
48 typedef struct attack_result (*ranged_attack) (struct player *p,
49  struct object *obj,
50  struct loc grid);
51 
52 extern void do_cmd_fire(struct command *cmd);
53 extern void do_cmd_fire_at_nearest(void);
54 extern void do_cmd_throw(struct command *cmd);
55 
56 
57 extern int breakage_chance(const struct object *obj, bool hit_target);
58 int chance_of_melee_hit(const struct player *p, const struct object *weapon);
59 extern bool test_hit(int chance, int ac, int vis);
60 void apply_deadliness(int *die_average, int deadliness);
61 extern void py_attack(struct player *p, struct loc grid);
62 extern bool py_attack_real(struct player *p, struct loc grid, bool *fear);
63 
64 #endif /* !PLAYER_ATTACK_H */
int dmg
Definition: player-attack.h:28
int breakage_chance(const struct object *obj, bool hit_target)
Hit and breakage calculations
Definition: player-attack.c:67
bool success
Definition: player-attack.h:27
uint32_t u32b
Definition: h-basic.h:164
Definition: z-type.h:24
The struct command type is used to return details of the command the game should carry out...
Definition: cmd-core.h:176
void do_cmd_fire(struct command *cmd)
Fire an object from the quiver, pack or floor at a target.
Definition: player-attack.c:1187
void apply_deadliness(int *die_average, int deadliness)
Deadliness multiplies the damage done by a percentage, which varies from 0% (no damage done at all) t...
Definition: player-attack.c:185
A list of the different hit types and their associated special message.
Definition: player-attack.h:36
const char * text
Definition: player-attack.h:38
u32b msg_type
Definition: player-attack.h:29
void do_cmd_throw(struct command *cmd)
Throw an object from the quiver, pack or floor.
Definition: player-attack.c:1246
Handles the queueing of game commands.
const char ** p[]
Definition: name.c:40
void py_attack(struct player *p, struct loc grid)
Attack the monster at the given location.
Definition: player-attack.c:875
Definition: player-attack.h:26
void do_cmd_fire_at_nearest(void)
Front-end command which fires at the nearest target with default ammo.
Definition: player-attack.c:1296
struct attack_result(* ranged_attack)(struct player *p, struct object *obj, struct loc grid)
ranged_attack is a function pointer, used to execute a kind of attack.
Definition: player-attack.h:48
bool py_attack_real(struct player *p, struct loc grid, bool *fear)
Attack the monster at the given location with a single blow.
Definition: player-attack.c:612
char * hit_verb
Definition: player-attack.h:30
bool test_hit(int chance, int ac, int vis)
Determine if the player "hits" a monster.
Definition: player-attack.c:127
u32b msg_type
Definition: player-attack.h:37
Most of the "player" information goes here.
Definition: player.h:503
int chance_of_melee_hit(const struct player *p, const struct object *weapon)
Return the player's chance to hit with a particular weapon.
Definition: player-attack.c:83