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  char *lash_desc;
36  int numerator;
38  int divisor;
40  int msgt;
41  bool obvious;
42  int color;
43  struct projection *next;
44 };
45 
46 extern struct projection *projections;
47 
51 enum
52 {
59 };
60 
61 
78 enum
79 {
80  PROJECT_NONE = 0x0000,
81  PROJECT_JUMP = 0x0001,
82  PROJECT_BEAM = 0x0002,
83  PROJECT_THRU = 0x0004,
84  PROJECT_STOP = 0x0008,
85  PROJECT_GRID = 0x0010,
86  PROJECT_ITEM = 0x0020,
87  PROJECT_KILL = 0x0040,
88  PROJECT_HIDE = 0x0080,
89  PROJECT_AWARE = 0x0100,
90  PROJECT_SAFE = 0x0200,
91  PROJECT_ARC = 0x0400,
92  PROJECT_PLAY = 0x0800,
93  PROJECT_INFO = 0x1000,
94 };
95 
96 /* Display attrs and chars */
98 extern wchar_t proj_to_char[PROJ_MAX][BOLT_MAX];
99 
100 void thrust_away(struct loc centre, struct loc target, int grids_away);
101 int inven_damage(struct player *p, int type, int cperc);
102 int adjust_dam(struct player *p, int type, int dam, aspect dam_aspect,
103  int resist, bool actual);
104 
105 bool project_f(struct source, int r, struct loc grid, int dam, int typ);
106 bool project_o(struct source, int r, struct loc grid, int dam, int typ,
107  const struct object *protected_obj);
108 void project_m(struct source, int r, struct loc grid, int dam, int typ, int flg,
109  bool *did_hit, bool *was_obvious);
110 bool project_p(struct source, int r, struct loc grid, int dam, int typ,
111  int power);
112 
113 int project_path(struct loc *gp, int range, struct loc grid1, struct loc grid2,
114  int flg);
115 bool projectable(struct chunk *c, struct loc grid1, struct loc grid2, int flg);
116 int proj_name_to_idx(const char *name);
117 const char *proj_idx_to_name(int type);
118 
119 struct loc origin_get_loc(struct source origin);
120 
121 bool project(struct source origin, int rad, struct loc finish, int dam, int typ,
122  int flg, int degrees_of_arc, byte diameter_of_source,
123  const struct object *obj);
124 
125 #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
Definition: project.h:89
char * lash_desc
Definition: project.h:35
int index
Definition: project.h:29
int msgt
Definition: project.h:40
char * desc
Definition: project.h:32
Definition: project.h:54
Definition: project.h:57
wchar_t proj_to_char[PROJ_MAX][BOLT_MAX]
Definition: project.c:40
Definition: z-type.h:24
Definition: project.h:87
char * name
Definition: project.h:30
struct loc origin_get_loc(struct source origin)
The main project() function and its helpers
Definition: project.c:382
Definition: project.h:53
Definition: project.h:91
Element struct.
Definition: project.h:28
uint8_t byte
Definition: h-basic.h:167
bool project_p(struct source, int r, struct loc grid, int dam, int typ, int power)
Called from project() to affect the player.
Definition: project-player.c:762
struct projection * next
Definition: project.h:43
Definition: cave.h:178
Definition: project.h:93
void project_m(struct source, int r, struct loc grid, int dam, int typ, int flg, bool *did_hit, bool *was_obvious)
Called from project() to affect monsters.
Definition: project-mon.c:1278
Definition: project.h:80
Definition: project.h:90
int color
Definition: project.h:42
Definition: project.h:86
Definition: project.h:85
random_value denominator
Definition: project.h:37
byte proj_to_attr[PROJ_MAX][BOLT_MAX]
Definition: project.c:39
Definition: project.h:58
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
void thrust_away(struct loc centre, struct loc target, int grids_away)
Thrust the player or a monster away from the source of a projection.
Definition: project-mon.c:83
Definition: project.h:93
const char ** p[]
Definition: name.c:40
Definition: project.h:81
struct projection * projections
Definition: project.c:33
Definition: project.h:92
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
bool projectable(struct chunk *c, struct loc grid1, struct loc grid2, int flg)
Determine if a bolt spell cast from grid1 to grid2 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:348
char * player_desc
Definition: project.h:33
bool project_f(struct source, int r, struct loc grid, int dam, int typ)
Called from project() to affect terrain features.
Definition: project-feat.c:684
int damage_cap
Definition: project.h:39
Definition: project.h:55
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:552
Definition: project.h:56
bool project_o(struct source, int r, struct loc grid, int dam, int typ, const struct object *protected_obj)
Called from project() to affect objects.
Definition: project-obj.c:502
int project_path(struct loc *gp, int range, struct loc grid1, struct loc grid2, 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:847
Most of the "player" information goes here.
Definition: player.h:489
bool obvious
Definition: project.h:41
Definition: source.h:7
const char * proj_idx_to_name(int type)
Definition: project.c:71
Definition: project.h:83
int numerator
Definition: project.h:36
Definition: project.h:84
Definition: project.h:88
Definition: target.h:39
int divisor
Definition: project.h:38
Write value lines for a set of modifiers.