summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
Commit message (Collapse)AuthorAgeFilesLines
* Apply my latest commits to 0.4.j-p-e-g2008-07-131-1/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6531 c06c8d41-db1a-0410-9941-cceddc491573
* Another clean up, and add some new weapon speech.j-p-e-g2008-07-071-3/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6439 c06c8d41-db1a-0410-9941-cceddc491573
* FR 2006559: fix descriptions of viewed monsters not always fitting intozelgadis2008-07-051-0/+3
| | | | | | | | | | 24 rows, like it was fixed for lookup (?/ command). Also, fixed probem with zombies and other derived monsters not having a description when viewed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6402 c06c8d41-db1a-0410-9941-cceddc491573
* Add res_rotting() method to the actor class so that the "are you the rightzelgadis2008-07-021-1/+6
| | | | | | | | type of undead to resist rotting" logic can be in just one place instead of duplicated every time the check is made. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6354 c06c8d41-db1a-0410-9941-cceddc491573
* Improve pacified monsters' routines for leaving the level again. Remove dolorous2008-07-021-1/+1
| | | | | | | | | | | death by submersion for now, since it's too specific to certain monsters, and leaving the level long enough will make them disappear anyway. Also, have monsters sometimes cycle through previously unreachable areas again, in case things change on the level to make them reachable. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6346 c06c8d41-db1a-0410-9941-cceddc491573
* Make the neutrality enchantment decay properly.dolorous2008-07-021-0/+9
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6336 c06c8d41-db1a-0410-9941-cceddc491573
* If a monster wields a non-branded launcher there is no message, so wej-p-e-g2008-07-021-2/+5
| | | | | | | | | | | *know* it is a plain one -> it is now auto-identified which enables us to autoidentify branded ammo shot from it. Fix Trolls starting out wearing bucklers and remove the stat checks during (normal) random weapon choice. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6333 c06c8d41-db1a-0410-9941-cceddc491573
* Revert the change on ammo handling for Tiles, and replace it with a morej-p-e-g2008-07-021-1/+1
| | | | | | | | | | | | | | | generic logic that uses item tiles for BEAM_MISSILE, else bolts according to flavour. Identify monster fired ammunition ego if the launcher ego is known, not that it has much of an effect because plain ammo gets no special description. In the message list the fired item as it will look to the player (i.e. "arrow of ice" for a plain arrow fired off a bow of frost), even though the item actually dropped will still be a plain one. I hope this isn't too confusing. (And if it is, it should be easy to revert. :p) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6331 c06c8d41-db1a-0410-9941-cceddc491573
* Add still more miscellaneous minor fixes.dolorous2008-07-021-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6321 c06c8d41-db1a-0410-9941-cceddc491573
* Make berserking and non-living monsters stop retreating from Sanctuary aszelgadis2008-07-021-3/+11
| | | | | | | | | | | | soon as they leave it, since they're being forced out rather than actually afraid. Also give a "stops retreating" message for them instead of the "regaining courage" one. Remove faulty logic that was causing monsters to not notice the player as soon as they stopped fleeing Sanctuary. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6320 c06c8d41-db1a-0410-9941-cceddc491573
* Simplify.dolorous2008-06-301-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6233 c06c8d41-db1a-0410-9941-cceddc491573
* Bug 2005002: Allow friendly and neutral-good monsters to cast spells while inzelgadis2008-06-291-6/+30
| | | | | | | | | sanctuary, and allow hostile and neutral monsters to cast spells once outside of sanctuary as long as it won't harm anything inside of sanctuary. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6205 c06c8d41-db1a-0410-9941-cceddc491573
* Faking falls through shaft traps for pacified monsters doesn't quite dolorous2008-06-291-1/+4
| | | | | | | | work, as it doesn't use the proper target. Fix this by not marking pacified monsters for transit if they fall through shaft traps. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6194 c06c8d41-db1a-0410-9941-cceddc491573
* After some pointers from jpeg, rework the routine for monsters' leaving dolorous2008-06-281-6/+1
| | | | | | | | | the level to use the pathfinding routines for patrolling. The monsters still sometimes disappear when near the exit instead of on it, which needs to be fixed, but it's vastly closer to working properly. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6186 c06c8d41-db1a-0410-9941-cceddc491573
* Prevent monsters from zapping wands at a player in sanctuary by puttingzelgadis2008-06-281-0/+6
| | | | | | | | | a sanctuary check in mons_should_fire(). Force monster to stop fleeing before it zaps a wand at the player. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6178 c06c8d41-db1a-0410-9941-cceddc491573
* Misc. minor cleanups. (Yes, a huge amount of them but still...)j-p-e-g2008-06-261-21/+24
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6146 c06c8d41-db1a-0410-9941-cceddc491573
* Don't include inscription in a dancing weapon's name if the desc typezelgadis2008-06-241-2/+10
| | | | | | | is BASENAME, QUALNAME or DBNAME. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6091 c06c8d41-db1a-0410-9941-cceddc491573
* Fix monster emergency spells not checking for ENCH_TP, thus allowingj-p-e-g2008-06-231-7/+15
| | | | | | | | | | monsters to cancel their teleportation without meaning to. (BR 2000428) Fix the quiver not being cleared when wielding the only quiverable (and thus previously quivered) item. (Un)wielding such an item now switches nicely between "Nothing wielded" and "Nothing quivered", as it should be. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6089 c06c8d41-db1a-0410-9941-cceddc491573
* Clean up monster pacifying a bit: don't allow it to work for stationary dolorous2008-06-231-24/+17
| | | | | | | monsters, or for monsters that aren't holy, natural, undead, or demonic. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6085 c06c8d41-db1a-0410-9941-cceddc491573
* Comment fix.dolorous2008-06-221-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6042 c06c8d41-db1a-0410-9941-cceddc491573
* Really fix compilation.dolorous2008-06-211-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6022 c06c8d41-db1a-0410-9941-cceddc491573
* Fix compilation.dolorous2008-06-211-6/+6
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6021 c06c8d41-db1a-0410-9941-cceddc491573
* Add minor cosmetic fixes.dolorous2008-06-211-14/+14
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6020 c06c8d41-db1a-0410-9941-cceddc491573
* Improve level exit handling again.dolorous2008-06-201-1/+0
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6008 c06c8d41-db1a-0410-9941-cceddc491573
* Add miscellaneous minor fixes.dolorous2008-06-201-4/+4
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5994 c06c8d41-db1a-0410-9941-cceddc491573
* Update tutorial information for the 'm' and 'a' screens.j-p-e-g2008-06-191-1/+1
| | | | | | | | | Space allowing, differentiate between hydras with different numbers of heads in the monster list. (This is probably only interesting in the Swamp.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5993 c06c8d41-db1a-0410-9941-cceddc491573
* Revert another erroneous cleanup.dolorous2008-06-191-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5989 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1996837: Allow equipping spellcasters with ammunition on generation.j-p-e-g2008-06-191-17/+22
| | | | | | | Fix 1997179: Merge zombies correctly in the monster list. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5977 c06c8d41-db1a-0410-9941-cceddc491573
* Add various god gift-related cleanups.dolorous2008-06-191-11/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5966 c06c8d41-db1a-0410-9941-cceddc491573
* Fix invisible monsters being described to "burst forth from the water"j-p-e-g2008-06-181-1/+4
| | | | | | | if there's no water nearby. (BR 1994574) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5965 c06c8d41-db1a-0410-9941-cceddc491573
* Simplify again.dolorous2008-06-181-3/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5957 c06c8d41-db1a-0410-9941-cceddc491573
* Add an unfinished attempt at making pacified monsters leave the level. dolorous2008-06-171-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BEH_LEAVE replaces BEH_INVESTIGATE, which wasn't being used. Notes: Since leaving the level is similar to fleeing in some ways, monsters leaving the level share some behaviors with fleeing monsters: they are less likely to shoot; they are more likely to use scrolls of blinking or teleportation; and leaving eyeballs won't paralyze you or drain your MP. Leaving the level is also similar to lurking in some ways, so it won't be interrupted by noticing something, just as with lurking. Getting far enough away from a monster will make it leave the level (i.e., die with KILL_DISMISSED and MF_HARD_RESET, so it takes its stuff with it), as will getting it into a grid it can submerge in, at which time it will submerge and leave the level. Neither of these apply to monsters that can't move, of course, except for mimics, since they can teleport. Incomplete things (sorry for the mess): I still haven't figured out how to make a monster target a dungeon feature (in this case, the nearest level exit, the nearest teleportation or shaft trap, or the nearest submersible grid), so, currently, a pacified monster will just go to where its last target was and stand there until/unless one of the aforementioned level exit scenarios occurs. Pacified monsters can still cast summoning spells. Whatever they summon is neutral, just as they are, but such summons can still get in the way. (Try pacifying an orc high priest, for example.) Maybe summoning should be disabled or have its chance lowered for neutral monsters in general, unless something's in their way? Speaking of targeting, the leaving-by-submerging scenario should occur only if there's no other way to reach the target: all ways off the level are blocked, the monster's habitat is water and it's not amphibious, the monster's habitat is lava, or (possibly) the monster's habitat is rock. There should be a message if the monster leaves the level, but what about the ones that do so out of the player's LOS? git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5924 c06c8d41-db1a-0410-9941-cceddc491573
* Typo fix.dolorous2008-06-171-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5923 c06c8d41-db1a-0410-9941-cceddc491573
* Make yet more use of wrappers.dolorous2008-06-171-4/+14
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5900 c06c8d41-db1a-0410-9941-cceddc491573
* Add yet more cleanups.dolorous2008-06-171-5/+10
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5899 c06c8d41-db1a-0410-9941-cceddc491573
* Add miscellaneous minor fix.dolorous2008-06-161-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5897 c06c8d41-db1a-0410-9941-cceddc491573
* Add still more cleanups.dolorous2008-06-161-3/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5895 c06c8d41-db1a-0410-9941-cceddc491573
* Use wrapper functions more often when checking monster behaviors.dolorous2008-06-161-0/+10
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5891 c06c8d41-db1a-0410-9941-cceddc491573
* Add yet more miscellaneous minor fixes.dolorous2008-06-161-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5888 c06c8d41-db1a-0410-9941-cceddc491573
* Clean up and consolidate most of the monster pacification routines.dolorous2008-06-161-2/+17
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5885 c06c8d41-db1a-0410-9941-cceddc491573
* Simplify further.dolorous2008-06-161-5/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5884 c06c8d41-db1a-0410-9941-cceddc491573
* Add still more spacing fixes.dolorous2008-06-161-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5872 c06c8d41-db1a-0410-9941-cceddc491573
* Add more spacing fixes.dolorous2008-06-151-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5868 c06c8d41-db1a-0410-9941-cceddc491573
* Add more minor cosmetic fixes.dolorous2008-06-151-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5865 c06c8d41-db1a-0410-9941-cceddc491573
* Add spacing fix.dolorous2008-06-151-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5863 c06c8d41-db1a-0410-9941-cceddc491573
* Add still more minor cosmetic fixes.dolorous2008-06-141-2/+0
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5828 c06c8d41-db1a-0410-9941-cceddc491573
* * Add a prompt when attacking monsters with an inappropriate weapon orj-p-e-g2008-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | when attempting to use (controlled) berserk while wielding an inappropriate weapon. (FR 1956656) * Make monsters stop patrolling/travelling if they change levels (or are banished). * Disable the friendly pickup toggle for characters unable to use them. Currently, only worshippers of TSO and Beogh are capable of gaining allies that are permanent (not summoned), permanently friendly (not charmed) and intelligent enough to pick up stuff (no zombies). I don't know if you keep your friends if you leave TSO. If so, the toggle should be enabled while that is the case (i.e. if you're still worshipping a good god) * Re-order the wizmode commands in the help screen. They're now not listed strictly alphabetically anymore, but rather sorted into different categories that should make actually finding commands easier. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5819 c06c8d41-db1a-0410-9941-cceddc491573
* Improve handling of god gifts when dumping gods, so that only god gifts dolorous2008-06-141-2/+5
| | | | | | | granted to you by that god are affected. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5803 c06c8d41-db1a-0410-9941-cceddc491573
* Implement FR 1928421: let Snorg go berserk!j-p-e-g2008-06-131-1/+1
| | | | | | | | | There's a flat 5% chance of Snorg going berserk each turn an enemy (you or an ally) is in sight. Once he is wounded, even if just by a scratch, that chance increases to 20% per turn. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5795 c06c8d41-db1a-0410-9941-cceddc491573
* Implement the Petrify spell in a rather basic variant, and replace the j-p-e-g2008-06-121-9/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | player spell "Paralyse" with it, i.e. not the wand/potion/misc. effects. Petrify is a 4th level spell of the Enchantment/Transmigrations school (a unique combination, I believe), all other values (incl. the level) were shamelessly stolen from Paralysis. Anyway, it consists of two elements (so I actually added TWO new enchantments), Petrifying and Petrified. A monster that is petrifying cannot move around but can perform actions like hitting adjacent monsters or casting spells at a slowed rate (1.5 of the normal cost). Once this sub-enchantment runs out (happens faster) the monster cannot move or act anymore, so it works like Paralysis. The damage you do during stabbing is one third of what you'd do otherwise, for both states of enchantment, and for both stabbing counts as unchivalric behaviour. It has not been implemented as a monster spell, and ghosts of characters that had it will use Paralyse instead. Consequently, the effect on the player (in self targetting) only handles the Petrified part. Numbers, esp. enchantment timeout, will need tweaking. They're currently Petrifying: cturn = 50 / _mod_speed(10, mons->speed); Petrified: cturn = std::max(8, 150 / (1 + modded_speed(mons, 5))) because I wanted the first to always run out faster than the second, but at the same time make the ratio of Petrifying/Petrified tilt in favour of the first for powerful monsters. The numbers are more or less made up, and tested with different monsters in wizard mode. Still, could be anything between too weak and overpowered, though the latter is more likely. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5761 c06c8d41-db1a-0410-9941-cceddc491573