Hengband  2.1.4
 全て データ構造 ファイル 関数 変数 型定義 マクロ定義 ページ
マクロ定義 | 関数 | 変数
monster2.c

モンスター処理 / misc code for monsters [詳細]

#include "angband.h"
monster2.cのインクルード依存関係図

マクロ定義

#define HORDE_NOGOOD   0x01
 (未実装フラグ)HORDE生成でGOODなモンスターの生成を禁止する? [詳細]
 
#define HORDE_NOEVIL   0x02
 (未実装フラグ)HORDE生成でEVILなモンスターの生成を禁止する? [詳細]
 
#define MON_SCAT_MAXD   10
 mon_scatter()関数によるモンスター配置で許される中心からの最大距離 [詳細]
 
#define GROUP_MAX   32
 place_monster_group() 関数によるモンスターのGROUP生成時の配置最大数 / Maximum size of a group of monsters [詳細]
 

関数

void set_target (monster_type *m_ptr, int y, int x)
 モンスターの目標地点をセットする / Set the target of counter attack [詳細]
 
void reset_target (monster_type *m_ptr)
 モンスターの目標地点をリセットする / Reset the target of counter attack [詳細]
 
monster_racereal_r_ptr (monster_type *m_ptr)
 モンスターの真の種族を返す / Extract monster race pointer of a monster's true form [詳細]
 
void delete_monster_idx (int i)
 モンスター配列からモンスターを消去する / Delete a monster by index. [詳細]
 
void delete_monster (int y, int x)
 指定位置に存在するモンスターを削除する / Delete the monster, if any, at a given location [詳細]
 
static void compact_monsters_aux (int i1, int i2)
 モンスター情報を配列内移動する / Move an object from index i1 to index i2 in the object list [詳細]
 
void compact_monsters (int size)
 モンスター情報配列を圧縮する / Compact and Reorder the monster list [詳細]
 
void wipe_m_list (void)
 プレイヤーのフロア離脱に伴う全モンスター配列の消去 / Delete/Remove all the monsters when the player leaves the level [詳細]
 
s16b m_pop (void)
 モンスター配列の空きを探す / Acquires and returns the index of a "free" monster. [詳細]
 
static bool summon_specific_aux (int r_idx)
 指定されたモンスター種族がsummon_specific_typeで指定された召喚条件に合うかどうかを返す [詳細]
 
static bool restrict_monster_to_dungeon (int r_idx)
 指定されたモンスター種族がダンジョンの制限にかかるかどうかをチェックする / Some dungeon types restrict the possible monsters. [詳細]
 
errr get_mon_num_prep (monster_hook_type monster_hook, monster_hook_type monster_hook2)
 モンスター生成制限関数最大2つから / Apply a "monster restriction function" to the "monster allocation table" [詳細]
 
static int mysqrt (int n)
 平方根を切り捨て整数で返す [詳細]
 
s16b get_mon_num (int level)
 生成モンスター種族を1種生成テーブルから選択する [詳細]
 
void monster_desc (char *desc, monster_type *m_ptr, int mode)
 モンスターの呼称を作成する / Build a string describing a monster in some way. [詳細]
 
int lore_do_probe (int r_idx)
 モンスターの調査による思い出補完処理 / Learn about a monster (by "probing" it) [詳細]
 
void lore_treasure (int m_idx, int num_item, int num_gold)
 モンスターの撃破に伴うドロップ情報の保管処理 / Take note that the given monster just dropped some treasure [詳細]
 
void sanity_blast (monster_type *m_ptr, bool necro)
 ELDRITCH_HORRORによるプレイヤーの精神破壊処理 [詳細]
 
void update_mon (int m_idx, bool full)
 モンスターの各情報を更新する / This function updates the monster record of the given monster [詳細]
 
void update_monsters (bool full)
 単純に生存している全モンスターの更新処理を行う / This function simply updates all the (non-dead) monsters (see above). [詳細]
 
static bool monster_hook_chameleon_lord (int r_idx)
 カメレオンの王の変身対象となるモンスターかどうか判定する / Hack – the index of the summoning monster [詳細]
 
static bool monster_hook_chameleon (int r_idx)
 カメレオンの変身対象となるモンスターかどうか判定する / Hack – the index of the summoning monster [詳細]
 
void choose_new_monster (int m_idx, bool born, int r_idx)
 モンスターの変身処理 [詳細]
 
static bool monster_hook_tanuki (int r_idx)
 たぬきの変身対象となるモンスターかどうか判定する / Hook for Tanuki [詳細]
 
static int initial_r_appearance (int r_idx)
 モンスターの表層IDを設定する / Set initial racial appearance of a monster [詳細]
 
byte get_mspeed (monster_race *r_ptr)
 モンスターの個体加速を設定する / Get initial monster speed [詳細]
 
static bool place_monster_one (int who, int y, int x, int r_idx, u32b mode)
 モンスターを一体生成する / Attempt to place a monster of the given race at the given location. [詳細]
 
static bool mon_scatter (int r_idx, int *yp, int *xp, int y, int x, int max_dist)
 モンスター1体を目標地点に可能ながり近い位置に生成する / improved version of scatter() for place monster [詳細]
 
static bool place_monster_group (int who, int y, int x, int r_idx, u32b mode)
 モンスターを目標地点に集団生成する / Attempt to place a "group" of monsters around the given location [詳細]
 
static bool place_monster_okay (int r_idx)
 モンスター種族が召喚主の護衛となれるかどうかをチェックする / Hack – help pick an escort type [詳細]
 
bool place_monster_aux (int who, int y, int x, int r_idx, u32b mode)
 一般的なモンスター生成処理のサブルーチン / Attempt to place a monster of the given race at the given location [詳細]
 
bool place_monster (int y, int x, u32b mode)
 一般的なモンスター生成処理のメインルーチン / Attempt to place a monster of the given race at the given location [詳細]
 
bool alloc_horde (int y, int x)
 指定地点に1種類のモンスター種族による群れを生成する [詳細]
 
bool alloc_guardian (bool def_val)
 ダンジョンの主生成を試みる / Put the Guardian [詳細]
 
bool alloc_monster (int dis, u32b mode)
 ダンジョンの初期配置モンスターを生成1回生成する / Attempt to allocate a random monster in the dungeon. [詳細]
 
static bool summon_specific_okay (int r_idx)
 モンスターが召喚の基本条件に合っているかをチェックする / Hack – help decide if a monster race is "okay" to summon [詳細]
 
bool summon_specific (int who, int y1, int x1, int lev, int type, u32b mode)
 モンスターを召喚により配置する / Place a monster (of the specified "type") near the given location. [詳細]
 
bool summon_named_creature (int who, int oy, int ox, int r_idx, u32b mode)
 特定モンスター種族を召喚により生成する / A "dangerous" function, creates a pet of the specified type [詳細]
 
bool multiply_monster (int m_idx, bool clone, u32b mode)
 モンスターを増殖生成する / Let the given monster attempt to reproduce. [詳細]
 
void message_pain (int m_idx, int dam)
 ダメージを受けたモンスターの様子を記述する / Dump a message describing a monster's reaction to damage [詳細]
 
void update_smart_learn (int m_idx, int what)
 SMART(適格に攻撃を行う)モンスターの学習状況を更新する / Learn about an "observed" resistance. [詳細]
 
bool player_place (int y, int x)
 プレイヤーを指定座標に配置する / Place the player in the dungeon XXX XXX [詳細]
 
void monster_drop_carried_objects (monster_type *m_ptr)
 モンスターが盗みや拾いで確保していたアイテムを全てドロップさせる / Drop all items carried by a monster [詳細]
 

変数

cptr horror_desc [MAX_SAN_HORROR]
 ELDRITCH HORROR効果時のモンスターの形容メッセージ(通常時) [詳細]
 
cptr funny_desc [MAX_SAN_FUNNY]
 ELDRITCH HORROR効果時のモンスターの形容メッセージ(幻覚状態時) [詳細]
 
cptr funny_comments [MAX_SAN_COMMENT]
 ELDRITCH HORROR効果時の幻覚時間延長を示す錯乱表現 [詳細]
 
static int summon_specific_type = 0
 召喚条件を指定するグローバル変数 / Hack – the "type" of the current "summon specific" [詳細]
 
static int summon_specific_who = -1
 召喚を行ったプレイヤーあるいはモンスターのIDを示すグローバル変数 / Hack – the index of the summoning monster [詳細]
 
static bool summon_unique_okay = FALSE
 召喚対象にユニークを含めるかを示すグローバル変数 / summoning unique enable [詳細]
 
static int chameleon_change_m_idx = 0
 カメレオンの変身先モンスターIDを受け渡すためのグローバル変数 [詳細]
 
static int place_monster_idx = 0
 護衛対象となるモンスター種族IDを渡すグローバル変数 / Hack – help pick an escort type [詳細]
 
static int place_monster_m_idx = 0
 護衛対象となるモンスターIDを渡すグローバル変数 / Hack – help pick an escort type [詳細]
 

説明

モンスター処理 / misc code for monsters

日付
2014/07/08
作者
Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke 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. 2014 Deskull rearranged comment for Doxygen.

マクロ定義

#define GROUP_MAX   32

place_monster_group() 関数によるモンスターのGROUP生成時の配置最大数 / Maximum size of a group of monsters

#define HORDE_NOEVIL   0x02

(未実装フラグ)HORDE生成でEVILなモンスターの生成を禁止する?

#define HORDE_NOGOOD   0x01

(未実装フラグ)HORDE生成でGOODなモンスターの生成を禁止する?

#define MON_SCAT_MAXD   10

mon_scatter()関数によるモンスター配置で許される中心からの最大距離

関数

bool alloc_guardian ( bool  def_val)

ダンジョンの主生成を試みる / Put the Guardian

引数
def_val現在の主の生成状態
戻り値
生成に成功したらtrue

関数の呼び出しグラフ:

呼出しグラフ:

bool alloc_horde ( int  y,
int  x 
)

指定地点に1種類のモンスター種族による群れを生成する

引数
y生成地点y座標
x生成地点x座標
戻り値
生成に成功したらtrue

関数の呼び出しグラフ:

呼出しグラフ:

bool alloc_monster ( int  dis,
u32b  mode 
)

ダンジョンの初期配置モンスターを生成1回生成する / Attempt to allocate a random monster in the dungeon.

引数
disプレイヤーから離れるべき最低距離
mode生成オプション
戻り値
生成に成功したらtrue

Place the monster at least "dis" distance from the player. Use "slp" to choose the initial "sleep" status Use "monster_level" for the monster level

関数の呼び出しグラフ:

呼出しグラフ:

void choose_new_monster ( int  m_idx,
bool  born,
int  r_idx 
)

モンスターの変身処理

引数
m_idx変身処理を受けるモンスター情報のID
born生成時の初変身先指定ならばtrue
r_idx旧モンスター種族のID
戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void compact_monsters ( int  size)

モンスター情報配列を圧縮する / Compact and Reorder the monster list

引数
size圧縮後のモンスター件数目標
戻り値
なし

This function can be very dangerous, use with caution!

When actually "compacting" monsters, we base the saving throw on a combination of monster level, distance from player, and current "desperation".

After "compacting" (if needed), we "reorder" the monsters into a more compact order, and we reset the allocation info, and the "live" array.

関数の呼び出しグラフ:

呼出しグラフ:

static void compact_monsters_aux ( int  i1,
int  i2 
)
static

モンスター情報を配列内移動する / Move an object from index i1 to index i2 in the object list

引数
i1配列移動元添字
i2配列移動先添字
戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void delete_monster ( int  y,
int  x 
)

指定位置に存在するモンスターを削除する / Delete the monster, if any, at a given location

引数
x削除位置x座標
y削除位置y座標
戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void delete_monster_idx ( int  i)

モンスター配列からモンスターを消去する / Delete a monster by index.

引数
i消去するモンスターのID
戻り値
なし

モンスターを削除するとそのモンスターが拾っていたアイテムも同時に削除される。 / When a monster is deleted, all of its objects are deleted.

関数の呼び出しグラフ:

呼出しグラフ:

s16b get_mon_num ( int  level)

生成モンスター種族を1種生成テーブルから選択する

引数
level生成階
戻り値
選択されたモンスター生成種族

Choose a monster race that seems "appropriate" to the given level

This function uses the "prob2" field of the "monster allocation table", and various local information, to calculate the "prob3" field of the same table, which is then used to choose an "appropriate" monster, in a relatively efficient manner.

Note that "town" monsters will only be created in the town, and "normal" monsters will never be created in the town, unless the "level" is "modified", for example, by polymorph or summoning.

There is a small chance (1/50) of "boosting" the given depth by a small amount (up to four levels), except in the town.

It is (slightly) more likely to acquire a monster of the given level than one of a lower level. This is done by choosing several monsters appropriate to the given level and keeping the "hardest" one.

Note that if no monsters are "appropriate", then this function will fail, and return zero, but this should almost never happen.

関数の呼び出しグラフ:

呼出しグラフ:

errr get_mon_num_prep ( monster_hook_type  monster_hook,
monster_hook_type  monster_hook2 
)

モンスター生成制限関数最大2つから / Apply a "monster restriction function" to the "monster allocation table"

引数
monster_hook制限関数1
monster_hook2制限関数2
戻り値
エラーコード

関数の呼び出しグラフ:

呼出しグラフ:

byte get_mspeed ( monster_race r_ptr)

モンスターの個体加速を設定する / Get initial monster speed

引数
r_ptrモンスター種族の参照ポインタ
戻り値
加速値

呼出しグラフ:

static int initial_r_appearance ( int  r_idx)
static

モンスターの表層IDを設定する / Set initial racial appearance of a monster

引数
r_idxモンスター種族ID
戻り値
モンスター種族の表層ID

関数の呼び出しグラフ:

呼出しグラフ:

int lore_do_probe ( int  r_idx)

モンスターの調査による思い出補完処理 / Learn about a monster (by "probing" it)

引数
r_idx補完されるモンスター種族ID
戻り値
明らかになった情報の度数

Return the number of new flags learnt. -Mogami-

呼出しグラフ:

void lore_treasure ( int  m_idx,
int  num_item,
int  num_gold 
)

モンスターの撃破に伴うドロップ情報の保管処理 / Take note that the given monster just dropped some treasure

引数
m_idxモンスター情報のID
num_item手に入れたアイテム数
num_gold手に入れた財宝の単位数
戻り値
なし

Note that learning the "GOOD"/"GREAT" flags gives information about the treasure (even when the monster is killed for the first time, such as uniques, and the treasure has not been examined yet).

This "indirect" method is used to prevent the player from learning exactly how much treasure a monster can drop from observing only a single example of a drop. This method actually observes how much gold and items are dropped, and remembers that information to be described later by the monster recall code.

呼出しグラフ:

s16b m_pop ( void  )

モンスター配列の空きを探す / Acquires and returns the index of a "free" monster.

戻り値
利用可能なモンスター配列の添字

This routine should almost never fail, but it can happen.

関数の呼び出しグラフ:

呼出しグラフ:

void message_pain ( int  m_idx,
int  dam 
)

ダメージを受けたモンスターの様子を記述する / Dump a message describing a monster's reaction to damage

引数
m_idxモンスター情報ID
dam与えたダメージ
戻り値
なし

Technically should attempt to treat "Beholder"'s as jelly's

関数の呼び出しグラフ:

呼出しグラフ:

static bool mon_scatter ( int  r_idx,
int *  yp,
int *  xp,
int  y,
int  x,
int  max_dist 
)
static

モンスター1体を目標地点に可能ながり近い位置に生成する / improved version of scatter() for place monster

引数
r_idx生成モンスター種族
yp結果生成位置y座標
xp結果生成位置x座標
y中心生成位置y座標
x中心生成位置x座標
max_dist生成位置の最大半径
戻り値
成功したらtrue

関数の呼び出しグラフ:

呼出しグラフ:

void monster_desc ( char *  desc,
monster_type m_ptr,
int  mode 
)

モンスターの呼称を作成する / Build a string describing a monster in some way.

引数
desc記述出力先の文字列参照ポインタ
m_ptrモンスターの参照ポインタ
mode呼称オプション
戻り値
なし

We can correctly describe monsters based on their visibility. We can force all monsters to be treated as visible or invisible. We can build nominatives, objectives, possessives, or reflexives. We can selectively pronominalize hidden, visible, or all monsters. We can use definite or indefinite descriptions for hidden monsters. We can use definite or indefinite descriptions for visible monsters.

Pronominalization involves the gender whenever possible and allowed, so that by cleverly requesting pronominalization / visibility, you can get messages like "You hit someone. She screams in agony!".

Reflexives are acquired by requesting Objective plus Possessive.

If no m_ptr arg is given (?), the monster is assumed to be hidden, unless the "Assume Visible" mode is requested.

If no r_ptr arg is given, it is extracted from m_ptr and r_info If neither m_ptr nor r_ptr is given, the monster is assumed to be neuter, singular, and hidden (unless "Assume Visible" is set), in which case you may be in trouble... :-)

I am assuming that no monster name is more than 70 characters long, so that "char desc[80];" is sufficiently large for any result.

Mode Flags: MD_OBJECTIVE –> Objective (or Reflexive) MD_POSSESSIVE –> Possessive (or Reflexive) MD_INDEF_HIDDEN –> Use indefinites for hidden monsters ("something") MD_INDEF_VISIBLE –> Use indefinites for visible monsters ("a kobold") MD_PRON_HIDDEN –> Pronominalize hidden monsters MD_PRON_VISIBLE –> Pronominalize visible monsters MD_ASSUME_HIDDEN –> Assume the monster is hidden MD_ASSUME_VISIBLE –> Assume the monster is visible MD_TRUE_NAME –> Chameleon's true name MD_IGNORE_HALLU –> Ignore hallucination, and penetrate shape change

Useful Modes: 0x00 –> Full nominative name ("the kobold") or "it" MD_INDEF_HIDDEN –> Full nominative name ("the kobold") or "something" MD_ASSUME_VISIBLE –> Genocide resistance name ("the kobold") MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE –> Killing name ("a kobold") MD_PRON_VISIBLE | MD_POSSESSIVE –> Possessive, genderized if visable ("his") or "its" MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE –> Reflexive, genderized if visable ("himself") or "itself"

関数の呼び出しグラフ:

void monster_drop_carried_objects ( monster_type m_ptr)

モンスターが盗みや拾いで確保していたアイテムを全てドロップさせる / Drop all items carried by a monster

引数
m_ptrモンスター参照ポインタ
戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

static bool monster_hook_chameleon ( int  r_idx)
static

カメレオンの変身対象となるモンスターかどうか判定する / Hack – the index of the summoning monster

引数
r_idxモンスター種族ID
戻り値
対象にできるならtrueを返す

関数の呼び出しグラフ:

呼出しグラフ:

static bool monster_hook_chameleon_lord ( int  r_idx)
static

カメレオンの王の変身対象となるモンスターかどうか判定する / Hack – the index of the summoning monster

引数
r_idxモンスター種族ID
戻り値
対象にできるならtrueを返す

関数の呼び出しグラフ:

呼出しグラフ:

static bool monster_hook_tanuki ( int  r_idx)
static

たぬきの変身対象となるモンスターかどうか判定する / Hook for Tanuki

引数
r_idxモンスター種族ID
戻り値
対象にできるならtrueを返す

関数の呼び出しグラフ:

呼出しグラフ:

bool multiply_monster ( int  m_idx,
bool  clone,
u32b  mode 
)

モンスターを増殖生成する / Let the given monster attempt to reproduce.

引数
m_idx増殖するモンスター情報ID
cloneクローン・モンスター処理ならばtrue
mode生成オプション
戻り値
生成できたらtrueを返す

Note that "reproduction" REQUIRES empty space.

関数の呼び出しグラフ:

呼出しグラフ:

static int mysqrt ( int  n)
static

平方根を切り捨て整数で返す

引数
n数値
戻り値
平方根

呼出しグラフ:

bool place_monster ( int  y,
int  x,
u32b  mode 
)

一般的なモンスター生成処理のメインルーチン / Attempt to place a monster of the given race at the given location

引数
y生成地点y座標
x生成地点x座標
mode生成オプション
戻り値
生成に成功したらtrue

関数の呼び出しグラフ:

呼出しグラフ:

bool place_monster_aux ( int  who,
int  y,
int  x,
int  r_idx,
u32b  mode 
)

一般的なモンスター生成処理のサブルーチン / Attempt to place a monster of the given race at the given location

引数
who召喚主のモンスター情報ID
y生成地点y座標
x生成地点x座標
r_idx生成するモンスターの種族ID
mode生成オプション
戻り値
生成に成功したらtrue

Note that certain monsters are now marked as requiring "friends". These monsters, if successfully placed, and if the "grp" parameter is TRUE, will be surrounded by a "group" of identical monsters.

Note that certain monsters are now marked as requiring an "escort", which is a collection of monsters with similar "race" but lower level.

Some monsters induce a fake "group" flag on their escorts.

Note the "bizarre" use of non-recursion to prevent annoying output when running a code profiler.

Note the use of the new "monster allocation table" code to restrict the "get_mon_num()" function to "legal" escort types.

関数の呼び出しグラフ:

呼出しグラフ:

static bool place_monster_group ( int  who,
int  y,
int  x,
int  r_idx,
u32b  mode 
)
static

モンスターを目標地点に集団生成する / Attempt to place a "group" of monsters around the given location

引数
who召喚主のモンスター情報ID
y中心生成位置y座標
x中心生成位置x座標
r_idx生成モンスター種族
mode生成オプション
戻り値
成功したらtrue

関数の呼び出しグラフ:

呼出しグラフ:

static bool place_monster_okay ( int  r_idx)
static

モンスター種族が召喚主の護衛となれるかどうかをチェックする / Hack – help pick an escort type

引数
r_idxチェックするモンスター種族のID
戻り値
護衛にできるならばtrue

関数の呼び出しグラフ:

呼出しグラフ:

static bool place_monster_one ( int  who,
int  y,
int  x,
int  r_idx,
u32b  mode 
)
static

モンスターを一体生成する / Attempt to place a monster of the given race at the given location.

引数
who召喚を行ったモンスターID
y生成位置y座標
x生成位置x座標
r_idx生成モンスター種族
mode生成オプション
戻り値
成功したらtrue

To give the player a sporting chance, any monster that appears in line-of-sight and is extremely dangerous can be marked as "FORCE_SLEEP", which will cause them to be placed with low energy, which often (but not always) lets the player move before they do.

This routine refuses to place out-of-depth "FORCE_DEPTH" monsters.

XXX XXX XXX Use special "here" and "dead" flags for unique monsters, remove old "cur_num" and "max_num" fields.

XXX XXX XXX Actually, do something similar for artifacts, to simplify the "preserve" mode, and to make the "what artifacts" flag more useful.

This is the only function which may place a monster in the dungeon, except for the savefile loading code.

関数の呼び出しグラフ:

呼出しグラフ:

bool player_place ( int  y,
int  x 
)

プレイヤーを指定座標に配置する / Place the player in the dungeon XXX XXX

引数
x配置先X座標
y配置先Y座標
戻り値
配置に成功したらTRUE

呼出しグラフ:

monster_race* real_r_ptr ( monster_type m_ptr)

モンスターの真の種族を返す / Extract monster race pointer of a monster's true form

引数
m_ptrモンスターの参照ポインタ
戻り値
本当のモンスター種族参照ポインタ

呼出しグラフ:

void reset_target ( monster_type m_ptr)

モンスターの目標地点をリセットする / Reset the target of counter attack

引数
m_ptrモンスターの参照ポインタ
戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

static bool restrict_monster_to_dungeon ( int  r_idx)
static

指定されたモンスター種族がダンジョンの制限にかかるかどうかをチェックする / Some dungeon types restrict the possible monsters.

引数
r_idxチェックするモンスター種族ID
戻り値
召喚条件が一致するならtrue / Return TRUE is the monster is OK and FALSE otherwise

呼出しグラフ:

void sanity_blast ( monster_type m_ptr,
bool  necro 
)

ELDRITCH_HORRORによるプレイヤーの精神破壊処理

引数
m_ptrELDRITCH_HORRORを引き起こしたモンスターの参照ポインタ
necro暗黒領域魔法の詠唱失敗によるものならばTRUEを返す
戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void set_target ( monster_type m_ptr,
int  y,
int  x 
)

モンスターの目標地点をセットする / Set the target of counter attack

引数
m_ptrモンスターの参照ポインタ
y目標y座標
x目標x座標
戻り値
なし

呼出しグラフ:

bool summon_named_creature ( int  who,
int  oy,
int  ox,
int  r_idx,
u32b  mode 
)

特定モンスター種族を召喚により生成する / A "dangerous" function, creates a pet of the specified type

引数
who召喚主のモンスター情報ID
oy目標地点y座標
ox目標地点x座標
r_idx生成するモンスター種族ID
mode生成オプション
戻り値
召喚できたらtrueを返す

関数の呼び出しグラフ:

呼出しグラフ:

bool summon_specific ( int  who,
int  y1,
int  x1,
int  lev,
int  type,
u32b  mode 
)

モンスターを召喚により配置する / Place a monster (of the specified "type") near the given location.

Return TRUE if a monster was actually summoned.

引数
who召喚主のモンスター情報ID
y1目標地点y座標
x1目標地点x座標
lev相当生成階
type召喚種別
mode生成オプション
戻り値
召喚できたらtrueを返す

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

Note: SUMMON_UNIQUE and SUMMON_AMBERITES will summon Unique's Note: SUMMON_HI_UNDEAD and SUMMON_HI_DRAGON may summon Unique's Note: None of the other summon codes will ever summon Unique's.

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.

関数の呼び出しグラフ:

static bool summon_specific_aux ( int  r_idx)
static

指定されたモンスター種族がsummon_specific_typeで指定された召喚条件に合うかどうかを返す

戻り値
召喚条件が一致するならtrue

関数の呼び出しグラフ:

呼出しグラフ:

static bool summon_specific_okay ( int  r_idx)
static

モンスターが召喚の基本条件に合っているかをチェックする / Hack – help decide if a monster race is "okay" to summon

引数
r_idxチェックするモンスター種族ID
戻り値
召喚対象にできるならばTRUE

関数の呼び出しグラフ:

呼出しグラフ:

void update_mon ( int  m_idx,
bool  full 
)

モンスターの各情報を更新する / This function updates the monster record of the given monster

引数
m_idx更新するモンスター情報のID
fullプレイヤーとの距離更新を行うならばtrue
戻り値
なし

This involves extracting the distance to the player (if requested), and then checking for visibility (natural, infravision, see-invis, telepathy), updating the monster visibility flag, redrawing (or erasing) the monster when its visibility changes, and taking note of any interesting monster flags (cold-blooded, invisible, etc).

Note the new "mflag" field which encodes several monster state flags, including "view" for when the monster is currently in line of sight, and "mark" for when the monster is currently visible via detection.

The only monster fields that are changed here are "cdis" (the distance from the player), "ml" (visible to the player), and "mflag" (to maintain the "MFLAG_VIEW" flag).

Note the special "update_monsters()" function which can be used to call this function once for every monster.

Note the "full" flag which requests that the "cdis" field be updated, this is only needed when the monster (or the player) has moved.

Every time a monster moves, we must call this function for that monster, and update the distance, and the visibility. Every time the player moves, we must call this function for every monster, and update the distance, and the visibility. Whenever the player "state" changes in certain ways ("blindness", "infravision", "telepathy", and "see invisible"), we must call this function for every monster, and update the visibility.

Routines that change the "illumination" of a grid must also call this function for any monster in that grid, since the "visibility" of some monsters may be based on the illumination of their grid.

Note that this function is called once per monster every time the player moves. When the player is running, this function is one of the primary bottlenecks, along with "update_view()" and the "process_monsters()" code, so efficiency is important.

Note the optimized "inline" version of the "distance()" function.

A monster is "visible" to the player if (1) it has been detected by the player, (2) it is close to the player and the player has telepathy, or (3) it is close to the player, and in line of sight of the player, and it is "illuminated" by some combination of infravision, torch light, or permanent light (invisible monsters are only affected by "light" if the player can see invisible).

Monsters which are not on the current panel may be "visible" to the player, and their descriptions will include an "offscreen" reference. Currently, offscreen monsters cannot be targetted or viewed directly, but old targets will remain set. XXX XXX

The player can choose to be disturbed by several things, including "disturb_move" (monster which is viewable moves in some way), and "disturb_near" (monster which is "easily" viewable moves in some way). Note that "moves" includes "appears" and "disappears".

関数の呼び出しグラフ:

呼出しグラフ:

void update_monsters ( bool  full)

単純に生存している全モンスターの更新処理を行う / This function simply updates all the (non-dead) monsters (see above).

引数
full距離更新を行うならtrue
戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void update_smart_learn ( int  m_idx,
int  what 
)

SMART(適格に攻撃を行う)モンスターの学習状況を更新する / Learn about an "observed" resistance.

引数
m_idx更新を行う「モンスター情報ID
what学習対象ID
戻り値
なし

呼出しグラフ:

void wipe_m_list ( void  )

プレイヤーのフロア離脱に伴う全モンスター配列の消去 / Delete/Remove all the monsters when the player leaves the level

戻り値
なし

This is an efficient method of simulating multiple calls to the "delete_monster()" function, with no visual effects.

関数の呼び出しグラフ:

呼出しグラフ:

変数

chameleon_change_m_idx = 0
static

カメレオンの変身先モンスターIDを受け渡すためのグローバル変数

TODO:
変数渡しの問題などもあるができればchameleon_change_m_idxのグローバル変数を除去し、関数引き渡しに移行すること
cptr funny_comments[MAX_SAN_COMMENT]
初期値:
=
{
"Wow, cosmic, man!",
"Rad!",
"Groovy!",
"Cool!",
"Far out!"
}

ELDRITCH HORROR効果時の幻覚時間延長を示す錯乱表現

cptr funny_desc[MAX_SAN_FUNNY]

ELDRITCH HORROR効果時のモンスターの形容メッセージ(幻覚状態時)

cptr horror_desc[MAX_SAN_HORROR]

ELDRITCH HORROR効果時のモンスターの形容メッセージ(通常時)

place_monster_idx = 0
static

護衛対象となるモンスター種族IDを渡すグローバル変数 / Hack – help pick an escort type

TODO:
関数ポインタの都合を配慮しながら、グローバル変数place_monster_idxを除去し、関数引数化する
place_monster_m_idx = 0
static

護衛対象となるモンスターIDを渡すグローバル変数 / Hack – help pick an escort type

TODO:
関数ポインタの都合を配慮しながら、グローバル変数place_monster_m_idxを除去し、関数引数化する
summon_specific_type = 0
static

召喚条件を指定するグローバル変数 / Hack – the "type" of the current "summon specific"

TODO:
summon_specific_typeグローバル変数の除去と関数引数への代替を行う
summon_specific_who = -1
static

召喚を行ったプレイヤーあるいはモンスターのIDを示すグローバル変数 / Hack – the index of the summoning monster

TODO:
summon_specific_who グローバル変数の除去と関数引数への代替を行う
summon_unique_okay = FALSE
static

召喚対象にユニークを含めるかを示すグローバル変数 / summoning unique enable

TODO:
summon_unique_okay グローバル変数の除去と関数引数への代替を行う