Data Structures | Macros | Enumerations | Functions
effects.h File Reference

effect handling More...

#include "list-effects.h"

Go to the source code of this file.

Data Structures

struct  effect


#define EFFECT(x, a, b, d)   EF_##x,


enum  effect_index { EF_NONE, EF_MAX }


bool remove_all_curse (void)
void free_effect (struct effect *source)
 Free all the effects in a structure.
bool effect_valid (struct effect *effect)
bool effect_aim (struct effect *effect)
const char * effect_info (struct effect *effect)
const char * effect_desc (struct effect *effect)
effect_index effect_lookup (const char *name)
int effect_param (const char *type)
 Translate a string to an effect parameter index.
bool effect_do (struct effect *effect, bool *ident, bool aware, int dir, int beam, int boost)
 Do an effect, given an object.
void effect_simple (int index, const char *dice_string, int p1, int p2, int p3, bool *ident)
 Perform a single effect with a simple dice string and parameters Calling with ident a valid pointer will (depending on effect) give success information; ident = NULL will ignore this.

Detailed Description

effect handling

Copyright (c) 2007 Andi Sidwell Copyright (c) 2014 Ben Semmler, Nick McConnell

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

Macro Definition Documentation

#define EFFECT (   x,
)    EF_##x,

Enumeration Type Documentation


Function Documentation

bool effect_aim ( struct effect effect)
const char* effect_desc ( struct effect effect)
bool effect_do ( struct effect effect,
bool ident,
bool  aware,
int  dir,
int  beam,
int  boost 

Do an effect, given an object.

Boost is the extent to which skill surpasses difficulty, used as % boost. It ranges from 0 to 138.

Note that no effect ever sets *ident to FALSE

References effect::dice, dice_roll(), effect_valid(), FALSE, effect_kind::handler, effect_handler_context_s::ident, effect::index, msg, effect::next, effect::params, randint0, and value.

Referenced by do_mon_spell(), effect_simple(), hit_trap(), spell_cast(), and use_aux().

const char* effect_info ( struct effect effect)
effect_index effect_lookup ( const char *  name)

References EF_MAX, effect_names, i, N_ELEMENTS, and streq.

Referenced by do_cmd_wiz_effect().

int effect_param ( const char *  type)
void effect_simple ( int  index,
const char *  dice_string,
int  p1,
int  p2,
int  p3,
bool ident 
bool effect_valid ( struct effect effect)
void free_effect ( struct effect source)

Free all the effects in a structure.

sourcethe effects being freed

References effect::dice, dice_free(), mem_free(), and effect::next.

Referenced by cleanup_act(), cleanup_class(), cleanup_ego(), cleanup_mon_spell(), cleanup_object(), cleanup_trap(), and effect_simple().

bool remove_all_curse ( void  )