summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player-stats.cc
Commit message (Collapse)AuthorAgeFilesLines
* 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!
* Redraw player EV after a Str change (#8658)reaverb2014-06-081-0/+1
|
* Replace Hammer card with Fortitude.Shayne Halvorson2014-05-281-0/+3
| | | | | It grants damage shaving along with a strength boost, as Battlelust is likely not to make it into Nemelex's decks.
* Remove player burden and carrying capacitygammafunk2014-05-261-3/+0
| | | | | | | | | | | Item inventory weights (based on item mass) generally don't lead to meaningful decisions that justify the inventory juggling and interface problems that come from having burden states. The 52-slot limit is a better system for limiting inventory and providing inventory-related decisions because it's not so fine-grained and doesn't require the player to examine weights for each slot. Work is ongoing to improve the slot system by consolidating food types and handling strategic consumables in a different way.
* Don't have Jiyva tend to reduce strength based on burdengammafunk2014-05-261-13/+24
| | | | | | | Previously Jiyva stat shuffling would tend to shuffle points away from or to strength based on whether the player was under or over burden capacity. We are removing player burden, so this weighting is unnecessary.
* Remove various references to use-IDing jewellery that now identifies on equipChris Campbell2014-05-121-10/+0
| | | | There's probably a bunch more obsolete code for this still lying around.
* Remove -str from thin skeletal structure.Shmuale Mark2014-03-281-2/+0
| | | | | | Its usefulness is already very character dependent, and the only other scales with a malus (rough black) provides a very significant bonus. Also replace "Stlth" with "Stealth".
* Eliminate EVP 15 breakpoint for getting Dex from Jiyva.Neil Moore2014-03-021-2/+13
| | | | | | | | | | | | | | | | | | | | | | When we compute the player's target stats, we first meet carrying capacity and EVP requirements for strength, then decide how much to target intelligence based on spellcasting skills. Whatever weight is left over was being assigned to either str or dex, based on the player's armour EVP. If the player was wearing chain or heavier, Jiyva would happily drop their dex to 9. Now the stats remaining after assigning Int are divided proportionally between Str and Dex based on the armour's EVP and the player's Dodging skill. The formula is (evp - dodging)/15 (bounded between 0 and 1), so: * At 0 dodging skill, chain mail or heavier will give pure strength. Even leather will weight towards strength somewhat in the absence of dodging. * If Dodging is at least as high as the EVP, the extra weight is assigned entirely to dexterity. This means it is possible to weight towards pure dexterity even in GDA, once the "minimum" strength of 25 is reached.
* Add an indicator and identify sustain abilities on partial protection.Sage2013-12-291-2/+3
|
* Replace `mpr(s, ch)` with `mprf(ch, s)`Adam Borowski2013-11-291-3/+2
| | | | | | | | | 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.
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-2/+2
|
* Remove moths of suppressionChris Campbell2013-11-111-27/+18
| | | | | | | | | | | Suppression is a hugely complicated and inconsistent mechanic. Its original purpose was to be a way of overriding rPois in Spider but there are now plenty of monsters that do this effectively (and much more simply). [1KB: I moved this to trunk, as it made an already extremely hard to review branch massively more so. There's nothing but a single enum to preserve, so compat break doesn't make this removal any easier or harder.]
* Let choose_stat_gain work by returning a string.elliptic2013-11-031-5/+17
| | | | | | | It used to be that to use this lua hook to automatically choose a stat at level-up, the function choose_stat_gain had to call crawl.sendkeys('s') or some such. This still works, but now the function can return a string instead and the first character will be used.
* Don't let Jiyva permanently drain stats if one reaches 72.Adam Borowski2013-10-251-1/+2
|
* Don't penalize Spellcasting for Jiyva weighting.Adam Borowski2013-10-251-4/+0
| | | | Victory dancing scrolls is gone ages away.
* Reformat multi-line array literals.Adam Borowski2013-10-051-1/+2
|
* Rename `che_stat_boost` to `chei_stat_boost`Chris Oelmueller2013-09-171-3/+3
|
* Simplify.Neil Moore2013-09-021-3/+3
| | | | | | | | | Now that you.stat_zero[] is unsigned, test for nonzero rather than greater than zero in a number of places. Also replace a += (conditioned on the initial value being zero) with plain assignment. This helps to clarify that we don't have to worry about overflowing the cap there.
* Cap stat_zero time, don't save it as a negative number.Neil Moore2013-09-021-1/+8
| | | | | | | | | | | Recovery is now limited to at most 200 turns. Previously it was unlimited, but after a save and restore it would either take 127 or fewer turns, or take forever as the time was restored as a negative number. Besides the cap on recovery time, we marshall as an unsigned byte, not signed. The cap could be increased, but anything larger than 255 will require a minor tag and a change to the marshalling format.
* Formatting fixesBrendan Hickey2013-08-251-3/+3
|
* Make stat mutations less boring.Brendan Hickey2013-08-251-6/+6
| | | | | | | | | Replace 14 levels of stat mutations with 2. Each tier conveys +/-2. If a player happened to have +14 strength, for example, convert the excess strength to base strength. Be conservative in converting bad stat mutations to avoid splatting players.
* Set boring stat mutation probabilities to zero.Brendan Hickey2013-08-251-1/+4
| | | | | MUT_STRONG_STIFF and MUT_FLEXIBLE_WEAK probabilities are hereby set to zero in preparation for removal.
* Remove bonus strength from LichformChris Campbell2013-07-161-1/+0
| | | | | | Having carrying capacity change frequently when switching in and out of such a form is more annoying than helpful. Also remove the (tiny) stealth bonus.
* Don't deal stat loss damage when first hitting zeroChris Campbell2013-06-181-1/+1
| | | | | Intended it to only occur on subsequent draining and accidentally changed that when fixing it.
* Only deal stat loss damage on actual stat lossChris Campbell2013-06-171-16/+13
| | | | Including stat loss while still recovering from draining, now.
* Remove stat death, have stat loss below 0 cause damage insteadChris Campbell2013-06-171-50/+16
| | | | | | | | | | | Death after spending a while with a stat at 0 no longer occurs, but the negative effects (slowing, significant stat-dependent restrictions) and the recovery period after restoring from 0 still exist, and additional stat loss when below 0 causes some irresistible damage. Actual stat death was rare, slightly spoilery in implementation (in particular the death timer being precisely 90 actions) and the stat zero restrictions remain a pretty good reason to not want to have your stats at zero for any length of time.
* 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;
* 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.
* Fix various breakages caused by body armour EVP rescaling.elliptic2013-04-251-3/+3
| | | | | Bardings gave -7 EV instead of -2, Ozo's armour didn't work on leather, Jiyva stat action went crazy, etc.
* Refactor amulet and equipment-checking functions.Neil Moore2012-12-161-6/+6
| | | | | | | | | | | | | | | | | | Move most of the player_* functions related to amulets, and all of the player_effect_* functions, into class actor, with some overridden in class player. Likewise, move player_equip(), player_equip_ego_type(), and scan_artefacts() into class player, with pure virtuals in class actor and corresponding implementations in class monster. Also remove a few now-redundant functions. This commit doesn't actually make any kinds of equipment have an effect on monsters that didn't already, but it should be much easier to do so now, since the relevant methods are there now. Monster gourmand, conservation, faith don't necessarily make sense, but those methods are in actor anyway for consistency with the rest. Fixes #6172. We now check for innate gourmand (etc.) without reference to suppression.
* Fix Jiyva stat action to use the new carrying capacity formula.elliptic2012-12-131-1/+1
|
* Tweak scales mutation numbers.elliptic2012-11-251-1/+2
| | | | Mainly small buffs of +1 AC to the weaker scales.
* Split MOUSE_MODE_MORE into versions for prompts, to give the Webtiles client ↵Florian Diebold2012-11-231-1/+1
| | | | more information.
* Fix possible save corruption when disconnecting on the stat gain prompt.Adam Borowski2012-11-211-8/+8
| | | | | While actual corruption is quite unlikely, at the very least the turn will be ended at an arbitrary moment, before all actors get to move.
* Make a note when a stat drops to <= 0.Adam Borowski2012-10-261-0/+3
|
* Remove unnecessary includes from header files.Jay3.14152012-10-231-0/+1
| | | | | | | | | | For most header files, this only saves on having to recompile a small number of source files, but there are also a few headers where small changes would now take significantly less time. This is most obvious for the Tiles build for which the dependencies have been greatly reduced, so that the only additional includes when compared to console are strictly library or tile related.
* Fix stats being capped below at zero in situations where they shouldn't be.elliptic2012-09-201-6/+6
| | | | | | | Specifically, for checking whether a stat is drained and for output. You can now get the uncapped stats with you.strength(false), you.intel(false), and you.dex(false).
* Fix choose_stat_gain call asking for the wrong number of returns.elliptic2012-09-181-1/+1
|
* Android port.frogbotherer2012-09-081-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2 files are added to the root of the repository: * AndroidAppSettings.cfg: settings file required for Android SDL port. Will change on each minor release to reset configuration. * AndroidBuild.sh: script called by the Android SDL port to commence building the game itself It might be nice to be able to move them elsewhere, but for now, their presence here is required. The build process is documented in docs/develop/android.txt There's a TOUCH_UI compiler flag which sets all the things specific to a touch screen interface. There has been a large amount of changes in the Makefile for redefining where the dat/, saves/, etc. directories go, because the "install" part of the make isn't the final destination for these files under Android - the environment we deploy to is a separate device from the build environment. There is also a number of changes to the tiles interface. Some are specific to the TOUCH_UI, but others are also changed in USE_TILE_LOCAL. Touch only: * 'a'bilities menu goes straight to menu without prompting first * tap menu header to toggle/submit * menu instead of prompt to select which corpse to butcher * same for eating food from the floor (those 2 could go in local tiles too) * show_more defaults to false and less --more-- messages * pickup mode defaults to menu * defaults for tile_layout_priority is different (commands are more important than inventory) * popup for yes/no prompts, level-up stat gain and swapping rings (should be used for all prompts, and probably local tiles too) * spell casting: force selection menu * map mode: left-click rather than right-click for mouse mode; autotravel on left-click removed * remove skills training and memorisation panels Also local tiles (some could also be integrated in webtiles): * commands below description are clickable * clickable shopping menu (uses PrecisionMenu) * split the command panel in 2 (common actions and system commands) * add a map command panel * tapping or left-clicking the player is smarter: * picks up the item if there's one on the tile, otherwise * shows pick-up menu if there's several items on the tile, otherwise * traverses stairs (or enters a portal or shop) if one is present, otherwise * prays if an altar is present, otherwise * waits one turn * right-clicking the map enters map mode and brings the map commands tab to the front; map mode stays until exited rather than upon release of mouse Some more details can be found in android_patch_notes.txt on #5677 (although some TODOs are already obsolete). Signed-off-by: Raphael Langella <raphael.langella@gmail.com>
* Don't Jiyva-shuffle stats to zero (#6130).Neil Moore2012-08-291-1/+2
|
* Use std namespace.Raphael Langella2012-08-261-16/+15
| | | | | | | | | | | | | 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.
* Massive style fix (braces, indentation, etc.)Neil Moore2012-08-011-1/+1
|
* Remove parentheses around return (simple_function_call).Adam Borowski2012-07-051-7/+7
| | | | For way too paranoid and underinclusive values of "simple".
* String scalars are scalars, too.Adam Borowski2012-07-051-3/+3
|
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-10/+10
|
* Make a bunch of functions static or gone.Adam Borowski2012-06-231-36/+0
|
* Make staves and rods separate object classes.Adam Borowski2012-06-121-0/+2
| | | | | | | | | | | | They have about no overlap, more than both being usable as weapons. A vast majority of uses immediately checked item_is_rod()/item_is_staff(). I kept them shared for acquirement, for now. Also, eliminate rods of smiting -- hardly ever used, problematic theme-wise as they use "divine providence" without worship. Keeping rods of striking for now, could be used to fix artificer problems. Adding/removing rod enums is a mess due to tile handling, renaming ROD_SMITING to ROD_LIGHTNING for now.
* Remove a good deal of header inclusion.Adam Borowski2012-05-231-1/+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.
* Give full protection from stat loss under vitalisation, instead of one level ↵Chris Campbell2012-04-301-15/+22
| | | | of sustab
* Suppression aura effects, part 1Ben Striegel2012-04-041-18/+27
| | | | | | | | | | | This first round of suppression effects focuses solely on denying the player any advantages (and disadvantages!) from equipped magical items. Specifically, I searched for the following three strings in the source: "wearing", "player_equip", and "scan_artefact" and added a "you.suppressed()" clause to ensure that effects only apply outside of fields of magical suppression. There's a lot more to do, but this is a good start. Specifically, this addresses the most important aspect of the suppression aura, which is to deny the player any resists from items.