Functions | Variables
obj-properties.c File Reference

functions to deal with object properties More...

#include "angband.h"
#include "init.h"
#include "object.h"


struct obj_propertylookup_obj_property (int type, int index)


void create_obj_flag_mask (bitflag *f, bool id,...)
 Create a "mask" of object flags of a specific type or ID threshold. More...
void flag_message (int flag, char *name)
 Print a message when an object flag is identified by use. More...
int sustain_flag (int stat)
 Return the sustain flag of a given stat. More...


struct obj_propertyobj_properties

Detailed Description

functions to deal with object properties

Copyright (c) 2014 Chris Carr, 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

◆ create_obj_flag_mask()

void create_obj_flag_mask ( bitflag f,
bool  id,

Create a "mask" of object flags of a specific type or ID threshold.

fis the flag array we're filling
idis whether we're masking by ID level the list of flags or ID types we're looking for

N.B. OFT_MAX must be the last item in the ... list

References args, i, obj_property::id_type, obj_property::index, OBJ_PROPERTY_FLAG, of_on, of_wipe, OFT_MAX, angband_constants::property_max, obj_property::subtype, obj_property::type, and z_info.

Referenced by ego_apply_magic(), equip_learn_after_time(), object_learn_on_wield(), object_power_calculation_ALL_MISC(), object_power_calculation_ALL_PROTECTS(), object_power_calculation_ALL_SUSTAINS(), object_power_calculation_NUM_MISC(), object_power_calculation_NUM_PROTECTS(), object_power_calculation_NUM_SUSTAINS(), and shape_learn_on_assume().

◆ flag_message()

void flag_message ( int  flag,
char *  name 

Print a message when an object flag is identified by use.

flagis the flag being noticed
nameis the object name

References buf, lookup_obj_property(), msg, obj_property::msg, obj_property::next, OBJ_PROPERTY_FLAG, strnfcat(), and tag.

Referenced by equip_learn_after_time(), equip_learn_flag(), object_curses_find_flags(), and object_learn_on_wield().

◆ lookup_obj_property()

struct obj_property* lookup_obj_property ( int  type,
int  index 

◆ sustain_flag()

int sustain_flag ( int  stat)

Return the sustain flag of a given stat.

References STAT_MAX.

Referenced by describe_sustains(), display_player_sust_info(), effect_handler_DRAIN_STAT(), and object_learn_on_wield().

Variable Documentation

◆ obj_properties

struct obj_property* obj_properties