diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-07 12:03:36 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-07 12:03:36 +0000 |
commit | 7ce4f0c31ffe27368d7a62298dcb45fd244904b1 (patch) | |
tree | 582135bc457bb1aa6d8978f3208f291469719c59 /crawl-ref/source/items.cc | |
parent | f001432886469258339851993d506a8ec3d0b097 (diff) | |
download | crawl-ref-7ce4f0c31ffe27368d7a62298dcb45fd244904b1.tar.gz crawl-ref-7ce4f0c31ffe27368d7a62298dcb45fd244904b1.zip |
Yet another fix to the arena win/loss/tie logic.
During arena mode don't reserve any of mitm[] when creating new items, and when
mitm[] fills up call arena_cull_items() instead of _cull_items(), since in
arena mode we can cull via how boring/interesting the items are rather than
having to consider game balance and fairness to the player.
Allow the arena to veto monster placement, rather than culling them immediately
after they're placed.
New arena tags:
* "no_bands" prevents band members from being placed.
* "move_spawners" teleports test spawners every turn to spread their
summons randomly over the arena.
* "ban_glyphs:" lists a set of text glyphs of types of monsters which
shouldn't be allowed in the arena.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8300 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r-- | crawl-ref/source/items.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index a05a5d8e9e..200656794c 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -26,6 +26,7 @@ REVISION("$Rev$"); #include "externs.h" +#include "arena.h" #include "beam.h" #include "branch.h" #include "cloud.h" @@ -60,6 +61,7 @@ REVISION("$Rev$"); #include "skills2.h" #include "spl-book.h" #include "spl-util.h" +#include "state.h" #include "stuff.h" #include "stash.h" #include "tiles.h" @@ -323,6 +325,9 @@ int get_item_slot( int reserve ) { ASSERT( reserve >= 0 ); + if (crawl_state.arena) + reserve = 0; + int item = NON_ITEM; for (item = 0; item < (MAX_ITEMS - reserve); item++) @@ -331,7 +336,16 @@ int get_item_slot( int reserve ) if (item >= MAX_ITEMS - reserve) { - item = (reserve <= 10) ? _cull_items() : NON_ITEM; + if (crawl_state.arena) + { + item = arena_cull_items(); + // If arena_cull_items() can't free up any space then + // _cull_items() won't be able to either, so give up. + if (item == NON_ITEM) + return (NON_ITEM); + } + else + item = (reserve <= 10) ? _cull_items() : NON_ITEM; if (item == NON_ITEM) return (NON_ITEM); |