Go to the documentation of this file.
19 #ifndef TARGET_H
20 #define TARGET_H
22 #include "mon-predicate.h"
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
39 struct target {
40  struct loc grid;
41  int midx;
42 };
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 void target_fix(void);
51 void target_release(void);
52 int cmp_distance(const void *a, const void *b);
53 s16b target_pick(int y1, int x1, int dy, int dx, struct point_set *targets);
54 bool target_accept(int y, int x);
55 void coords_desc(char *buf, int size, int y, int x);
56 void target_get(struct loc *grid);
57 struct monster *target_get_monster(void);
58 bool target_sighted(void);
59 struct point_set *target_get_monsters(int mode, monster_predicate pred);
60 bool target_set_closest(int mode, monster_predicate pred);
62 #endif /* !TARGET_H */
Monster information, for a specific monster.
Definition: monster.h:369
struct monster * target_get_monster(void)
Returns the currently targeted monster index.
Definition: target.c:402
Definition: z-type.h:24
bool target_accept(int y, int x)
Determine if a given location is "interesting".
Definition: target.c:324
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:275
void target_set_location(int y, int x)
Set the target to a location.
Definition: target.c:179
bool target_set_monster(struct monster *mon)
Set the target to a monster (or nobody); if target is fixed, don't unset.
Definition: target.c:151
A set of points that can be constructed to apply a set of changes to.
Definition: z-type.h:50
void target_release(void)
Release the target.
Definition: target.c:219
struct point_set * target_get_monsters(int mode, monster_predicate pred)
Return a target set of target_able monsters.
Definition: target.c:427
bool target_okay(void)
Update (if necessary) and verify (if possible) the target.
Definition: target.c:123
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:475
bool target_able(struct monster *m)
Determine if a monster makes a reasonable target.
Definition: target.c:109
void look_mon_desc(char *buf, size_t max, int m_idx)
Monster health description.
Definition: target.c:55
void target_get(struct loc *grid)
Obtains the location the player currently targets.
Definition: target.c:392
int16_t s16b
Definition: h-basic.h:162
bool target_sighted(void)
True if the player's current target is in LOS.
Definition: target.c:411
int cmp_distance(const void *a, const void *b)
Sorting hook – comp function – by "distance to player".
Definition: target.c:239
Monster predicates.
void coords_desc(char *buf, int size, int y, int x)
Describe a location relative to the player position.
Definition: target.c:367
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:202
void target_fix(void)
Fix the target.
Definition: target.c:210