summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dactions.cc
Commit message (Collapse)AuthorAgeFilesLines
* makhleb's summons should also go hostile on excommunication (6124)Jesse Luehrs2014-08-161-2/+7
|
* The great mon-stuff migration.Shmuale Mark2014-06-221-1/+0
| | | | | | | | | 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.
* Rename functions (|amethyst).Shmuale Mark2014-06-191-1/+1
|
* Try to reduce duplication in Recite code.Shmuale Mark2014-06-191-1/+1
| | | | | | | | | | | | | | is_chaotic() and is_unclean() have been changed to return an int roughly equal to what would have been returned before by the Zin recite function. Some bool flags were added to the function to make it still work right for the other uses (e.g. silver). Prince Ribbit is no longer specially vulnerable to Recite, and insane/ sluggish uniques are unclean rather than chaotic, which seems more consistent with the other uses of the terms. The special case for nonliving and plant monsters to be unrecitable is removed.
* Don't crash on Gozag-detected underwater gold.Neil Moore2014-06-071-4/+3
| | | | Don't bother detecting it.
* Time out friendly bribed monsters like neutral bribed monsters (dpeg).Steve Melenchuk2014-06-031-7/+3
| | | | | Yes, this means they don't demand payment now and again, and stop following you when the initial bribe expires.
* Really fix Gozag gold detection (#8584).Steve Melenchuk2014-05-231-1/+1
| | | | | | | | | It was moving the wrong item to the top of the cell - I wanted item_def::index(), not item_def::link. Also, if the gold was the second item on the cell, it would get missed, and if more than one identical item was being generated on the same tile before and after the gold, it could also get missed.
* When flagging Gozag-detected gold, assert that there's an item there.Steve Melenchuk2014-05-231-0/+3
| | | | Should catch the crash in #8584.
* Fix a debug mode reference to a removed delayed actionChris Campbell2014-05-171-0/+2
|
* Fix debug compilation (again).Steve Melenchuk2014-05-081-0/+1
| | | | Whoops.
* Extend bribes to all previously-unseen monsters.Steve Melenchuk2014-05-081-0/+8
| | | | | | | | Most players intuitively expect it to behave this way and are surprised when it isn't. You obviously can't bribe monsters in your LOS or that are chasing you, so Bribe Branch retains its strategic nature.
* Nudge Gozag's passive gold detection.Steve Melenchuk2014-05-071-4/+0
| | | | | Fix other item being detected in place of gold (#8499); don't show the message for it (elliptic).
* Gozag: Gold sense.Steve Melenchuk2014-05-071-0/+16
| | | | You passively detect gold on entering a level.
* Gozag: Don't let bribes take effect until the player spots the monster.Steve Melenchuk2014-05-071-1/+10
| | | | | Prevents abuses like clearing out the Orc:$ end entirely offscreen; also gives the opportunity for some nice dialogue.
* Gozag: abandon called shops on excommunication.Steve Melenchuk2014-05-071-0/+20
| | | | | | This needs to be communicated somehow, but only if the player has actually used the ability; this might happen pending some changes to track Gozag ability use.
* Gozag: prelimiary implementation of Bribe Branch.Steve Melenchuk2014-05-071-0/+12
| | | | | | | | | | Spend 3000 gold for a chance of temporarily turning some of the inhabitants of a branch good neutral, or possibly even friendly. Bribes are only effective against newly generated monsters (i.e. on level creation or monsters that spawn afterwards); the fund times out over time and more quickly with the number of enemies affected, upon which neutral enemies turn hostile again; friendly followers will continue to follow the player subject to occasional follow-up payments.
* Gozag: gold lust.Steve Melenchuk2014-05-071-0/+1
| | | | | Fighting near the gold piles of recently-defeated enemies boosts your skills.
* Gozag: shift gold to top of piles.Steve Melenchuk2014-05-071-0/+17
|
* Fix enchantments on hogs during Kirke death (#8446)Eduardo Gonzalez2014-05-041-0/+2
| | | | | The enchantment list was being preserved, but not the cache of which ones were active. Reloading the game would succesfully reset the cache.
* Don't turn holies neutral when worshipping a good godChris Campbell2014-04-281-5/+1
| | | | | | | | | | | | | | It's almost never relevant (with Mennas being possibly the only edge case), and has a number of negative effects: dungeon generation depending on the player's god in Pan, strange interactions with getting additional chances to convert on piety breakpoints, and generally a lot of code for a pretty questionable gain. Flavour-wise it seems perfectly reasonable that the holies in the dungeon just all see you as insufficiently pious, or some kind of a heretic (as is the case for non-holy religious monsters). Kept some of the holy speech for the case where an Elyvilon worshipper pacifies a holy.
* Move mon death stuff from mon-stuff.cc to mon-death.cc.Shmuale Mark2014-04-121-0/+1
| | | | | | | Touches a lot of files since their #includes have to be edited. (Pushing now since it shouldn't break anything and keeping it updated is nasty.)
* End the spirit howl. Permanently.Adam Borowski2014-01-151-14/+5
| | | | | They're on every list of problematic Forest monsters, and neither of Forest proposals has a place for them. Plus, even worse, they're summoners.
* Drop pointless empty lines after or before a brace.Adam Borowski2013-12-211-1/+0
| | | | | I left them only where the contents is not indented, like in a namespace or a template.
* More formatting fixes for return (...);Neil Moore2013-11-151-24/+24
|
* Rewrite monster_iterator.Adam Borowski2013-10-311-1/+1
| | | | | It degenerated to a simple loop over menv, hardly worth any syntactic sugar. I kept it for now, though.
* Unbreak build.Adam Borowski2013-07-311-0/+1
| | | | | Guys, actually trying to compile after a pull --rebase would be nice; there's 16 commits in a row which don't even build.
* Tweak formatting and fix a typo.Neil Moore2013-07-301-1/+1
|
* Fix a Kirke crash by deporkalating transiting hogs correctly.blackcustard2013-07-301-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | Normally, monsters are stored in a list (env.mons or menv for short). There is a grid (env.mgrid or mgrd for short) which maps the position (x, y) of the monster to its index in the list. Transiting monsters, however, exist outside both the monster list and the monster grid. They are stored separately, and they do not really have positions. The deporkalation code inside dactions.cc was not transiting-monster aware. It would call monster::move_to_pos on transiting hogs, just as on non-transiting hogs. When it did so, it would write their index inside the monster list into the monster grid. Of course, since these hogs were not in the monster list in the first place, this "index" was bogus. Within a few turns one of several unrelated parts Crawl would try to investigate the monster grid and trip over the bogus entry, triggering this assertion in monster_at inside mon-util.cc: ASSERT(mindex <= MAX_MONSTERS); Changes: 1. Make the deporkalation code transiting-monster aware. Do not call monster::move_to_pos on transiting monsters. (Fixes the crash.) 2. Add some informative comments. 3. Make an implicit type conversion from monster to follower explicit.
* Change how Spirit Wolves work somewhatDracoOmega2013-07-301-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the very low per-turn chance of the wolves using their spirit howl was intended to mean that a majority of packs would not use it at all before being killed, in practice the randomness involved meant that sometimes a player could be afflicted by the status several encounters in a row. Worse, for a player with good defenses, the wolf attacks presented little danger, but still took a very long time to stop. In general, this could lead to them being an irritating encounter that nonetheless presented little danger. This commit is aimed at trying to address this. Spirit howl now lasts less time, but the spawning of packs within it happens somewhat more rapidly. Spirit wolves themselves hit noticably harder and are a little more accurate. The wolves attracted by spirit howl no longer count as summons, but are finite in number across all uses of spirit howl (ie: they represent the rest of the spirit pack, attracted from outside the waking world). This has a couple ramifications: there is now some reward for actually fighting them instead of running away until they time out (yet one that cannot be farmed) and (significantly) there is an upper limit on how many times the player has to deal with this effect, instead of potentially having to deal with it over and over and over again as one clears Forest. Wolves within sight of the player no longer disappear when the howl ends, though those out of view do (and are thus eligable to be called again by a subsequent spirit howl), providing another tangible strategic advantage to killing them instead of running away until they stop showing up. Finally, there is also a lengthly cooldown after the effect ends before any wolf can use it again (so there is no longer any chance for one to howl the moment the first one expires) Overall, the aim is that spirit howl occur less times in total, take up less of the player's overall time, be a little less annoying in some ways, and also provide more actual threat when it occurs. This commit also fixes multiple bugs with the original implementation: non-hostile wolves will no longer howl, placement will more properly respect LoS instead of sometimes spawning them immediately in view, and some pathfinding bugs that could cause wolves to not properly pursue the player have been fixed.
* Formatting fixPete Hurst2013-07-021-2/+1
|
* Turn pairs of assertions with x > min, x <= max into ASSERT_RANGE.Adam Borowski2013-06-081-2/+1
| | | | | The perl regexp to do so is: s&ASSERT\(([^\n]+) >= ([^\n]+)\);\s*ASSERT\(\1 < ([^\n]+)\);&ASSERT_RANGE($1, $2, $3);&sg;
* Set mid before calling define_monsterPete Hurst2013-05-281-1/+4
|
* Refactor ASSERT(a && b) -> ASSERT(a); ASSERT(b);Brendan Hickey2013-04-281-1/+2
| | | | | | | Convert conjunctive assertions into separate assertions. This ought to be correctness preserving. I ran the stress tests and didn't notice anything unusual. While I have confidence in it, if you are the slightest bit suspicious of this, please roll it back. Found instances with `ASSERT(\([^(|]*\) && \([^)|]*\))` Manually inspected each instance.
* Make a function static.Adam Borowski2013-04-261-2/+4
|
* Include debug.h earlier.Adam Borowski2013-04-261-1/+0
| | | | | Via externs.h -> bitary.h, it was effectively included by everything anyway, and this way simplifies include chains.
* Formatting fixes.Adam Borowski2013-04-101-1/+2
|
* Allow demons and angels to recover from porkalationPete Hurst2013-04-011-1/+3
| | | | Kirke's porkalator could create hell hogs and holy swine, but these monsters weren't checked for on reversion.
* #2263 Allow Kirke hogs to revert form across levelsPete Hurst2013-04-011-0/+81
| | | | Uses dactions as per Pikel's slave band.
* Fix debug compilationDracoOmega2013-03-091-1/+1
|
* Add more minor cosmetic fixes.David Lawrence Ramsey2013-03-091-3/+3
|
* Add minor cosmetic fixes.David Lawrence Ramsey2013-03-091-3/+3
|
* Apply dactions to transiting monsters, refactor related codeDracoOmega2013-03-091-56/+86
| | | | | | | | | | | | | Dactions which affect monsters (such as abandoning or joining certain gods, enslaving new souls, killing Pikel) now apply not only to monsters currently on a level, but monsters that have yet to transit to a level (eg: fell down a shaft or were banished, but the player has not yet visited their destination). Previously, it was possible to visit the Abyss and find (say) still-friendly undead slaves there after abandoning Yred in the meantime. This also fixes the unfortunate case of shafted Pikel slave not getting the news about their cruel slavemaster's death.
* Fix Mantis 6689: Make Jiyva slimes convertible again after penance (also ↵David Lawrence Ramsey2013-02-231-2/+14
| | | | reconversion).
* Comment fixes.David Lawrence Ramsey2013-02-231-1/+1
|
* Remove unnecessary includes from header files.Jay3.14152012-10-231-0/+1
| | | | | | | | | | For most header files, this only saves on having to recompile a small number of source files, but there are also a few headers where small changes would now take significantly less time. This is most obvious for the Tiles build for which the dependencies have been greatly reduced, so that the only additional includes when compared to console are strictly library or tile related.
* Remove parentheses around return (simple_function_call).Adam Borowski2012-07-051-3/+3
| | | | For way too paranoid and underinclusive values of "simple".
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-2/+2
|
* Work around a clang warning.Adam Borowski2012-05-231-0/+4
| | | | | At least, they finally fixed glaring errors in their handling of printf(), so warning-less clang builds are now a reasonable possibility.
* Fix the Tomb not losing -cTele on picking up the rune.Adam Borowski2012-04-301-0/+6
| | | | | | | | | I did not reintroduce dynamic branch flags, but used a daction instead to clear the flag on remaining levels. Old games that have Tomb:3 already generated but didn't pick up the rune yet will still get an error message when picking it up, but it's otherwise harmless.
* Mindexicide: behaviour_event().Adam Borowski2012-04-211-1/+1
| | | | | This also reveals how bad the beam blaming code is, need to rewrite that soon -- mostly because of problems with reflection.