summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_you.cc
Commit message (Collapse)AuthorAgeFilesLines
* Add player lua to get the base skill value (unmodified by draining etc).elliptic2014-08-161-0/+8
|
* allow iterating over branches in a non-enum order (8742)Jesse Luehrs2014-08-021-6/+6
| | | | | | | | | | | | 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-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 letter <-> index from stuff.cc to prompt.cc (wheals)Nicholas Feinberg2014-07-281-0/+1
|
* Move held_status() from stuff.cc to traps.ccNicholas Feinberg2014-07-271-0/+1
| | | | | Also add some comments to stuff.h, categorizing functions for later removal.
* Refactor weapon_skill()Nicholas Feinberg2014-07-131-1/+1
| | | | | | | | | | | | | | This function was misleadingly named (it only provided the skill used for melee weapons, not ranged weapons), and incomplete; code along the lines of "is_ranged_weapon(*it) ? range_skill(*it) : weapon_skill(*it)" was scattered in about half a dozen different functions. I've corrected both of those problems (renaming weapon_ skill() to melee_skill() and adding item_weapon_skill()), and also possibly fixed two bugs in the process - an l_you.cc function that claimed to provide the skill used for the starting weapon (but actually only gave the melee skill), and unrand creation code that checked if a potential unrand swap used the same (melee) skill as the weapon type being generated.
* Avoid an infinite loop in wizmode/Lua piety gain (reaverb)Neil Moore2014-06-111-3/+1
| | | | If you are with Gozag (also No God or Xom with the Lua function).
* Remove jewelry and armour sources of conservationgammafunk2014-05-281-2/+0
| | | | | | The amulet of conservation and cloaks of preservation are no longer necessary without item destruction. Maxwell's patent armour now has the resistance ego and grants rF+ and rC+.
* Remove player burden and carrying capacitygammafunk2014-05-261-4/+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.
* Cap sustain abilities at 1 levelChris Campbell2014-05-151-1/+1
| | | | | Two levels of sustain abilities is very rarely relevant, and isn't something that makes for an interesting multi-level resist.
* Changed you.depth_fraction to return in full range [0, 1]infiniplex2014-05-121-1/+2
|
* Give players the exact poison survival prediction value, through @ or lua.elliptic2014-03-291-2/+2
| | | | | | | | | | | | | This addresses issues with different sizes of HP bars giving this value to different amounts of accuracy (mainly a console vs webtiles thing, I believe). The extra accuracy is barely useful at all (especially as it is sometimes off by 1 anyway), but giving it to the player doesn't seem like a problem - we just don't want to waste space in the main display. Displays as "You are seriously poisoned (50 -> 19)." in the @ status display. Also replaced you.poisoning() with you.poison_survival() in the player lua, since that is the value we are displaying everywhere else.
* Make all abyss teleports shift the Abyss (minmay).Shmuale Mark2014-03-081-1/+1
| | | | | | | | | | | | | | | | Partly this is to (somewhat) make the Abyss a little easier. Teleports still take longer than orbrun teleports to kick in on average, and in general letting the player know what an action will do is a good thing. But the main reason is that, due to maprot, same-area abyss teleports are a pretty awful interface screw. You are prevented from remembering what monsters were around (this was quite annoying when being marked was more common in the abyss), and though you can see for one second what direction you came from, immediately after the screen refreshes and you can't anymore. Possibly this could lead to improving/removing altogether maprot.
* Change how runrest_ignore_poison works for new poisonDracoOmega2014-03-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | Since the full amount of poison can be known in advance, instead of interrupting based on damage-per-tick and current absolute hp, use the ratio of poisoning to current and max hp. The option is now specified as cur_hp_ratio:max_hp_ratio in percent (ignoring unless the poison is more than cur_hp_ratio of your current hp and max_hp_ratio of your maximum hp). I changed the default setting to 50:100, which is fairly arbitrary, and still likely interrupts on many situations that you'd rather rest off the poison without interruption (after all, even 90% poisoning is pretty safe if in a known-safe location). Plus, low hp warnings will still constantly interrupt if you fall below the threshold for them, which is also really bad. Basically, this still needs a lot of work before the idealized non-obtrusive resting that is one of the main points of deterministic poison actually functions, but this is at least an improvement over the current settings, I think.
* Add player lua to tell whether the player is rooted to the ground.elliptic2014-03-061-0/+2
|
* Add you.anchored() lua for dimension anchor status.elliptic2014-02-231-0/+2
|
* 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.
* Allow setting you.gold(x) in dlua.Adam Borowski2013-11-291-1/+1
| | | | Even if the game is not in wizmode, like vaults could want to.
* Don't overload lua you.gold().Adam Borowski2013-11-291-17/+15
| | | | | | | It's safer to have the same function be available in clua and dlua, and allow setting the amount only in wizmode. This way, we have only C++-like overloading (number of arguments) but no two distinct versions depending on which interpreter you're in.
* Rename a function for clarity.Neil Moore2013-11-291-2/+2
|
* Allow you.gold to be read in cluagammafunk2013-11-291-0/+2
|
* Swiftness changes.elliptic2013-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | | A L2 buff that could easily be kept up permanently and gave a very powerful effect for the entire game was problematic for a few reasons. The stealth and trapfinding penalties were supposed to help with this, but they didn't really succeed, so let's try something else. Now Swiftness has two stages, of equal duration. In the first stage it decreases movement delay by 25% and in the second stage it increases movement delay by 50%. This has the effect that the spell is speed-neutral over the two stages combined if you are moving the entire time, so you cannot simply use the spell to kite monsters forever. It still provides a powerful short-term boost to movement speed and the balance between the two stages can be broken in a few ways, including simply taking more non-movement actions during the second stage. Of course, the spell cannot be recast while either stage is in effect. The penalties to stealth and trapfinding have been removed and the spell is now castable by Formicids.
* Give Trog's Hand its own duration.pubby2013-11-101-1/+2
| | | | | | | | | | | | Trog's hand was using DUR_REGENERAITON, and setting ATTR_DIVINE_REGENERATION to true to specify it was the god ability and not the spell. This was silly, so this commit gives trog's hand its own duration: DUR_TROGS_HAND. This also fixes a very minor bug: previously if you had trog's hand active and you tried to cast regen, you got penance but the spell was immediately canceled. Other duration spells were not canceled.
* Don't leak information about underwater items to lua.elliptic2013-11-061-1/+1
|
* Let mutation_name() return the short name.Adam Borowski2013-09-091-6/+4
| | | | | | It's internally named "wizname" but is accessible to the player, for example via the lua interface. We also have a "short desc" that often differs, but that's used only on the % screen.
* New Lua methods you.ability_table(), you.spell_table().Neil Moore2013-08-191-0/+41
| | | | | | | These return a table with letters as keys and spell/ability names as values. Previously, finding the spell on a given letter required cross-referencing the results of you.spells() and you.spell_letters(). Now it is as simple as you.spell_table()["a"]
* Added LUA you.depth_fraction functioninfiniplex2013-06-141-0/+3
|
* Reverse the argument of get_monster_by_name().Adam Borowski2013-06-091-2/+1
| | | | | | The default, substring match, was totally unintuitive and broken. Only one place is actually changed, something about shapeshifters.
* Force exact matching for unique name in Lua you.uniques (#7179).Steve Melenchuk2013-06-081-1/+5
| | | | | | | If a unique name is the same as a branch name or abbreviation, the underlying code apparently interprets the branch name first; this has obviously never been a problem before now, but was causing Pan-the-unique to appear in duplicate for a forest end vault.
* Merge branch 'master' into djinnAdam Borowski2013-05-291-2/+0
|\
| * Cure all nausea, permanently.Adam Borowski2013-04-301-2/+0
| | | | | | | | Contaminated chunks provide less nutrition instead.
* | Djinn: stealing their magic makes them true monsters.Adam Borowski2013-04-281-0/+2
|/ | | | | | MP draining tends to be way powerful when applied to HP, thus we instead use monster-like antimagic. This applies to antimagic weapons as well, although those would work well even without this.
* Fix teleporter vault trapping players.Adam Borowski2013-03-271-4/+1
| | | | | | | | | | | | | | | | | | Or, robbing them of XP and items unless they're spoiled (Nemelex's Gamble). In other cases, it's a matter of disrobing just to go through, which is a mere inconvenience except for zigsprint, where it was special-cased (yay consistency). It was also inconsistent with all other fixed means of teleportation, such as Passage of Golubria, portal vaults, hell portals, abyss portals, etc, which all are not swayed by mere -TELE. In the first discussion that happened, the only reasoning for the change was similarity of names between "teleporter" and "-TELE", rather than gameplay reasons. So let's deal with that instead. This reverts commit 7f0416492553db52d7613d506b8ab584b7819904.
* Add you.phase_shifted() to Lua API (kek).Neil Moore2013-03-111-0/+2
|
* Fix teleporters ignoring stasis, add failure messages for some vaultsChris Campbell2012-12-241-1/+4
| | | | | Except for Zigsprint teleporters, Maxwell's users should be encouraged at all costs.
* Refactor amulet and equipment-checking functions.Neil Moore2012-12-161-5/+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.
* Revert most of the lev->flight patch (by code size, not functionality).Adam Borowski2012-11-131-1/+1
| | | | | | | | | | | This stops wands of paralysis, the Petrify spell, and nets from auto-killing anything that can fly (ie, a good part of later threats). Also, this fixes unwinged humanoids from getting wings in tiles and for other shape considerations. Unrelated fixes: message when flying up stairs, monsters picking items from deep water.
* Replace levitation with flight and remove controlled flight (elliott)Chris Campbell2012-11-071-3/+1
|
* Remove unnecessary includes from header files.Jay3.14152012-10-231-1/+2
| | | | | | | | | | 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.
* Player Lua: you.conservation(), you.res_corr().elliptic2012-09-291-0/+4
|
* Player Lua: you.breath_timeout, extra_resistant, mighty, agile, brilliant.elliptic2012-09-261-0/+10
|
* Player Lua: you.regenerating().elliptic2012-09-261-0/+2
| | | | Doesn't distinguish between regeneration spell and Trog's Hand.
* Move a couple of functions from dlua to clua.elliptic2012-09-251-26/+27
| | | | Specifically, you.have_orb(), you.have_rune(), and you.num_runes().
* Player Lua: you.silencing().elliptic2012-09-251-0/+2
| | | | | Previously you could just tell whether your square was silenced, not whether it was you doing the silencing.
* Add player Lua: you.on_fire() and you.petrifying().elliptic2012-09-241-0/+4
|
* Allow teleporters to work outside the abyss.Neil Moore2012-09-221-1/+2
|
* A test for abyssal shifts.Adam Borowski2012-09-221-0/+2
|
* Fix stats being capped below at zero in situations where they shouldn't be.elliptic2012-09-201-3/+3
| | | | | | | 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).
* Use std namespace.Raphael Langella2012-08-261-13/+13
| | | | | | | | | | | | | 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.