summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/attack.cc
Commit message (Collapse)AuthorAgeFilesLines
* Tweak defender_name method and use it more.Neil Moore2014-08-071-10/+10
| | | | | Have it take a parameter indicating whether reflexive is allowed, and replace existing calls to defender_name() and def_name(DESC_THE).
* Slightly improve a message.Neil Moore2014-08-071-1/+2
| | | | "The goblin blocks its own attack." instead of just "... its attack."
* Don't let arrows melt, burn, or freeze themselves (rockygargoyle)Neil Moore2014-08-071-1/+2
|
* Further fix compilation.Neil Moore2014-08-031-1/+1
|
* Hide a hack better.Shmuale Mark2014-08-031-9/+5
| | | | | | | Ideally, we wouldn't be using special for unrands totally different from how items of the same type do, but that's less trivial than this commit. A centralised place to check for being an unrand should at least make such a change easier.
* Remove stuffNicholas Feinberg2014-07-291-1/+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!
* Move canned_message() from stuff.cc to message.ccNicholas Feinberg2014-07-271-0/+1
|
* Provide and use a public interface to pronoun declensions.Neil Moore2014-07-201-7/+2
| | | | It's in mon-util.h for now but probably should go somewhere else.
* Use correct stats for reflected range attacks (#8794)Neil Moore2014-07-171-22/+22
| | | | | | This should make reflected needles work while preserving the old blaming behaviour (a player reflector gets kill credit but not god blame). Needs more thorough testing.
* Fix reflected attack damage (PleasingFungus, doh)Neil Moore2014-07-141-1/+3
|
* Don't crash when reflecting a missile at a monster (#8792)Neil Moore2014-07-141-2/+7
|
* Make draining decrease monster attack damageNicholas Feinberg2014-07-131-1/+3
|
* Make draining temporary (for monsters)Nicholas Feinberg2014-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hit dice-reduction effect of draining has historically had several problems. It reduced monsters' maximum hp, which made it look like they were getting *less* injured, since they had a higher proportion of hp remaining. It lowered monster XP & piety gains, which was irrelevant but misled new players who somehow learned about it. It occasionally led to "degenerate" hit-and-run tactics. And most damningly of all, it hardly ever mattered - it triggered on ~13% of hits, which meant that on low HD monsters the extra damage would kill them before the effect was noticeable, and against high HD monsters, the effect would only ever be noticeable at all with the aforementioned hit-and-run tactics. So, to fix those problems, draining now gives a "drained" status, that reduces monster HD for most combat-related purposes (spellcasting, accuracy, damage, etc.), but not max hp, xp, or piety. This is temporary, but will last 20-30 turns, and refreshes every time the drain triggers - essentially, it should last until you kill the monster, unless you run away. The temp-status is now applied to the monster every time they get drained; the chance of the drain brand activating has been reduced to 1/2, from 2/3. This should focus the effects of the brand more on the unique part of it, the draining/weakening effect. As a bonus, this also means that players can no longer have their followers permanently weakened by draining effects. Beogh buff!
* Separate 'permanent' and 'temporary' monster hit diceNicholas Feinberg2014-07-131-2/+2
| | | | As part of a wider scheme to make draining temporary.
* Refactor weapon_skill()Nicholas Feinberg2014-07-131-4/+1
| | | | | | | | | | | | | | This function was misleadingly named (it only provided the skill used for melee weapons, not ranged weapons), and incomplete; code along the lines of "is_ranged_weapon(*it) ? range_skill(*it) : weapon_skill(*it)" was scattered in about half a dozen different functions. I've corrected both of those problems (renaming weapon_ skill() to melee_skill() and adding item_weapon_skill()), and also possibly fixed two bugs in the process - an l_you.cc function that claimed to provide the skill used for the starting weapon (but actually only gave the melee skill), and unrand creation code that checked if a potential unrand swap used the same (melee) skill as the weapon type being generated.
* Fix magical staves always doing 0 damage (#8771)Policarpo Caballero2014-07-091-1/+1
|
* Apply shadow form damage reduction to ranged attacksChris Campbell2014-07-091-0/+4
|
* Don't apply unarmed melee bonuses from forms to throwing weaponsChris Campbell2014-07-091-3/+2
|
* Remove unused parameters from umbra() and backlit().Neil Moore2014-07-051-2/+2
|
* 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.
* Remove the dragon slaying brandreaverb2014-06-181-19/+2
| | | | | | | | Generally it doesn't create interesting decisions because dragons are such a small group and are mostly a subset of monsters slowed by the freezing brand. In addition, it has rather arbitrary effects against players, hitting some for an degenerate amount of damage while ignoring others.
* Make profane servitors ignore holy wrath, like holy energy (#7089).Shmuale Mark2014-06-171-5/+2
|
* Rename "vampiricism" to "vampirism" (ChrisOelmueller, #8435)reaverb2014-06-151-6/+6
| | | | | | | Chris Oelmueller made an excellent patch for this, but unfortunately it was rather rotted by the time somebody decided to look at it. It was easier to recreate than update. I've also added some tiles stuff which was missed in the original patch.
* Plus2: Turn .plus into slayingNicholas Feinberg2014-06-141-10/+14
|
* Combine plus/plus2 for rings of slaying, and Acc+/Dam+ on artefactsChris Oelmueller2014-06-131-7/+5
| | | | | | | | | | Phase out ARTP_ACCURACY, rename ARTP_DAMAGE to ARTP_SLAYING which now combines both Acc+ and Dam+ bonuses. Bracers of archery are +4 now instead of +5,+3. [Committer's note: fixed a description and cleaned up various other small issues.]
* Revert "Make random_choose_weighted() end on -1 weight"reaverb2014-06-101-2/+2
| | | | | | | This reverts commit 7e81480cda18144ff185f5248639a072b654deff. Turns out I missed some calls to random_choose_weighted(), this change might not even be worth doing.
* Make random_choose_weighted() end on -1 weightreaverb2014-06-101-2/+2
| | | | For consistency with random_choose().
* Combine the frost/flame and freezing/flaming brands.Shmuale Mark2014-06-101-7/+0
| | | | | | | Elec and venom launchers already use the same brands, and with ranged code more similar to melee code this change actually simplifies most code. There should be no gameplay change though some weird brand picking code for launchers was refactored, which might have some effect.
* Fix Confusing Touch's damage reductionNicholas Feinberg2014-06-011-2/+0
|
* Rework Confusing TouchNicholas Feinberg2014-05-291-10/+4
| | | | | | | | | | | | | | In its previous state, it was fiddly, misleading, and kind of overpowered. So: Raise it to level 2 (& remove it from Cantrips, replacing it with Corona). Remove the stacking-duration effect & increase the initial duration. Set damage of all hits to 0, and make the first successful (confusing) hit end the effect. This should still be useful, but in a level 2 kind of way. We'll see how that pans out.
* Correct a comment I screwed up.Neil Moore2014-05-291-2/+3
| | | | And update another comment to match it.
* Correct some doxygen blocks.Neil Moore2014-05-291-1/+1
| | | | | Some of them were missing the /** (or /*!) that makes doxygen consider the comment in the first place.
* Destroy item destructiongammafunk2014-05-281-1/+1
| | | | | | | | | | | | | | | | | | | Now that inventory weight and player burden states are gone, item destruction doesn't serve one purpose it clearly accomplished: help prevent the player from being at or next to burden capacity at all times. Outright destruction of strategic consumables encourages more needless inventory management, so we'd like to exclude these from any form of destruction and possibly prevent them from taking up inventory space at all. Denial of tactical consumables, either temporarily or permanently, is something we're going to look into later on, possibly in the release after next, since it can create interesting and generally not frustrating gameplay if done correctly. Needless to say, item destruction wasn't a player favorite and may have a sparsely attended funeral. RIP in peace. For now we aren't adjusting the rate of consumable generation to compensate for no item destruction, but that balancing will happen after play-testing shows how much adjustment is necessary.
* Clean up a weird bit of melee damage code (#8390).Shmuale Mark2014-05-201-2/+1
| | | | | I can't imagine that this will have a noticeable effect on gameplay and otherwise the code around that point is quite nice.
* Condense three functions into one.Steve Melenchuk2014-05-191-25/+4
|
* Replace corrosion with a temporary effect.Shayne Halvorson2014-05-141-0/+3
| | | | | | | | | | | | | | | | | | | | If your equipment would have been corroded under the old system, you now get a temporary (but stacking) -5 AC and -3 weapon damage. Corrosion against armour-wearing monsters instead halves their AC. Committer's notes: Fixed whitespace and fit to Trunk Added Corrosion entry to hiscores.cc The original patch showed the slaying malus on the weapon, which may be preferable to a status light. gammafunk noted that ouch.cc iterates over equipment when deciding when to corrode, this might make less sense under the new system. -reaverb
* Consistantly use "antimagic" instead of "anti-magic" (MarvinPA)reaverb2014-05-111-1/+1
|
* New monster spell: Drain Magic.Steve Melenchuk2014-05-101-24/+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.
* Hacks to get Hellfire working as intended.Steve Melenchuk2014-05-051-0/+16
| | | | | | About half of this code is to get the attack to show the flavour as "hellfire bolt". This could probably be redone by having the attack class have some kind of projectile name field.
* Nerf throwing (#8493).Steve Melenchuk2014-05-041-16/+17
| | | | i.e. don't consider the weapon the player is using when throwing things.
* Some fixes related to clumsy bashing.Steve Melenchuk2014-05-031-1/+1
|
* More fixes for throwing.Steve Melenchuk2014-05-011-1/+79
| | | | | In particular, give the damage bonus for skill that was supposed to happen with the rewrite.
* Fix some more weapon checks for throwing purposes.Steve Melenchuk2014-05-011-12/+17
| | | | Wielding a weapon should not influence throwing at all.
* Fix some invalid assumptions regarding throwing attacks.Steve Melenchuk2014-05-011-4/+5
| | | | | Namely, it was using unarmed combat skill for to-hit calculations, and even then only if you weren't wielding anything.
* Make ranged attacks play a bit nicer with fsim.Steve Melenchuk2014-04-281-4/+5
| | | | | Report accuracy correctly; don't let some effects like blood splatter and distortion trigger (as with old melee attacks).
* Credit attacker, not defender, for attack kills.Steve Melenchuk2014-04-271-1/+1
| | | | Oops.
* Handle gloves of archery properly with new ranged combat.Steve Melenchuk2014-04-271-2/+8
|
* Let stabbing with blowgun attacks extend effect duration (elliptic).Steve Melenchuk2014-04-271-21/+5
| | | | | | | | | | | | 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.
* Give M_ARCHER monsters their acc/dam bonuses back.Steve Melenchuk2014-04-271-4/+1
| | | | | | | | | | Sort of similar to how M_FIGHTER gets a melee accuracy bonus, I think this has a place here. The numbers are a bit complicated; the old code gave an ammoHitBonus of random2avg(HD * 4 / 3, 2) to the beam hit which is later added to the damage bonus. Since the randomisation here works differently the 4/3 is straight-up added to the to_hit and randomised when added to the damage.
* Ranged attack brands!Steve Melenchuk2014-04-271-4/+946
| | | | | | | | | | | 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!