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 
77 enum
78 {
79  PROJECT_NONE = 0x0000,
80  PROJECT_JUMP = 0x0001,
81  PROJECT_BEAM = 0x0002,
82  PROJECT_THRU = 0x0004,
83  PROJECT_STOP = 0x0008,
84  PROJECT_GRID = 0x0010,
85  PROJECT_ITEM = 0x0020,
86  PROJECT_KILL = 0x0040,
87  PROJECT_HIDE = 0x0080,
88  PROJECT_AWARE = 0x0100,
89  PROJECT_SAFE = 0x0200,
90  PROJECT_ARC = 0x0400,
91  PROJECT_PLAY = 0x0800,
92  PROJECT_INFO = 0x1000
93 };
94 
95 /* Display attrs and chars */
97 extern wchar_t proj_to_char[PROJ_MAX][BOLT_MAX];
98 
99 void thrust_away(struct loc centre, int t_y, int t_x, int grids_away);
100 int inven_damage(struct player *p, int type, int cperc);
101 int adjust_dam(struct player *p, int type, int dam, aspect dam_aspect,
102  int resist, bool actual);
103 
104 bool project_f(struct source, int r, int y, int x, int dam, int typ);
105 bool project_o(struct source, int r, int y, int x, int dam, int typ,
106  const struct object *protected_obj);
107 void project_m(struct source, int r, int y, int x, int dam, int typ, int flg,
108  bool *did_hit, bool *was_obvious);
109 bool project_p(struct source, int r, int y, int x, int dam, int typ);
110 
111 int project_path(struct loc *gp, int range, int y1, int x1, int y2, int x2, int flg);
112 bool projectable(struct chunk *c, int y1, int x1, int y2, int x2, int flg);
113 int proj_name_to_idx(const char *name);
114 const char *proj_idx_to_name(int type);
115 
116 struct loc origin_get_loc(struct source origin);
117 
118 bool project(struct source origin, int rad, struct loc finish, int dam, int typ,
119  int flg, int degrees_of_arc, byte diameter_of_source,
120  const struct object *obj);
121 
122 #endif /* !PROJECT_H */
Spell types used by project() and related functions.
char * blind_desc
Definition: project.h:34
int adjust_dam(struct player *p, int type, int dam, aspect dam_aspect, int resist, bool actual)
Adjust damage according to resistance or vulnerability.
Definition: project-player.c:44
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:710
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:627
Definition: project.h:55
void thrust_away(struct loc centre, int t_y, int t_x, int grids_away)
Thrust the player or a monster away from the source of a projection.
Definition: project-mon.c:83
wchar_t proj_to_char[PROJ_MAX][BOLT_MAX]
Definition: project.c:40
Definition: z-type.h:24
Definition: project.h:83
Definition: project.h:86
Definition: project.h:52
Definition: project.h:87
Definition: project.h:91
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:1291
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:347
Definition: project.h:85
struct loc origin_get_loc(struct source origin)
The main project() function and its helpers
Definition: project.c:387
Element struct.
Definition: project.h:28
uint8_t byte
Definition: h-basic.h:167
Definition: project.h:56
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:503
Definition: cave.h:160
Definition: project.h:92
Definition: project.h:88
int color
Definition: project.h:41
random_value denominator
Definition: project.h:36
byte proj_to_attr[PROJ_MAX][BOLT_MAX]
Definition: project.c:39
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:84
Definition: project.h:57
Definition: project.h:53
const char ** p[]
Definition: name.c:40
struct projection * projections
Definition: project.c:33
Definition: project.h:82
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
bool project(struct source origin, int rad, struct loc finish, 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:557
Definition: project.h:80
Definition: project.h:79
Definition: project.h:54
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
Definition: project.h:90
Definition: project.h:93
Intialize random names
Definition: init.c:838
Most of the "player" information goes here.
Definition: player.h:489
bool obvious
Definition: project.h:40
Definition: source.h:7
const char * proj_idx_to_name(int type)
Definition: project.c:71
int numerator
Definition: project.h:35
Definition: project.h:81
Definition: project.h:89
int divisor
Definition: project.h:37
Write value lines for a set of modifiers.