summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fineff.cc
Commit message (Collapse)AuthorAgeFilesLines
* Let BLOOD finally have its place in the sunNicholas Feinberg2014-07-011-1/+1
| | | | | | ...by moving bloodspatter functions into their own file. Death to misc.cc! Long live the new file hierarchy!
* 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.
* Correct the call to apply_location_effects() in trampleNicholas Feinberg2014-06-211-1/+2
| | | | Doesn't seem like this ever matters, but it's the principle.
* Make trampling trigger traps (Jazzimus, 5183)Nicholas Feinberg2014-05-281-0/+1
|
* Don't mirror mirrored damage (#4171).Steve Melenchuk2014-04-251-0/+2
| | | | | Yredelemnul presumably doesn't want damage bouncing back and forth like this.
* Make rakshasa defense cloning a fineff and take energy (elliptic).Steve Melenchuk2014-04-081-0/+30
| | | | Prevents crashes related to tornado and monster positioning.
* Remove shock serpent lightning torrent, adjust discharge / statsDracoOmega2014-03-111-2/+9
| | | | | | | | | | | | | | | | | | | | | | Lightning torrent didn't work as well as hoped, in practice. The intent was that it be dangerous unless actively controlled by quickly hitting the serpent, but be much less threatening if you did this. However, between misses and low damage hits, it was quite possible to be attacking a serpent continuously and still fail to prevent the torrent. Even worse, if the serpent was obstructed by other monsters, there was often no good way to keep it from unleashing the attack the moment you killed what was in front of it. A fast monster with relatively threatening attacks is likely already a priority target without the need for some other specific mechanic to encourage this. Thus, lightning torrent is removed, and the retribution discharge is made dependant on the damage inflicted upon it rather than time from last discharge (with starting hits triggering a larger shock). Also raise HD (and thus AF_ELEC damage) slightly, while lowering their base melee, to shift the damage just a touch more from physical to elemental. This also fixes a bug where the discharge would not trigger on any attack that actually killed the serpent.
* Make all abyss teleports shift the Abyss (minmay).Shmuale Mark2014-03-081-1/+1
| | | | | | | | | | | | | | | | Partly this is to (somewhat) make the Abyss a little easier. Teleports still take longer than orbrun teleports to kick in on average, and in general letting the player know what an action will do is a good thing. But the main reason is that, due to maprot, same-area abyss teleports are a pretty awful interface screw. You are prevented from remembering what monsters were around (this was quite annoying when being marked was more common in the abyss), and though you can see for one second what direction you came from, immediately after the screen refreshes and you can't anymore. Possibly this could lead to improving/removing altogether maprot.
* Don't arc electricity when attacking with an elec weapon in waterChris Campbell2014-02-091-13/+0
| | | | | | The main thing it did was cause annoying prompts when you could hit yourself or an ally with the arc. It was rarely relevant other than that, and just made elec brand a bit more complicated unnecessarily.
* Revamp shock serpentsDracoOmega2014-01-281-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the original version may have been conceptually interesting, it had multiple mechanical problems. Even putting aside the bugs in the implementation of monster static discharge, frying its allies when injured doesn't seem like a good mechanic to me, and the way static discharge jumps means that many messages are generated for every single event (for similar reasons I don't think it works very well as an active spell for them either). Also, shock's damage scaling meant it was basically harmless on a monster of this tier - a cantrip as best. This commit attempts to take the central concepts of the original design and make it a more effective and workable monster. Shock serpents now passively gather charge when in combat. After multiple turns of building charge, they can unleash it as an unavoidable arc of lightning aimed at their primary target (and nearby allies, in the style of dazzling spray) which does substancial damage. However, injuring the shock serpent discharges ALL of the sustained charge as a (much weaker) reprisal effect. The idea is that the player will be encouraged to suffer through the reprisal to avoid a worse attack and that it might sometimes change target priorities in a large melee or affect retreat tactics employed. In addition, I have replaced shock with a stronger electrical bolt styled after electric eels. The code duplication involved here bugs me, but shocks if far too weak and lightning bolt too strong and the electric eel bolt cannot just be made into a spell and given to both of them without reducing eel fire rate significantly. Finally, they get slight hd and melee boost, and lose the poison resistant and poisonous corpses. So much of Snake already leaves poison corpses and it doesn't seem to me that there's much need for any poison association here. Note that a great many numbers here are quite provisional, particularly charge rate and the power of lightning torrent itself.
* 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.
* Restrict mpr() to literals only.Adam Borowski2013-11-291-1/+1
| | | | | The translation project is stalled, but this makes all of such static strings trivially gatherable without any extra work.
* Make Spectral Weapon damage sharing use a fineff.Ed Gonzalez2013-06-291-1/+14
| | | | | This way the order of targets in an AoE shouldn't matter for the damage sharing leaving you with at least 1hp.
* Fixed issue with merging deferred_damage_fineff.Ed Gonzalez2013-06-291-1/+2
| | | | Merging now checks that both have the same state for attacker_effects.
* Fixed some effects being applied twice to damage.Ed Gonzalez2013-06-291-1/+1
| | | | | | | | | | | | | | When a deferred_damage_fineff is used, ::hurt is called twice. Once for the original target, and a second time for the shared target. Both calls would apply effects such as weakening from wretched and QUAD DAMAGE. While SIXTEEN TIMES damage is funny, the attacker's effects should only be applied once. Now ouch/hurt functions and the deferred_damage_fineff have an 'attacker_effects' parameter, which defaults to true. If false, then damage effects from the attacker are assumed to have already been applied. All existing uses of deferred_damage_fineff have been appropriately updated. Also applied to spectral weapon damage sharing.
* Move player hog form untransformation into a fineff (Kirke)Pete Hurst2013-05-281-0/+10
| | | | | For consistency it seems better to print the "Hogs revert" message before the player transforms.
* Use a delayed_action_fineff for Kirke and Pikel death (Mantis #5306)Pete Hurst2013-05-261-0/+13
| | | | | | | | | | | | | | | | | The issue here is that gods such as TSO *may* give penance if Kirke or Pikel are killed with an area effect, since the hogs/slaves suddenly become penance-inducing targets halfway through evaluating affected monsters. This is a) inconsistent because it depends on the sequence of monster evaluation and b) not really in the spirit of the penance because at the time you thought you were damaging things you were allowed to. Kirke and Pikel were already using a daction (to support off-level conversion of hogs/slaves), but somewhat ironically dactions are actually executed once instantly and then again later on. The new delayed_action_fineff can be used for any daction to postpone the initial execution until after other effects finish. This means all damage will occur to hogs or bound slaves *before* the death causes any still alive to get converted back, avoiding the penance issue.
* Refactor ASSERT(a && b) -> ASSERT(a); ASSERT(b);Brendan Hickey2013-04-281-4/+8
| | | | | | | 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.
* Rename kraken_damage_fineff to deferred_damage_fineffDracoOmega2013-02-211-8/+8
| | | | | There was nothing specific to kraken in the code, and there are other cases where this fineffect might be useful.
* Change the monster-inflicted injury mirror message to not use a pronoun.David Lawrence Ramsey2013-01-241-1/+1
| | | | | | "It" is not appropriate for monsters with gender or uniques, and we can't get the proper pronoun if the monster is dead from the damage anyway.
* Give mirror damage its own kill_method_typeChris Campbell2013-01-171-1/+1
| | | | | KILLED_BY_REFLECTION was intended for shields of reflection, and produced awkward messages for mirror damage deaths.
* Allow TRJ to spawn jellies on both arena teams.Neil Moore2013-01-031-1/+2
|
* Give TRJ spawns the same attitude as TRJ.Neil Moore2013-01-031-2/+12
| | | | | | | | | | | | | | | | It was possible to cause a neutral TRJ to take damage out of LOS, resulting in hostile jellies that would then attack it. If TRJ was friendly (it is possible though very difficult with a combination of scroll of vulnerability, HD reduction from draining, and enslavement), yield no jellies whatsoever; this is preferable to creating permanent allies from temporary enslavement. If TRJ was killed by the attack that triggered the spawning, its attitude is no longer available; just make the jellies hostile in that event. Fixes #6491.
* Make starcursed masses merge with a neighbour when damaged.DracoOmega2012-12-171-0/+13
| | | | | | Whenever a starcursed mass sustains non-lethal damage, they will immediately merge with a random adjacent starcursed mass. This gives players an option to help supress their proliferation, so long as they do not ignore them for long.
* Fix a Royal Jelly + fire vortex crash.Adam Borowski2012-11-161-2/+4
|
* Use final effects to pass kraken damage upwards.Adam Borowski2012-10-161-0/+20
| | | | | | | | | | | | | | | | This should avoid the rest of still notorious crashes[1], and unlike DracoOmega's ideas, doesn't turn krakens into a boring summoner-with-a-swarm -of-pets we have too many examples of. (Improvements to tentacle AI and connectivity are very welcome, I just vehemently oppose making tentacles obstacles rather than parts of the kraken itself.) I did not yet purge a lot of no longer needed checks, to reduce possible conflicts. [1]. Even though such crashes are rare now, this is what killed my record Abyss stress test run after over a week and umpteen million turns.
* Properly handle new final effects that spawn when previoud ones fire.Adam Borowski2012-10-161-9/+10
| | | | If one would merge with an existing one, the extra would be ignored.
* Fix memory corruption when merging fineffs.Neil Moore2012-10-091-5/+3
| | | | | | | | We could end up with a pointer to a deleted object in the final effects vector. Instead of replacing the old fineff with the new one, merge the new one into the old one then delete the new one. This means that fineff::schedule() may delete "this", so should only be called as (new blah_fineff())->schedule()
* Fix TRJ capitalization (elliott).elliptic2012-09-121-2/+2
|
* Fix a few fineff mergeability checks.Neil Moore2012-09-091-2/+2
|
* Fix a crash when fineffs trigger other fineffs.Neil Moore2012-09-091-2/+5
|
* Fix a memory leak when merging final_effects.Neil Moore2012-09-091-1/+4
|
* Object-orient final_effect.Neil Moore2012-09-081-108/+155
| | | | | | | | | This is mostly to avoid the bit-packing of the previous commit. Admittedly, it's a bit overkill for that. This could probably use some cleanup: currently we store attacker, defender, and position in the base class, even though not all subclasses have those.
* Bleed as a final effect.Neil Moore2012-09-081-0/+6
| | | | | | | | Killing a kraken with an attack on one of its tentacles was crashing when the attack caused bleeding, because the tentacle was killed by monster::hurt() and hence its position was invalid. See !lm @78291 crash 20 -log for an example.
* Use std namespace.Raphael Langella2012-08-261-2/+2
| | | | | | | | | | | | | 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.
* Don't crash when a dead monster makes TRJ spawn jellies.Neil Moore2012-07-301-1/+2
| | | | | We were passing _place_monster_aux() a bad monster index as the foe, triggering an assert.
* Delay Royal Jelly spawns until the end of an actor's turn.Adam Borowski2012-07-181-0/+64
| | | | | | | | | This means they can't be damaged by the same attack or spell that spawned them. Also, use div_rand_round() instead of fixed thresholds every 12 hp. They worked well when TRJ couldn't heal, but now it can repeatedly go over the same threshold.
* Use a fineff for melee distortion blinks and teleports.Adam Borowski2012-06-261-0/+5
| | | | | They can possibly cause an Abyss shift, removing the attacker in the middle of a combat call.
* Make crash frogs blink frogs again.Adam Borowski2012-06-211-1/+1
|
* When an attacker blinks due to own melee attack, do it as a final effect.Adam Borowski2012-06-201-0/+7
| | | | | | This avoids crashes if he lands in a trap or in a shaft. The defender blinking is AFAIK safe.
* Don't move a trampler into tramplee's space until after the given attack.Adam Borowski2012-05-291-0/+11
| | | | | | | | | | | | This fixes crashes if either was moved off-level. It does _not_ fix a random monster with the same mindex continuing wuth the next attack on the level you dropped to -- combat code is sprinkled with attacked/defender->alive() which happily uses a stale pointer which, while currently always pointing to an actor struct (you or menv[x]), may refer to another monster which can happen to be alive and in range. Also, for some reason attacker following doesn't obey traps. This is more fixable than it used to be, though.
* Enable flash_monster_colour calls in Webtiles.Florian Diebold2011-12-081-1/+1
| | | | | They aren't implemented in the Webtiles interface, but they should still be there for equivalence with normal console.
* Replace a bunch of floating-point sqrt()s by integer ones.Adam Borowski2011-11-131-2/+2
|
* cppcheck: use ++p not p++ for complex types (like iterators).Adam Borowski2011-07-051-1/+1
| | | | | | | | | | | 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.
* Remove a no longer valid comment.Adam Borowski2011-05-061-5/+0
|
* Fix a crash when a monster with Injury Mirror dies.Adam Borowski2011-04-271-2/+2
| | | | Don't unnecessarily call the foreign object, too.
* Use mid not mindex for delayed "final" effects.Adam Borowski2011-04-101-10/+6
| | | | | | Since these are very short lived, this shouldn't happen outside of some very far-fetched scenarios: something would have to kill a monster with a final effect and spawn a new one.
* Make file headers doxygen-friendly, drop useless fields.Adam Borowski2011-03-281-6/+5
| | | | | | | "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.
* Reduce spam when getting hit by multiple attacks while praying to Yred.Adam Borowski2010-09-241-2/+19
| | | | | | This also reduces the piety cost in that case somewhat. It should also protect against crashes or DEAD MONSTER messages in some obscure cases (and potentially introduce other bugs...).
* Don't spam for multiple Mirror Damage backlashes -- for example, weapon brands.Adam Borowski2010-09-241-0/+15
| | | | Also, this caps elec water discharges for monsters with multiple attacks to one.