summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/los.cc
Commit message (Collapse)AuthorAgeFilesLines
* The great mon-stuff migration.Shmuale Mark2014-06-221-0/+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/+2
| | | | This fixes all the instances caught by unbrace.
* Drop some useless parentheses around comparisons.Adam Borowski2014-01-101-3/+3
|
* Use a scalar range for find_ray() and friends instead of a circle_def object.Adam Borowski2013-12-031-7/+6
|
* Simplify a very convoluted way of checking c.abs().Adam Borowski2013-12-031-8/+2
|
* Refactor ASSERT(a && b) againBrendan Hickey2013-11-151-2/+4
| | | | | | This commit converts ASSERT(a && b) to ASSERT(a); ASSERT(b); Assertions of the form !(a && b) are left intact, since there isn't an obvious readability gain over (!a || !b).
* Manually fix a few more instances of return (...)Neil Moore2013-11-151-1/+1
| | | | | These weren't caught by util/unbrace because they weren't at the beginning of the line.
* More formatting fixes for return (...);Neil Moore2013-11-151-2/+2
|
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-1/+1
|
* Get rid of a strange accessor.Adam Borowski2013-11-051-8/+2
|
* Revamp stone of earth elementalsDracoOmega2013-05-261-1/+4
| | | | | | | | | | | As part of the elemental evoker revamp, the stone of earth elementals is renamed stone of tremors, and given a new effect on an xp-based recharge. When evoked and pressed against an adjacent rock wall, a shockwave will travel along the surface of this wall, curving as the rock does, and damaging creatures standing next to it with falling rubble and (rarely) shafting them. Some walls along the shockwave's path will also be destroyed and from these up to 3 earth elementals will be summoned (dependent on evocations).
* Refactor ASSERT(a && b) -> ASSERT(a); ASSERT(b);Brendan Hickey2013-04-281-2/+4
| | | | | | | 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.
* 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.
* Fix general checks for bush and oklob types to use species when applicable.David Lawrence Ramsey2013-02-201-1/+1
| | | | This ensures that burning bushes and oklob saplings are handled consistently.
* Indentation fixes.Adam Borowski2012-12-051-4/+4
|
* Use std namespace.Raphael Langella2012-08-261-24/+23
| | | | | | | | | | | | | 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.
* Massive style fix (braces, indentation, etc.)Neil Moore2012-08-011-3/+5
|
* Rename bit_array to bit_vector.Adam Borowski2012-07-261-7/+7
|
* Remove parentheses around return (simple_function_call).Adam Borowski2012-07-051-2/+2
| | | | For way too paranoid and underinclusive values of "simple".
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-11/+11
|
* Remove #define LOS_MAX_RADIUSAdam Borowski2012-06-241-1/+1
| | | | | | | Having both it and LOS_RADIUS is misleading, especially as they're arbitrarily used. This distinction doesn't make sense anyway, as any LOS changes need to be done at runtime, only the max matters during compilation.
* Make some functions static/gone.Adam Borowski2012-06-021-25/+15
|
* Replace "atype() == ACT_MONSTER" with "is_monster()" -- half the length.Adam Borowski2012-03-221-1/+1
| | | | Could probably just make it !is_player() instead, too.
* Make a bunch of uninitialized variables static.Adam Borowski2011-12-271-8/+8
| | | | | Too bad, .bss is full of improperly initialized objects that should either be shared or go away.
* Make most of initialized data static.Adam Borowski2011-12-271-1/+1
| | | | | All or almost all of .data segment that is not referenced externally should be done.
* Whitespace fixes.Adam Borowski2011-12-111-2/+2
|
* Fix mimic opacity for different LOS models.Adam Borowski2011-12-111-5/+16
|
* Disambiguate the LOS_SOLID confusion.Adam Borowski2011-12-111-1/+1
| | | | | | | | | | | Its name suggests it's about line of effect, while in fact it's both effect and sight. Thus, I've split its uses into LOS_SOLID and LOS_SOLID_SEE -- the former is what LOS_SOLID was usually understood to mean, the latter is what it actually was (being targettable with an arrow/beam). The difference is: LOS_SOLID_SEE obeys clouds. The name of the latter is abysmal -- if you have a better idea, please sed.
* Consistently use a space after flow control statements.Adam Borowski2011-12-021-2/+2
|
* Correct a spelling mistake in a comment.Michael Gagno2011-11-221-1/+1
|
* Make a bunch of functions static, delete some unused junk.Adam Borowski2011-11-111-3/+3
|
* Merge all the feature mimics into a single monster type.Raphael Langella2011-09-051-1/+12
| | | | It's now possible to create any kind of feature mimic using &M.
* Straighten the two cell_see_cell() confusion.Adam Borowski2011-09-051-1/+1
| | | | | | | | | | | | There were two functions: one used no cache and ignored clouds, another one has a cache and accepts different LOS models. I added a new cached model: LOS_SOLID (using opc_solid). All but one uses of opc_fullyopaque (two-argument cell_see_cell()) were bugs to me, so they were moved to a different model. This makes Refrigeration not work through glass walls anymore (it still works though clouds).
* Fix format string warnings.Adam Borowski2011-07-061-2/+2
| | | | | Most are annoying STL types (which can still cause crashes on exotic platforms), but there's a number of actual bugs as well.
* cppcheck: use ++p not p++ for complex types (like iterators).Adam Borowski2011-07-051-8/+8
| | | | | | | | | | | Pre-increment looks worse than post-increment, but on a C++ object the latter forces an allocation plus copy that is completely unnecessary but the compiler doesn't know that yet. Note that I did change some of our iterators to return void rather than the old or new value for exactly this performance reason before, breaking the expected behaviour. If that's an issue, tell me, we can use preincrements instead which have very little penalty.
* cppcheck: fix inefficient checking for emptiness.Adam Borowski2011-07-051-1/+1
| | | | | On some STL structures size() is slow. I did not bother limitting sed, so innocent bystanders got pulled into the machine, but there's no loss.
* Gut and parcel out most of stuff.ccAdam Borowski2011-06-041-1/+0
|
* dprf()ize a number of #ifdef ... mprf(MSGCH_DIAGNOSTICS).Adam Borowski2011-04-211-11/+3
| | | | | | | | | There's no cost for costly functions like name() anymore -- but remember, if a dprf() had a side effect before, it did happen, but now it won't outside of debug builds. I skipped anything even remotely related to combat code, to avoid making the combat overhaul merge any worse.
* Make file headers doxygen-friendly, drop useless fields.Adam Borowski2011-03-281-4/+4
| | | | | | | "File:" is shown in your editor's status bar. "Written by:" was used only for the first person who changed a file. We got git for that now, and pre-DCSS history is so woefully inaccurate it doesn't really matter.
* Fix #3436: los not updating when a door mimic is killed.Johanna Ploog2011-02-141-3/+7
|
* Give all ASSERT(false) proper messages.Adam Borowski2011-01-111-3/+2
|
* Massive spacing fixes: "( spaces after parentheses )".Adam Borowski2010-10-151-7/+7
| | | | | | I did review it manually to find places where they made sense (like some tables), but for a massive sed job like this there might be places that I missed.
* Fix some warnings.Adam Borowski2010-10-131-3/+3
| | | | | | A default: case was missing for object types that have no attached commands. Clang complains loudly about unsigned>=0 (always true), and there's no obvious way to disable this in asserts but not elsewhere.
* Ashenzari's scrying.Adam Borowski2010-10-071-4/+0
| | | | | | | Smite-targetted spells shouldn't probably work through walls, they are not blocked yet, though. I dread the thousands places that assume vision to be reciprocal...
* ... and check if it works.Adam Borowski2010-09-301-1/+0
|
* Rename class "monsters" to "monster".Robert Vollmert2010-09-051-1/+1
|
* Unbreak non-wizard builds.Adam Borowski2010-07-221-0/+4
|
* Wizard mode xray vision (Ctrl-V).Robert Vollmert2010-07-201-1/+1
| | | | | It would be nice to expose the whole viewed area, but LOS code assumes circular bounds in a few places.
* Make a few random functions static.Adam Borowski2010-07-061-1/+1
|
* For functions with names starting with _, actually declare them static.Adam Borowski2010-07-061-4/+4
|