summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stairs.cc
Commit message (Collapse)AuthorAgeFilesLines
* allow iterating over branches in a non-enum order (8742)Jesse Luehrs2014-08-021-3/+3
| | | | | | | | | | | | 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 stuffNicholas Feinberg2014-07-291-0/+1
| | | | | | | .cc, moving its contents into the new stepdown.cc and strings.cc. (The latter also got many donations from libutil.h.) Down with stuff! Up the new flesh!
* Create prompt.ccNicholas Feinberg2014-07-271-1/+1
|
* Let BLOOD finally have its place in the sunNicholas Feinberg2014-07-011-0/+1
| | | | | | ...by moving bloodspatter functions into their own file. Death to misc.cc! Long live the new file hierarchy!
* Remove the now-superfluous friendly_pickup command suite.Shmuale Mark2014-05-281-3/+0
| | | | Including the default_friendly_pickup option.
* Expose bitset's count function through FixedBitVector...Eduardo Gonzalez2014-05-091-5/+1
| | | | | and use it to speed up counting runes in a few places. Vaults and Zot entrances report activated runes by name, so weren't updated.
* Delete an unused bool argument from _exit_stair_message()reaver2014-04-301-3/+3
|
* Don't allow tripping when being cast deeper into the Abyss (#6975)Chris Campbell2014-03-271-0/+2
| | | | Or when Xom reverts your banishment.
* Allow players to continue traversing stairs if they get sealed halfway.Steve Melenchuk2014-03-111-3/+3
| | | | This was never intentional, by all indications.
* Make Zot unlocking flash colour depend on the inserted runePekka Lampila2014-01-301-3/+4
|
* Drop some useless parentheses around comparisons.Adam Borowski2014-01-101-2/+2
|
* Drop pointless empty lines after or before a brace.Adam Borowski2013-12-211-1/+0
| | | | | I left them only where the contents is not indented, like in a namespace or a template.
* Ignore brentry when returning from a ziggurat.Adam Borowski2013-12-211-1/+2
| | | | | | | | | The code checked this before the level stack, thus if you returned from Pan, a trovel or (in transferred saves) D, you got placed in Depths instead. For extra fun, try this in a pre-Depths save! :รพ We could just check the stack first, but the current code allows for a regular subbranch of the Abyss, etc.
* Unify an if.Adam Borowski2013-12-211-14/+12
|
* Replace Ziggurat fees with a 3-rune lock.Adam Borowski2013-12-191-4/+15
| | | | | | | | | | | | | | | | | | | | | | This way you need a good deal less scumming if you want to try multiple Ziggurats -- completely or not. The number of runes required comes from historic data of people who left Ziggurats at particular urune count: 0: 7 1: 7 2: 19 3: 117 (earliest completion) 4: 175 5: 224 6: 164 7: 134 8: 112 9: 162 10: 177 11: 164 12: 106 13: 56 14: 100 15: 329
* Schedule DNGN_ENTER_PORTAL_VAULT for removal; other related fixes.Adam Borowski2013-12-191-2/+7
|
* Make portal entrances and exits proper features on their own.Adam Borowski2013-12-181-4/+11
| | | | | Overloading made it impossible to redefine them, assign colours, made it hard to do stuff on C++ side, and stank of elderberries.
* Drop map_shadow, use a bitmap and update it incrementally.Adam Borowski2013-12-041-4/+2
| | | | | | | | | | | | | | | | | Copying the whole map_knowledge every turn was really costly. We don't care about any fields of the map other than the "seen" flag, too. Thus, we can move it into a bitmap and update only changes rather than everything. This means we need to update the entire bitmap once exploration starts, but that's a small fraction of the cost: qw profiles: before: 9.55% check_for_interesting_features() 0.18% start_explore(bool) after: 0.29% start_explore(bool) 0.10% check_for_interesting_features()
* Remove another extra space (elliptic)Neil Moore2013-11-301-1/+1
|
* Drop tagstring.{cc,h}Adam Borowski2013-11-291-1/+0
| | | | A whole file for four lines of code.
* Restrict mpr() to literals only.Adam Borowski2013-11-291-1/+1
| | | | | The translation project is stalled, but this makes all of such static strings trivially gatherable without any extra work.
* Replace `mpr(s, ch)` with `mprf(ch, s)`Adam Borowski2013-11-291-13/+12
| | | | | | | | | Also simplify quite a few cases. It turns out in >90% cases of non-literals the argument had .c_str(), which meant it was pointlessly malloc()ed and converted from and to std::string. I believe a sprintf is faster, so even the argument of miniscule speed-up doesn't apply.
* Move the rune lock to Vaults rather than Depths.Adam Borowski2013-11-201-2/+2
| | | | | I can't quite fathom the reason to not moving it to /dev/null instead, but here you go.
* Consider Formicid-made shafts known.pubby2013-11-181-2/+4
| | | | | This affects the distance they fall; known shafts fall less floors than unknown ones.
* Indicate how far players get shafted on-screen (and in notes)Samuel Bronson2013-11-171-2/+9
|
* Replace an "if (x); if (!x);" by "if (x); else;"Samuel Bronson2013-11-171-1/+1
|
* Use default parents for nonexistent branches.Neil Moore2013-11-121-2/+1
| | | | | | | | | | | | 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.
* Theatrics when entering the Depths for the first time.Steve Melenchuk2013-11-121-2/+11
| | | | Minor at this point, and may become irrelevant in the future.
* Transform the lower half of D into a new branch: the Depths.Steve Melenchuk2013-11-121-5/+3
| | | | | | | | | | | | 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.
* Simplify.Adam Borowski2013-11-101-1/+1
|
* Make all shaft falls a milestone.pubby2013-11-101-1/+1
| | | | Shafting only 1 floor wasn't being considered a milestone.
* Fix wizmode returning from a non-existent branch.Neil Moore2013-11-061-1/+2
|
* More runelock shaft clean-up.Adam Borowski2013-11-051-19/+0
|
* Revert "Allow D:14 shafts, make them known; try to always place one."Raphael Langella2013-11-051-12/+0
| | | | | | | This reverts commit 3c177f47aa1bbf47db5dea54bdaa4f770a0220b4. This reverts commit e1004a1d0131a735b2b9be1c87b1fd27e09bf81f. This reverts commit 930d8ed00efae890e3899670ae87cfdc07eda236. This reverts commit 637089748731402da6c33483b30118d2eebdcc73.
* Axe a buttload of useless #includes.Adam Borowski2013-11-031-1/+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-15/+15
| | | | | Seriously, even preparing this commit gave me a pain in the triangle between the thumb and index finger's bases and the wrist.
* Prompt before taking a runelock shaftChris Campbell2013-11-021-0/+12
| | | | | | | This will also prompt for unknown shafts, such as from chaos weapons. Obviously these shouldn't even be possible, but in the meantime having the incorrect prompt is better than forcing people past the runelock accidentally.
* Store the entry level for every branch (rather than just depth).Adam Borowski2013-11-021-11/+8
| | | | | | | | 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.
* Also require a rune to go from D:15 to D:14.David Ploog2013-11-021-0/+19
| | | | In case you somehow ended up there (for example early portal to Hell).
* Just check stone stairs/escape hatches on D:14Chris Campbell2013-10-311-1/+1
| | | | In case a branch entry or similar were to be added to D:14, for example.
* Allow entering portal vaults and being banished on D:14Chris Campbell2013-10-311-1/+3
|
* Rune lock.Raphael Langella2013-10-311-0/+17
| | | | | You need a rune to go to D:15. Downstairs of D:14 could be recoloured or replaced by a portal (maybe more consistent with D:27 zot portal).
* Rewrite monster_iterator.Adam Borowski2013-10-311-1/+1
| | | | | It degenerated to a simple loop over menv, hardly worth any syntactic sugar. I kept it for now, though.
* Have the Orb not take up an inventory slot.Steve Melenchuk2013-10-301-5/+2
| | | | | It still, however, costs 60 aum to carry, and has all of its other effects.
* Cache whether any slimy wall exists on the level.Adam Borowski2013-10-081-0/+3
|
* Rename "natural traps" to "shafts".Adam Borowski2013-09-251-2/+2
|
* Get rid of random_shuffle().Adam Borowski2013-09-101-1/+1
| | | | | | | | | | | | | | | | | | This should hopefully make games from the same seed proceed the same on all architectures[1], as I can't think of anything else that behaves differently based on pointer size, endianness or exact pointer values. I used a NIH implementation instead of passing a third argument to random_shuffle, as the interface is so much nicer. [1]. This will be affected by terminal size (elemental colours are not resolved outside the screen), tile windows size (random animations), tiles/non-tiles and possibly others. Also, I don't think we use STL hashes anywhere, but if we'd do, the STL implementation will matter. Please don't make this stop you: this commit is only to make test cases from my stress tests portable which is a small benefit, perhaps even smaller than the nicer call interface.
* Fix shafting with items bugs.pubby2013-09-091-3/+3
| | | | | | | | | | | | | | First, the down_stairs function called handle_items_on_shaft, but it called it after changing you.depth. This meant it shafted the items you LANDED on, rather than the items you were standing on at the time of shafting. Second, the stash and map knowledge weren't being cleared despite the items being obviously moved. Third, place_transiting_items wasn't handling stacks properly. If you shafted a stack of ammo, only 1 ammo would exist afterwards. This also fixes also applies to any other usage of place_transiting_items.
* Fix do_shaft: allow it to work anywhere.pubby2013-08-251-2/+2
| | | | | | | A bug in down_stairs was preventing players from getting shafted when not standing over a shaft trap (such as from chaos brand). This function had an option for players to get shafted this way, but it wasn't being properly checked in the function body.
* Refactor 'you.religion' checks.Brendan Hickey2013-07-281-1/+2
| | | | | Pull 'you.religion [!=]= FOO' checks into a function: you_worship(FOO). This change is part of a large plan to clean up religion.