summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
Commit message (Collapse)AuthorAgeFilesLines
* Simplify out a functiongammafunk2014-08-051-2/+5
|
* Hide a hack better.Shmuale Mark2014-08-031-2/+1
| | | | | | | 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.
* Create prompt.ccNicholas Feinberg2014-07-271-1/+1
|
* Move canned_message() from stuff.cc to message.ccNicholas Feinberg2014-07-271-0/+1
|
* Make rPois a bit more consistent (for players)Nicholas Feinberg2014-07-261-0/+2
| | | | | | | | | | | | Direct damage resistance from 50% to 66%. Chance of preventing poison from 90% to 66%. Chance of preventing curare from 80% to 66%. AF_STRONG_POISON (eg redbacks) no longer pierces rPois for players. Wasps (AF_PARALYSE) now have their effects downgraded one level by rPois (para -> slow, slow -> nothing) instead of outright negated. rPois should be a helpful resist to have, not a binary pass-fail check for certain areas & enemies.
* Refactor acid resistanceNicholas Feinberg2014-07-261-4/+5
|
* Comment and constify get_resistible_fraction()Nicholas Feinberg2014-07-261-13/+22
|
* Rebalance crossbowsNicholas Feinberg2014-07-131-1/+5
| | | | | | | | | | | | | | | | | | | | | | Again as a result of the ranged weapons rebalance, crossbows needed to change. The analogy here is long blades' to bows' m&f; better return on skill investment & a higher power cap, but rarer. Hand crossbows are added as a starting type, "something like an armour-piercing dagger"; crossbows are upgraded to arbalests (a little worse than a glaive), and a new rare triple crossbow type is added on the top end (a little worse than a bardiche, though with a lower skill cost.) Please note that the triple crossbow historically existed & is extremely verisimilitudinous. Hellfire is now an arbalest, and Sniper is now a triple crossbow (well, a "heavy crossbow", since it has mindelay of 27 instead of 22, and since I didn't want to have to change the sprite). All crossbows have a mindelay of at least 1.0; this is an attempt to differentiate them. Possibly something more ambitious will be attempted in 1.6, but this is a first step.
* Refactor weapon_skill()Nicholas Feinberg2014-07-131-2/+2
| | | | | | | | | | | | | | 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.
* The great mon-stuff migration.Shmuale Mark2014-06-221-0/+45
| | | | | | | | | 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.
* Rename BEAM_NAPALM to BEAM_STICKY_FLAMEreaverb2014-06-111-1/+1
|
* Whitespace fix.Steve Melenchuk2014-05-161-1/+1
|
* Doxidise a comment.Neil Moore2014-05-151-2/+10
|
* Fix reaching attacks sometimes taking no time.elliptic2014-05-151-1/+3
| | | | For instance, the killing blow with Wyrmbane did this.
* Balance cleaving order better when no walls are adjacent to the attacker.elliptic2014-05-071-2/+3
| | | | | Previously it would always attack the square directly opposite the target first, now it targets that either first or last.
* Remove more instances where directing a cleave at empty space is optimal.elliptic2014-05-071-1/+11
| | | | | | | | | | | | | | | | | | | | c876910 made some progress towards this, but left situations like o@o oo. where the player must attack the empty space in order to be guaranteed to hit all the monsters. Now attacking any direction will hit all the monsters in this situation. This is implemented by making the cleave targetter try to go more than 3-4 squares around in each direction if the attacker is next to at least one wall. Walls still stop cleaving as normal, so in the situation O@o the player has to choose whether to hit the ogre or the five orcs, as before.
* Merge branch 'ranged_combat'Steve Melenchuk2014-05-031-3/+0
|\ | | | | | | | | | | | | The implementation is done; from here on out it's all balance work, and that's better done in trunk. Release the ogre hordes!
| * Remove the special-casing for launcher min delay.Steve Melenchuk2014-05-011-3/+0
| | | | | | | | | | This impacts blowguns, whose mindelay goes to 5 (was 7), slings to 5 (was 7), bows to 5 (was 6).
* | Make cleave hit 8 squares instead of 7Chris Campbell2014-05-011-5/+6
|/ | | | | | Hitting 7 squares results in occasional awkwardness where attacking empty space is the best way to target enemies, and the difference between 7 and 8 isn't a significant factor in cleaving's balance.
* Formatting fixes.Neil Moore2014-03-071-4/+0
|
* Rename unchivalric_attack_type and friends.Shmuale Mark2014-03-061-18/+16
| | | | | | The enum values were never checked in any code relating to chivalry, except to see that a value wasn't 0 (ie it was a forbidden stab). A recent bug arose from the bad naming, too.
* Fix stabbing.elliptic2014-03-061-6/+6
| | | | | | | | | Commit 8afe6cab changed is_unchivalric_attack() without realizing that this is actually the function that controls whether you get a stab and how strong the stab is. This commit reverts the part of 8afe6cab that changed that function, adds a comment cautioning against this, and adds a check for mons_is_object() in tso_unchivalric_attack_safe_monster() just in case (though intelligence checks probably already caught this).
* Fix a crash in is_unchivalric_attack. (gammafunk)Pekka Lampila2014-02-201-1/+1
|
* Fix to attack penance warnings.gammafunk2014-02-191-5/+11
| | | | | | | | | | | | | | | | | Currently if you melee an "object" (according to mons_is_object()) such as a conjured ball lightning, you get a penance warning if worshiping TSO. This is a "bad attack" and should give a prompt, but will not cause penance. This commit fixes this by making the necessary call to god_hates_attacking_friend() to determine if penance would occur. This also fixes the case when you attack allies/followers under beogh, which currently doesn't give a penance warning (although it does give a bad attack warning). This commit also cleans up is_unchivalric_attack() so that attacking an object is not reported as unchivalric and attacking a friend that your god doesn't hate for you attack isn't reported as UCAT_ALLY. These seem to both be technicalities at this point, but they should avoid some confusion if conducts change or new gods appear.
* s/Dithmengos/Dithmenos/ (dpeg).Steve Melenchuk2014-02-101-2/+2
| | | | | At least three devs are probably waiting for this to be pushed if they're not about to push it themselves. So now it's done.
* Don't arc electricity when attacking with an elec weapon in waterChris Campbell2014-02-091-48/+6
| | | | | | 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.
* Make warnings against penance-causing attacks more prominent.Sage2014-01-301-1/+2
| | | | | | | | | | | | The prompt to hit an enslaved creature differs very little regardless of your god, even if it would cause penance with that god. This patch makes such attacks require yes_or_no like walking into a Zot trap instead of yesno, and explicitly states that it will cause penance with your god. For reference, only betrayal attacks under Okawaru and the good gods, attacking neutral creatures under Elyvilon or TSO, unchivalric attacks under TSO, and plant betrayal under Fedhas is affected; attacks with brands offensive to your god are not, and neither are attacks which only cause piety loss.
* Trigger grand avatar on ranged attacks (tenofswords).Steve Melenchuk2014-01-221-7/+3
| | | | Also contains some merging of duplicate code.
* Demonspawn warmongers: Grand Avatar.Steve Melenchuk2014-01-211-0/+17
| | | | | | | | | | Listed in the proposal as Icon of Greatness. A grand avatar behaves similarly to both a spectral weapon and a battlesphere in that it attacks targets the caster and its nearby allies either attack in melee or by battlesphere-triggered conjurations; it is only guaranteed to attack if the triggerer does at least 15 damage, though it may trigger randomly below that threshold.
* Drop some pointless costly conversions.Adam Borowski2014-01-201-1/+1
|
* Give the shadow god a non-placeholder name: Dithmengos.Steve Melenchuk2014-01-101-2/+2
|
* Shadow god: Shadow Mimic.Steve Melenchuk2014-01-101-0/+5
| | | | | | | | | | | At a 10% chance at 4* piety up to 50% at 200 piety, you get an extra "shadow action" on melee, ranged attacks, or spells, where a shadow of your species and HD equal to your XL attacks with a +0 plain version of the relevant weapon or casts the relevant targeted spell. Having the full-powered version of the spell get cast here probably should be toned down somehow; it's significantly better than the other possible mimicked actions.
* Display correct min delay for launchers.Neil Moore2013-12-271-0/+3
|
* Correctly display min delay of the dark maul.Neil Moore2013-12-271-1/+6
| | | | | | Now the mindelay code accounts for the fact that skill level 27 is the maximum. This shouldn't change the actual calculation in melee_attack, and it is a bug if it does.
* Display minimum delay in a weapon's description.wheals2013-12-271-0/+19
| | | | | | | | | | | | It could be easily calculated, and it was usually considered extremely important while only being mentioned in passing in the manual. Thus, all three important delays are visible now: mindelay, current delay (by swinging your weapon), and base delay. Like other things on the screen, it's a base property of the weapon, so there is no reason not to show it. The screen had to be condensed a little to fit in 80 chars, but even the dark maul made it.
* Fix spelling of "targeting" (#7837)Chris Campbell2013-12-101-1/+1
| | | | See Mantis for discussion.
* Don't convert the argument to stop_attack_prompt() back and forth.Adam Borowski2013-11-291-1/+2
|
* More formatting fixes for return (...);Neil Moore2013-11-151-3/+3
|
* Use cell_is_solid where appropriate.Neil Moore2013-11-011-2/+2
|
* Spacing fixes.Adam Borowski2013-10-061-3/+3
|
* Brace removal.Adam Borowski2013-10-051-4/+0
|
* Fix conduct prompting for jump attacks with elec/devastator.gammafunk2013-10-011-0/+1
| | | | | Warnings were not being generated for non-adjacent jump attacks and some double-prompting occured for adjacent ones.
* Simplify conduct checks and fix prompting with elec/devastator for jump-attackgammafunk2013-10-011-34/+47
| | | | | | | Instead of trying to differentiate sanctuary vs. other conduct issues, just count them equally as a conduct violation, which seems the intention of bad_attack() anyways. Elec attacks for targets in water and devastator also give conduct prompts now with no double-prompting.
* Allow jump attack to target an empty squaregammafunk2013-10-011-33/+168
| | | | | | The player can target an in-range empty square for jump attack. If it turns out that the square is empty, the jump-attack fails and the player rebounds to their original position, losing the turn.
* Evokable Jump attack abilitygammafunk2013-10-011-3/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Player chooses a monster target within range where there's at least one valid landing site adjacent to the target. * There must be a monster to target to use the ability, but the monster can be friendly or neutral. * A random valid landing site is chosen, the player is moved to that square, and weapon melee occurs against the target at the landing site. * Jump attacks are melee with the wielded weapon and get a 20% damage bonus * Valid landing sites are always habitable squares with no monster and no thing that's dangerous to the player. * Flying monsters or giant monsters not standing in deep water or lava can 'block' the path of a landing site by being in the ray path from the player to the landing site. * If a visible monster blocks the path to a landing site, it won't be considered as a valid landing site. * If something invisible blocks a landing site, the site will be shown as valid and can be randomly chosen, in which case the player 'rebounds off something unseen' and never leaves the starting square, but wastes a turn (delay 10aut). * If the player is adjacent to the monster, sites adjacent to the player are not valid; you have to 'jump over' the monster in this case. * Player can't jump if exhausted or standing in water/lava/liquefied ground * Exhaustion duration is set after jump (regardless of success) to prevent a second jump, with a duration formula that's the same as the breath duration. * The usual melee checks wielded weapon/friendly etc. checks are performed for the jump melee. * If any of the valid landing sites would cause problems with self-electrocution or sanctuary violation, the player is warned first. * Range is determined by evocations training; starting attack range is 3 (movement 2), and it increases by one at evocations 5 and 10. * The cost of the jump is 2MP and a hunger cost using the same calculation as for flame breath. * The delay of a successful jump is the same as melee delay. * Fail rate for the ability calculation based on evoke taken from breath fail rate code
* Fix an infinite loop with insane friendlies attacking the player.Adam Borowski2013-09-301-2/+3
| | | | | | | | mon-act thinks the attack will succeed, melee_attack denied it. Since insanity is a form of confusion, let's allow the monster to attack you. Also, don't set the foe to the player in such a case: attack just once, like it's done against monsters.
* Fire fineffs after individual monster attacks (#6936).Steve Melenchuk2013-09-181-1/+6
| | | | | | This also fixes player::is_banished() for a target validity check, so if Sonja's first attack banishes the player, the player is banished instantly and isn't subject to Sonja's remaining attacks.
* Refactor out finesse delay adjustment code.Neil Moore2013-08-101-0/+13
| | | | | As a side effect, make the one case that used /= 2 (namely, launcher_final_speed()) use div_round_rand() like the others.
* Adjust rN resist scaling, fix numerous inconsistenciesDracoOmega2013-07-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Instead of rN granting 33/66/100% resistance to negative energy damage, it now provides 50/75/100%. The relatively smaller benefit of low levels of rN compared to other resists, combined with negative energy attacks themselves inflicting less damage than many attacks of other elements, meant that wearing an item of rN+ was almost never worth caring about, even against monsters who focused on negative energy attacks. Rings of life protection in particular were nearly junk (while rings of rF and rC were desireable swaps against many creatures). This, combined with the previous draining change, should hopefully make them a little better. Also, it turned out that rN didn't actually function the way it would be expected to in numerous cases. Player rN did reduce the damage from draining bolts by 33/66/100%, but monster rN did not affect base damage taken at all, unless they had rN+++ (ie: a monster with rN+ took just as much damage as one without) although it DID affect the HD-loss component. Moreover, it did not reduce the additional damage from drain- branded melee by 33/66/100 for either player or monster defenders. Instead, it was something like 33/50/60%, meaning that draining weapons actually DID inflict bonus damage against living players with rN+++ (but the message for them doing so was supressed). All of these should now behave consistently and as expected.
* Change chimera to use ghost_demon object and implement resistsPete Hurst2013-07-011-1/+1
| | | | | Currently resists are additive between the three different parts. Also the chimera now gets SInv if one of the parts has it.