summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/view.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix 1945389: Detect Creatures not clearing monsters detected on changedj-p-e-g2008-07-061-1/+1
| | | | | | | terrain. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6419 c06c8d41-db1a-0410-9941-cceddc491573
* Many code cleanups, mostly involving using stack_iterator andharanp2008-07-021-0/+1
| | | | | | | radius_iterator instead of the previous setup. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6347 c06c8d41-db1a-0410-9941-cceddc491573
* For (some) consistency, make monster::foe an unsigned short, since that dolorous2008-06-031-1/+1
| | | | | | | | matches player::pet_target, and because tags.cc seems to save monster::foe as a short anyway. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5461 c06c8d41-db1a-0410-9941-cceddc491573
* I'm not sure I actually coded anything worthwhile, though I experimentedj-p-e-g2008-06-021-0/+2
| | | | | | | | | | | | | | | | a fair bit and as usually ended up doing lots of clean-up. Oh wait, I modified eat_from_floor prompts to only force a more if there was actually a message before trying the inventory (whoops), and also modified the corpses in pack hint to take into account that a saccing player won't be interested in butchering rotten corpses. Also implemented a modified FR 1981119: when Detect Creatures only detects plants already seen before, print a different message ("You detect no further creatures."). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5435 c06c8d41-db1a-0410-9941-cceddc491573
* When using gcc (the Linux/UNIX compiler) static class members must bezelgadis2008-05-301-5/+7
| | | | | | | | | initialized outside of the class declaration or they won't by defined in any of the object files, leading to "undefined reference" errors when linking. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5336 c06c8d41-db1a-0410-9941-cceddc491573
* Diversify patrol behaviour for monsters of different intelligence.j-p-e-g2008-05-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | * I_NORMAL, I_HIGH: as before * I_ANIMAL: try to only move within LOS of the patrol point * I_INSECT: as animal, but patrol radius is 5 * I_PLANT : patrol radius is also 5, but there are some other differences: If the patrol point gets out of sight, zombies don't even attempt to get back. Instead they become confused (not literally, though) and reset their patrol point to 0 (if hostile, thus stop patrolling) or to their current position (to continue "waiting" if friendly). Also, while patrolling, if they reach their target there's a 50% chance of not moving this turn, and 50% the next turn, etc. Especially the latter needs testing. If it looks *too* stupid even for zombies I'll take it out again. These changes should also help to make patrolling a bit more efficient because for stupid monsters we have: - one los calculation instead of two (patrol point, monster) - smaller radius - no calculation at all if success is unlikely (distance check) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5335 c06c8d41-db1a-0410-9941-cceddc491573
* Implement a much more efficient version of the LOS testing used forj-p-e-g2008-05-291-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | monster patrolling. As before, ray casting is used to verify LOS but ray casting now only happens if a blocked grid is encountered when searching the surroundings in a growing spiral. If a blocked grid is found, all beams that might possibly go through this grid (heuristically tested, probably tests more than needed) are checked right away and all grids behind the blocked one are marked as well - this blocking can be reversed, if we later find another beam that unblocks it. A beam that was already tried isn't tried a second time. The values are stored in a (2*LOS_RANGE)^2 array and then directly compared when deciding where to send a patrolling monster next. In the worst case we still need to fire beams at each of the edge grids, but that probably can't be avoided entirely, though performance could obviously still be improved. The increase in speed is very much noticeable, i.e. for me Crawl runs smoothly again. :) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5330 c06c8d41-db1a-0410-9941-cceddc491573
* Add more noise-related cleanups.dolorous2008-05-281-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5318 c06c8d41-db1a-0410-9941-cceddc491573
* Modify num_feats_between to return early if a feature has beenj-p-e-g2008-05-271-1/+2
| | | | | | | | encountered and we're only interested in whether the path is clear or not. Also, more whitespace/comment changes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5298 c06c8d41-db1a-0410-9941-cceddc491573
* Make patrolling monster movement more natural: don't always return toj-p-e-g2008-05-261-0/+2
| | | | | | | | | | | the patrol centre, make it more likely to return to the patrol area if the monster left it somehow but is still nearby, and make friendly monsters move around the player on their way to their target. Also, highlight wizard commands in the wizard help. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5252 c06c8d41-db1a-0410-9941-cceddc491573
* Use #define HUD_VALUE_COLOR instead of hardcoding LIGHTGREY so Davidpauldubois2008-04-211-2/+0
| | | | | | | can experiment with using other colors like WHITE git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4436 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1943303: Prevention of barding generation in monsters equipment.j-p-e-g2008-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | And while I was at it... improved monster pickup handling. * Ranged spellcasters won't pick up missiles anymore (except throwing nets). * Allow monsters with behaviour != BEH_WANDER to pick up items again. (Restricted to scrolls, potions, wands and weapons, since these could be useful in a fight.) * Restrict monster pickup to items they may actually use (3 types of scrolls, six types of potions), though they may still pick up all types of wands, if only to annoy the player. As before, pickup only takes place if a monster happens to be on a square with items and only the top items of stashes are checked - monsters won't make a beeline for items or search stashes for goodies. Also, neutrals and friendlies still won't pick up anything at all; this might have to be changed. Unrelated: fixed an ASSERT for divine retribution during penance. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4255 c06c8d41-db1a-0410-9941-cceddc491573
* + Implement most of the suggestions for HUD compression.pauldubois2008-04-021-6/+0
| | | | | | | | | | | | | | | | | | | | Didn't do anything with exp as there didn't seem to be consensus. + Enable the HP/Magic bars in non-tile builds; move them a little bit. I stumbled across these while looking into making HP/MP draw on a single line. I think it's a nice feature; worth at least an option, if they're not on all the time. + Fix bar-drawing bug (the "reduced" part was not drawing properly) + Reduce size of hud by 2, expand mlist by 2. Non-tile only; tile doesn't need the extra space and it uses GOTO_STAT for other things. I don't want to risk making it too small. Not implemented: - Monster list renders from the bottom up (tricky) - Use only 2 lines for warning lights git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4043 c06c8d41-db1a-0410-9941-cceddc491573
* Add still more whitespace fixes.dolorous2008-03-311-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3989 c06c8d41-db1a-0410-9941-cceddc491573
* Finally allow ranged attacks (BEAM_MISSILE) and spells (BEAM_MMISSILE only)j-p-e-g2008-03-291-0/+1
| | | | | | | | | | | | | | | | | to also saturate the blood with floor. Add a basic blood scent effect: all hounds, vampires, and the mosquito get M_BLOOD_SCENT which will let them wake up when blood is spilled in their vicinity. smell_blood() is rather similar to noisy(), so monsters will try to seek the origin of the blood spilled. Player vampires now get a message if blood is spilled outside their LOS, "You smell fresh blood" with a distance estimate ("near-by", "in the distance") added for vampires that are (near) bloodless. Also, the radius a vampire will be capable of smelling blood will increase the thirstier he is. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3936 c06c8d41-db1a-0410-9941-cceddc491573
* [Bug 1907221] Add "Modified for Crawl Reference" statement and author to aj-p-e-g2008-03-081-1/+1
| | | | | | | | huge number of files. Also correct file name comments. No coding changes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3539 c06c8d41-db1a-0410-9941-cceddc491573
* Add gore and splatter to Crawl - in the form of Jarmo's j-p-e-g2008-01-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | (strongly modified, I admit) blood patch. Whenever the player or a monster capable of bleeding suffers damage (currently only in melee) or when you dissect a corpse there's a chance (depending on damage/corpse weight) that the square will turn bloody and be coloured red, with a much lower chance of additionally spattering some of the surrounding squares. These chances are probably still a bit too high for later values of possible damage dealt. Also, ranged and some of the magic attacks (earth-based, mostly) should also be able to send blood flying. :p For now, this is flavour only, but it shouldn't be too difficult to introduce relations to Necromancy or evil gods. Also consider dragons to be warm-blooded, like dinosaurs. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3230 c06c8d41-db1a-0410-9941-cceddc491573
* Tiles!ennewalker2008-01-051-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3194 c06c8d41-db1a-0410-9941-cceddc491573
* More tweaks of Zin:j-p-e-g2008-01-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | 1. Let sanctuaries shrink during the last few turns rather than suddently disappear when it times out. 2. Introduce donations (and remove item sacrifice) I suppose abilities will now have to become more expensive pietywise. I raised the piety cost of the sanctuary from 10 to 15, but that probably won't be enough. For the piety gain I introduced a new duration, DUR_PIETY_POOL that is filled with gold/200 * log(gold) upon donation and then leaks with 5% chance per turn one piety point into the actual piety. All numbers are open for discussion and change. Breaks saves. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3181 c06c8d41-db1a-0410-9941-cceddc491573
* A completely reworked version of Zin as per the lengthyj-p-e-g2007-12-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | discussion in October/November. Zin effects: - protection from harm (like all good gods) - feeding when starving (as before) - mutation resistance (chance of piety/200) Zin restrictions: - no cannibalism (like all good gods) - no attacking friends - no eating of intelligent beings' corpses - no deliberate mutating Zin invocations: - Smiting (general priestly ability?) - Revitalisation (Minor Healing + 5 mp) - Sanctuary (protection from attacks) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3164 c06c8d41-db1a-0410-9941-cceddc491573
* [1857669] Fixed books using the wrong glyph when thrown, removed SYM_foo ↵dshaligram2007-12-281-0/+1
| | | | | | enum and replaced it with dchars. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3130 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed bad detect items behaviour on pre-mapped squares (Iaido).dshaligram2007-12-021-0/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2982 c06c8d41-db1a-0410-9941-cceddc491573
* [1837663] Fixed monsters' raise dead using player's LOS.dshaligram2007-11-281-8/+18
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2920 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed stash-tracker seeing through walls (it was using stale LOS after ↵dshaligram2007-11-151-0/+1
| | | | | | blink/teleport), fixed shadow creatures crash in labyrinths, and fixed use of displayed stair glyph for handling selection of monsters placed on stairs (display glyphs can be changed by the user). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2855 c06c8d41-db1a-0410-9941-cceddc491573
* Beogh conversion fixes for trunk.j-p-e-g2007-10-291-0/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2660 c06c8d41-db1a-0410-9941-cceddc491573
* First steps toward removing the need for 6-deep rock-wall padding around ↵dshaligram2007-10-061-1/+1
| | | | | | dungeon maps. This is likely to be buggy for a while. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2341 c06c8d41-db1a-0410-9941-cceddc491573
* Updated colour names in initfile.cc for the new elemental colours.dshaligram2007-10-031-2/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2304 c06c8d41-db1a-0410-9941-cceddc491573
* Runes and the Orb now have elemental (flickering/shifting) colours.zelgadis2007-10-031-0/+5
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2302 c06c8d41-db1a-0410-9941-cceddc491573
* Berserking monsters are now noisy with a noise level thatj-p-e-g2007-09-291-1/+1
| | | | | | | befits their shout_type. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2253 c06c8d41-db1a-0410-9941-cceddc491573
* Introduces three new wall types, translucent versions of the normalzelgadis2007-09-191-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rock wall, stone wall and permanent rock wall. These are for use in vaults, and are never randomly generated. Magically translucent versions of the normal wall types are used, rather than glass, so we don't have to figure out how glass would react to things like digging and Shatter, but can re-use the code for the normal wall types. I've tried to fix all the places where the old code assumes that any square which is visible to the player has no walls between it and the player, but I've probably missed lots; this will require a lot of play testing before its ready for non-developers. viewwindow() now has two calls to losight(), the second one determining what squares would be visible if all translucent walls were made transparent, so that there's a quick way to see if there's any translucent walls between the player and a square. This second call to losight() doesn't cause any noticeable slowdown for me, but it might on an older system. Other than viewwindow() making a second call to losight(), there shouldn't be any changes to game-play or game-logic if there aren't any translucent walls around. The wizard blinking command (&b) has been changed so that it ignores all normal restrictions except for needing to see the target square and not landing on monsters; if the player lands on a wall square it's changed to floor. Wizard blinking also doesn't increase magical contamination. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2145 c06c8d41-db1a-0410-9941-cceddc491573
* Added new commands "re-do previous command" (bound to `) and "repeatzelgadis2007-09-191-0/+1
| | | | | | | | | | next command" (bound to 0). Though this is just an interface change, it changes code in the core input processing function (input() in acr.cc), and also messes around with the input buffer, so it could probably do with more testing before merging it into the 0.3 branch. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2137 c06c8d41-db1a-0410-9941-cceddc491573
* Split off portions of externs.h and enum.h into other files. Thezelgadis2007-09-151-0/+41
| | | | | | | | | | | | | crawl_environment, player and monsters classes have been left in externs.h, which necessitates that all of the enums references by those classes stay in enums.h, since you can't forward declare an enum. However, it's a start. Also, portions of misc.{cc,h} have been split off into traps.{cc,h}, place.{cc,h} and terrain.{cc,h} git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2095 c06c8d41-db1a-0410-9941-cceddc491573
* Cleaning up magic mapping. Patch by dolorous.j-p-e-g2007-09-131-1/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2078 c06c8d41-db1a-0410-9941-cceddc491573
* Turfed out obsolete orange crystal statue and silver statue features.dshaligram2007-09-071-6/+2
| | | | | | | | | | | | Moved MINMOVE and MINSEE brain damage into the dungeon_feature_type enumeration where it is clearer what they represent. Fixed ice statues not being appropriately affected by Shatter and Lee's. Moved 'v' examine hint information and feature notability into feature_def flags. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2061 c06c8d41-db1a-0410-9941-cceddc491573
* Improved tutorial with extensive information on itemsj-p-e-g2007-08-141-0/+1
| | | | | | | | as well as a few features. A bit of a clean-up and a few additions. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2001 c06c8d41-db1a-0410-9941-cceddc491573
* Added wizmode &L command to place a map on the current level by name. Thisdshaligram2007-07-281-0/+6
| | | | | | | | only really works for non-encompass vaults, and dungeon fixups are not applied (so random deep water -> shallow water conversion, auto-placement of water creatures, etc. will not happen). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1942 c06c8d41-db1a-0410-9941-cceddc491573
* Replaced timed markers with Lua markers. Breaks save compatibility.dshaligram2007-07-261-0/+1
| | | | | | KFEAT: feature names are now as in the dungeon_feature_type enum. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1930 c06c8d41-db1a-0410-9941-cceddc491573
* [1749272] Fixed view update issues:dshaligram2007-07-241-14/+2
| | | | | | | | | | | | - Redraw view when entering a new level before allowing monsters on the level to act. - Monsters are redrawn on the view as and when they move, instead of postponing the view update to the end of turn. - Beam animations and monster redraws force a view update if the view is stale (such as when a beam is shown during travel and travel_delay = -1). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1925 c06c8d41-db1a-0410-9941-cceddc491573
* Updated level-design.txt.dshaligram2007-07-211-0/+1
| | | | | | | | | | | Moved map markers to mapmark.cc. Added support for timer markers that remove a feature after a certain timeout. Need to hook up messaging to Lua. Added bazaars (need more bazaar layouts). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1899 c06c8d41-db1a-0410-9941-cceddc491573
* Cleaned up magic mapping: the test regarding whether you can magic mapharanp2007-07-131-5/+1
| | | | | | | | | | is done inside magic_mapping(), which now returns a bool success value. Functionally: this means that the randart magic mapping power can no longer map the Abyss or labyrinths, ditto Map card. We can change this part back if we want. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1851 c06c8d41-db1a-0410-9941-cceddc491573
* Lots and lots of type safety.haranp2007-07-081-1/+1
| | | | | | | | Caught a bug in the definition of shadows (isn't it lucky that BLACK == MST_NO_SPELLS?) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1788 c06c8d41-db1a-0410-9941-cceddc491573
* Basic SIGWINCH handling for Unix. Still needs to handle some cases (resizingdshaligram2007-06-171-0/+2
| | | | | | the term in the level-map doesn't work right, for instance). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1593 c06c8d41-db1a-0410-9941-cceddc491573
* [1738010] Stash-tracker now also tracks traps and other dungeon features.dshaligram2007-06-171-1/+3
| | | | | | | | Changed env.grid to dungeon_feature_type. (The special-level builder still stores map characters directly into env.grid and then translates them to features.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1592 c06c8d41-db1a-0410-9941-cceddc491573
* x on the level-map changes travel exclusion radius. Radius steps are 1, 4 anddshaligram2007-06-171-0/+1
| | | | | | | | | | 8. Travel cache version also changes. [1738213] describe_floor() now uses feature_description instead of rolling its own. This does produce redundant messages when stepping into shallow water, but I think we can live with that. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1591 c06c8d41-db1a-0410-9941-cceddc491573
* When showing glyphs in messages (as in the tutorial), use stringize_glyph() todshaligram2007-06-081-1/+4
| | | | | | | | | convert Unicode glyphs to multibyte sequences. Added multibyte_strlen to calculate string lengths correctly when dealing with multibyte strings. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1560 c06c8d41-db1a-0410-9941-cceddc491573
* Added support for Unicode characters in the map display with ncursesw (enableddshaligram2007-06-071-6/+7
| | | | | | | | | | | | by setting UNICODE_GLYPHS=y in makefile.unix). Removed the (1,1) offset between map and grid. Both map and grid are now in sync. Store object indexes instead of raw characters in env.map so that players can change charsets and have the display update immediately. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1552 c06c8d41-db1a-0410-9941-cceddc491573
* [1699948] Allow changing the viewport size if you're using a larger terminaldshaligram2007-06-041-2/+0
| | | | | | | | | than 80x24. Also allow moving the PC around the viewport without scrolling the viewport if the viewport is large enough. This is not tested on DOS and Windows yet. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1524 c06c8d41-db1a-0410-9941-cceddc491573
* Highlight monsters in the path of a beam (with :).dshaligram2007-06-021-0/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1512 c06c8d41-db1a-0410-9941-cceddc491573
* This is an experimental attempt at selecting more intuitive beams fordshaligram2007-06-021-1/+2
| | | | | | | | | | | | | | | targeting (see 1725723): - The default beam selected for targeting is the shortest available beam that is closest to the Bresenham line between src->targ. - Targeting beams convert aliased perpendiculars into diagonals, which look better. This requires an immortal fudge to make sure the diagonal conversion doesn't happen at the wrong places (when the conversion would cause the beam to miss the target square). - Tweaked beam bounce behaviour to look more natural. Comments and suggestions welcome. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1511 c06c8d41-db1a-0410-9941-cceddc491573
* Branch entry vaults now respect DEPTH: declarations so you can put tough ↵dshaligram2007-04-251-1/+1
| | | | | | | | branch entries deeper. Detect creatures no longer clears the level map of detected items. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1366 c06c8d41-db1a-0410-9941-cceddc491573