Angband
Functions
mon-move.h File Reference

Monster movement. More...

Go to the source code of this file.

Functions

bool multiply_monster (struct chunk *c, const struct monster *mon)
 

Monster turn routines These routines, culminating in monster_turn(), decide how a monster uses

its turn

More...
 
void process_monsters (struct chunk *c, int minimum_energy)
 

Monster processing routines to be called by the main game loop

More...
 
void reset_monsters (void)
 Clear 'moved' status from all monsters. More...
 
void restore_monsters (void)
 Allow monsters on a frozen persistent level to recover. More...
 

Detailed Description

Monster movement.

Copyright (c) 1997 Ben Harrison, David Reeve Sward, Keldon Jones.

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.

Function Documentation

◆ multiply_monster()

bool multiply_monster ( struct chunk c,
const struct monster mon 
)


Monster turn routines These routines, culminating in monster_turn(), decide how a monster uses

its turn

Lets the given monster attempt to reproduce.

Note that "reproduction" REQUIRES empty space.

Returns true if the monster successfully reproduced.

References monster::fx, monster::fy, i, place_new_monster(), monster::race, scatter(), and square_isempty().

Referenced by monster_turn_multiply(), and project_monster_handler_MON_CLONE().

◆ process_monsters()

void process_monsters ( struct chunk c,
int  minimum_energy 
)


Monster processing routines to be called by the main game loop

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.

This function and its children are responsible for a considerable fraction of the processor time in normal situations, greater if the character is resting.

References cave_monster(), cave_monster_max(), monster::energy, player_upkeep::generate_level, i, player::is_dead, monster::m_timed, monster::mflag, mflag_has, mflag_on, chunk::mon_current, monster_check_active(), monster_is_mimicking(), monster_turn(), angband_constants::move_energy, monster::mspeed, process_monster_timed(), PU_MONSTERS, monster::race, regen_monster(), true, turn, turn_energy(), player_upkeep::update, player::upkeep, and z_info.

Referenced by run_game_loop().

◆ reset_monsters()

void reset_monsters ( void  )

Clear 'moved' status from all monsters.

Clear noise if appropriate.

References cave, cave_monster(), cave_monster_max(), i, monster::mflag, mflag_off, and monster_take_terrain_damage().

Referenced by run_game_loop().

◆ restore_monsters()

void restore_monsters ( void  )