summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/view.cc
Commit message (Collapse)AuthorAgeFilesLines
* Apply some more commits to bring 0.4 up to date.j-p-e-g2008-07-101-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6484 c06c8d41-db1a-0410-9941-cceddc491573
* Fix potions of decay created by mummy curse sometimes being inscribed.j-p-e-g2008-07-071-1/+1
| | | | | | | | | Change inscription prompt to work as intended by David, after all. :) Make manuals use a reading counter (plus2) that is initialized with 3 + random2(15). Once it reaches 0, the manual crumbles to dust. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6443 c06c8d41-db1a-0410-9941-cceddc491573
* Another clean up, and add some new weapon speech.j-p-e-g2008-07-071-3/+6
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6439 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1870427: Max hp misreported if frail and rotted.j-p-e-g2008-07-061-9/+9
| | | | | | | | | | Fix 2002931: feature_item_brand not working No, it's not the important bugs, but at least these are bugs I can reproduce. :P git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6433 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1945389: Detect Creatures not clearing monsters detected on changedj-p-e-g2008-07-061-8/+7
| | | | | | | terrain. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6419 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 2011201: Disallow summoned orcs from joining a worshipper of Beogh.j-p-e-g2008-07-051-0/+1
| | | | | | | | Fix 2011258: Consolidate named orcs correctly in the monster list. Fix 2010542: Patrolling monsters forgetting the player too quickly. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6408 c06c8d41-db1a-0410-9941-cceddc491573
* Add spelling fixes where possible: "gray" -> "grey".dolorous2008-07-041-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6381 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1999363: Vampire eating issues.j-p-e-g2008-07-031-3/+2
| | | | | | | | | Tidy up the new lines item descriptions a bit, so you don't get three free lines in some cases (non-randart, non-special description items) and one or two in other cases. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6370 c06c8d41-db1a-0410-9941-cceddc491573
* Many code cleanups, mostly involving using stack_iterator andharanp2008-07-021-0/+5
| | | | | | | 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
* Misc. minor cleanups. (Yes, a huge amount of them but still...)j-p-e-g2008-06-261-72/+95
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6146 c06c8d41-db1a-0410-9941-cceddc491573
* Apply patch 1952761 by jarpian (wasp): targetting with the monster list.j-p-e-g2008-06-241-1/+2
| | | | | | | | | | | | | | I've updated the patch to the current mlist code, but there are still a couple of bugs that will need to be ironed out. For example, monsters are picked by comparing their attitude and type, which is not sufficient in the case of (non-collapsed) zombies, as well as mimics or ghosts. Also if the number of monsters in the visible list is greater than its rows (because some appear in the same row) then monsters outside of the visible list can be targetted. I guess this is an unintended feature. :) I'm certain there'll be more bugs, though. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6129 c06c8d41-db1a-0410-9941-cceddc491573
* In the level map fudge things somewhat when cycling through features:zelgadis2008-06-241-2/+48
| | | | | | | | | entrances to Zot and the four Hell branches, plus gates to further levels of Pandemonium, can be cycled via '>', while exits from Zot, the Vestibule of Hell, Pandemonium and portal vaults can be cycled via '<'. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6106 c06c8d41-db1a-0410-9941-cceddc491573
* Comment fix.dolorous2008-06-181-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5948 c06c8d41-db1a-0410-9941-cceddc491573
* Take good neutrals into account when checking if a monster's enemies are dolorous2008-06-181-3/+3
| | | | | | | | around, and have a monster leaving the level cast spells like a fleeing monster, for the sake of getting out of the way. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5936 c06c8d41-db1a-0410-9941-cceddc491573
* Clean up handling of monsters' changing attitudes due to religion, and a dolorous2008-06-171-2/+2
| | | | | | | few other related bits. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5907 c06c8d41-db1a-0410-9941-cceddc491573
* Readd erroneously removed parentheses.dolorous2008-06-171-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5902 c06c8d41-db1a-0410-9941-cceddc491573
* Fix compilation.dolorous2008-06-171-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5901 c06c8d41-db1a-0410-9941-cceddc491573
* Make yet more use of wrappers.dolorous2008-06-171-4/+4
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5900 c06c8d41-db1a-0410-9941-cceddc491573
* Comment fix.dolorous2008-06-161-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5898 c06c8d41-db1a-0410-9941-cceddc491573
* Clean up some more.dolorous2008-06-161-2/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5886 c06c8d41-db1a-0410-9941-cceddc491573
* General code cleanups.haranp2008-06-151-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5867 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1948131: Quiver slot name wraps around the screen.j-p-e-g2008-06-151-25/+27
| | | | | | | | Also fixes tile issues where the inventory was partly covered or not shown at all. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5844 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1992604: monster_los asserting for positions out of bounds.j-p-e-g2008-06-131-2/+13
| | | | | | | Mark bees created in bee hives as patrolling. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5789 c06c8d41-db1a-0410-9941-cceddc491573
* Added several new tutorial triggers including information on being caughtj-p-e-g2008-06-131-4/+4
| | | | | | | | | | | | | | | | | | | | | in a net, specific skills, magic resistance, and which stat to choose. In a given game you'll only ever see a small fraction of all tutorial events (we're at 71 now, and some of them are exclusive). In fact, a lot of the information is so generally useful (esp. on gods, skills and items) that I'm seriously considering opening up the general information (How do I use item x? What does Spellcasting do?) to a wider selection of characters. I don't think we'll want to explain the intricacies of Mummies, Ghouls, or Vampires, but a lot of this stuff even applies to them... (If we overhaul the tutorial, it's certainly not a 0.4 target, though.) Resetting the tutorial version to 8 as we somehow switched from digital version to binary and back to digital. It will take some time until we actually reach 110, and by then, I am sure the base files won't be save compatible anymore. :) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5777 c06c8d41-db1a-0410-9941-cceddc491573
* [1991381] Fixed issue where items on the player square were not being ↵ennewalker2008-06-121-0/+2
| | | | | | updated until viewed from a separate square, which caused problems when teleporting. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5765 c06c8d41-db1a-0410-9941-cceddc491573
* Improve performance by only checking whether there are lava or deepj-p-e-g2008-06-121-8/+6
| | | | | | | | | | | | | water grids nearby if the player recently moved (or restarted a game) and if a non-adjacent monster tries to reach the player. Remove now unneeded lua code (was used for the old pickup.lua) and make monsters switch away from ranged weapons when engaging you in melee. If a monster will still insist on hitting you with a sling it's a sure sign said sling is cursed (doesn't autoID, though). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5755 c06c8d41-db1a-0410-9941-cceddc491573
* Bug 1990763: if a monster tries to unsubmerge while under the player,zelgadis2008-06-121-1/+4
| | | | | | | | | | attempt to move it to an adjacent square before doing so. If there are no appropriate adjacent squares then try to make it stay submerged. If it can't stay submerged because the terrain changed then teleport it away. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5738 c06c8d41-db1a-0410-9941-cceddc491573
* Extend monster pathfinding to monsters circumventing pools of deep waterj-p-e-g2008-06-111-1/+1
| | | | | | | | | | | | | | | | | | or lava. I've added some more checks to avoid hampering performance too much, but of course there's still space for improvement. Once per turn check whether the player can see water and/or lava, and only if this is the case run the additional checks (monster habitat, grid_see_grid) when a monster tries to move. Smart monsters that have a ranged attack won't use pathfinding either since they can directly fire at the player. (This is identical to their pre-pathfinding behaviour.) Also fix butterflies really not interrupting resting. (Setting it to 0 doesn't work for some reason.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5737 c06c8d41-db1a-0410-9941-cceddc491573
* Increase efficiency for pathfinding around glass structures by loweringj-p-e-g2008-06-111-3/+3
| | | | | | | | | | | | | | | the chance to "try again" if the last time we were unsuccessful. Also, if a monster tries to find a path to the player (not directly reachable) and fails, mark all surrounding monsters of the same species within a radius of 2 as having been unsuccessful. This includes monsters that are currently out of los of the player or that are targetting a different monster. Once they target the player, there'll either be a direct path which they can use, or there won't, in which case there's a low chance of using path finding; otherwise they'll simply advance the traditional way as close as they can get. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5733 c06c8d41-db1a-0410-9941-cceddc491573
* Update stash tracker when teleporting, to keep track of items picked upj-p-e-g2008-06-091-1/+1
| | | | | | | | | | | | | | or dropped up in the same turn as teleporting. Note: In tiles, the tile for a grid isn't updated before you move aside to see it, so when you teleport, the remembered grid still may show items that you picked up several turns ago and does not show what you might have dropped there, provided you stayed in the same place before teleporting. I don't know how to fix that, so I'm handing it over to Enne. *waves* git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5652 c06c8d41-db1a-0410-9941-cceddc491573
* Don't let the Level map wizard command "teleport to target" place youzelgadis2008-06-091-1/+4
| | | | | | | on an invalid square. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5650 c06c8d41-db1a-0410-9941-cceddc491573
* Add a line on good gods disapproving of certain items to theirj-p-e-g2008-06-061-31/+37
| | | | | | | | | | | | | | | | | | | | | | | | description (evil_item). Same for evil_eating. In another step on the way to monster pathfinding, take the shortest path and extract a vector of waypoints out of it. When experimenting with ways to do this I noticed that grid_see_grid is not symmetrical (A may see B but not vice versa); I'm not sure what effects that could have. It won't directly affect the player as the checks for monster sees player and player sees monster both use the player LoS, but it could have an effect on friendly monsters fighting enemy ones, I guess. Also, I don't think num_feats_between needs the shortest beam available (called with false now). In fact, that seemed to hurt visibility a bit, probably because of attempting to take vision obstructing shortcuts. If this reasoning is wrong, please speak up and/or correct it. (I sure hope not because the shortest beam calculation has some more overhead that can be avoided this way.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5501 c06c8d41-db1a-0410-9941-cceddc491573
* handle_monster_shouts() was using "seen" type shouts for monsters basedzelgadis2008-06-061-1/+1
| | | | | | | only on their visibility, ingoring if they were in LOS or not. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5495 c06c8d41-db1a-0410-9941-cceddc491573
* Fix zombies of wrong habitat on land. It turns out that all thosej-p-e-g2008-06-041-1/+1
| | | | | | | | | | | | | | | careful checks for habitat were ignored (default is HT_LAND) because the base type for undead wasn't chosen until after the position. I now added another habitat check during the base type selection loop and now everything works. :) Add a warning inscription !D that ignores such items during actions like sacrificing items, destroying weapons (Ely), burning books (Trog) or casting sticks to snakes. The failure messages are very clumsy now, but they do get the point across, I hope. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5472 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-19/+44
| | | | | | | | | | | | | | | | 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
* Fix 1981533: Mouseclick allows eating inappropriate food types.j-p-e-g2008-06-021-1/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5434 c06c8d41-db1a-0410-9941-cceddc491573
* Comment fix.dolorous2008-06-011-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5414 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1937489: Remove map markers overwritten by lakes or rivers, as wasj-p-e-g2008-06-011-29/+30
| | | | | | | | | | | | | already done for vaults. Modify monster speech to make the beast only use some selected shouts (i.e. not "You hear an irritating whine") and NEVER do the demon taunts since it cannot speak. Demon lords can use almost the whole array of speaking verbs except for "buzz" and "whine". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5400 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1962147: Move the comments on the food you eat at the end of DELAY_EAT.j-p-e-g2008-05-311-179/+182
| | | | | | | | | | | | | | | | Fix 1971216: Kills by confused undead use LIVING_KILLED_BY_SERVANT instead because the message ("collateral kill") fits better and, though it's basically a hack, the distinction does fit somehow. Fix 1914948: Tweak message when you resist a spell cast by an invisible monster. Fix 1946608: Print "Nothing appears to happen." if reading ?EWI when unarmed. I guess that's it, plus probably some more cleanup. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5378 c06c8d41-db1a-0410-9941-cceddc491573
* When using gcc (the Linux/UNIX compiler) static class members must bezelgadis2008-05-301-0/+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-45/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Correct a mistake in the los check -- it's not quite so fast now, but atj-p-e-g2008-05-291-3/+15
| | | | | | | | | | | least it works correctly. Reduce chances for friendly orcs some more, though by now the main speech stems from cantrip spells of friendly priests and wizards. (At least I couldn't find special messages for them in monspeak.txt.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5332 c06c8d41-db1a-0410-9941-cceddc491573
* Implement a much more efficient version of the LOS testing used forj-p-e-g2008-05-291-0/+359
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Twelve new tutorial events, plus examining a square with a cloud orzelgadis2008-05-291-0/+12
| | | | | | | | | | | | | | | | | | | a monster submerged in shallow water will give extra info during turorial mode. Might be giving too many spoilers, especially the tips on surviving in the Abyss and saying exactly what each god likes and dislikes when covnerting. There's a bug in non-tiles build where the tutorial note on branch entrances shows the '>' symbol as light-grey instead of yellow; don't know what's causing that. Also, made player::backlit() used _get_contamination_level() to stay in sync with the rest of the code. Breaks savefile compatibilty. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5320 c06c8d41-db1a-0410-9941-cceddc491573
* Add more noise-related cleanups.dolorous2008-05-281-3/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5318 c06c8d41-db1a-0410-9941-cceddc491573
* Another use for patrolling:j-p-e-g2008-05-281-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Hostile monsters wandering across a grid they consider "interesting" may note it down as patrolling point to return to. There's currently no way of deleting such a patrol point short of enslaving the monster. As before, patrolling only applies while wandering. Other behaviour modes (chasing the player etc.) take precedence. For now interesting grids are: * altar to one of the good gods for holy beings * altar to Beogh, or entrance to/return from Orcish Mines for orcs * entrance to/return from Elven Halls for elves * entrance to the Hive for killer bees To test these changes, I've modified the stealth checks for wizard mode: If you set the Stealth skill to a value greater than 27 (possible in wizmode) hostile monsters will ignore you, i.e. not set MHITYOU if you are nearby. Noises will still wake monsters, and they'll hit you if they walk into you (or vice versa), but they won't target you. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5313 c06c8d41-db1a-0410-9941-cceddc491573
* Modify mon_enemies_around() logic to allow friends to also cast spellsj-p-e-g2008-05-281-1/+12
| | | | | | | | | | if they have a foe but you don't, i.e. if their foe is out of your LOS. Don't allow patrolling to a target grid that is occupied by a monster in case it's a stationary monster (plant or sleeping). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5311 c06c8d41-db1a-0410-9941-cceddc491573
* Modify num_feats_between to return early if a feature has beenj-p-e-g2008-05-271-11/+19
| | | | | | | | 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-2/+21
| | | | | | | | | | | 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