summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/skills.cc
Commit message (Collapse)AuthorAgeFilesLines
* Remove stuffNicholas Feinberg2014-07-291-1/+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!
* Move redraw functions from stuff.cc -> output.ccNicholas Feinberg2014-07-281-0/+1
|
* Convert crosstraining into an enhancer bonusBrendan Hickey2014-06-121-6/+0
| | | | | Remove traditional crosstraining. Replace it with a 20% skillpoint enhancer bonus.
* Remove Anti-trainingBrendan Hickey2014-06-111-3/+0
| | | | | | | | We made the decision a while ago to remove anti-training. This had come up in discussions about changing crosstraining and it seemed that no one actually likes anti-training. Rather than blocking on cross-training, let's just put this in.
* Correct some doxygen blocks.Neil Moore2014-05-291-1/+1
| | | | | Some of them were missing the /** (or /*!) that makes doxygen consider the comment in the first place.
* Remove dead codeBrendan Hickey2014-05-111-11/+0
| | | | Delete train_skill, an unused function.
* Remove the Sage effectChris Campbell2014-05-091-11/+0
| | | | Since the card was removed and it only remained as a Zotdef effect.
* Make skill training restrictions depend on carried instead of equipped itemsChris Campbell2014-04-091-8/+0
| | | | | | For Shields in particular, carrying a shield is sufficient for training purposes. Remove a number of now-unnecessary checks, including some checks that were already obsolete for curses on wielded weapons.
* Fix _check_abil_skills() for new invocation training (#8237).Steve Melenchuk2014-03-061-1/+1
|
* Rename abl-show.{cc,h} to ability.{cc,h}Adam Borowski2013-12-241-1/+1
| | | | The old name was quite puzzling...
* Drop double newlines where they seem to serve no purpose.Adam Borowski2013-12-211-1/+0
| | | | | Sometimes, they're there to emphasize a break between two sections of code, which is good. In a majority of cases, though, they're just inconsistent.
* Restrict mpr() to literals only.Adam Borowski2013-11-291-2/+2
| | | | | The translation project is stalled, but this makes all of such static strings trivially gatherable without any extra work.
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-2/+2
|
* Don't allocate pointless iterators.Adam Borowski2013-11-151-1/+1
| | | | | map or set.count() can test the presence of a given key and return 0 or 1 outright.
* Rewrite (x*y)/z as x*y/zAdam Borowski2013-10-261-2/+2
| | | | Also, simplify an expression such removal of parentheses revealed.
* 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 lots of typosChris Oelmueller2013-07-231-2/+2
|
* Remove the Traps skill.Adam Borowski2013-07-171-1/+0
|
* Increase xp required for higher levels, smooth out mid levelsDracoOmega2013-07-051-7/+7
| | | | | | | | | | | | | | | | As a second facet of the attempt to reduce player power growth into mid and lategame, the xp requirement of experience levels above 15 is steadily increased, with xl 16 requiring 3% more xp than previously while xl 27 requires 25% (xl 13-15 cost slightly less than before). Skill point costs are also increased in tandem, though the reduction in skill growth should be somewhat less than the one in xl. This also smooths out skill gain in the mid-teens, where the old values led to a sudden spike of growth which then sharply trailed off shortly after Lair (or thereabouts). The rate of change in growth should hopefully feel more continuous, instead of a noticable stall as one proceeds into midgame.
* Don't use floating point pow() for squaring an int.Adam Borowski2013-06-261-2/+2
| | | | It's put back into an int variable right after, so range is not an issue.
* Fix compilation with old (4.1) GCC and libstdc++Neil Moore2013-06-261-2/+2
| | | | | | | | | | | We use GCC version <= 4.1 as the criterion for the fix (which is the same as the similar Solaris fix). Probably we could use __GLIBCXX__ and/or __GLIBCPP__ to detect this better, but I haven't been able to test that (in particular, old g++ with a different libstdc++). This reverts commit 0e1e71dfe8e254a2d925fcb0a7ee6905c4175dd1. We still have to do some kind of casting for that particular case, though, because the first argument is unsigned.
* ASSERT_RANGEs other than >= <.Adam Borowski2013-06-081-2/+1
| | | | | | Committing separately as I'm not sure whether checking, for example, ASSERT_RANGE(level, 1, 28) is that nice. Perhaps 27 + 1 could be better? Perhaps some other syntax?
* Always study all manuals in the inventoryPekka Lampila2013-06-061-16/+19
| | | | | | Multiple manuals for different skills can be used at once. If there are multiple manuals for the same skill, the one with least charges is used up first.
* Convert several instances of "and" "not" and "or" to "&&" "!" and "||" (xFleury)Pete Hurst2013-05-191-1/+1
| | | | These are in the standard but break on MSVC.
* Remove "sage" entries for maxed skills.Samuel Bronson2013-05-181-0/+12
|
* Use FixedBitArray instead of large arrays of bools.Adam Borowski2013-04-091-4/+4
| | | | | The only cost is having assignments be a function, as you can't overload operator[] to have separate bits be lvalues.
* The Stabbing skill went to a dark alley, and, you know...Adam Borowski2013-04-011-1/+0
| | | | | | | | | | | | Per one of proposals, its effect is now an average of the weapon skill and Stealth. Stabbing tiers remain as before: * daggers * other short blades * long blades, spears, small club * other stuff Let's see how this works. We can always change the formulas, and at least the skill is gone.
* Don't spam "You cannot train any new skill." over and over.Adam Borowski2013-03-271-1/+4
| | | | | | | | | | | While this message cannot be totally ignored, as it warns about wasting xp, usually it means you could potentially learn a spell you don't want just to place xp in its skill. That firestorming conjurer may have better things to do than lugging a weapon of yet another type, or learning a cold spell. I made this message repeat itself: * when you reload the game * after exiting the 'm' screen
* When a skill reach level 27, also disable training it in the "other" mode.Raphael Langella2013-01-081-0/+3
| | | | | | Other mode being either auto or manual depending on which one is active. Probably the cause of #6507. It's only a display bug by the way, level 27 skills are never trained.
* Don't disable the manual skill on load (#6458).Neil Moore2012-12-221-0/+3
| | | | | | | | Reading a (non-useless) manual enabled training for its skill, even if training would otherwise be blocked (e.g. a manual of Shields without a shield, or a manual of Ice Magic with no relevant spells). However, on save and reload the skill was marked as untrainable. Fix this by always removing the player's manual_skill from stop_train.
* Remove the effect of stats on the cost of raising skills to 1.elliptic2012-09-201-29/+0
| | | | | It was a remnant of the old system in which raising skills to 1 meant something special, and it was insignificant anyway.
* Merge branch 'master' into glasnostAdam Borowski2012-08-311-53/+55
|\ | | | | | | Yay for conflicts galore (wax removal, std:: purge, tileidx changes).
| * Use a +1 to -2 scale for Exp apt instead of 100 to 160.elliptic2012-08-271-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | It is now consistent with the skill apts. Races with a -1 apt require 18% more experience to reach a given XL than races with a +0 apt do. The old apts were converted to the new scale as follows: 100 -> +1 110,120 -> 0 130,140,150 -> -1 160 -> -2
| * Unbreak compilation with GCC 4.1.Neil Moore2012-08-261-2/+2
| | | | | | | | | | | | | | | | | | We were getting an ambiguous overload with between pow(double, double) and pow(double, int) when calling pow() with two ints. It didn't show up before 0.12-a0-208-g770bcbd because the version taking an int was hidden in the std:: namespace. This doesn't seem to be a problem with GCC 4.6.
| * Use std namespace.Raphael Langella2012-08-261-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 touch maxHP and maxMP when simulating gaining skills (#5979).Raphael Langella2012-08-211-1/+3
| | | | | | | | | | On top of getting negative rot, you could also scum for free maxMP by toggling spellcasting on/off.
| * Don't force Troglodytes to train magic skills.Neil Moore2012-08-031-13/+9
| | | | | | | | | | | | | | | | Also, remove a few special cases that considered Spellcasting to be non-magic below level one for Troglodytes; this hasn't been necessary since scrolls stopped training Spellcasting in ee84c39. This reverts commit 1d240c20e937d950ff3de459d85665fcc06969ff.
| * Massive style fix (braces, indentation, etc.)Neil Moore2012-08-011-0/+2
| |
| * Actually fix loading dumps on most architectures.Adam Borowski2012-07-311-8/+8
| | | | | | | | | | | | | | | | | | | | | | The only popular one where this works is amd64, and even that reached 50% use in Linux on desktops/laptops only recently. Linux i386, Windows, arm*, etc, are still 32 bit, so are many less popular platforms. Nearly any use of "long" in portable code is a bug, except for some things where using a full machine word improves efficiency but you can still handle shorter words properly. Elsewhere else, either an int is enough (and you'd waste memory on 64 bit), or int is not enough and it will overflow on 32 bit.
| * Fix crash on loading dumps of sufficiently skilled players.Steve Melenchuk2012-07-301-9/+9
| | | | | | | | | | | | The skill exercise arrays would suffer integer overflow during the re-initialisation routines; this adjusts the relevant code to use longs (shudder) to avoid that issue.
| * Update trainable skill list before untrainable skill list.Steve Melenchuk2012-07-121-3/+3
| | | | | | | | | | The previous opposite order was confusing the skills screen on a cursed or distortion item wield (0005920).
* | Traps&Doors -> Traps.Adam Borowski2012-07-111-1/+1
|/ | | | | The only relevant use left, silently opening doors, is now 100% Stealth (and DEX), rather than 50% Stealth 50% T&D.
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-2/+2
|
* Make a bunch of functions static or gone.Adam Borowski2012-06-231-3/+4
|
* Don't spam the player about untrainable skills.Raphael Langella2012-05-231-2/+3
| | | | | When all your skills are either maxxed or untrainable. Just print the message once when the last trainable skill gets disabled.
* 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.
* Roll only once for identifying weapons by use.Adam Borowski2012-05-051-0/+5
| | | | | | | | | | | | | | | | | | | You could tediously id anything by bashing a plant or throwing it at a wall, with as little as 0.1 skill. This is no more: every weapon has a secret skill level needed to auto-id it. You must know enough about the weapon to possibly id it under the old system -- having wielded it once is enough, so are certain other ways. I intentionally didn't go into the complexity of checking current curse status or blocking distortion/vamp. Save compat: on training a weapon skill and certain other events for the first time, you'll get unsightly ids of a bunch of items. Probably not worth any effort, you are very unlikely to get multiple ids at once during normal play. This commit does not handle missiles: they are mergeable and thus don't have an unique random number, it would be enough to id one with the smallest number and then merge stacks, you are currently encouraged to keep one of every missile with different enchantments, etc.
* Axe a TODO. I refuse to id wizardry on skill training!Adam Borowski2012-05-051-1/+0
|
* Drop pointless braces after if/for/while everywhere.Adam Borowski2012-04-201-2/+0
|
* Remove restrictions on armour training.Raphael Langella2012-04-081-6/+2
|