summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/teleport.cc
Commit message (Collapse)AuthorAgeFilesLines
* Move canned_message() from stuff.cc to message.ccNicholas Feinberg2014-07-271-1/+1
|
* Improve behaviour on failure to monster teleport failure (#3839).Shmuale Mark2014-07-021-9/+4
| | | | | | | | It's fairly easy to reproduce by wizmoding Zig:1 full of plants and then teleporting a monster in there: it will probably end up in a wall. As the mantis issue says, this will basically never happen in a real game, but if it were to do so, just keeping it in place (with an appropriate message seems like the best behaviour).
* The great mon-stuff migration.Shmuale Mark2014-06-221-1/+248
| | | | | | | | | 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 scrambling.Shmuale Mark2014-04-061-1/+1
| | | | | | | It was something that was almost never relevant but that cluttered up the code regardless. If it were to be more relevant that would not really be a good thing since a chance for instadeath is rather bad design.
* Fix blinks placing the player over deep water/lava with temporary flightChris Campbell2014-03-231-2/+7
| | | | | It should only be possible with permanent flight (or on species that can swim).
* Rework the octopode crusher throwing abilitygammafunk2014-03-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | Previously this ability tried to throw victims into a "hard" dungeon feature for 50% increased damage. This was mostly an excuse add extra damage, it was almost always applied (hard dungeon features are abundant), and being next to a single hard feature doesn't have very much relevance to player strategy. The new version scores each landing site based on 1) all monsters adjacent to the site scored by the square of their difficulty and 2) how many adjacent open squares there are to the site. The end result is that hostile crushers will prefer to throw the player some place more dangerous. For non-player victims, the crusher (whether friendly or hostile) considers only distance from the player as the score, preferring to throw as far from the player as possible. The final landing site is a random weighted choice (using distance) on along the throw path from the victim to the site with the best score, with a random best site chosen if there's a tie in the scores. The minimum throw distance has been reduced to 2 squares from the player, and the damage die size is 4 * monster HD now that the hard feature check is no longer used.
* Don't crash on semicontrolled blink (#8236).Steve Melenchuk2014-03-061-2/+4
| | | | Broken by a5274fd.
* Refactored random_near_space(); fixed bugsNicholas Feinberg2014-03-051-97/+33
| | | | | | | | | | Cleaned up bugs in random_near_space(). Monsters can no longer blink through walls, or into lava/deep water. Ball lightning can be summoned over lava/deep water. [Committer's note: cleaned up a bit of code formatting and comments.] Signed-off-by: Steve Melenchuk <smelenchuk@gmail.com>
* More formatting fixes for return (...);Neil Moore2013-11-151-1/+1
|
* Get rid of all external uses of get_los().Adam Borowski2013-11-051-1/+1
| | | | | This also fixes a bunch of "act through glass" or "doesn't obey nightstalker/ lantern of shadows" bugs.
* Drop a redundant check.Adam Borowski2013-11-051-8/+4
| | | | LOS_NO_TRANS implies LOS_SOLID.
* Axe a buttload of useless #includes.Adam Borowski2013-11-031-1/+0
| | | | | Can't test Android, MSVC or Mac, but a very brief glance at the diff suggests it's unlikely they're affected.
* Prevent a few more potential clouds in solid features.Neil Moore2013-11-011-1/+2
| | | | Some wizmode-only until we get a wall-swimming form.
* A yet another rock worm + cloud fix.Adam Borowski2013-10-201-2/+5
|
* Fix some typos in comments and docsChris Oelmueller2013-08-221-1/+1
| | | | Also clarify one comment about weapon egos.
* Remove use of 'you' inside player member functionspubby2013-06-301-1/+1
| | | | | | 'you' seemed to be pointless in such context anyways, and lead to some const correctness bugs since '*this' could have a different const-ness from 'you'.
* Handle jumping spider jumpiness slightly betterPete Hurst2013-06-231-11/+17
| | | | | | | | This solves a strange case where using disjunction on a jumping spider would still cause it to jump, and where a humanoid-jumping spider hybrid could read a blink scroll which would cause them to jump. The jump check is moved into its own function on the monster class.
* Fixed lava orcs blinking into deep waterEd Gonzalez2013-06-021-8/+6
| | | | | | | | | | | | Previously, random_near_space assumed that if lava was safe, then so was deep water. Now that we've broken that assumption, this introduces a check for each feature in (DNGN_MINMOVE <= feat < DNGN_MINWALK). At the moment, this is just deep water and lava. Each such feature is first checked if the player can permanently enter it safely (as before), and then attempted targets are checked against a flag for the appropriate feature, rather than the one assumed to be more dangerous.
* Make jumping spiders jump instead of blinkPete Hurst2013-05-261-14/+23
| | | | | | | | | | | | | | | - Because they blinked they could go through grates (Mantis #5590) which didn't make sense for physical movement - Verb was wrong and purple clouds appeared despite some special- casing to prevent this; because crawl_state.which_mon_acting() actually returns an inaccurately null value during monster spellcasting and some other contexts. That function is only designed for use in handling "comes into view" messages properly and needs fixing to be fit for any general purpose. - "Appears out of nowhere" message was inaccurate, this would only have been seen rarely, but "leaps into view" is better
* Fix jumping spiders leaping when blinked.Adam Borowski2013-04-131-1/+2
|
* Player is not the Bugblatter Beast. Fixes disjunction not working against ↵Pete Hurst2013-03-141-2/+2
| | | | monsters that can't see you.
* Handle non-item sources of -TELE.Adam Borowski2012-12-291-1/+1
| | | | | | Currently, that's only sprint, and not for blink. This fixes relevant spells and abilities being usable but then doing nothing.
* DisjunctionBrendan Hickey2012-11-181-5/+13
| | | | | | | | | Level 8 translocation spell. Blinks away everything with diminishing probability with: P(~blink) = 0.8^(1/(dist+1)/(dist-1)) Over 10 ticks, a monster adjacent to the caster will blink with probability 0.9. Monsters may be blinked repeatedly.
* Use std namespace.Raphael Langella2012-08-261-8/+8
| | | | | | | | | | | | | 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.
* Do not crash when a constricted monster fails to blink.Neil Moore2012-07-071-7/+26
| | | | | Also, add messages for this case, and tweak the message when it does manage to escape by blinking.
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-13/+13
|
* Blink isn't guaranteed to work when constricted (2 escape attempts).Raphael Langella2012-07-041-0/+3
|
* A little optimization in random_near_space.Raphael Langella2012-05-231-8/+8
| | | | Just move some initialization outside of the loop.
* Use actor->is_player() instead of (actor == &you) as well.Adam Borowski2012-03-221-1/+1
| | | | | | | Not so sure here as the latter is a bit faster (comparison with a constant vs a virtual method call), but consistency is good. Perhaps we should use the latter way after all? In any case, it should be the same everywhere -- if someone has some insight, say a word so we can sed it again.
* Make fleeing monster blink_away when reading the scroll.Raphael Langella2012-02-281-6/+4
| | | | Instead of doing a random blink.
* Allow random blinks and teleport to put the player on mimics.Raphael Langella2012-01-241-1/+0
|
* Get rid of interactions between constriction and translocations.Adam Borowski2012-01-051-31/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * It's abusable: have problems teleporting (a randart with -TELE you can't easily swap, Abyss, limited means of teleportation, etc)? Summon a snake, aggro it, Teleport Other. Want to teleport a non-teleportable monster (statue, curse skull)? Same, without the need to aggro. * Inconsistent with anything else that hampers movement (nets, web traps, shallow water, leda). * If a snake's flesh cannot be teleported through, how come you can blink past a row of snakes? Or teleport through tons of stone? * An interface nightmare for Op/Na players. We'd have to implement a way to disable constricting -- or you'll die to the first pack of blink frogs you can't steamroll. Another needed command: "let go", if you're surrounded and need to run. * It's another big boost to something already thoroughly overpowered, both for players and monsters. I'd apply this nerf _and_ at least halve the damage. * Snake:5 without stasis: was considered dangerous before; now it's sure death if you get teleported into the main vault. Even if there was no extra damage, one of big nagas around you is bound to land a hit the turn you kill the previous constrictor.
* Don't use a turn trying to tele/blink when constricted.Neil Moore2011-12-291-0/+9
| | | | | | Also, change the status information: when you would be prevented from teleporting, make the "Constr" status light red, add "-Tele", and add a note to @.
* Avoid doubled "along for the ride" messages.Neil Moore2011-12-281-1/+5
| | | | | | | Also, avoid giving both "you release your grip" and "you lose your grip". As a side affect, attempting but failing to move (because of an impassable target, beholding, or fearmongering) no longer releases constrictions.
* Do not lose constriction when teleporting.Neil Moore2011-12-281-1/+4
| | | | | | | | | | | | | | | Add a flag (default true) to actor::move_to_pos(), actor::moveto(), and move_player_to_grid() indication whether clear_far_constrictions() should be called. When teleporting or blinking, pass false as that flag, pull along constrictors/constrictees, and only then call clear_far_constrictions(). Eronarn points out that it would be better to use an enum for the type of motion, rather than the (now two) boolean flags. I agree, but this is a much bigger change so I have not done so yet. It is still possible to get "comes along for the ride x2" if the teleporter is contricting and constricted by the same actor.
* Replace a hardcoded constant in an (approximately) million places.Adam Borowski2011-12-271-1/+1
|
* Merge branch 'constriction'Adam Borowski2011-12-221-0/+14
|\
| * Whitespace fixes.Adam Borowski2011-12-221-5/+4
| |
| * constrict w/o attack, more transloc effectsblueDave2011-12-221-0/+5
| |
| * constriction -- teleport and blink effectsblueDave2011-12-221-0/+10
| |
* | Change seen_context from strings to enums, slightly untangle it.Adam Borowski2011-12-051-1/+1
|/ | | | | | | | | | It's still a terrible mess. I didn't manage to understand it well enough so all[1] functionality is preserved, at the cost of clarity. I unified some values that are functionally identical, but not yet all. [1]. The context is reported only as a number in crash dumps, a minor regression but 1. saves speed, 2. it'd be a matter of copying the enum names if someone actually needs this.
* Interrupt passwall when hit by dispersal or otherwise blinkedChris Campbell2011-11-101-0/+3
|
* Apply the new feature mimic implementation to all types.Raphael Langella2011-09-051-0/+1
| | | | | | | | | | Starting from D:10, any door, stairs, escape hatch, shop fountain and portal has one chance in 100 of being a mimic. Branch entry vaults can be placed with a branch entry mimic. No mimics in the temple and the vestibule. For now, those are the only excluded places.
* 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.
* Store the blame when clouds are placed.Adam Borowski2010-12-261-3/+2
| | | | | The kill type and kill category are still needed only because we currently lose blame data when the agent dies or moves off-level.
* Make blink use is_feat_dangerous to exclude cells.Raphael Langella2010-12-021-3/+5
|
* Allow to dig/LRD/shatter iron grates. No stone of earth, passwall or boring ↵Adam Borowski2010-10-181-6/+6
| | | | beetles.
* Allow merfolk/kenku to blink over deep water/lavaRaphael Langella2010-10-051-1/+7
| | | | This fix mantis 1522
* Make jumping spiders leap not blink.Adam Borowski2010-09-131-3/+7
| | | | | | They used blink_{away,close}(), which already disallows blinking through glass, so all that needed to be done was adjusting the message and removing the tloc cloud.
* Rename class "monsters" to "monster".Robert Vollmert2010-09-051-4/+4
|