Angband
target.h
Go to the documentation of this file.
1 
19 #ifndef TARGET_H
20 #define TARGET_H
21 
22 #include "mon-predicate.h"
23 
33 #define TARGET_KILL 0x01
34 #define TARGET_LOOK 0x02
35 #define TARGET_XTRA 0x04
36 #define TARGET_GRID 0x08
37 #define TARGET_QUIET 0x10
38 
39 struct target {
40  struct loc grid;
41  int midx;
42 };
43 
44 void look_mon_desc(char *buf, size_t max, int m_idx);
45 bool target_able(struct monster *m);
46 bool target_okay(void);
47 bool target_set_monster(struct monster *mon);
48 void target_set_location(int y, int x);
49 bool target_is_set(void);
50 int cmp_distance(const void *a, const void *b);
51 s16b target_pick(int y1, int x1, int dy, int dx, struct point_set *targets);
52 bool target_accept(int y, int x);
53 void coords_desc(char *buf, int size, int y, int x);
54 void target_get(int *x, int *y);
55 struct monster *target_get_monster(void);
56 bool target_sighted(void);
57 struct point_set *target_get_monsters(int mode, monster_predicate pred);
58 bool target_set_closest(int mode, monster_predicate pred);
59 
60 #endif /* !TARGET_H */
void target_get(int *x, int *y)
Obtains the location the player currently targets.
Definition: target.c:348
Monster information, for a specific monster.
Definition: monster.h:325
struct monster * target_get_monster(void)
Returns the currently targeted monster index.
Definition: target.c:361
Definition: z-type.h:24
bool target_accept(int y, int x)
Determine if a given location is "interesting".
Definition: target.c:281
bool(* monster_predicate)(const struct monster *mon)
monster_predicate is a function pointer which tests a given monster to see if the predicate in questi...
Definition: mon-predicate.h:27
s16b target_pick(int y1, int x1, int dy, int dx, struct point_set *targets)
Help select a location.
Definition: target.c:232
void target_set_location(int y, int x)
Set the target to a location.
Definition: target.c:163
bool target_set_monster(struct monster *mon)
Set the target to a monster (or nobody)
Definition: target.c:139
A set of points that can be constructed to apply a set of changes to.
Definition: z-type.h:46
struct point_set * target_get_monsters(int mode, monster_predicate pred)
Return a target set of target_able monsters.
Definition: target.c:386
bool target_okay(void)
Update (if necessary) and verify (if possible) the target.
Definition: target.c:110
int x
Definition: z-type.h:25
png_bytep buf
Definition: libpng12/png.h:2815
int y
Definition: z-type.h:26
bool target_set_closest(int mode, monster_predicate pred)
Set target to closest monster.
Definition: target.c:432
bool target_able(struct monster *m)
Determine if a monster makes a reasonable target.
Definition: target.c:96
void look_mon_desc(char *buf, size_t max, int m_idx)
Monster health description.
Definition: target.c:46
int16_t s16b
Definition: h-basic.h:170
bool target_sighted(void)
True if the player's current target is in LOS.
Definition: target.c:370
int cmp_distance(const void *a, const void *b)
Sorting hook – comp function – by "distance to player".
Definition: target.c:196
Monster predicates.
void coords_desc(char *buf, int size, int y, int x)
Describe a location relative to the player position.
Definition: target.c:323
png_uint_32 size
Definition: libpng12/png.h:1546
int midx
Definition: target.h:41
struct loc grid
Definition: target.h:40
Definition: target.h:39
bool target_is_set(void)
Tell the UI the target is set.
Definition: target.c:185