モンスターの特殊技能と移動処理/ Monster spells and movement [詳細]
#include "angband.h"
マクロ定義 | |
#define | SPEAK_CHANCE 8 |
#define | GRINDNOISE 20 |
#define | CYBERNOISE 20 |
#define | BLOW_EFFECT_TYPE_NONE 0 |
#define | BLOW_EFFECT_TYPE_FEAR 1 |
#define | BLOW_EFFECT_TYPE_SLEEP 2 |
#define | BLOW_EFFECT_TYPE_HEAL 3 |
関数 | |
static bool | get_enemy_dir (int m_idx, int *mm) |
モンスターが敵に接近するための方向を決める / Calculate the direction to the next enemy [詳細] | |
void | mon_take_hit_mon (int m_idx, int dam, bool *fear, cptr note, int who) |
モンスターが敵モンスターに行う打撃処理 / Hack, based on mon_take_hit... [詳細] | |
static int | mon_will_run (int m_idx) |
モンスターがプレイヤーから逃走するかどうかを返す / Returns whether a given monster will try to run from the player. [詳細] | |
static bool | get_moves_aux2 (int m_idx, int *yp, int *xp) |
モンスターがプレイヤーに向けて遠距離攻撃を行うことが可能なマスを走査する / Search spell castable grid [詳細] | |
static bool | get_moves_aux (int m_idx, int *yp, int *xp, bool no_flow) |
モンスターがプレイヤーに向けて接近することが可能なマスを走査する / Choose the "best" direction for "flowing" [詳細] | |
static bool | get_fear_moves_aux (int m_idx, int *yp, int *xp) |
モンスターがプレイヤーから逃走することが可能なマスを走査する / Provide a location to flee to, but give the player a wide berth. [詳細] | |
static bool | find_safety (int m_idx, int *yp, int *xp) |
モンスターが逃げ込める安全な地点を返す / Choose a "safe" location near a monster for it to run toward. [詳細] | |
static bool | find_hiding (int m_idx, int *yp, int *xp) |
モンスターが隠れ潜める地点を返す / Choose a good hiding place near a monster for it to run toward. [詳細] | |
static bool | get_moves (int m_idx, int *mm) |
モンスターの移動方向を返す / Choose "logical" directions for monster movement [詳細] | |
static int | check_hit2 (int power, int level, int ac, int stun) |
モンスターから敵モンスターへの命中判定 [詳細] | |
static bool | monst_attack_monst (int m_idx, int t_idx) |
モンスターから敵モンスターへの打撃攻撃処理 [詳細] | |
static bool | check_hp_for_feat_destruction (feature_type *f_ptr, monster_type *m_ptr) |
static void | process_monster (int m_idx) |
モンスター単体の1ターン行動処理メインルーチン / Process a monster [詳細] | |
void | process_monsters (void) |
全モンスターのターン管理メインルーチン / Process all the "live" monsters, once per game turn. [詳細] | |
int | get_mproc_idx (int m_idx, int mproc_type) |
モンスターの時限ステータスを取得する [詳細] | |
static void | mproc_add (int m_idx, int mproc_type) |
モンスターの時限ステータスリストを追加する [詳細] | |
static void | mproc_remove (int m_idx, int mproc_type) |
モンスターの時限ステータスリストを削除 [詳細] | |
void | mproc_init (void) |
モンスターの時限ステータスリストを初期化する / Initialize monster process [詳細] | |
bool | set_monster_csleep (int m_idx, int v) |
モンスターの睡眠状態値をセットする / Set "m_ptr->mtimed[MTIMED_CSLEEP]", notice observable changes [詳細] | |
bool | set_monster_fast (int m_idx, int v) |
モンスターの加速状態値をセット / Set "m_ptr->mtimed[MTIMED_FAST]", notice observable changes [詳細] | |
bool | set_monster_slow (int m_idx, int v) |
bool | set_monster_stunned (int m_idx, int v) |
モンスターの朦朧状態値をセット / Set "m_ptr->mtimed[MTIMED_STUNNED]", notice observable changes [詳細] | |
bool | set_monster_confused (int m_idx, int v) |
モンスターの混乱状態値をセット / Set "m_ptr->mtimed[MTIMED_CONFUSED]", notice observable changes [詳細] | |
bool | set_monster_monfear (int m_idx, int v) |
モンスターの恐慌状態値をセット / Set "m_ptr->mtimed[MTIMED_MONFEAR]", notice observable changes [詳細] | |
bool | set_monster_invulner (int m_idx, int v, bool energy_need) |
モンスターの無敵状態値をセット / Set "m_ptr->mtimed[MTIMED_INVULNER]", notice observable changes [詳細] | |
static void | process_monsters_mtimed_aux (int m_idx, int mtimed_idx) |
モンスターの各種状態値を時間経過により更新するサブルーチン [詳細] | |
void | process_monsters_mtimed (int mtimed_idx) |
全モンスターの各種状態値を時間経過により更新するメインルーチン [詳細] | |
void | dispel_monster_status (int m_idx) |
モンスターへの魔力消去処理 [詳細] | |
bool | process_the_world (int num, int who, bool vs_player) |
モンスターの時間停止処理 [詳細] | |
void | monster_gain_exp (int m_idx, int s_idx) |
モンスターの経験値取得処理 [詳細] | |
変数 | |
static sint | d_off_y_0 [] |
static sint | d_off_x_0 [] |
static sint | d_off_y_1 [] |
static sint | d_off_x_1 [] |
static sint | d_off_y_2 [] |
static sint | d_off_x_2 [] |
static sint | d_off_y_3 [] |
static sint | d_off_x_3 [] |
static sint | d_off_y_4 [] |
static sint | d_off_x_4 [] |
static sint | d_off_y_5 [] |
static sint | d_off_x_5 [] |
static sint | d_off_y_6 [] |
static sint | d_off_x_6 [] |
static sint | d_off_y_7 [] |
static sint | d_off_x_7 [] |
static sint | d_off_y_8 [] |
static sint | d_off_x_8 [] |
static sint | d_off_y_9 [] |
static sint | d_off_x_9 [] |
static sint * | dist_offsets_y [10] |
static sint * | dist_offsets_x [10] |
static u32b | csleep_noise |
モンスターの特殊技能と移動処理/ Monster spells and movement
This file has several additions to it by Keldon Jones (keldo) to improve the general quality of the AI (version 0.1.1). n@um r.edu
#define BLOW_EFFECT_TYPE_FEAR 1 |
#define BLOW_EFFECT_TYPE_HEAL 3 |
#define BLOW_EFFECT_TYPE_NONE 0 |
#define BLOW_EFFECT_TYPE_SLEEP 2 |
#define CYBERNOISE 20 |
#define GRINDNOISE 20 |
#define SPEAK_CHANCE 8 |
|
static |
モンスターから敵モンスターへの命中判定
power | 打撃属性による基本命中値 |
level | 攻撃側モンスターのレベル |
ac | 目標モンスターのAC |
stun | 攻撃側モンスターが朦朧状態ならTRUEを返す |
|
static |
void dispel_monster_status | ( | int | m_idx | ) |
モンスターへの魔力消去処理
m_idx | 魔力消去を受けるモンスターの参照ID |
|
static |
モンスターが隠れ潜める地点を返す / Choose a good hiding place near a monster for it to run toward.
m_idx | モンスターの参照ID |
yp | 移動先のマスのY座標を返す参照ポインタ |
xp | 移動先のマスのX座標を返す参照ポインタ |
Pack monsters will use this to "ambush" the player and lure him out
of corridors into open space so they can swarm him.
Return TRUE if a good location is available.
|
static |
モンスターが逃げ込める安全な地点を返す / Choose a "safe" location near a monster for it to run toward.
m_idx | モンスターの参照ID |
yp | 移動先のマスのY座標を返す参照ポインタ |
xp | 移動先のマスのX座標を返す参照ポインタ |
A location is "safe" if it can be reached quickly and the player
is not able to fire into it (it isn't a "clean shot"). So, this will
cause monsters to "duck" behind walls. Hopefully, monsters will also
try to run towards corridor openings if they are in a room.
This function may take lots of CPU time if lots of monsters are
fleeing.
Return TRUE if a safe location is available.
|
static |
モンスターが敵に接近するための方向を決める / Calculate the direction to the next enemy
m_idx | モンスターの参照ID |
mm | 移動するべき方角IDを返す参照ポインタ |
|
static |
モンスターがプレイヤーから逃走することが可能なマスを走査する / Provide a location to flee to, but give the player a wide berth.
m_idx | モンスターの参照ID |
yp | 移動先のマスのY座標を返す参照ポインタ |
xp | 移動先のマスのX座標を返す参照ポインタ |
A monster may wish to flee to a location that is behind the player,
but instead of heading directly for it, the monster should "swerve"
around the player so that he has a smaller chance of getting hit.
|
static |
モンスターの移動方向を返す / Choose "logical" directions for monster movement
m_idx | モンスターの参照ID |
mm | 移動方向を返す方向IDの参照ポインタ |
モンスターがプレイヤーに向けて接近することが可能なマスを走査する / Choose the "best" direction for "flowing"
m_idx | モンスターの参照ID |
yp | 移動先のマスのY座標を返す参照ポインタ |
xp | 移動先のマスのX座標を返す参照ポインタ |
no_flow | モンスターにFLOWフラグが経っていない状態でTRUE |
Note that ghosts and rock-eaters are never allowed to "flow",
since they should move directly towards the player.
Prefer "non-diagonal" directions, but twiddle them a little
to angle slightly towards the player's actual location.
Allow very perceptive monsters to track old "spoor" left by
previous locations occupied by the player. This will tend
to have monsters end up either near the player or on a grid
recently occupied by the player (and left via "teleport").
Note that if "smell" is turned on, all monsters get vicious.
Also note that teleporting away from a location will cause
the monsters who were chasing you to converge on that location
as long as you are still near enough to "annoy" them without
being close enough to chase directly. I have no idea what will
happen if you combine "smell" with low "aaf" values.
|
static |
モンスターがプレイヤーに向けて遠距離攻撃を行うことが可能なマスを走査する / Search spell castable grid
m_idx | モンスターの参照ID |
yp | 適したマスのY座標を返す参照ポインタ |
xp | 適したマスのX座標を返す参照ポインタ |
int get_mproc_idx | ( | int | m_idx, |
int | mproc_type | ||
) |
モンスターの時限ステータスを取得する
モンスターが敵モンスターに行う打撃処理 / Hack, based on mon_take_hit...
perhaps all monster attacks on other monsters should use this?
m_idx | 目標となるモンスターの参照ID |
dam | ダメージ量 |
fear | 目標となるモンスターの恐慌状態を返す参照ポインタ |
note | 目標モンスターが死亡した場合の特別メッセージ(NULLならば標準表示を行う) |
who | 打撃を行ったモンスターの参照ID |
|
static |
モンスターがプレイヤーから逃走するかどうかを返す / Returns whether a given monster will try to run from the player.
m_idx | 逃走するモンスターの参照ID |
Monsters will attempt to avoid very powerful players. See below.
Because this function is called so often, little details are important
for efficiency. Like not using "mod" or "div" when possible. And
attempting to check the conditions in an optimal order. Note that
"(x << 2) == (x * 4)" if "x" has enough bits to hold the result.
Note that this function is responsible for about one to five percent
of the processor use in normal conditions...
|
static |
モンスターから敵モンスターへの打撃攻撃処理
m_idx | 攻撃側モンスターの参照ID |
t_idx | 目標側モンスターの参照ID |
void monster_gain_exp | ( | int | m_idx, |
int | s_idx | ||
) |
モンスターの経験値取得処理
m_idx | 経験値を得るモンスターの参照ID |
s_idx | 撃破されたモンスター種族の参照ID |
|
static |
モンスターの時限ステータスリストを追加する
void mproc_init | ( | void | ) |
モンスターの時限ステータスリストを初期化する / Initialize monster process
|
static |
モンスターの時限ステータスリストを削除
|
static |
モンスター単体の1ターン行動処理メインルーチン / Process a monster
m_idx | 行動モンスターの参照ID |
The monster is known to be within 100 grids of the player
In several cases, we directly update the monster lore
Note that a monster is only allowed to "reproduce" if there
are a limited number of "reproducing" monsters on the current
level. This should prevent the level from being "swamped" by
reproducing monsters. It also allows a large mass of mice to
prevent a louse from multiplying, but this is a small price to
pay for a simple multiplication method.
XXX Monster fear is slightly odd, in particular, monsters will
fixate on opening a door even if they cannot open it. Actually,
the same thing happens to normal monsters when they hit a door
XXX XXX XXX In addition, monsters which cannot open or bash
down a door will still stand there trying to open it...
XXX Technically, need to check for monster in the way
combined with that monster being in a wall (or door?)
A "direction" of "5" means "pick a random direction".
void process_monsters | ( | void | ) |
全モンスターのターン管理メインルーチン / Process all the "live" monsters, once per game turn.
During each game turn, we scan through the list of all the "live" monsters,
(backwards, so we can excise any "freshly dead" monsters), energizing each
monster, and allowing fully energized monsters to move, attack, pass, etc.
Note that monsters can never move in the monster array (except when the
"compact_monsters()" function is called by "dungeon()" or "save_player()").
This function is responsible for at least half of the processor time
on a normal system with a "normal" amount of monsters and a player doing
normal things.
When the player is resting, virtually 90% of the processor time is spent
in this function, and its children, "process_monster()" and "make_move()".
Most of the rest of the time is spent in "update_view()" and "lite_spot()",
especially when the player is running.
Note the special "MFLAG_BORN" flag, which allows us to ignore "fresh"
monsters while they are still being "born". A monster is "fresh" only
during the turn in which it is created, and we use the "hack_m_idx" to
determine if the monster is yet to be processed during the current turn.
Note the special "MFLAG_NICE" flag, which allows the player to get one
move before any "nasty" monsters get to use their spell attacks.
Note that when the "knowledge" about the currently tracked monster
changes (flags, attacks, spells), we induce a redraw of the monster
recall window.
void process_monsters_mtimed | ( | int | mtimed_idx | ) |
全モンスターの各種状態値を時間経過により更新するメインルーチン
mtimed_idx | 更新するモンスターの時限ステータスID |
Process the counters of monsters (once per 10 game turns)
These functions are to process monsters' counters same as player's.
|
static |
モンスターの各種状態値を時間経過により更新するサブルーチン
m_idx | モンスター参照ID |
mtimed_idx | 更新するモンスターの時限ステータスID |
モンスターの時間停止処理
num | 時間停止を行った敵が行動できる回数 |
who | 時間停止処理の主体ID |
vs_player | TRUEならば時間停止開始処理を行う |
bool set_monster_confused | ( | int | m_idx, |
int | v | ||
) |
モンスターの混乱状態値をセット / Set "m_ptr->mtimed[MTIMED_CONFUSED]", notice observable changes
m_idx | モンスター参照ID |
v | セットする値 |
bool set_monster_csleep | ( | int | m_idx, |
int | v | ||
) |
モンスターの睡眠状態値をセットする / Set "m_ptr->mtimed[MTIMED_CSLEEP]", notice observable changes
m_idx | モンスター参照ID |
v | セットする値 |
bool set_monster_fast | ( | int | m_idx, |
int | v | ||
) |
モンスターの加速状態値をセット / Set "m_ptr->mtimed[MTIMED_FAST]", notice observable changes
m_idx | モンスター参照ID |
v | セットする値 |
モンスターの無敵状態値をセット / Set "m_ptr->mtimed[MTIMED_INVULNER]", notice observable changes
m_idx | モンスター参照ID |
v | セットする値 |
energy_need | TRUEならば無敵解除時に行動ターン消費を行う |
bool set_monster_monfear | ( | int | m_idx, |
int | v | ||
) |
モンスターの恐慌状態値をセット / Set "m_ptr->mtimed[MTIMED_MONFEAR]", notice observable changes
m_idx | モンスター参照ID |
v | セットする値 |
bool set_monster_slow | ( | int | m_idx, |
int | v | ||
) |
bool set_monster_stunned | ( | int | m_idx, |
int | v | ||
) |
モンスターの朦朧状態値をセット / Set "m_ptr->mtimed[MTIMED_STUNNED]", notice observable changes
m_idx | モンスター参照ID |
v | セットする値 |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |