Hengband
2.2.1
|
関数 | |
void | process_monsters (void) |
全モンスターのターン管理メインルーチン / Process all the "live" monsters, once per game turn. [詳解] | |
void | process_monster (MONSTER_IDX m_idx) |
モンスター単体の1ターン行動処理メインルーチン / Process a monster [詳解] | |
int | get_mproc_idx (MONSTER_IDX m_idx, int mproc_type) |
モンスターの時限ステータスを取得する [詳解] | |
void | mproc_init (void) |
モンスターの時限ステータスリストを初期化する / Initialize monster process [詳解] | |
void | process_monsters_mtimed (int mtimed_idx) |
全モンスターの各種状態値を時間経過により更新するメインルーチン [詳解] | |
int get_mproc_idx | ( | MONSTER_IDX | m_idx, |
int | mproc_type | ||
) |
モンスターの時限ステータスを取得する
void mproc_init | ( | void | ) |
モンスターの時限ステータスリストを初期化する / Initialize monster process
void process_monster | ( | MONSTER_IDX | m_idx | ) |
モンスター単体の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
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 current 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 game 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 game 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.