summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.h
Commit message (Collapse)AuthorAgeFilesLines
* Provide and use a public interface to pronoun declensions.Neil Moore2014-07-201-0/+2
| | | | It's in mon-util.h for now but probably should go somewhere else.
* The great mon-stuff migration.Shmuale Mark2014-06-221-2/+17
| | | | | | | | | A good deal of functions move to the two new files, mon-poly and mon-message. Of the others, some go to where they are used, some to mon-util, and a few are made member methods of monster. This probably breaks Xcode compilation, and I'm not able to test the changes I made to MSVC that will (hopefully) keep it working.
* Remove residual references re: statue special-cased spells.Shmuale Mark2014-05-111-1/+1
|
* Let draconians grow up.Shmuale Mark2014-05-051-0/+1
| | | | | | | | They will now be able to mature into whatever drac type they can (i.e. white scorchers will still be disallowed) upon reaching the appropriate HD. The goal is mostly to make draconian mercenaries more attractive, since if they can survive they can become rather strong.
* Describe monster attack flavours in their descriptionsChris Campbell2014-05-041-1/+1
| | | | | | | | Adds monster attacks to monster_info and displays a line above monster spell sets for monsters with attack flavours, such as "It may attack to cause poisoning and deal extra fire damage." Player ghosts and random pan lords use brands instead of attack flavours and so aren't described here (and random pan lords shouldn't be anyway).
* Move monster shape into monster entries.Steve Melenchuk2014-04-241-0/+1
| | | | | | | There have been a lot of changes made over the years that weren't reflected in this function; this should help simplify maintenance of it, and has the added bonus of keeping things up to date with the new glyph changes.
* Remove MONEAT_FOOD from harpies and GastronokChris Campbell2014-03-231-1/+0
| | | | | | They were the only two monsters using it (allowing them to occasionally eat food or corpses from the floor), and it was very unlikely to ever have a significant effect.
* Remove fake Mara/Rakshasa monsters and associated code, refactor to use ↵DracoOmega2014-03-111-1/+0
| | | | | | | | | | | | | | | | | | | Phantom Mirror There was quite a bit of special case code for the 'fake' monsters which Mara and other rakshasa would create that can be subsumed beneath the general Phantom Mirror effect (which can properly create fake dummies of any type of monster in a unified way). The main practical gameplay difference that will result (aside from bugs introduced by this, of course) is that the true Mara will actually be disguised when he splits, instead of the player knowing for sure which one he is (until two of them blink in the same turn, anyway). This is a Mara buff, but it seems to me that an illusion spell of this nature shouldn't have been so easy to see through in the first place and that this is an overall better state of affairs. (Also, the clones do have less hp than before, if you end up killing the wrong one first).
* Unduplicate an antimagic checkChris Campbell2014-02-251-0/+1
| | | | Since it's needed in a bunch of different places now.
* Make friendly summons prefer paths that never leave the player's sightDracoOmega2014-02-251-0/+1
| | | | | | | | Sometimes the shortest path that a monster could see to its target would follow a route the player themselves couldn't see, which would cause them to oscillate back and forth at the edge of sight, moving away and then immediately returning once they left your view. Now they should elect to take longer paths that they can actually follow.
* Introduce a mons_is_player_shadow() to help with an ASSERT.Steve Melenchuk2014-02-231-0/+2
| | | | | | If the shadow kills something, it's possible for it to still be around when the code is called for this assert; this was seen with terrain change reversions.
* Describe monster energy usage in xv and ?/M screens.Steve Melenchuk2014-02-111-0/+13
| | | | | | | | | | | e.g. "A felid. [...] It covers ground quickly." "A hydra. [...] It swims extremely quickly." "An orb spider. [...] It is fast, but uses natural abilities extremely slowly."
* Fix seek/wandering behaviour of spectral weapons and battlespheres.gammafunk2014-02-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The monster versions of these spells were misbehaving differently depending on whether they are friendly or hostile due to assumptions in handle_behaviour(). Some changes that let these "avatars" behave properly when both friendly and hostile, regardless of caster: 0. I added a mons_is_avatar() function that returns true if the given monster type is a battlesphere, spectral weapon, or grand avatar. The behaviour changes only affect spectral weapons and battlespheres, and the function is currently only used for code relative to those two, but they're all in the class of "magical constructs attached to the caster". 1. Spectral weapons and battlespheres seek their owner upon creation. 2. Avatars now always know the location of their owner and will attempt to seek to their owner if they fail to seek their current target. 3. Avatars not created by the player see their owner as the "foe" to fall back to instead of the player. Using the owner for mon->foe when the avatar cannot attack (in the case of spectral weapons) is perhaps not the best system, but it's how non-avatar player-friendly monsters are currently able to track the player, so we use the analogous approach now. 4. Spectral weapons are all properly "leashed" to their owner and fall back to seeking owner if they are out of their two-distance leash. Battlespheres also seek back to their owner if said owner is teleported away.
* Demonspawn enemies: underlying base/non-base monster work.Steve Melenchuk2014-01-211-1/+5
| | | | | | | | | | | | | | | | | See: https://crawl.develz.org/wiki/doku.php?id=user:hangedman#faceted_classed_demonspawn_for_pan for explanations. This includes a move of the demonspawn glyph to '6'; this is intended to make the glyphs for each of the enemies unique, which wouldn't really be possible with the overloaded '@' glyph. A lot of the functionality that varies for base demonspawn is present, including attack flavours and spininess; the base monsters differ slightly to reflect this. The nonbase enemies are all currently identical; further, nothing places anywhere yet. Differentiation to come in following commits.
* Remove apparently unused BEH_PANICDracoOmega2014-01-181-1/+0
| | | | | | | | | | | While several parts of code checked if a monster WAS 'panicking' (described in a comment as 'fleeing without running away'), it was never actually possible for a monster to enter this state, nor did there seem to be any behavioral code associated with being in it. The flee-based behavioral code is convoluted enough already without mysterious unused things cluttering it up, so I have pruned it. (Hopefully I am not overlooking anything)
* Split some prototypes etc off to mon-book.hNeil Moore2014-01-171-12/+1
| | | | | | | | | | | | | All the ones that reference mon_spellbook_type, so that the users of mon-util.h don't all require a rebuild whenever mon-spll.h is touched and mon-mst.h regenerated. For the same reason, change the 'sec' field mon monster_entry back to an int, and make get_spellbooks a function rather than a method of monster_info. I did not split the implementations off into a new .cc file, but that wouldn't be unreasonable.
* Split tracking of "illuminating" and "fiery" conducts.Steve Melenchuk2014-01-141-0/+1
| | | | | This should be a little more clear for players, besides which there's been some hesitation expressed about the latter.
* Dithmengos hates the light.Steve Melenchuk2014-01-111-0/+1
| | | | | | | | | | Dithmengos hates items, spells, and monsters that cause illumination, and particularly appreciates kills of the latter. This hatred extends to most forms of fire (enemy of the darkness since ancient times). There's a few questionable things in here which could stand to be looked at (I'm including items that only glow through their description, most notably freezing-brand melee weapons).
* 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.
* Remove Mislead.Adam Borowski2013-12-151-0/+1
| | | | | | It was a pure interface screw, and even worse, required a large amount of support code that's a maintenance burden, causing crashes we need to fix from time to time.
* Don't let Dryads walk through treesChris Campbell2013-12-031-1/+0
| | | | | | | | | | Being able to awaken trees and pull you next to them is a strong combination on its own, it's not necessary for them to also hide in the trees while doing so. Removes a lot of code for handling wall movement since rock worms are gone too, but leaves HT_ROCK - it appears that spatial maelstroms sort-of-use it (not sure if they actually need it, though).
* Make ENCH_SLEEPY a flag rather an enchantment.Adam Borowski2013-11-271-0/+1
| | | | | | | | | | | | | This way it can get cleared a lot faster: we have a loop to remove it from every monster every turn, which shows up this prominently on qw profiles: [4] 59.6 0.07 14.57 21662 handle_monsters(bool) [4] 0.31 9.15 1263185/2072593 monster::del_ench(enchant_type, bool, bool) This commit merely optimizes it without improving the complexity: inventing some field last_slept could allow setting this only when the monster gets hibernated. For now I went the easy but lame way; having the query encapsulated means a stronger optimization can be done easier.
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-1/+1
|
* Staticalize.Adam Borowski2013-10-241-1/+0
|
* Inline.Adam Borowski2013-10-241-2/+0
| | | | Really, that blink/jump hack should go.
* Separate monster_descriptor() into proper functions.Adam Borowski2013-10-191-0/+2
|
* Inline a function.Adam Borowski2013-10-171-1/+0
|
* Include mon-spll.h just once.Adam Borowski2013-09-211-5/+1
| | | | | This sadly doesn't fix the "rebuild world" problem, as mon-mst.h derived from it is still included globally.
* Move mons_is_stationary() to struct actor.Adam Borowski2013-09-131-1/+0
| | | | Simplifies code in a number of places, and also fixes a few tree-moving bugs.
* Adjust M_STABBER movement behaviorDracoOmega2013-08-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the greatest issues with the range-maintaining behavior of spriggan assassins and enchanters is that they are the most likely to play keep-away against the players they are the most harmless to. This is especially true of enchanters, since a player that falls easily prey to hibernation will have the enchanter quickly get into melee where it can be dealt with, while those characters outright immune to it (and there are many) will have the enchanter continuously refuse to stop running away until cornered, even though their main offense cannot theoretically affect you. This was somewhat less problematic for assassins, since they would simply run out of ammo in a few turns, but these suffered an inverse problem: they would only ever get a single stab attempt, then remain locked in melee and refuse to use any remaining needles they might possess). Moreover, the fact that enchanters would close range if you could not see them caused other odd behavior; sometimes it was advantageous to NOT be able to see invisible creatures, so that they would stop running away, even though being invisible did not grant them any special stabbing bonuses against you). Assassins and enchanters are now able to appraise whether you are inherently immune to their abilities or not, and if you are, will not bother to maintain range at any point. (This only applies to immunity granted through obvious sources, so undead vs. sleep, but not clairity vs. confusion, for example). Moreover, they will now prefer holding their position rather than actively retreating from their target, if they are already within several spaces of it. Finally, assassins will switch back to their blowguns in melee range if they still possess ammo that can incapacitate the player, alternating between incapacitation and stab attempts.
* Don't crash on ?/morc wizardNeil Moore2013-08-241-1/+1
| | | | | | | | | We were trying to get a monster from the monster_info, but that doesn't work when there was no monster (or in general when the monster_info doesn't have a location). Change mons_spellbook_list to take the monster type instead. Thanks to ChrisOelmueller for pointing out the bug.
* Rename a no-longer-static function.Neil Moore2013-08-241-2/+2
|
* Display monster spells and magical abilities with x-vcjo2013-08-241-1/+16
| | | | | | Decrease the need for spoilers by showing monster spells and magical abilities when examining a monster with the command x-v. If monsters have multiple possible spellbooks, all of them are listed.
* Replace Caniforms with Druid's CallDracoOmega2013-08-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Even after being buffed somewhat, Caniforms summoned only virtually harmless monsters for the druid's depth, and worse, the druid's speed meant summoning them in large numbers. Possibly these were originally intended to provide movement constraints to block the player from escaping angry trees, but dryads already focus upon this angle. Instead, let's replace the spell with something thematically similar, but which hopefully sidesteps the problems the original suffered. Druid's Call summons wild beasts from elsewhere on the level to the druid's location and grants them might in the process. Each cast will summon either 2 lower-HD monsters (HD<10) or a single higher-HD monster. The definition of 'beast' here is hoped to be somewhat intuitive to players (ie: wild animals of various kinds), but admittedly has some fuzzy lines to it. Currently it is defined as any natural holiness creature of insect, reptile, or animal intelligence, excluding dragons, ugly things, ice/sky beasts, spirit wolves, and butterflies. And apises (which are still bulls, despite being holy). Possibly these criteria can use further adjustment.
* Revert "Bye bye clinging."Raphael Langella2013-08-121-0/+3
| | | | | | | | | | | | | Clinging might be a minor feature, but it's a distinguishing one, it's thematic and it's working quite well. Player/monster symmetry has never been a goal, so it seems dubious to invoke it as the reason to throw away all the work that has been put into clinging. We can always say that the player turns into a different kind of spider which is unable to cling for some reason. This reverts commit bdc56382eacf7af1b2330dc6444916d368741fec. This reverts commit d689486464fcaaac025a6f469ab69674a2f4d173. This reverts commit 1addaaf8ee92de5060fdb436f93251843abd2035.
* Correctly display whether oklobs, statues etc are stabbable (#7338)Chris Campbell2013-07-151-1/+0
| | | | | | There doesn't seem to be any reason to hide the information, and presumably oklobs do something with their acid-spitty bits that makes it clear when they've noticed you.
* Bye bye clinging.Adam Borowski2013-07-101-3/+0
| | | | | | | | | | | With player clinging removed, monster doesn't make much sense. Note that I personally somehow like clinging -- even if it's rarely useful except early on, it was quite harmless. However, I'm strongly against having players and monsters inconsistent when there's no very good reason. Thus, reverting this and MarvinPA's change is an option. Just please keep or revert them together.
* Fix overflow in curse skull monster energy pickup_percent.Neil Moore2013-06-261-9/+9
| | | | | | | | | | | | Curse skulls got an action energy of 15, meaning their pickup_percent was 150, outside the range of the int8_t that stores it. Since none of the energy usage numbers should be negative, make that a uint8_t instead. Also change the other members to uint8_t so we don't need duplicate overloaded versions of combine(). This wasn't actually relevant to curse skulls, since they had MONUSE_NOTHING, but it was producing a compiler warning and more importantly could turn up with some future monster.
* Fix formatting and simplify (Spectral Weapon)Pete Hurst2013-06-261-0/+1
|
* New monster: Thorn Hunter (and Briar Patches)DracoOmega2013-06-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are swift-moving predatory plants of rudimentary intelligence, able to fire volleys of sharp thorns at their targets and raise barricades of thorny briars. The brairs are fragile fire-vulnerable plants (that crumble shortly after being created), but are also spiny and will inflict damage upon a player trying to clear them. They can, however, be fired past in the same manner as bushes. The Thorn Hunter will raise wide walls of briars in arcs in the distance beyond the player in an attempt to cut off retreat and movement in those directions, and also as closer range barriers to protect itself from hostile movement towards it while remaining able to fire its projectiles past them. Some parts of the code for this is... somewhat unpleasant. The briars themselves are drawn using arcs of a circle of randomized radius and center (based upon distance between its target, and whether it is using the briars defensively or offensively) but done in what I suspect is a very ineffecient manner. Probably worse are several points of code where the thorn hunter is special-cased to 'cache' information about where its foe was the previous turn (to guess whether it is approaching or retreating, and thus which type of barrier to form, should it choose to do so), and also where it WILL be moving, should it choose not to use an ability. The 'bunkering' behavior, where the thorn hunter will fire from behind a defensive barrier, is accomplishd by checking in mon_special_ability what space the hunter is about to move in, and then if that space contains a briar, giving it a high chance to fire instead (otherwise it mostly just spends turns meleeing its own wall immediately after raising it). I believe the net effect in visible behavior and tactics is interesting, but a lot of it feels a bit 'hacky', since it needs to analyze information that the monster AI framework does not generally have access to. Perhaps there is a better way to have gone about all this, but I hope at least that the way I have done it is clean and clear, even if rather special-casey.
* Implement chimera legsPete Hurst2013-06-231-0/+2
| | | | | | | This allows the chimera to take the legs of one of their parts. This can give them the base speed of the legs monster, also enables clinging, and for jumping spiders, will flavour a self-blink as a jump instead of a blink.
* Refactor monster jumpiness checkPete Hurst2013-06-231-0/+2
| | | | Following other instances of class/monster checks
* Support mons_base_type for chimeraPete Hurst2013-06-231-0/+2
| | | | | | This results in the base monster (i.e. the first chimera part) getting inspected for many checks, instead of MONS_CHIMERA. This should allow chimera to do several more things.
* Allow random chimera to be created with MONS syntaxPete Hurst2013-06-231-0/+1
| | | | | | | | | | This enables a MONS spec to just be "chimera" and three depth- appropriate monsters will be used. This can produce bizarre results but might be useful. It should also allows things like "place:Zot:5 chimera vs place:Pan chimera" in Arena. The filters could be refined further to allow random chimera to not be completely ridiculous.
* Be more consistent about Beogh conversion criteria (#7180)Neil Moore2013-06-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | If the priest was out of LOS but within LOS radius, you could get the "press a Y" message without actually having the Beogh light. Conversely, you could get the light but no message if you were invisible to the priest. Now the following criteria must hold to get either the status light or the speech and message: * The priest must not be silenced. * You must be able to see the priest. * The priest must be able to see you. Glass is fine. Furthermore, you won't get the status light (but will still get the message) if you are silenced but the priest is not. The priest's current behaviour also affects whether you will get the "a Y" message. If it's already seeking you (because of noise for example) you won't get the message; this makes sense for the preaching speech, but the a Y message should probably happen when you first get the light as well. I still worry the message might be too easy to miss, but I don't think it's worth a default force_more.
* Reverse the argument of get_monster_by_name().Adam Borowski2013-06-091-1/+1
| | | | | | The default, substring match, was totally unintuitive and broken. Only one place is actually changed, something about shapeshifters.
* Generalize the check for monsters allowing Beogh conversion.David Lawrence Ramsey2013-06-011-1/+1
|
* Give every orc priest a portable altar.Adam Borowski2013-06-011-1/+3
| | | | | | | | | | You also get to pacify one orc band per game: the band you surrender to will let you live. Obviously, abandoning and reconversion doesn't work (even if you're still allowed to repent). Unlike HOPr only, this allow to play more interesting combos with Beogh. Converting when you (maybe!) get that Orc:4 altar is way too late to get much use of Beogh.
* Clean up tentacle/tentacle segment handling somewhat.David Lawrence Ramsey2013-05-271-3/+4
| | | | | | | | | | | mons_is_tentacle() now returns true only for actual tentacles, which makes mons_is_tentacle_end() redundant. mons_is_tentacle_or_tentacle_segment() does what mons_is_tentacle() used to do, and is used properly on both sides of Mislead. Handling of child tentacles (everything other than eldritch ones) is now handled more generically, in case more types of them are added.
* Add a few checks for mon-data to --test.Adam Borowski2013-05-261-0/+1
| | | | | | | | | | | It currently does not validate, as I'm introducing a new requirement: any monster that drops a corpse must work with Simulacrum. It's debatable which ones should allow zombies as well, but at least there's now support for having spectrals/simulacra/skeletons but no zombies. The word "zombifiable" is quite ambiguous, too.