Go to the documentation of this file.
22 #include "source.h"
23 #include "object.h"
24 #include "player-attack.h"
25 #include "cmds.h"
28 /* Types of effect */
29 typedef enum
30 {
32  #define EFFECT(x, a, b, c, d, e) EF_##x,
33  #include "list-effects.h"
34  #undef EFFECT
35  EF_MAX
36 } effect_index;
38 /*** Functions ***/
40 void free_effect(struct effect *source);
41 bool effect_valid(const struct effect *effect);
42 bool effect_aim(const struct effect *effect);
43 const char *effect_info(const struct effect *effect);
44 const char *effect_desc(const struct effect *effect);
45 effect_index effect_lookup(const char *name);
46 int effect_subtype(int index, const char *type);
47 bool effect_do(struct effect *effect,
48  struct source origin,
49  struct object *obj,
50  bool *ident,
51  bool aware,
52  int dir,
53  int beam,
54  int boost,
55  struct command *cmd);
56 void effect_simple(int index,
57  struct source origin,
58  const char *dice_string,
59  int subtype,
60  int radius,
61  int other,
62  int y,
63  int x,
64  bool *ident);
65 int recharge_failure_chance(const struct object *obj, int strength);
67 #endif /* INCLUDED_EFFECTS_H */
bool effect_valid(const struct effect *effect)
Definition: effects.c:5483
The struct command type is used to return details of the command the game should carry out...
Definition: cmd-core.h:176
const char * effect_desc(const struct effect *effect)
Definition: effects.c:5512
int other
Extra parameter to be passed to the handler.
Definition: object.h:60
effect_index effect_lookup(const char *name)
Definition: effects.c:5520
const char * effect_info(const struct effect *effect)
Definition: effects.c:5504
int x
X coordinate or distance.
Definition: object.h:57
Definition: effects.h:31
int type
Definition: mon-msg.c:80
int radius
Radius of the effect (if it has one)
Definition: object.h:59
Definition: effects.h:29
int y
Y coordinate or distance.
Definition: object.h:56
int effect_subtype(int index, const char *type)
Translate a string to an effect parameter subtype index.
Definition: effects.c:5538
int subtype
Projection type, timed effect type, etc.
Definition: object.h:58
int recharge_failure_chance(const struct object *obj, int strength)
Returns N which is the 1 in N chance for recharging to fail.
Definition: effects.c:2404
bool effect_do(struct effect *effect, struct source origin, struct object *obj, bool *ident, bool aware, int dir, int beam, int boost, struct command *cmd)
Execution of effects
Definition: effects.c:5701
Header for game command files.
Attacks (both throwing and melee) by the player.
basic object structs and enums
bool effect_aim(const struct effect *effect)
Definition: effects.c:5489
Definition: object.h:52
void effect_simple(int index, struct source origin, const char *dice_string, int subtype, int radius, int other, int y, int x, bool *ident)
Perform a single effect with a simple dice string and parameters Calling with ident a valid pointer w...
Definition: effects.c:5784
Intialize random names
Definition: init.c:1084
Definition: source.h:7
int index
Definition: obj-info.c:68
void free_effect(struct effect *source)
Free all the effects in a structure.
Definition: effects.c:5469
List of effects.