diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-31 08:41:27 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-31 08:41:27 +0000 |
commit | 86d488e3efa0b1d8ec12223527235e3ef3a5fec2 (patch) | |
tree | 88b3d97a6f74ea6eb21405b3072e1e1a9c6830b0 /crawl-ref/source/acr.cc | |
parent | 496a1b4c58651aa28878db51bb1d5f3534d8a0a5 (diff) | |
download | crawl-ref-86d488e3efa0b1d8ec12223527235e3ef3a5fec2.tar.gz crawl-ref-86d488e3efa0b1d8ec12223527235e3ef3a5fec2.zip |
Add arena mode, activated on the command-line by 'crawl -arena "monster v monster"' (eg: crawl -arena "Sigmund v Jessica") to let monsters fight each other undisturbed by the player. Good to examine monster AI and monster behaviour when the player is AWOL.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8059 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index bd122ecf91..960b612392 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -43,6 +43,7 @@ #include "abl-show.h" #include "abyss.h" +#include "arena.h" #include "branch.h" #include "chardump.h" #include "cio.h" @@ -135,6 +136,8 @@ char info[ INFO_SIZE ]; // messaging queue extern'd everywhere {dlb} int stealth; // externed in view.cc +void world_reacts(); + static key_recorder repeat_again_rec; // Clockwise, around the compass from north (same order as enum RUN_DIR) @@ -160,7 +163,6 @@ static void _close_door(coord_def move); static void _start_running( int dir, int mode ); static void _prep_input(); -static void _world_reacts(); static command_type _get_next_cmd(); static keycode_type _get_next_keycode(); static command_type _keycode_to_command( keycode_type key ); @@ -1527,7 +1529,7 @@ static void _input() crawl_state.cancel_cmd_repeat("Cannot move, cancelling command " "repetition."); - _world_reacts(); + world_reacts(); return; } @@ -1547,13 +1549,13 @@ static void _input() if (you_are_delayed() && current_delay_action() != DELAY_MACRO_PROCESS_KEY) { if (you.time_taken) - _world_reacts(); + world_reacts(); return; } if (you.turn_is_over) { - _world_reacts(); + world_reacts(); return; } @@ -1622,7 +1624,7 @@ static void _input() if (apply_berserk_penalty) _do_berserk_no_combat_penalty(); - _world_reacts(); + world_reacts(); } else viewwindow(true, false); @@ -3049,7 +3051,7 @@ static void _check_sanctuary() decrease_sanctuary_radius(); } -static void _world_reacts() +void world_reacts() { crawl_state.clear_god_acting(); @@ -3080,7 +3082,8 @@ static void _world_reacts() search_around(false); // Check nonadjacent squares too. } - stealth = check_stealth(); + if (!crawl_state.arena) + stealth = check_stealth(); #ifdef DEBUG_STEALTH // Too annoying for regular diagnostics. @@ -3090,7 +3093,7 @@ static void _world_reacts() if (you.special_wield != SPWLD_NONE) special_wielded(); - if (one_chance_in(10)) + if (!crawl_state.arena && one_chance_in(10)) { // this is instantaneous if (player_teleport() > 0 && one_chance_in(100 / player_teleport())) @@ -3099,7 +3102,7 @@ static void _world_reacts() you_teleport_now( false, true ); // to new area of the Abyss } - if (env.cgrid(you.pos()) != EMPTY_CLOUD) + if (!crawl_state.arena && env.cgrid(you.pos()) != EMPTY_CLOUD) in_a_cloud(); if (you.level_type == LEVEL_DUNGEON && you.duration[DUR_TELEPATHY]) @@ -3149,7 +3152,7 @@ static void _world_reacts() viewwindow(true, true); - if (Options.stash_tracking) + if (Options.stash_tracking && !crawl_state.arena) { StashTrack.update_visible_stashes( Options.stash_tracking == STM_ALL ? StashTracker::ST_AGGRESSIVE @@ -3872,6 +3875,12 @@ static bool _initialise(void) } #endif + if (crawl_state.arena) + { + run_arena(); + end(0, false); + } + // Sets up a new game. const bool newc = new_game(); if (!newc) |