Angband
Data Structures | Macros | Typedefs | Functions | Variables
project-obj.c File Reference

projection effects on objects More...

#include "angband.h"
#include "cave.h"
#include "mon-util.h"
#include "obj-chest.h"
#include "obj-desc.h"
#include "obj-gear.h"
#include "obj-identify.h"
#include "obj-ignore.h"
#include "obj-pile.h"
#include "obj-tval.h"
#include "obj-util.h"
#include "list-elements.h"
#include "list-project-environs.h"
#include "list-project-monsters.h"

Data Structures

struct  project_object_handler_context_s
 

Object handlers

More...

Macros

#define ELEM(a, b, c, d, e, f, g, col)   project_object_handler_##a,
#define PROJ_ENV(a, col)   project_object_handler_##a,
#define PROJ_MON(a, obv)   NULL,

Typedefs

typedef struct
project_object_handler_context_s 
project_object_handler_context_t
 

Object handlers


typedef void(* project_object_handler_f )(project_object_handler_context_t *)

Functions

int inven_damage (struct player *p, int type, int cperc)
 Destroys a type of item on a given percent chance.
static void project_object_elemental (project_object_handler_context_t *context, int element, const char *singular_verb, const char *plural_verb)
 Project an effect onto an object.
static void project_object_handler_ACID (project_object_handler_context_t *context)
static void project_object_handler_ELEC (project_object_handler_context_t *context)
static void project_object_handler_FIRE (project_object_handler_context_t *context)
static void project_object_handler_COLD (project_object_handler_context_t *context)
static void project_object_handler_POIS (project_object_handler_context_t *context)
static void project_object_handler_LIGHT (project_object_handler_context_t *context)
static void project_object_handler_DARK (project_object_handler_context_t *context)
static void project_object_handler_SOUND (project_object_handler_context_t *context)
static void project_object_handler_SHARD (project_object_handler_context_t *context)
static void project_object_handler_NEXUS (project_object_handler_context_t *context)
static void project_object_handler_NETHER (project_object_handler_context_t *context)
static void project_object_handler_CHAOS (project_object_handler_context_t *context)
static void project_object_handler_DISEN (project_object_handler_context_t *context)
static void project_object_handler_WATER (project_object_handler_context_t *context)
static void project_object_handler_ICE (project_object_handler_context_t *context)
static void project_object_handler_GRAVITY (project_object_handler_context_t *context)
static void project_object_handler_INERTIA (project_object_handler_context_t *context)
static void project_object_handler_FORCE (project_object_handler_context_t *context)
static void project_object_handler_TIME (project_object_handler_context_t *context)
static void project_object_handler_PLASMA (project_object_handler_context_t *context)
static void project_object_handler_METEOR (project_object_handler_context_t *context)
static void project_object_handler_MISSILE (project_object_handler_context_t *context)
static void project_object_handler_MANA (project_object_handler_context_t *context)
static void project_object_handler_HOLY_ORB (project_object_handler_context_t *context)
static void project_object_handler_ARROW (project_object_handler_context_t *context)
static void project_object_handler_LIGHT_WEAK (project_object_handler_context_t *context)
static void project_object_handler_DARK_WEAK (project_object_handler_context_t *context)
static void project_object_handler_KILL_WALL (project_object_handler_context_t *context)
static void project_object_handler_KILL_DOOR (project_object_handler_context_t *context)
static void project_object_handler_KILL_TRAP (project_object_handler_context_t *context)
static void project_object_handler_MAKE_DOOR (project_object_handler_context_t *context)
static void project_object_handler_MAKE_TRAP (project_object_handler_context_t *context)
bool project_o (int who, int r, int y, int x, int dam, int typ)
 Called from project() to affect objects.

Variables

static const
project_object_handler_f 
object_handlers []

Detailed Description

projection effects on objects

Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke

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 ELEM (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  col 
)    project_object_handler_##a,
#define PROJ_ENV (   a,
  col 
)    project_object_handler_##a,
#define PROJ_MON (   a,
  obv 
)    NULL,

Typedef Documentation


Object handlers

typedef void(* project_object_handler_f)(project_object_handler_context_t *)

Function Documentation

int inven_damage ( struct player p,
int  type,
int  cperc 
)
bool project_o ( int  who,
int  r,
int  y,
int  x,
int  dam,
int  typ 
)

Called from project() to affect objects.

Called for projections with the PROJECT_ITEM flag set, which includes beam, ball and breath effects.

Parameters
whois the monster list index of the caster
ris the distance from the centre of the effect
y
xthe coordinates of the grid being handled
damis the "damage" from the effect at distance r from the centre
typis the projection (GF_) type
Returns
whether the effects were obvious

Note that this function determines if the player can see anything that happens by taking into account: blindness, line-of-sight, and illumination.

Hack – effects on objects which are memorized but not in view are also seen.

References object::artifact, become_aware(), cave, cave_monster(), project_object_handler_context_s::do_kill, FALSE, project_object_handler_context_s::ignore, object::ignore, ignore_item_ok(), object::marked, object::mimicking_m_idx, msg, msgt(), object::next, project_object_handler_context_s::note_kill, object::number, object_delete(), object_desc(), object_handlers, project_object_handler_context_s::obvious, ODESC_BASE, square_excise_object(), square_light_spot(), square_object(), TRUE, and VERB_AGREEMENT.

Referenced by project().

static void project_object_elemental ( project_object_handler_context_t context,
int  element,
const char *  singular_verb,
const char *  plural_verb 
)
static

Project an effect onto an object.

Parameters
contextis the project_o context.
elementis for elements that will destroy an object, or that it will ignore.
singular_verbis the verb that is displayed when one object is destroyed.
plural_verbis the verb that is displayed in multiple objects are destroyed.

References project_object_handler_context_s::do_kill, object::el_info, EL_INFO_HATES, EL_INFO_IGNORE, FALSE, element_info::flags, project_object_handler_context_s::ignore, project_object_handler_context_s::note_kill, object::number, project_object_handler_context_s::obj, TRUE, and VERB_AGREEMENT.

Referenced by project_object_handler_ACID(), project_object_handler_COLD(), project_object_handler_ELEC(), project_object_handler_FIRE(), project_object_handler_FORCE(), project_object_handler_ICE(), project_object_handler_METEOR(), project_object_handler_PLASMA(), project_object_handler_SHARD(), and project_object_handler_SOUND().

static void project_object_handler_ACID ( project_object_handler_context_t context)
static
static void project_object_handler_ARROW ( project_object_handler_context_t context)
static
static void project_object_handler_CHAOS ( project_object_handler_context_t context)
static
static void project_object_handler_COLD ( project_object_handler_context_t context)
static
static void project_object_handler_DARK ( project_object_handler_context_t context)
static
static void project_object_handler_DARK_WEAK ( project_object_handler_context_t context)
static
static void project_object_handler_DISEN ( project_object_handler_context_t context)
static
static void project_object_handler_ELEC ( project_object_handler_context_t context)
static
static void project_object_handler_FIRE ( project_object_handler_context_t context)
static
static void project_object_handler_FORCE ( project_object_handler_context_t context)
static
static void project_object_handler_GRAVITY ( project_object_handler_context_t context)
static
static void project_object_handler_HOLY_ORB ( project_object_handler_context_t context)
static
static void project_object_handler_ICE ( project_object_handler_context_t context)
static
static void project_object_handler_INERTIA ( project_object_handler_context_t context)
static
static void project_object_handler_KILL_DOOR ( project_object_handler_context_t context)
static
static void project_object_handler_KILL_TRAP ( project_object_handler_context_t context)
static
static void project_object_handler_KILL_WALL ( project_object_handler_context_t context)
static
static void project_object_handler_LIGHT ( project_object_handler_context_t context)
static
static void project_object_handler_LIGHT_WEAK ( project_object_handler_context_t context)
static
static void project_object_handler_MAKE_DOOR ( project_object_handler_context_t context)
static
static void project_object_handler_MAKE_TRAP ( project_object_handler_context_t context)
static
static void project_object_handler_MANA ( project_object_handler_context_t context)
static
static void project_object_handler_METEOR ( project_object_handler_context_t context)
static
static void project_object_handler_MISSILE ( project_object_handler_context_t context)
static
static void project_object_handler_NETHER ( project_object_handler_context_t context)
static
static void project_object_handler_NEXUS ( project_object_handler_context_t context)
static
static void project_object_handler_PLASMA ( project_object_handler_context_t context)
static
static void project_object_handler_POIS ( project_object_handler_context_t context)
static
static void project_object_handler_SHARD ( project_object_handler_context_t context)
static
static void project_object_handler_SOUND ( project_object_handler_context_t context)
static
static void project_object_handler_TIME ( project_object_handler_context_t context)
static
static void project_object_handler_WATER ( project_object_handler_context_t context)
static

Variable Documentation

const project_object_handler_f object_handlers[]
static

Referenced by project_o().