summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.h
Commit message (Collapse)AuthorAgeFilesLines
* Have monsters check constriction before using knockback abilitiesgammafunk2014-07-021-0/+1
| | | | | | | | | | If a monster is constricting a victim, don't allow it to use a spell or ability that would knock the victim back, thus breaking the constriction. I made this commit when I was considering giving op crushers primal wave, an idea that I dropped, but the check should still be there, and this does move otherwise duplicated code to a single method.
* Don't pause the game for offscreen explosions.Neil Moore2014-06-081-1/+1
|
* Rename nuke_wall() destroy_wall()reaverb2014-06-051-1/+1
| | | | and also change a temporary variable name to avoid overshadowing
* New monster spell: Drain Magic.Steve Melenchuk2014-05-101-3/+3
| | | | | | | | It's an antimagic enchantment, borrowing the code from melee antimagic (which now internally refers to the new beam type). I have a vague notion that this might remove antimagic effects from the caster at some point, but that's for later.
* Remove the interaction between disintegration and statue enemies.Steve Melenchuk2014-05-101-1/+0
| | | | | ...which turned them into "do you have a wand of disintegration" check and nothing more.
* Let stabbing with blowgun attacks extend effect duration (elliptic).Steve Melenchuk2014-04-271-1/+1
| | | | | | | | | | | | Poisoned needles deal more poison damage; curare has its effect amplified; duration-based needles have their durations extended (except frenzy, possibly for now). The needle of paralysis hits the stone giant in a vulnerable spot!!!! This code might have some side effects based on the dur paramater of enchant_monster_with_flavour being meaningful for the duration-base needle enchantment types; if so, that'll need fixing.
* Ranged attack brands!Steve Melenchuk2014-04-271-0/+1
| | | | | | | | | | | Launchers use the equivalent melee brand effects if the missile isn't an elemental brand (or the attacker is Nessos). Missiles have their own set of effects; flame, frost, and poison use effects basically identical to weapon brands, and everything else has its old effect back. The lajatang of Order works again. Hooray!
* Basic ranged attack functionality.Steve Melenchuk2014-04-271-0/+3
| | | | | | | | | | Moves a lot of code from melee_attack to attack to be shared with ranged weapons. Handles the entire basic attack process - checks to-hit, calculates damage, prints messages as necessary. TODO: attack delay, brands.
* Generalize and clean up some beam initialization code.gammafunk2014-03-061-1/+1
| | | | | | | | | Adds bolt_parent_init() which copies the most useful set of properties from a "parent" beam to a "child" beam. Use this in three relevant places in beam.cc where lots of individual property copying was done. I've also moved the enchant power setting bits for teleport self and sleep to a more reasonable place.
* Allow the draw delay for explosions to be changed (as it can for beams)DracoOmega2014-03-061-0/+1
|
* Stop enslave soul from sometimes wasting resources.wheals2014-02-231-0/+2
| | | | | | If the monster wasn't valid or was too close to dead. It's still possible to waste turns if you fail the check for success, though.
* Magically-penetrating projectiles pierce through shields.Steve Melenchuk2014-02-041-2/+2
| | | | | | | | Thus, bolts of penetration (and arrows of penetration from Piercer), but not large rocks. In my brief testing this is not extremely noticeable, but the times when it is should make all the difference.
* Fix curare source and target being switched. (wheals)Pekka Lampila2014-02-041-1/+1
|
* Make some unrands more interesting, bring back twowheals2014-02-031-0/+2
| | | | | | | | | | | | | * Make Zhor have rC+++ (as it is it has some trouble competing with a robe of resistance) * Make Leech drain hp on all hits, rather than 3/5ths like other vampiric weapons * Bring back Sniper: it's a +15 vorpal crossbow with slower fire (ranged dark maul) * Bring back Snakebite: it's a +5 venom dwhip that curares the defender on 1 out of 5 hits * Make the Singing Sword a bastard sword (this is fairly big buff, but it still has no brand) * Remove Bullseye, give Gong 21 more SH and 5 less EV (remaining a normal-sized shield)
* Drop double newlines where they seem to serve no purpose.Adam Borowski2013-12-211-2/+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.
* Fix spelling of "targeting" (#7837)Chris Campbell2013-12-101-1/+1
| | | | See Mantis for discussion.
* Don't let Dryads walk through treesChris Campbell2013-12-031-1/+0
| | | | | | | | | | Being able to awaken trees and pull you next to them is a strong combination on its own, it's not necessary for them to also hide in the trees while doing so. Removes a lot of code for handling wall movement since rock worms are gone too, but leaves HT_ROCK - it appears that spatial maelstroms sort-of-use it (not sure if they actually need it, though).
* Replace `mpr(s, ch)` with `mprf(ch, s)`Adam Borowski2013-11-291-1/+1
| | | | | | | | | 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.
* Blame the player for effects from known /RE and chaos (#7576)Neil Moore2013-09-271-0/+2
| | | | | | | | | | | | If the effect was unpredictable but the source was known to be unpredictable, set beam.effect_wanton, and use that instead of just effect_known to determine whether gods should assign blame. There are only a few remaining direct uses of effect_known; perhaps they are no longer needed? Also, don't treat contamination from haste or invis as intentional unless it was the player who cast the spell.
* Don't crash on reflected needles.Neil Moore2013-06-251-1/+1
| | | | | | We were checking the weapon of the beam's agent(), but reflected beams returned the reflector, not the original agent. Add a new parameter to bolt::agent() to handle this.
* Tracers for cloud spells for both players (#2491) and monsters.Steve Melenchuk2013-03-171-0/+4
| | | | | | | | This updates the beam code to check for the impact of a cloud forming at the beam's endpoint, and updates the player implementations of the cloud spells to fire a tracer cloud at that endpoint; thus players will be warned for targetting themself and/or allies, and monsters will take allies into consideration when using cloud spells.
* Add formatting fix.David Lawrence Ramsey2013-02-131-1/+2
|
* Fix inconsistencies in bolt struct references.David Lawrence Ramsey2013-02-131-1/+1
|
* Make targeters aware of monsters their beams cannot hitDracoOmega2013-02-031-0/+1
| | | | | | | | Previously there was no way for beam targeters to know that they could never hit certain things, such as orbs of destruction or plants under Fedhas and would imply that explosion spells would terminate upon them, if the player was trying to aim through them. Now they should properly match the path the beam will actually take.
* Make I and z? usable again in debug builds.Adam Borowski2012-11-271-0/+3
| | | | | | | | Since 1f7c9b4d, if you know even a couple beam spells, you need to go through several --More--s every time a spell list is shown. These tracers are not really useful for debug purposes as you can get a regular tracer if you want, so there's no reason to show them all.
* Don't bother estimating minimal damage in beam tracers.Adam Borowski2012-10-031-1/+1
| | | | | The result was almost always 0, and even if it was not, its value was not meaningful in any way, due to floorings.
* Make melee combat use common AC code.Adam Borowski2012-10-031-11/+0
| | | | No functionality changes here, as melee always use regular AC rules.
* Use std namespace.Raphael Langella2012-08-261-24/+22
| | | | | | | | | | | | | 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.
* Get Fireball tracers and targetter to work properly.Steve Melenchuk2012-08-021-2/+4
| | | | | | | | | This involves a substantial overhaul of targetter_beam to retain more information about the beam, and changes to tracers to allow that information to reach all the way into the relevant depths of the beam code. Fixes #6020.
* Make "visible monster in range" spell check more sophisticated.Steve Melenchuk2012-07-301-0/+1
| | | | | | | | | | | | | | | The old system merely added a bonus range square for certain spells, which led to issues in some edge cases. The new check employs tracers to see if targetting anything within range will actually harm an enemy. Cloud spells (other than Mephitic Cloud, which is more akin to a Fireball in its implementation) aren't handled by either the new or the old system, but they probably could be worked in with some additional effort. Fixes #2068.
* Don't prompt in the middle of targetting.Neil Moore2012-07-151-0/+1
| | | | | | | | | | | | If you aimed a beam targetter (including IMB and Fireball) past a statue, every move of the targetting cursor would prompt about whether you really want to shoot when your fire is blocked. The code checks for thing like BEAM_VISUAL, but we use the real beam type to properly resolve bouncing etc. Instead, add a new flag is_targetting and use that for the beam targetters. The smite and LRD targetters don't set is_tracer and is_targetting; perhaps they should for consistency.
* IMB tracer and targetting improvements.Steve Melenchuk2012-07-111-0/+2
| | | | | | | | | | | | | | IMB tracers now account for the possible explosion, so that the player will get appropriate warnings and IMB-wielding monsters will consider the affect that the spell could have on allies. Thus, this fixes 0005823. There's also now a dedicated targetter for IMB, employing the same code to determine what squares can be affected as the tracer, which has been split out from the relevant section of the beam code. Finally, on account of the above split, the IMB explosion code itself is now a bit cleaner.
* Simplify and sanitize beam AC code, allow beams with proportional AC rule.Adam Borowski2012-06-221-1/+13
| | | | | | | | | Bugs fixed: * white draconian breath worked differently vs players and monsters * tracers didn't know about triple AC reduction * AC was queried many times (needs to scan all armour, etc) Bugs added: * ook? I bet there's something :p
* 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.
* Always id scrolls of fear as well.Adam Borowski2011-11-201-3/+1
| | | | It's a no-brainer to read-id unknown scrolls next to a kobold.
* Don't pass the victim to range_func, it's useless.Adam Borowski2011-11-061-3/+2
| | | | And makes it harder to get rid of cleanup_dead = false.
* Remove the ranged brand of reaping (unused for over a year).Adam Borowski2011-11-061-3/+2
| | | | | Fixing it is possible -- if you want that, please revert this commit and do the work, using the new melee design.
* Fix ranged combat fsim.Raphael Langella2011-10-071-0/+1
| | | | It still a bit slow, but it works.
* Item mimics use the new generation algorithm too.Raphael Langella2011-09-051-1/+0
| | | | | | | Also remove the teleport and change behaviour. Speed is reduced to 8 so they are still easy to escape. They start being generated at dungeon level 7. Any item has 1 chance in 500 of being a mimic.
* Eronarn's profane servitors and antihaloesChris Campbell2011-09-031-0/+1
| | | | | | | | | | | | | | | | | | | | Profane servitor: An angel twisted into an undead monster by Yredelemnul. He gifts these as a new tier above bone dragons. They are in Yred's elemental colors, generated wielding a demon whip, probably slightly better than a bone dragon in melee, and have res holy instead of holy vuln like most undead. It also generates an umbra. Only Yred gifts spawn them currently though they'd be great for some vaults. umbra: An 'antihalo' composed of flickering darkness, which is the opposite of a halo. Creatures in an umbra are harder to hit with both ranged/melee, but get a stealth bonus. Currently only profane servitors generate an umbra. Demons, undead, and worshipers of Yredelemnul (at **+ for players, but all monsters) aren't harmed by an umbra but still get the stealth boost. The patch also changes the "Glow" status light to "Contam", and displays "Glow" when actually backlit (for whatever reason: halo, sticky flame, corona).
* Don't miscast when the spell can still be aborted (#4281).Raphael Langella2011-07-211-4/+7
| | | | | | | | | | | | | | | | This is a significant refactoring. All the spells now return a spret_type and take a boolean which tells if the spell has actually failed. Also some code clean up in _do_cast(). All spells have their own function now. Also fix the following bugs: * Properly abort fire storm if forced casting on a wall with '!'. Also put a message for forced out of range casting (like cloud spells). * Casting summon elemental on an invisible monster aborted with no cost. * if a summoning spell aborts because create_monster fails, you don't lose a turn. You still get a chance of miscast in this rare case. * s2s, tukima and branding spells abort properly instead of consuming turn and MP when player is not wielding appropriate object. * s2s abort message when wielding a non-snakable.
* Make cppcheck a bit happier.Adam Borowski2011-07-051-1/+1
|
* Kludge beams to never hit the same person more than twice.Adam Borowski2011-07-041-0/+1
| | | | | | | | | | | | The physics works well in other cases, and here it works realistically. Too bad, this leads to quirky play where players spend too much time lining up shots into corridor entrances. How to hit someone twice is intuitive, how to do that thrice is not. A surprise one-turn death from a wand or an elf mage is not that fun either, double hits keep staying out of bounces vital while putting a cap on deadliness. It does nerf early AEs, we may want to compensate them somehow.
* Make file headers doxygen-friendly, drop useless fields.Adam Borowski2011-03-281-5/+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.
* Track the source of monster enchantments.Adam Borowski2011-02-231-4/+4
| | | | | | This fixes Injury Mirror not working for delayed damage, kills done by undead/demon allies not counting as such, damage tracking not handling ench damage, etc.
* Make monster tracers round up average expected damage so that monsters like ↵Darshan Shaligram2010-12-081-0/+1
| | | | oklob plants will use ranged attacks on high-AC targets.
* Simplify phrasingRaphael Langella2010-11-071-1/+1
|
* Move monster invisibility enchantment handling into its own function.David Lawrence Ramsey2010-10-271-0/+2
|
* Make some functions static, remove unused among those.Adam Borowski2010-10-271-4/+0
|
* Massive spacing fixes: "( spaces after parentheses )".Adam Borowski2010-10-151-6/+6
| | | | | | 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.