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 int inven_damage(struct player *p, int type, int cperc);
100 int adjust_dam(struct player *p, int type, int dam, aspect dam_aspect,
101  int resist, bool actual);
102 
103 bool project_f(struct source, int r, int y, int x, int dam, int typ);
104 bool project_o(struct source, int r, int y, int x, int dam, int typ,
105  const struct object *protected_obj);
106 void project_m(struct source, int r, int y, int x, int dam, int typ, int flg,
107  bool *did_hit, bool *was_obvious);
108 bool project_p(struct source, int r, int y, int x, int dam, int typ);
109 
110 int project_path(struct loc *gp, int range, int y1, int x1, int y2, int x2, int flg);
111 bool projectable(struct chunk *c, int y1, int x1, int y2, int x2, int flg);
112 int proj_name_to_idx(const char *name);
113 const char *proj_idx_to_name(int type);
114 
115 struct loc origin_get_loc(struct source origin);
116 
117 bool project(struct source, int rad, int y, int x, int dam, int typ, int flg,
118  int degrees_of_arc, byte diameter_of_source,
119  const struct object *obj);
120 
121 #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
Definition: project.h:56
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:690
int msgt
Definition: project.h:39
Definition: project.h:84
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:595
Definition: project.h:79
wchar_t proj_to_char[PROJ_MAX][BOLT_MAX]
Definition: project.c:40
Definition: z-type.h:24
Definition: project.h:83
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:1019
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:339
struct loc origin_get_loc(struct source origin)
The main project() function and its helpers
Definition: project.c:379
Definition: project.h:53
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:549
Definition: project.h:88
Definition: project.h:90
Element struct.
Definition: project.h:28
uint8_t byte
Definition: h-basic.h:167
Definition: project.h:55
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:483
Definition: cave.h:160
int color
Definition: project.h:41
Definition: project.h:81
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
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:86
int y
Definition: z-type.h:26
Definition: project.h:92
Definition: project.h:54
const char ** p[]
Definition: name.c:40
Definition: project.h:82
struct projection * projections
Definition: project.c:33
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:52
Definition: project.h:89
Definition: project.h:85
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:87
Intialize random names
Definition: init.c:756
Most of the "player" information goes here.
Definition: player.h:450
Definition: project.h:80
Definition: project.h:88
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:91
Definition: project.h:57
int divisor
Definition: project.h:37
Write value lines for a set of modifiers.