mon-move.h File Reference

Monster movement. More...

Go to the source code of this file.


bool multiply_monster (const struct monster *m)
 Lets the given monster attempt to reproduce. More...
void process_monsters (struct chunk *c, int minimum_energy)
 Process all the "live" monsters, once per game turn. More...
void reset_monsters (void)
 Clear 'moved' status from all monsters. 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

bool multiply_monster ( const struct monster mon)

Lets the given monster attempt to reproduce.

Note that "reproduction" REQUIRES empty space.

Returns true if the monster successfully reproduced.

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

Referenced by process_monster_multiply(), and project_monster_handler_MON_CLONE().

void process_monsters ( struct chunk c,
int  minimum_energy 

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(), angband_constants::move_energy, monster::mspeed, process_monster(), process_monster_timed(), PU_MONSTERS, monster::race, regen_monster(), turn, turn_energy(), player_upkeep::update, player::upkeep, and z_info.

Referenced by run_game_loop().

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().