summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monplace.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix 2011722: Reallow targetting beams such that you may be hit. (There'sj-p-e-g2008-07-061-1/+2
| | | | | | | | | | | | | a new prompt now, but don't prompt a second time if you already confirmed another one before.) Fix some issues when creating items in the Abyss during GDT_GAME_START. This may or may not have played a role in 2008976. Lower spawning rate in the Abyss during GDT_GAME_START (10% spawning chance instead of guaranteed spawning per 5 turns). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6434 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 2010077: Increase respawning rates again.j-p-e-g2008-07-061-5/+13
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6430 c06c8d41-db1a-0410-9941-cceddc491573
* Add a function x_chance_in_y(x,y) to replace the variousj-p-e-g2008-07-061-2/+2
| | | | | | | | random2(y) < x checks, e.g. x_chance_in_y(weight, totalweight). This should make things a bit more readable. Apply it to a number of files. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6428 c06c8d41-db1a-0410-9941-cceddc491573
* [2000669] Fixing logic error that may have caused untargetable resting ↵ennewalker2008-07-051-2/+2
| | | | | | monsters to be created. If place_monster was called with force_pos, it could create monsters on top of other monsters. If that monster was resting (and thus never moved) and the first monster did move, the first monster would set mgrd to NON_MONSTER, making the resting monster untargetable. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6411 c06c8d41-db1a-0410-9941-cceddc491573
* Simplify.dolorous2008-07-051-8/+7
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6410 c06c8d41-db1a-0410-9941-cceddc491573
* Send wizards into the Dungeon wearing a proper wizard hat. David isj-p-e-g2008-07-041-5/+0
| | | | | | | | right in that should not be too powerful for this comparatively weak class, and that it is immensely flavourful. :) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6397 c06c8d41-db1a-0410-9941-cceddc491573
* [1997205] Fixing issue where monsters could be placed in walls. Also, ↵ennewalker2008-07-041-46/+49
| | | | | | consolidated repeated "is this a valid location" logic into a single function. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6395 c06c8d41-db1a-0410-9941-cceddc491573
* Restrict DrMo, unrestrict DrFE and DrIE. Disallow the creation of capsj-p-e-g2008-07-041-1/+1
| | | | | | | | | for Gladiators - species who can't wear helmets just don't get them now. Uncomment debugging option in monster placement. However useful (and necessary) it may be at the moment, it has no place in trunk. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6389 c06c8d41-db1a-0410-9941-cceddc491573
* Tweak change log a bit and add new commands to 034_changes.txt. Arej-p-e-g2008-07-041-1/+6
| | | | | | | | there more new commands I've forgotten? Please don't include wizmode commands as they don't matter during normal game. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6387 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 2008767: "random" not working for book choice optionj-p-e-g2008-07-031-4/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6375 c06c8d41-db1a-0410-9941-cceddc491573
* Added allow_self_target option, with possible values yes, no, prompt.haranp2008-07-021-1/+0
| | | | | | | Added brief documentation (could be improved.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6339 c06c8d41-db1a-0410-9941-cceddc491573
* Make fake raksha summons invisible before checking player_angers_monster()zelgadis2008-07-021-3/+3
| | | | | | | | | so the player won't be told about enraged monsters s/he can't see. Most probably can only occur as the result of wizard commands, but better safe than sorry. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6324 c06c8d41-db1a-0410-9941-cceddc491573
* Simplify.dolorous2008-06-301-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6232 c06c8d41-db1a-0410-9941-cceddc491573
* Only place a newly created monster (summons) on a sanctuary square if itzelgadis2008-06-291-0/+4
| | | | | | | | | | | | | | | is friendly. Only allow friendly and neutral-good monsters to blink or teleport onto a sanctuary square. Don't allow corpses on sanctuary squares to be rotted or animated. Restrict monster cantrip messages to self-buff types if the player is in sanctuary. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6211 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 2005269: trolls being capable of wearing almost all armour types.j-p-e-g2008-06-281-9/+8
| | | | | | | Remove dated mentions of item sacrifices in print_god_likes(). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6188 c06c8d41-db1a-0410-9941-cceddc491573
* For amphibious creatures with HT_WATER, don't force replacing floor compatible j-p-e-g2008-06-271-0/+1
| | | | | | | | terrain with deep water when placing them by map definition or in wizard mode. (Suggested in BR 2000631.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6168 c06c8d41-db1a-0410-9941-cceddc491573
* #undef my debugging statements againj-p-e-g2008-06-261-1/+19
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6157 c06c8d41-db1a-0410-9941-cceddc491573
* Fix another two instances of monster placement returning false j-p-e-g2008-06-261-13/+25
| | | | | | | instead of -1. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6155 c06c8d41-db1a-0410-9941-cceddc491573
* Fix a bug in monster summoning that was causing crashes, for examplej-p-e-g2008-06-261-12/+13
| | | | | | | | | | when attempting to cast Shadow Creatures in a bazaar (which is bound to fail, anyway). I guess it would have also caused crashes anywhere else where the level was devoid of monsters and creating one failed - for whatever reason. I don't actually know how likely that combination is. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6151 c06c8d41-db1a-0410-9941-cceddc491573
* Let a level_id be directly compared to a branch type with == and != tozelgadis2008-06-221-6/+3
| | | | | | | | determine if a level_id is (not) in BRANCH_FOO; takes care of comparing level_type to LEVEL_DUNGEON. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6034 c06c8d41-db1a-0410-9941-cceddc491573
* Don't note monsters of HD <= 2. (Butterflies may be extremely rare, butj-p-e-g2008-06-211-3/+4
| | | | | | | | | | when they appear, it's not interesting enough to be noted.) Tweak wizmode monster placement to never place monsters at the player position. Rather, change one of the neighbouring square's terrain type, if need be. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6032 c06c8d41-db1a-0410-9941-cceddc491573
* Bug 1997989: Only dancing weapon were being created in the Abyss if thezelgadis2008-06-201-1/+4
| | | | | | | player was bansihed from the Hall of Blades. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5995 c06c8d41-db1a-0410-9941-cceddc491573
* Add various god gift-related cleanups.dolorous2008-06-191-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5966 c06c8d41-db1a-0410-9941-cceddc491573
* More progress on making pacified monsters leave the level. They'll now dolorous2008-06-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | find the nearest exit, and disappear once they reach it. There's a new travel target, MTRAV_EXIT. Notes: This is currently very simplistic. The monsters still don't use pathfinding, so if they're blocked, they'll just stand there again. With shaft traps, the monsters shouldn't try to go directly to the target, since they can't disappear at the same time they fall through to another level. With teleport traps, they should only go to them when all paths to exits are blocked, and they shouldn't disappear when they hit them. There may also be issues if a monster hits one and reappears nearby, since it won't be far enough outside the player's LOS to disappear. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5935 c06c8d41-db1a-0410-9941-cceddc491573
* Add more miscellaneous minor fixes.dolorous2008-06-181-3/+6
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5931 c06c8d41-db1a-0410-9941-cceddc491573
* Added "rare_interesting" game option. Like ood_interesting, but for thezelgadis2008-06-171-10/+17
| | | | | | | value retruned by mons_rarity(). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5917 c06c8d41-db1a-0410-9941-cceddc491573
* Fix compilation again.dolorous2008-06-171-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5908 c06c8d41-db1a-0410-9941-cceddc491573
* Clean up handling of monsters' changing attitudes due to religion, and a dolorous2008-06-171-31/+29
| | | | | | | few other related bits. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5907 c06c8d41-db1a-0410-9941-cceddc491573
* Added several new tutorial triggers including information on being caughtj-p-e-g2008-06-131-6/+6
| | | | | | | | | | | | | | | | | | | | | 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
* Add explanatory comments to the pathfinding routines. I might have gonej-p-e-g2008-06-121-13/+56
| | | | | | | | overboard here :) - but I figured that it could be useful to occasionally explain *why* I implemented something a certain way. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5767 c06c8d41-db1a-0410-9941-cceddc491573
* Make sure chaotic beings are actually angered by Zin worshippers (oops).dolorous2008-06-121-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5754 c06c8d41-db1a-0410-9941-cceddc491573
* Clean up handling of killing mutators or rotters (i.e., chaotic beings), dolorous2008-06-121-4/+14
| | | | | | | | and make them become enraged by your lawful aura if you start worshipping Zin. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5750 c06c8d41-db1a-0410-9941-cceddc491573
* Overhaul god gift handling again so that we can tell which god sent dolorous2008-06-121-2/+1
| | | | | | | | | | | which gift. There was an unused god parameter in the monsters struct, which was probably intended to hold which god a monster worshipped. I've used it as an indicator of which god sent the monster, under the assumption that gods would send their own worshippers as gifts. (I hope this isn't an abuse of it.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5748 c06c8d41-db1a-0410-9941-cceddc491573
* Bug 1990763: if a monster tries to unsubmerge while under the player,zelgadis2008-06-121-1/+1
| | | | | | | | | | 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-6/+3
| | | | | | | | | | | | | | | | | | 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
* Remove #define SHUT_LABYRINTH because I don't think it's needed anymore.j-p-e-g2008-06-111-0/+6
| | | | | | | Add more information to the version command. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5729 c06c8d41-db1a-0410-9941-cceddc491573
* Add spacing fix.dolorous2008-06-111-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5724 c06c8d41-db1a-0410-9941-cceddc491573
* Enable monsters to move around glass structures if they can see thej-p-e-g2008-06-101-1/+12
| | | | | | | | | | | | | | | | | | | | | | player through the walls. Don't use pathfinding to target other monsters, only the player! Monsters of different intelligence have different limits on the distance they may travel to circumvent an obstacle, i.e. zombies will only use a range of 2, whereas highly intelligent monsters can expertly find their way through (transparent) labyrinths, though there's a chance they'll forget their target if they don't see it, so for very long and winding paths it's likely they don't ever arrive. Will probably affect performance, though I did test on entire levels turned transparent with Vitrification and things seemed to run more or less smoothly. Ideally, monsters should also be able to move around other obstacles that don't affect visibility (such as water, lava, or statues) but that is currently not possible. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5700 c06c8d41-db1a-0410-9941-cceddc491573
* Add still more summoning-related cleanups.dolorous2008-06-091-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5655 c06c8d41-db1a-0410-9941-cceddc491573
* Use the proper flag type to indicate god gifts (oops).dolorous2008-06-091-0/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5645 c06c8d41-db1a-0410-9941-cceddc491573
* Fix player_will_anger_monster() so that it works properly when the holy, dolorous2008-06-091-8/+11
| | | | | | | unholy, and antimagical parameters are NULL. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5643 c06c8d41-db1a-0410-9941-cceddc491573
* Fix player_will_anger_monster() so that any of the boolean pointers beingzelgadis2008-06-091-0/+2
| | | | | | | non-NULL doesn't force the return value to be true. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5631 c06c8d41-db1a-0410-9941-cceddc491573
* Add one more miscellaneous minor fix.dolorous2008-06-091-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5624 c06c8d41-db1a-0410-9941-cceddc491573
* Clean up handling of angered monsters.dolorous2008-06-081-10/+30
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5579 c06c8d41-db1a-0410-9941-cceddc491573
* Clean up summoning of random demons and random holy beings again.dolorous2008-06-071-3/+24
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5560 c06c8d41-db1a-0410-9941-cceddc491573
* Generalize summoning of holy beings, in case any more of them are added.dolorous2008-06-071-0/+5
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5556 c06c8d41-db1a-0410-9941-cceddc491573
* Clean up yet more.dolorous2008-06-071-65/+67
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5550 c06c8d41-db1a-0410-9941-cceddc491573
* Enable pathfinding for patrolling monsters who lost their patrol point.j-p-e-g2008-06-071-16/+47
| | | | | | | | | | | | | | | | | | | | | Fixed patrol definitions in maps not actually working. Tested both by teleporting the minotaur in a labyrinth. About 50 turns later it arrived back in its lair. :) Since the minotaur proved to have a high magic resistance, it had plenty of time to loot the stash at the labyrinth entrance once I'd woken it before I finally managed to teleport it away (in wizmode you can force monsters not noticing you). This resulted in "A minotaur, wielding the demon trident "Suyn Oma", and wearing a heavily runed ring mail." o_O It had also picked up a scroll and a wand. Ouch... (but cool!) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5536 c06c8d41-db1a-0410-9941-cceddc491573
* Allow creation of non-friendly god gifts. The BEH_GOD_GIFT behavior has dolorous2008-06-061-7/+10
| | | | | | | been removed, and the MF_GOD_GIFT flag is set directly instead. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5503 c06c8d41-db1a-0410-9941-cceddc491573
* Add a line on good gods disapproving of certain items to theirj-p-e-g2008-06-061-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | 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