summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/branch.h
Commit message (Collapse)AuthorAgeFilesLines
* allow iterating over branches in a non-enum order (8742)Jesse Luehrs2014-08-021-0/+15
| | | | | | | | | | | | 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.
* 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.
* Don't recompile world when random-pick.h gets changed.Adam Borowski2013-11-251-0/+1
| | | | Also, drop one copy of monster distribution data.
* Store the entry level for every branch (rather than just depth).Adam Borowski2013-11-021-1/+2
| | | | | | | | 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.
* Alternate Forest with Crypt.Steve Melenchuk2013-05-261-1/+3
| | | | | | | 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).
* Merge branch 'master' into mon-pickAdam Borowski2012-11-041-2/+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-2/+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.
* | Convert mon-pick data to a more readable scheme.Adam Borowski2012-08-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of a base level and a rarity, which then use a ridiculously obscure algorithm to accept or reject monsters, the new data includes: * minimal depth the monster can be found on * maximal depth * rarity at the center of the range * distribution type (flat, a linear triangle, something halfway between the two) * the monster's enum The results should be the same, with very minor differences: * distributions within allowed range are approximated by one of three shapes (FLAT, SEMI, PEAK), this shouldn't produce noticeable differences * effective rarity has been shoehorned into a 0..1000 range (out of 0..10201), using div_rand_round(). There's a number of monsters with 35/10201 rarity which ends up as 3 or 4, and strings of monsters of the same rarity end up randomly perturbed. * the once-in-the-life-of-universe chance to generate a monster outside the -5..+5 range is gone, you can now set arbitrary ranges and they're absolute. There's no actual code to use this data yet, merely an emulation of the old functions. It looks like ZotDef applies some complex rules to the monster's depth, it may take some thinking about how to convert it.
* | Don't use internal data of mon-pick from the outside.Adam Borowski2012-08-261-1/+0
|/
* 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-1/+0
| | | | The only call to it was special-cased to return the Vestibule immediately.
* Give branches explicit base absdepth, instead of using distance to D:1.Adam Borowski2012-04-261-0/+1
|
* Remove some unused portal vault special-casing.Adam Borowski2012-04-261-2/+0
|
* Use monster_type for mon-pick functions.Adam Borowski2012-04-091-2/+2
|
* Purge remnants of Hell instant upstairs code.Adam Borowski2012-04-081-1/+0
| | | | | | This also fixes X[] being unable to go back and forth between Hell levels -- [ would always switch to the Vestibule. Now it will do so only if the cursor is on a portal back there.
* 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.
| * Declare an explicit type for colours.Adam Borowski2012-03-131-2/+2
| | | | | | | | | | | | | | | | | | | | An imperial buttload of places assumes these to be 8 bits, which makes it impossible to add support for 256 (or more!) colours. This commit tries to allow expanding it in the future; sadly, it is badly incomplete. At least, new code can use the new type. Also, beware of "branded" colours which use bits above 8 for inverse, underline, etc.
* | A branch flag: BFLAG_NO_ITEMS, convert the old giant if to use that.Adam Borowski2011-11-041-0/+1
| | | | | | | | What with the Hive?
* | Split the branch data into read-only and mutable parts.Adam Borowski2011-11-041-6/+6
| | | | | | | | | | | | | | | | 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.
* | Renumber branch flags starting from 1.Adam Borowski2011-11-041-2/+2
| | | | | | | | No regard for save compat, it's already about to get broken.
* | Remove the ability to dynamically set branch flags.Adam Borowski2011-11-041-5/+0
| | | | | | | | The tutorial uses it, but for encompass vaults that's not needed.
* | Remove BFLAG_NO_TELE_CONTROL, redundant with level flags.Adam Borowski2011-11-041-2/+0
| |
* | Remove BFLAG_HAS_ORB, nothing used it.Adam Borowski2011-11-041-1/+0
| |
* | Get rid of level_type, unify BRANCH_*, LEVEL_* and portal vaults.Adam Borowski2011-11-041-3/+4
| |
* | Branch data for "LEVEL_" and lua branches.Adam Borowski2011-11-041-0/+1
|/ | | | | It's amazing how much redundancy and inconsistency can be removed by unifying this code. This commit only adds the data in a common format yet.
* Remove unused level flags, forbid exclusions in Abyss and Lab.Adam Borowski2011-10-091-2/+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.
* Apply the new feature mimic implementation to all types.Raphael Langella2011-09-051-0/+2
| | | | | | | | | | 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/+1
|
* Remove unused non-Lua fog generator code, almost unused trap generators.Adam Borowski2011-08-171-6/+0
| | | | | | | | The version we do use, placing fog generators with vaults, gives a lot better control. Per-branch trap generators were used only to block mechanical traps from generating in Slime, this can be done with a single if.
* Make file headers doxygen-friendly, drop useless fields.Adam Borowski2011-03-281-5/+4
| | | | | | | "File:" is shown in your editor's status bar. "Written by:" was used only for the first person who changed a file. We got git for that now, and pre-DCSS history is so woefully inaccurate it doesn't really matter.
* Remove altar_chance from branch data, as it is no longer used.Vsevolod Kozlov2010-12-291-1/+0
|
* Remove shop_chance from branch-data.h.Vsevolod Kozlov2010-12-291-1/+0
| | | | | | | Only dgn.br_has_shops used it, and that is not used anywhere in dat as far as grep can see. The chances are now in dat/des/builder/shops.des anyway.
* Make some functions static, remove unused among those.Adam Borowski2010-10-271-1/+0
|
* Get rid of some more insidious longs.Adam Borowski2010-10-041-5/+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.
* describe ambient_noiseJesse Luehrs2010-08-251-1/+1
|
* add ambient noise levels to branchesJesse Luehrs2010-08-251-0/+4
| | | | | | | | | | | | | | | noise loudness is increased or decreased by a branch-dependent amount to simulate having background noise. hive is very noisy and crypt is very quiet, and a couple other branches are in between... we might want to give values to a couple other ones, but couldn't really think of good ideas for that off the top of my head. i'm not sure how much this actually affects with our current noise system, but i think it's a reasonable concept to build on. this also gives a bonus/malus to stealth, the size of which is certainly up for tweaking (with the current numbers, hive is +40 and crypt is -40).
* Rename chars used as numbers to int8_t/uint8_t. Fix some other type usage.Adam Borowski2010-07-301-2/+2
| | | | | | | | | | This should help against the signed char problems, and is good for code readability. Now, if you have a char, it's either an untyped in-memory byte, or a symbol inside a string. Small numbers are instead [u]int8_t, ints, an enum type, or, in so many cases, bools. I didn't touch any of the tiles code, as it's currently broken and I don't want to risk making it unbroken harder.
* Bring sanity to enums by making them diffable/patchable.Adam Borowski2010-06-081-1/+1
|
* Replace branch::has_shops by branch::shop_chance.Robert Vollmert2010-05-031-1/+1
| | | | | | shop_chance is the chance for a level in that branch to get shops at all. This commit should result in equivalent placement, giving a flat 20% for each branch that had has_shops == true.
* Report parent level in branch entry milestones.Darshan Shaligram2010-02-271-0/+2
| | | | | | | | | | | | | | | | | | | | When generating a milestone for entering a new area, include the level containing the entry stair/portal in the 'oplace' key. This will allow Henzell to report the dungeon level containing the Lair entrance, wizlab, etc. This isn't perfect: oplace will be plain Wrong when the player uses the Trowel card to create portal vaults outside the main dungeon (such as Trowel in Pandemonium). Trowel is generally problematic outside the dungeon (see http://crawl.develz.org/mantis/view.php?id=960). Since Ziggurats can legitimately be generated in Pandemonium, generate ziggurat entry milestones in the onclimb event of the ziggurat portal, instead of waiting until the player has entered the Ziggurat. Unfortunately this means that the entry place for Ziggurats will be reported in the 'place' field instead of 'oplace'. I recommend that this change not be included in 0.6, since we need additional work to fix Trowel and other issues before we have full milestone sanity.
* make the branch depth possibilities a member of the branch structJesse Luehrs2010-02-081-0/+4
|
* Monster respawn rate reduces after 3k turns on level, respawning ends after ↵Darshan Shaligram2010-01-221-0/+1
| | | | | | | | | | | | | | 15k turns on level, monster level fuzz and super OOD rates increase with time spent beyond 3k turns on level. The four hells, Zot, and all non-LEVEL_DUNGEON areas (Pan, Abyss and friends) are not affected by these changes. Monster level fuzz can now be up to +7 levels (was +4); this also applies to monsters placed during level-generation (14% chance per monster as before). Super OODs can now be up to +26 (random2avg(27, 2); was +11). Super OOD gen only begins after over 1k turns spent on level and is still quite rare initially (1 in 500, was 1 in 5000 in 0.5). Monster fuzz chances (chance of +0-7 to monster level) increase after 3k turns from 14% to 100% after 7.8k turns. Super OOD chances increase after 3k turns from 1 in 500 (0.2%) to 100% after 12k turns.
* Remove "called from:" comments.Vsevolod Kozlov2009-11-031-3/+0
| | | | | | These were of questionable use and freshness. Signed-off-by: Robert Vollmert <rvollmert@gmx.net>
* Drop obsolete CVS last-committed headers ($Author$).Adam Borowski2009-10-061-3/+0
|
* Enable vault generation for non-LEVEL_DUNGEON levels, make ziggurat eligible ↵dshaligram2008-11-251-0/+3
| | | | | | for random gen in main dungeon and Pan; still needs entry portal timing/charging fixes, and ziggurat builder is still incomplete. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7601 c06c8d41-db1a-0410-9941-cceddc491573
* Remove unneeded methods (including the old resistance screen), renamej-p-e-g2008-06-121-4/+9
| | | | | | | debugging functions, and some other clean-up. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5757 c06c8d41-db1a-0410-9941-cceddc491573
* The level-builder now enforces the constraint that every contiguous region ↵dshaligram2008-04-101-1/+3
| | | | | | on a level must include at least one stair (ekiM). This guarantee does not apply to areas inside vaults (the builder assumes vault-designers are sane) and does not apply to certain branches (Swamp, Shoals, the branches of Hell), or the non-Dungeon areas (Abyss, Pan, Bazaars). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4169 c06c8d41-db1a-0410-9941-cceddc491573
* Added Flight card to Deck of Emergency.haranp2008-04-041-0/+1
| | | | | | | Artefacts yield 2 piety instead of 1. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4070 c06c8d41-db1a-0410-9941-cceddc491573
* The number of traps randomly generated on a level, and which types ofzelgadis2007-11-131-2/+8
| | | | | | | | | | | traps are randomly selected, can now easily be controlled on a branch by branch basis (and for Pan and the Abyss), similar to how monster level and rarity is controlled (via function pointers in the Branch data structure). The same can be done for fog machines (though this feature isn't being used as of yet). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2846 c06c8d41-db1a-0410-9941-cceddc491573
* Shaft traps (trap doors) [1792195] and level annotation [1769009]zelgadis2007-10-051-0/+1
| | | | | | | | | | added, with the shaft traps changed as per comments on SF; shafts aren't randomly generated yet, so this doesn't change gameplay. Changed DNGN_TRAP_III to DNGN_TRAP_NATURAL, of which trap type the shaft traps are the only current member. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2328 c06c8d41-db1a-0410-9941-cceddc491573