Angband
Functions | Variables
game-world.h File Reference

Game core management of the game world. More...

#include "cave.h"

Go to the source code of this file.

Functions

bool is_daytime (void)
 Say whether it's daytime or not.
int turn_energy (int speed)
 The amount of energy gained in a turn by a player or monster.
void play_ambient_sound (void)
 Play an ambient sound dependent on dungeon level, and day or night in town.
void process_world (struct chunk *c)
 Handle things that need updating once every 10 game turns.
void on_new_level (void)
 Housekeeping on arriving on a new level.
void process_player (void)
 Process player commands from the command queue, finishing when there is a command using energy (any regular game command), or we run out of commands and need another from the user, or the character changes level or dies, or the game is stopped.
void run_game_loop (void)
 The main game loop.

Variables

u16b daycount
u32b seed_randart
u32b seed_flavor
s32b turn
bool character_generated
bool character_dungeon
bool character_saved
const byte extract_energy [200]

Detailed Description

Game core management of the game world.

Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke

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 is_daytime ( void  )
void on_new_level ( void  )
void play_ambient_sound ( void  )

Play an ambient sound dependent on dungeon level, and day or night in town.

References player::depth, is_daytime(), and sound().

Referenced by on_new_level(), and process_world().

void process_player ( void  )

Process player commands from the command queue, finishing when there is a command using energy (any regular game command), or we run out of commands and need another from the user, or the character changes level or dies, or the game is stopped.

Notice the annoying code to handle "pack overflow", which must come first just in case somebody manages to corrupt the savefiles by clever use of menu commands or something. (Can go? NRM)

Notice the annoying code to handle "monster memory" changes, which allows us to avoid having to update the window flags every time we change any internal monster memory field, and also reduces the number of times that the recall window must be redrawn.

References CMD_GAME, cmd_get_nrepeats(), CMD_SLEEP, cmdq_pop(), cmdq_push(), effect_simple(), player_upkeep::energy_use, EVENT_CHECK_INTERRUPT, EVENT_COMMAND_REPEAT, EVENT_REFRESH, event_signal(), player_upkeep::generate_level, handle_stuff(), player::is_dead, player_upkeep::monster_race, notice_stuff(), pack_overflow(), player_has, player_resting_complete_special(), player_upkeep::playing, PR_MONSTER, process_player_cleanup(), player_upkeep::redraw, player::timed, and player::upkeep.

Referenced by run_game_loop().

void process_world ( struct chunk c)
void run_game_loop ( void  )
int turn_energy ( int  speed)

The amount of energy gained in a turn by a player or monster.

References extract_energy, angband_constants::move_energy, and z_info.

Referenced by adj_energy(), describe_effect(), describe_food(), process_monsters(), process_world(), and run_game_loop().

Variable Documentation

bool character_dungeon
bool character_generated
bool character_saved
u16b daycount
const byte extract_energy[200]
u32b seed_flavor
u32b seed_randart
s32b turn