summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/branch.cc
Commit message (Collapse)AuthorAgeFilesLines
* Properly hide conflicting branches on ctrl-O.Shmuale Mark2014-08-031-3/+2
| | | | | Also cleans up some old Forest code, which might make ^O look a bit weird on imported saves; probably not a big problem.
* allow iterating over branches in a non-enum order (8742)Jesse Luehrs2014-08-021-4/+90
| | | | | | | | | | | | This allows us to have a consistent and logical ordering of branches without requiring the branch enum itself to be reordered (which could have save compatibility implications). The new ordering of branches just moves Depths to the place in the ordering that it already is planned to go on the next major save compat bump, but other changes are possible, if desired. All places in the code that iterate over branches have been updated to use the new iterator except for code dealing with save files, which still uses enum order, so that we can change the display ordering without affecting saves.
* Remove Hall of Bladesreaverb2014-06-071-1/+2
| | | | | | The complaints against the branch are well documented, mostly stating Dancing Weapons are awful enemies and the Hall of Blades is filled with them.
* Formatting fixes (add braces).Neil Moore2014-05-121-0/+2
| | | | This fixes all the instances caught by unbrace.
* Gozag: prelimiary implementation of Bribe Branch.Steve Melenchuk2014-05-071-0/+1
| | | | | | | | | | Spend 3000 gold for a chance of temporarily turning some of the inhabitants of a branch good neutral, or possibly even friendly. Bribes are only effective against newly generated monsters (i.e. on level creation or monsters that spawn afterwards); the fund times out over time and more quickly with the number of enemies affected, upon which neutral enemies turn hostile again; friendly followers will continue to follow the player subject to occasional follow-up payments.
* Purge some references to Forest.Shmuale Mark2014-03-031-3/+3
| | | | In particular, ctrl-O should no longer mention the branch.
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-3/+3
|
* Use default parents for nonexistent branches.Neil Moore2013-11-121-2/+3
| | | | | | | | | | | | If we don't per-game brentry data, make parent_branch return what would be the parent, rather than NUM_BRANCHES. Among other things, this avoids leaking random branch choices in the ctrl-o screen (branches not in the current game were never listed). Also revert two piecemeal fixes that are now handled by the more general code: This reverts commit 259fcac8a0cba227ee4dc49cf5a7d5d2718cdc9c. This reverts commit 81f5e101725dc1c0d5e96fc068a7b2b8d72b12ba.
* Transform the lower half of D into a new branch: the Depths.Steve Melenchuk2013-11-121-1/+1
| | | | | | | | | | | | D is now 16 levels (the unsealed part was 14 levels previously), and the Depths are six levels. Vaults is enterable from Depths:2-5; Abyss, Hell, and Pan portals are available for the entire length of the branch. Right now the monster set is identical to Vaults except for the absence of Vaults-specific humans. D's monster set has also been truncated, mainly on the out-of-depth front. It's my intent that this serve as a starting point for figuring out what monsters we want to split between the two branches.
* Restore "Branch not generated this game" prompt.Neil Moore2013-11-061-1/+1
| | | | | We needed to check whether its *default* parent was Lair, not whether its parent was Lair in this game.
* Axe a buttload of useless #includes.Adam Borowski2013-11-031-2/+0
| | | | | Can't test Android, MSVC or Mac, but a very brief glance at the diff suggests it's unlikely they're affected.
* Shorten branch enums.Adam Borowski2013-11-031-3/+3
| | | | | Seriously, even preparing this commit gave me a pain in the triangle between the thumb and index finger's bases and the wrist.
* Store the entry level for every branch (rather than just depth).Adam Borowski2013-11-021-7/+5
| | | | | | | | This allows moving branches around without breaking save compat or at least serious hacks. The portal stack can be probably dropped now: two copies of the same level can't exist anyway.
* Remove the Dwarven Hall.Adam Borowski2013-07-101-2/+2
| | | | It's easy to re-add it if we'd have a better idea for it after all.
* No parent for the root branch.Neil Moore2013-06-211-0/+2
| | | | | Among other things, this prevents G ctrl-p in zotdef from showing "Dungeon".
* Turn pairs of assertions with x > min, x <= max into ASSERT_RANGE.Adam Borowski2013-06-081-2/+1
| | | | | The perl regexp to do so is: s&ASSERT\(([^\n]+) >= ([^\n]+)\);\s*ASSERT\(\1 < ([^\n]+)\);&ASSERT_RANGE($1, $2, $3);&sg;
* Alternate Forest with Crypt.Steve Melenchuk2013-05-261-4/+14
| | | | | | | Forest's entrance depth and absolute depth are now the same as Crypt's. This also adds functionality to move Tomb's entrance to Forest if Crypt isn't placed in the game, so Tomb always exists (at present).
* Refactor ASSERT(a && b) -> ASSERT(a); ASSERT(b);Brendan Hickey2013-04-281-1/+2
| | | | | | | Convert conjunctive assertions into separate assertions. This ought to be correctness preserving. I ran the stress tests and didn't notice anything unusual. While I have confidence in it, if you are the slightest bit suspicious of this, please roll it back. Found instances with `ASSERT(\([^(|]*\) && \([^)|]*\))` Manually inspected each instance.
* Merge branch 'master' into mon-pickAdam Borowski2013-02-241-0/+4
|\ | | | | | | Sorry for merge commits, but rerere is pretty limited.
| * Restore save compatibility with 0.11 final.Adam Borowski2013-01-261-0/+4
| | | | | | | | | | | | | | This does not include trunk versions older than some time after 0.11 branching, although you can upgrade such saves in two steps, by loading in 0.11 and then in current trunk. I doubt this will lead to any troubles as 0.10 saves are not compatible anyway.
* | Merge branch 'master' into mon-pickAdam Borowski2012-11-041-1/+1
|\| | | | | | | | | Merge commits instead of rerere suck, but not being able to comfortably use the test rig sucks even more.
| * Use std namespace.Raphael Langella2012-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | I had to rename distance() (in coord.h) to distance2() because it conflicts with the STL function to compare 2 iterators. Not a bad change given how it returns the square of the distance anyway. I also had to rename the message global variable (in message.cc) to buffer. I tried to fix and improve the coding style has much as I could, but I probably missed a few given how huge and tedious it is. I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool and util/levcomp.*, because I have no clue about those.
* | Don't use internal data of mon-pick from the outside.Adam Borowski2012-08-261-5/+0
|/
* Bump save compat, in order to recover from monster_spells.Adam Borowski2012-08-191-5/+1
| | | | | | | | | The problematic spells happen to be the same that add a massive number of enchantments and alter save structure, adding save compat for those would require a lot of work and be risky. Thus, it's easier to rewind, and then re-apply parts that we do want to keep.
* Drop a bunch of parentheses from return statements.Adam Borowski2012-08-081-1/+1
| | | | | This is incomplete, partially because of me getting bored, partially because of doubts about the point of leaving simple addition/etc in parentheses.
* Purge the remnants of Hive.Adam Borowski2012-07-241-1/+4
|
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-1/+1
|
* Remove a good deal of header inclusion.Adam Borowski2012-05-231-2/+0
| | | | | | | | | These accumulate but never get removed; no wonder compilation times keep rising. The includes.sh script has lots of false negatives (and positives...), and can't check .h files which cause the biggest slowdown, it'd be nice to run multidelta on those somehow.
* Set ZotDef in Zot.Neil Moore2012-05-021-0/+1
| | | | | | | | | | | Allow games to use different root branches. Currently this is Zot for zotdef, and Dungeon for everything else. If there are reachable branches that precede the root branch in branches[], the ^O screen will incorrectly print them first. This is not currently the case for any game type, and isn't likely to be the case in the future, because branches[] is for the most part topologically sorted.
* Remove an almost unused function.Adam Borowski2012-04-271-16/+0
| | | | The only call to it was special-cased to return the Vestibule immediately.
* Remove some unused portal vault special-casing.Adam Borowski2012-04-261-20/+0
|
* Fix oplace for entering portals.Adam Borowski2012-04-081-1/+4
| | | | | This assumes no walkways when there's anything on the stack -- ie, no non-portal subbranches from a portal vault.
* Merge branch 'master' into portal_branchesAdam Borowski2012-03-261-2/+2
|\ | | | | | | | | This includes fixes for 64834896234968 places in master that add new uses of LEVEL_FOO and so on.
| * Enable the Spider Nest.Michael Gagno2012-03-131-2/+2
| | | | | | | | | | | | | | The lair rotation is now one of spider/snake and one of shoals/swamp. Spider still isn't finished, but it's playable. I don't know about the branch difficulty, but we should find out soon enough.
* | Use branch depth rather than absolute depth as the authoritative one.Adam Borowski2012-01-031-7/+2
| |
* | Purge away attempts to retain save compat for level_type changes.Adam Borowski2011-11-041-23/+0
| |
* | Split the branch data into read-only and mutable parts.Adam Borowski2011-11-041-3/+5
| | | | | | | | | | | | | | | | As a side effect, branches can now be shortened without breaking major save compat. This commit itself doesn't preserve compat though, even though it'd be easy -- other parts are too nasty already.
* | Remove the ability to dynamically set branch flags.Adam Borowski2011-11-041-53/+0
| | | | | | | | The tutorial uses it, but for encompass vaults that's not needed.
* | Get rid of level_type, unify BRANCH_*, LEVEL_* and portal vaults.Adam Borowski2011-11-041-61/+53
|/
* Remove unused level flags, forbid exclusions in Abyss and Lab.Adam Borowski2011-10-091-19/+0
| | | | | | | | Old unmappable levels are gone for good, and good riddance. Thus, player_in_mappable_area() is obsolete; I removed it and stolen the name for "Lab or Abyss" check, done inconsistently in several places. Also, exclusions there were problematic -- I removed them for now, please change this back if you can fix them.
* Disable the Hive, guarantee some very basic food supply.Adam Borowski2011-09-261-1/+1
|
* Apply the new feature mimic implementation to all types.Raphael Langella2011-09-051-0/+12
| | | | | | | | | | Starting from D:10, any door, stairs, escape hatch, shop fountain and portal has one chance in 100 of being a mimic. Branch entry vaults can be placed with a branch entry mimic. No mimics in the temple and the vestibule. For now, those are the only excluded places.
* Generalize checks for disabled Lair branches.Adam Borowski2011-08-301-0/+6
|
* Adjust some whitespace and formatting.Adam Borowski2011-07-081-1/+2
|
* Check for level_type == LEVEL_DUNGEON in at_branch_bottom.Vsevolod Kozlov2011-06-191-1/+2
| | | | | | | Anything relying on it -not- checking level_type is probably obscure and should be done in a different way. Not sure whether such cases exist. Should fix #415[23].
* Doxygenization and junk purging that was missed by my script.Adam Borowski2011-04-021-5/+0
|
* Make some functions static, remove unused among those.Adam Borowski2010-10-271-6/+1
|
* Get rid of redundant and misindented breaks.Adam Borowski2010-10-211-6/+0
|
* Stop debug spam in labs.Adam Borowski2010-10-211-0/+3
|
* Get rid of some more insidious longs.Adam Borowski2010-10-041-7/+5
| | | | | | | | | | Especially constructs like: long foo = x.props[].get_int() can get you by surprise on 32 bit arches -- even worse now that most devs are on amd64. Item flags I typedeffed as iflags_t, as it's likely we'll have to extend it soon, yet defining it as uint64_t now would be misleading since there are so many places it's used in a 32 bit manner.