summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/shout.cc
Commit message (Collapse)AuthorAgeFilesLines
* Remove stuffNicholas Feinberg2014-07-291-2/+3
| | | | | | | .cc, moving its contents into the new stepdown.cc and strings.cc. (The latter also got many donations from libutil.h.) Down with stuff! Up the new flesh!
* Separate 'permanent' and 'temporary' monster hit diceNicholas Feinberg2014-07-131-1/+1
| | | | As part of a wider scheme to make draining temporary.
* Remove sharks from the gamereaverb2014-07-121-31/+1
| | | | | They had all the same problems as big fish or other melee liquid-only monsters.
* Reformat.Neil Moore2014-07-051-5/+1
| | | | | Mostly by joining short lines in places where that would let us remove braces.
* The great mon-stuff migration.Shmuale Mark2014-06-221-1/+1
| | | | | | | | | 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.
* Formatting fixes (add braces).Neil Moore2014-05-121-0/+4
| | | | This fixes all the instances caught by unbrace.
* Remove mangroves, make single trees block LOS.wheals2014-03-291-1/+0
| | | | | | | | | | | Trees are in some ways yet another type of transparent wall, and, as MarvinPA has said, "in general having areas full of trees where you can see lots of enemies but not target them just plays badly." There were two differences between trees and mangroves, besides LOS: the latter didn't start forest fires and left shallow water when destroyed. That behaviour is kept, instead checking whether the tree (technically, the player) is in Swamp.
* Fix some speech substitutions with noisy weapons (#6476)Chris Campbell2014-03-281-0/+3
| | | | | A lot of this is duplicated from do_mon_str_replacements(), possibly that should be cleaned up somehow.
* Remove player blood/web sense of out-of-sight monstersChris Campbell2014-03-141-76/+0
| | | | | | | It was very unlikely to ever trigger - caused by a monster somehow being made to bleed just out of your LOS in the blood sense case, or a monster being caught in a web while you are in spider form in the web sense case, and even less likely to actually be useful if it did somehow trigger.
* M_VIGILANT changes.elliptic2014-02-131-4/+0
| | | | | | | | | | | The flag no longer makes the monster automatically notice the player as soon as the player enters sight. Instead, it divides the chance of the monster forgetting about an out-of-sight player by 3. (The flag also still has the effect of making the monster's foe_memory not decrease with time.) This affects only one monster currently: curse skull. The purpose of the flag is to make the monster handle being out of the player's sight better, so possibly wandering mushroom should gain it too.
* Make shark blood frenzy message more specificDracoOmega2014-01-281-2/+2
| | | | | So that players will understand what is actually triggering it without already knowing.
* Unbreak monster blood scent and web senseDracoOmega2014-01-281-1/+1
| | | | | It looks like it was assuming everything was out of range if it had any distance at all.
* Make noisy randarts only make noise when hitting thingsChris Campbell2013-12-221-1/+1
| | | | | They now don't give messages or make noise at all when just travelling or exploring, only when hitting things. Also reduce their noise level slightly.
* 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.
* Replace `mpr(s, ch)` with `mprf(ch, s)`Adam Borowski2013-11-291-2/+2
| | | | | | | | | Also simplify quite a few cases. It turns out in >90% cases of non-literals the argument had .c_str(), which meant it was pointlessly malloc()ed and converted from and to std::string. I believe a sprintf is faster, so even the argument of miniscule speed-up doesn't apply.
* Make ENCH_SLEEPY a flag rather an enchantment.Adam Borowski2013-11-271-2/+2
| | | | | | | | | | | | | 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-2/+2
|
* Remove moths of suppressionChris Campbell2013-11-111-2/+2
| | | | | | | | | | | Suppression is a hugely complicated and inconsistent mechanic. Its original purpose was to be a way of overriding rPois in Spider but there are now plenty of monsters that do this effectively (and much more simply). [1KB: I moved this to trunk, as it made an already extremely hard to review branch massively more so. There's nothing but a single enum to preserve, so compat break doesn't make this removal any easier or harder.]
* Get rid of a strange accessor.Adam Borowski2013-11-051-1/+1
|
* Less los_def usage.Adam Borowski2013-11-051-0/+1
|
* 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.
* monster_near_iteratorAdam Borowski2013-10-311-2/+4
| | | | | | | | | | | | Does the "in view" part of functionality of monster_iterator, is simpler, allows using los models other than LOS_DEFAULT, and gets rid of a lot of uses of get_los(). The code is nearly identical as actor_near_iterator, but the old delegation used more code than either of those. Still, perhaps templating could work? This commit also fixes a buttload of ignoring invis / see invis / sense invis (ie, visible_to()) and act-through-glass bugs.
* Revert "Remove player clinging".Adam Borowski2013-08-121-1/+2
| | | | | | | | | | | | | | Minus gargoyle clinging, of course. With monster clinging back, it would be inconsistency for inconsistency sake. Player clinging: * is what people expect spiders to be able to do (if monsters can). Count on bug reports about this. * allows people to learn monster mechanics on their own * is useful in the early game, or later if you don't have that particular spell. People don't tend to lug heavy potions of Flight either. * is actually fun
* More padding fixes for ternary operatorChris Oelmueller2013-08-031-2/+2
|
* Refactor 'you.religion' checks.Brendan Hickey2013-07-281-1/+1
| | | | | Pull 'you.religion [!=]= FOO' checks into a function: you_worship(FOO). This change is part of a large plan to clean up religion.
* Replace @a_player_genus@ in weapon noises.Adam Borowski2013-07-171-0/+2
| | | | Yay for monster speech having a list of replacements on its own.
* Remove player clingingChris Campbell2013-07-091-2/+1
| | | | | | | | | As a player mechanic, it's almost never relevant and in the few cases where it can be relevant it's quickly obsoleted by fairly common sources of flight, as well as being unnecessarily complicated (no diagonal clinging for some reason?). As a race-specific mechanic it also results in a lot of annoying message spam ("You open the door. You fall off the door.").
* Tweak chimera name displayPete Hurst2013-07-021-1/+1
| | | | | | | Allow a single head to temporarily act by setting ghost.acting_part; this allows the introductory shout messages to actually reference the three monster types. Improved the chimera name display slightly by changing it to "chimera (foo, bar, baz)".
* Make chimera more talkativePete Hurst2013-07-021-2/+5
| | | | | | Causes the three heads to announce themselves when the chimera is released; gives you a flavourful hint as to what the components are without specifically checking.
* New monster flag M_VIGILANTDracoOmega2013-06-261-0/+4
| | | | | | | | | | | | This flag makes a monster always wake up when the player comes into LoS and never naturally forget about them (though stairs and teleports and such still work) This is intended at the moment for curse skulls, to simulate their previous behavior of generating awake, but also to keep them from simply wandering off if you wait long enough while one is outside your LoS. Possibly it could eventually make sense for other magical sentinels (eg: golems, once golems are better)
* Implement chimera legsPete Hurst2013-06-231-1/+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.
* Handle chimera noisesPete Hurst2013-06-211-0/+6
| | | | | | | | | | | | | | | | | In monster data it changes to S_RANDOM; this is fine for most purposes for which this is used, e.g. determining whether or not a monster is silent. In handle_monster_shouts itself, the shout type is substituted for the shout of one of the constituent parts. There is a question mark over do_mon_str_replacements -- in most of the places it's called from, chimera are irrelevant, and when it's called from handle_monster_shouts the shout type we already determined is passed in. So there shouldn't be any strange cases, unless perhaps someone made something new that used sentient monsters as chimera components. Would need to refactor mons_shouts to accept a monster instead of a monster_type to make this any better.
* New mcros ASSERT_IN_BOUNDS{,_OR_ORIGIN}().Neil Moore2013-06-091-1/+1
| | | | | These print the out-of-bounds coordinate as part of the assertion message.
* Fix a crash related to LRD, noise, and permarock.blackcustard2013-06-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Some spells (e.g. dig and Lee's Rapid Deconstruction (LRD)) can be used on the very edge of the level (permarock/open sea/lava sea). This is by design. LRD can use permarock to make explosions, but cannot destroy it. The bolt class wanted these spells to cause noise, and it was attempting to center the noise on the border tile, which is technically out-of-bounds. Because the noise code did not check for out of bounds positions, the bolt class was successful. When the resulting noise disturbed a monster, the out-of-bounds sound's out-of-bounds location would be passed to behaviour_event through its src_pos argument, triggering this assertion: "ASSERT(in_bounds(src_pos) || src_pos.origin());". Changes: 1. Added an assertion in noisy in sound.cc to ensure that all sounds are in-bounds. 2. Made these spells only generate noises in-bounds. If a noise needs to be generated out-of-bounds, it will instead be generated nearby, but in-bounds. Maybe this messes things up by changing who can hear the sound in certain situations?
* Make a function public and renameDracoOmega2013-03-061-8/+1
|
* Add Vault WardensDracoOmega2013-03-031-0/+1
| | | | | | | | | | | | | These are the watch captains of the vault, similar in stats to a greater vault guard, with more HD and slightly better equipment. They can evoke a rune of sealing which slams shut doors near the player and seals them closed. Sealed doors cannot be opened by the player by any means (though they can still be destroyed in the usual ways), although monsters can open them freely. The seals will expire after a number of turns, or instantly upon the death of the warden which sealed them.
* Don't let Stealth skill inhibit monster shouting.elliptic2012-12-121-1/+1
| | | | | | Stealth should stop monsters from noticing you, not from shouting after they do notice you. The shouting chance is now fixed at what it was with 6 Stealth skill previously (80% chance).
* Indentation fixes.Adam Borowski2012-12-051-22/+22
|
* 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.
* Add spelling fixes.David Lawrence Ramsey2012-10-121-1/+1
|
* Improve speech syntax: capitalization and random substrings.Jay3.14152012-10-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. @The_monster@ shouts, "I hate you, @CAPS@ @player_name@ @NOCAPS@!" will result in the actual player name being capitalized. (Spaces are trimmed.) 2. @The_monster@ says, "I am [very ||really ] hungry." will randomly result in "I am very hungry", "I am hungry" or "I am really hungry". If the pattern turns up a lot, you need to assign weights to the different choices, or you require nested random sets, you'll need to stick to the old fallback of defining ad hoc @keywords@. Otherwise, this should make things somewhat simpler. Works for both monster and weapon speech, including shouts, noisy weapons and the Singing Sword. I've also taken the liberty to update the speech documentation, which still listed the old website (!) and pointed users looking for advice to the newsgroup). Conflicts: crawl-ref/source/art-func.h crawl-ref/source/libutil.cc crawl-ref/source/libutil.h Signed-off-by: Florian Diebold <flodiebold@gmail.com>
* Merge branch 'master' into glasnostAdam Borowski2012-08-311-38/+43
|\ | | | | | | Yay for conflicts galore (wax removal, std:: purge, tileidx changes).
| * Use std namespace.Raphael Langella2012-08-261-35/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | I had to rename distance() (in coord.h) to distance2() because it conflicts with the STL function to compare 2 iterators. Not a bad change given how it returns the square of the distance anyway. I also had to rename the message global variable (in message.cc) to buffer. I tried to fix and improve the coding style has much as I could, but I probably missed a few given how huge and tedious it is. I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool and util/levcomp.*, because I have no clue about those.
| * Monsters with M_BLOOD_SCENT can smell blood regardless of the player's race.Policarpo Caballero2012-08-121-1/+2
| |
| * Massive style fix (braces, indentation, etc.)Neil Moore2012-08-011-2/+6
| |
* | Runed doors.Adam Borowski2012-08-311-0/+1
| | | | | | | | | | | | They're meant to stop autoexplore, and maybe request a confirmation for being opened. This is not yet implemented, but we can use them for converting secret doors that were used for marking a place as interesting.
* | Drop the code for displaying/handling/etc secret doors.Adam Borowski2012-07-111-2/+0
|/
* Some more return deparenthesization.Adam Borowski2012-07-051-2/+2
|
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-17/+17
|
* Rename swamp trees to mangroves.Michael Gagno2012-07-031-1/+1
| | | | | Since these are opaque (and therefore behave differently from normal trees), a renaming is warranted.