Angband
project.h
Go to the documentation of this file.
1 
6 #ifndef PROJECT_H
7 #define PROJECT_H
8 
9 #include "source.h"
10 
14 enum
15 {
16  #define ELEM(a) PROJ_##a,
17  #include "list-elements.h"
18  #undef ELEM
19  #define PROJ(a) PROJ_##a,
20  #include "list-projections.h"
21  #undef PROJ
22  PROJ_MAX
23 };
24 
28 struct projection {
29  int index;
30  char *name;
31  char *type;
32  char *desc;
33  char *player_desc;
34  char *blind_desc;
35  int numerator;
37  int divisor;
39  int msgt;
40  bool obvious;
41  int color;
42  struct projection *next;
43 };
44 
45 extern struct projection *projections;
46 
50 enum
51 {
58 };
59 
60 
76 enum
77 {
78  PROJECT_NONE = 0x000,
79  PROJECT_JUMP = 0x001,
80  PROJECT_BEAM = 0x002,
81  PROJECT_THRU = 0x004,
82  PROJECT_STOP = 0x008,
83  PROJECT_GRID = 0x010,
84  PROJECT_ITEM = 0x020,
85  PROJECT_KILL = 0x040,
86  PROJECT_HIDE = 0x080,
87  PROJECT_AWARE = 0x100,
88  PROJECT_SAFE = 0x200,
89  PROJECT_ARC = 0x400,
90  PROJECT_PLAY = 0x800
91 };
92 
93 /* Display attrs and chars */
95 extern wchar_t proj_to_char[PROJ_MAX][BOLT_MAX];
96 
97 int inven_damage(struct player *p, int type, int cperc);
98 int adjust_dam(struct player *p, int type, int dam, aspect dam_aspect, int resist);
99 
100 bool project_f(struct source, int r, int y, int x, int dam, int typ);
101 bool project_o(struct source, int r, int y, int x, int dam, int typ,
102  const struct object *protected_obj);
103 void project_m(struct source, int r, int y, int x, int dam, int typ, int flg,
104  bool *did_hit, bool *was_obvious);
105 bool project_p(struct source, int r, int y, int x, int dam, int typ);
106 
107 int project_path(struct loc *gp, int range, int y1, int x1, int y2, int x2, int flg);
108 bool projectable(struct chunk *c, int y1, int x1, int y2, int x2, int flg);
109 int proj_name_to_idx(const char *name);
110 const char *proj_idx_to_name(int type);
111 
112 struct loc origin_get_loc(struct source origin);
113 
114 bool project(struct source, int rad, int y, int x, int dam, int typ, int flg,
115  int degrees_of_arc, byte diameter_of_source,
116  const struct object *obj);
117 
118 #endif /* !PROJECT_H */
Spell types used by project() and related functions.
char * blind_desc
Definition: project.h:34
Definition: project.h:87
int index
Definition: project.h:29
bool project_f(struct source, int r, int y, int x, int dam, int typ)
Called from project() to affect terrain features.
Definition: project-feat.c:685
int msgt
Definition: project.h:39
char * desc
Definition: project.h:32
bool project_p(struct source, int r, int y, int x, int dam, int typ)
Called from project() to affect the player.
Definition: project-player.c:592
Definition: project.h:53
Definition: project.h:56
wchar_t proj_to_char[PROJ_MAX][BOLT_MAX]
Definition: project.c:40
Definition: z-type.h:24
Definition: project.h:85
void project_m(struct source, int r, int y, int x, int dam, int typ, int flg, bool *did_hit, bool *was_obvious)
Called from project() to affect monsters.
Definition: project-mon.c:1010
char * name
Definition: project.h:30
bool projectable(struct chunk *c, int y1, int x1, int y2, int x2, int flg)
Determine if a bolt spell cast from (y1,x1) to (y2,x2) will arrive at the final destination, assuming that no monster gets in the way, using the project_path() function to check the projection path.
Definition: project.c:330
struct loc origin_get_loc(struct source origin)
The main project() function and its helpers
Definition: project.c:370
bool project(struct source, int rad, int y, int x, int dam, int typ, int flg, int degrees_of_arc, byte diameter_of_source, const struct object *obj)
Generic "beam"/"bolt"/"ball" projection routine.
Definition: project.c:540
Definition: project.h:52
Definition: project.h:89
Element struct.
Definition: project.h:28
uint8_t byte
Definition: h-basic.h:167
struct projection * next
Definition: project.h:42
bool project_o(struct source, int r, int y, int x, int dam, int typ, const struct object *protected_obj)
Called from project() to affect objects.
Definition: project-obj.c:487
Definition: cave.h:147
Definition: project.h:78
Definition: project.h:88
int color
Definition: project.h:41
Definition: project.h:84
Definition: project.h:83
random_value denominator
Definition: project.h:36
int x
Definition: z-type.h:25
byte proj_to_attr[PROJ_MAX][BOLT_MAX]
Definition: project.c:39
Definition: project.h:57
int inven_damage(struct player *p, int type, int cperc)
Destroys a type of item on a given percent chance.
Definition: project-obj.c:40
char * type
Definition: project.h:31
Definition: project.h:88
int type
Definition: mon-msg.c:80
int y
Definition: z-type.h:26
const char ** p[]
Definition: name.c:40
Definition: project.h:79
struct projection * projections
Definition: project.c:33
Definition: project.h:90
Definition: project.h:80
int proj_name_to_idx(const char *name)
Definition: project.c:60
A struct representing a strategy for making a dice roll.
Definition: z-rand.h:40
char * player_desc
Definition: project.h:33
int damage_cap
Definition: project.h:38
Definition: project.h:54
Definition: project.h:55
int adjust_dam(struct player *p, int type, int dam, aspect dam_aspect, int resist)
Adjust damage according to resistance or vulnerability.
Definition: project-player.c:44
int project_path(struct loc *gp, int range, int y1, int x1, int y2, int x2, int flg)
Projection paths
Definition: project.c:123
aspect
Random aspects used by damcalc, m_bonus_calc, and ranvals.
Definition: z-rand.h:55
Intialize random names
Definition: init.c:656
Most of the "player" information goes here.
Definition: player.h:452
bool obvious
Definition: project.h:40
Definition: source.h:7
const char * proj_idx_to_name(int type)
Definition: project.c:71
Definition: project.h:81
int numerator
Definition: project.h:35
Definition: project.h:82
Definition: project.h:86
int divisor
Definition: project.h:37
Write value lines for a set of modifiers.