Angband
Functions | Variables
obj-curse.c File Reference

functions to deal with object curses More...

#include "angband.h"
#include "effects.h"
#include "init.h"
#include "obj-curse.h"
#include "obj-gear.h"
#include "obj-knowledge.h"
#include "obj-pile.h"
#include "obj-util.h"
#include "player-timed.h"

Functions

int lookup_curse (const char *name)
 Return the index of the curse with the given name. More...
 
void copy_curses (struct object *obj, int *source)
 Copy all the curses from a template to an actual object. More...
 
bool curses_are_equal (const struct object *obj1, const struct object *obj2)
 Check whether two objects have the exact same curses. More...
 
static bool curses_conflict (int first, int second)
 Detect if a curse is in the conflict list of another curse. More...
 
bool append_object_curse (struct object *obj, int pick, int power)
 Append a given curse with a given power to an object. More...
 
bool append_artifact_curse (struct artifact *art, int pick, int power)
 Append a given curse with a given power to an artifact. More...
 
bool do_curse_effect (int i, struct object *obj)
 Do a curse effect. More...
 

Variables

struct cursecurses
 

Detailed Description

functions to deal with object curses

Copyright (c) 2016 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.

Function Documentation

bool append_artifact_curse ( struct artifact art,
int  pick,
int  power 
)

Append a given curse with a given power to an artifact.

Parameters
theartifact to curse
pickthe curse to append
powerthe power of the new curse

References angband_constants::curse_max, artifact::curses, curses_conflict(), i, mem_zalloc(), and z_info.

Referenced by add_curse().

bool append_object_curse ( struct object obj,
int  pick,
int  power 
)
void copy_curses ( struct object obj,
int source 
)

Copy all the curses from a template to an actual object.

Parameters
objthe object the curses are being attached to
sourcethe curses being copied

References angband_constants::curse_max, object::curses, i, mem_zalloc(), curse_data::power, randcalc(), RANDOMISE, object::time, curse_data::timeout, and z_info.

Referenced by copy_artifact_data(), ego_apply_magic(), and object_prep().

bool curses_are_equal ( const struct object obj1,
const struct object obj2 
)

Check whether two objects have the exact same curses.

Parameters
obj1the first object
obj2the second object

References angband_constants::curse_max, object::curses, i, curse_data::power, and z_info.

Referenced by object_runes_known(), and object_stackable().

static bool curses_conflict ( int  first,
int  second 
)
static

Detect if a curse is in the conflict list of another curse.

References buf, curse::conflict, and my_strcat().

Referenced by append_artifact_curse(), and append_object_curse().

bool do_curse_effect ( int  i,
struct object obj 
)

Do a curse effect.

Parameters
ithe index into the curses array

References object::effect, effect_do(), object::effect_msg, i, msgt(), NULL, curse::obj, player_knows_curse(), randint1, and source_object().

Referenced by decrease_timeouts().

int lookup_curse ( const char *  name)

Return the index of the curse with the given name.

References angband_constants::curse_max, i, curse::name, streq, and z_info.

Referenced by player_learn_curse().

Variable Documentation

struct curse* curses