Angband
Data Structures | Macros | Functions | Variables
mon-summon.c File Reference

Monster summoning. More...

#include "angband.h"
#include "mon-make.h"
#include "mon-summon.h"
#include "mon-util.h"
#include "list-summon-types.h"

Data Structures

struct  summon_details

Macros

#define S(a, b, c, d, e, f, g)   { #a, b, c, d, e, f, g },

Functions

int summon_name_to_idx (const char *name)
 Functions.
static bool summon_specific_okay (monster_race *race)
 Decide if a monster race is "okay" to summon.
int summon_message_type (int summon_type)
 The message type for a particular summon.
bool can_call_monster (int y, int x, monster_type *m_ptr)
 Check to see if you can call the monster.
int call_monster (int y, int x)
 Calls a monster from the level and moves it to the desired spot.
int summon_specific (int y1, int x1, int lev, int type, bool delay, bool call)
 Places a monster (of the specified "type") near the given location.

Variables

static int summon_specific_type = 0
 The "type" of the current "summon specific".
struct monster_basekin_base
 The kin base for S_KIN.
static struct summon_details summon_info []

Detailed Description

Monster summoning.

Copyright (c) 1997-2007 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 S (   a,
  b,
  c,
  d,
  e,
  f,
 
)    { #a, b, c, d, e, f, g },

Function Documentation

int call_monster ( int  y,
int  x 
)
bool can_call_monster ( int  y,
int  x,
monster_type m_ptr 
)

Check to see if you can call the monster.

References cave, FALSE, monster::fx, monster::fy, los(), ox, oy, monster::race, summon_specific_okay(), and TRUE.

Referenced by call_monster().

int summon_message_type ( int  summon_type)

The message type for a particular summon.

References summon_details::message_type, and summon_info.

Referenced by effect_handler_SUMMON().

int summon_name_to_idx ( const char *  name)

Functions.

References i, streq, and summon_info.

Referenced by effect_param().

int summon_specific ( int  y1,
int  x1,
int  lev,
int  type,
bool  delay,
bool  call 
)

Places a monster (of the specified "type") near the given location.

Return TRUE iff a monster was actually summoned.

We will attempt to place the monster up to 10 times before giving up.

Note: S_UNIQUE and S_WRAITH will summon Uniques Note: S_ANY, S_HI_UNDEAD, S_HI_DEMON and S_HI_DRAGON may summon Uniques Note: None of the other summon codes will ever summon Uniques.

This function has been changed. We now take the "monster level" of the summoning monster as a parameter, and use that, along with the current dungeon level, to help determine the level of the desired monster. Note that this is an upper bound, and also tends to "prefer" monsters of that level. Currently, we use the average of the dungeon and monster levels, and then add five to allow slight increases in monster power.

Note that we use the new "monster allocation table" creation code to restrict the "get_mon_num()" function to the set of "legal" monsters, making this function much faster and more reliable.

Note that this function may not succeed, though this is very rare.

References call_monster(), cave, player::depth, monster::energy, FALSE, get_mon_num(), get_mon_num_prep(), i, monster_race::level, mon_inc_timed(), MON_TMD_FLG_NOMESSAGE, place_new_monster(), monster::race, scatter(), player_state::speed, monster_race::speed, square_isempty(), square_iswarded(), square_monster(), player::state, summon_specific_okay(), summon_specific_type, TRUE, and type.

Referenced by effect_handler_SUMMON(), and effect_handler_TRAP_RUNE_SUMMON().

static bool summon_specific_okay ( monster_race race)
static

Decide if a monster race is "okay" to summon.

Compares the given monster to the monster type specified by summon_specific_type. Returns TRUE if the monster is eligible to be summoned, FALSE otherwise.

References monster_race::base, summon_details::base1, summon_details::base2, summon_details::base3, FALSE, monster_race::flags, match_monster_bases(), summon_details::race_flag, rf_has, summon_info, summon_specific_type, TRUE, and summon_details::unique_allowed.

Referenced by can_call_monster(), and summon_specific().

Variable Documentation

struct monster_base* kin_base

The kin base for S_KIN.

Referenced by effect_handler_SUMMON().

struct summon_details summon_info[]
static
int summon_specific_type = 0
static

The "type" of the current "summon specific".

Referenced by summon_specific(), and summon_specific_okay().