summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.h
Commit message (Collapse)AuthorAgeFilesLines
* Comment and constify get_resistible_fraction()Nicholas Feinberg2014-07-261-1/+1
|
* The great mon-stuff migration.Shmuale Mark2014-06-221-0/+6
| | | | | | | | | 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.
* Make cleave hit 8 squares instead of 7Chris Campbell2014-05-011-1/+1
| | | | | | 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.
* Rename unchivalric_attack_type and friends.Shmuale Mark2014-03-061-15/+15
| | | | | | 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.
* Don't arc electricity when attacking with an elec weapon in waterChris Campbell2014-02-091-2/+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.
* Display minimum delay in a weapon's description.wheals2013-12-271-0/+1
| | | | | | | | | | | | 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.
* Allow jump attack to target an empty squaregammafunk2013-10-011-2/+4
| | | | | | 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-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Refactor out finesse delay adjustment code.Neil Moore2013-08-101-0/+2
| | | | | As a side effect, make the one case that used /= 2 (namely, launcher_final_speed()) use div_round_rand() like the others.
* Simplify is_melee_weapon and move it out of fight.ccNeil Moore2013-06-191-1/+0
| | | | | Also, make it take a reference rather than a pointer (like is_{,ranged_}weapon) and use it in the berserk check.
* Count stabs on the action dump.Adam Borowski2013-03-171-0/+1
| | | | | | | | This implementation breaks them down by UCAT_type, which is probably too detailed. Ideally, I'd want just two categories: sleep/para stabs (ie, those with no roll that deal massive damage) and the rest (a bit of extra damage). It doesn't matter where we coalesce them, though, so it'd be easy to combine the data at output time.
* Make the table of weapon str/dex weighting reflect _mostly_ status quo, use it.Adam Borowski2013-02-241-4/+0
| | | | | | | | | | | I left intact (ie, effectively changed) bigger maces and axes (slightly strengthier), extremes like quick blade and ogre clubs (slightly more extremist), big polearms (glaive +1, bardiche +3). If any of you would prefer weapon types to have identical weighting like before, a reference list is on https://crawl.develz.org/mantis/view.php?id=5825 Note that for melee weapons, a redundant and out of sync copy was used instead, this table was consulted only for launchers.
* Remove unnecessary includes from header files.Jay3.14152012-10-231-2/+0
| | | | | | | | | | For most header files, this only saves on having to recompile a small number of source files, but there are also a few headers where small changes would now take significantly less time. This is most obvious for the Tiles build for which the dependencies have been greatly reduced, so that the only additional includes when compared to console are strictly library or tile related.
* Change cleave parameters to use attacker actor instead of pos.Raphael Langella2012-09-291-2/+3
|
* Only do handle_phase_attempted() once when cleaving.Raphael Langella2012-09-241-0/+1
| | | | | | | | | It fixes a number of issues: * You get a single stop attack prompt for all targets * No more fumbling for each target * Hunger cost isn't multiplied by targets Still broken for ctrl+dir attacks.
* Cleave effect for Axes.Raphael Langella2012-09-151-0/+7
| | | | | | | | | | | | | | | | | | | | | * Additional targets are acquired by rotating from the main target in both directions but no more than 3 cells. Solid features block cleaving. On open grounds, it attacks 7 cells (all but the opposite one from the main target). A single wall on the side can block one or two targets since it doesn't go all around. * Additional attacks do 75% damage. Main target still takes full damage. * Allies don't block cleaving and are not harmed by it unless attacker is confused. * Monsters wielding axes get cleaving too. * Broad axe, battleaxe and executioner's axe base damage is reduced by 1. More nerfing might be needed for the latter 2. * Cleaving works when attacking empty spaces (useful against invisible monsters) * Monsters dual wielding axes should work. Thanks to LexAckson for helping with this implementation (especially rotate_adjacent).
* Fix an ugly hack.Raphael Langella2012-04-091-1/+2
|
* Make another bunch of functions static or deleted.Adam Borowski2012-03-211-2/+0
| | | | | Looks like get_XXX_path and the like in files.cc could use some drastic simplification, or perhaps even a nuking and rewrite.
* Fix the accuracy calculation of fsim melee.Raphael Langella2012-03-071-1/+1
|
* Revert "Revert "Clean up aux code a bit.""elliptic2011-11-271-1/+1
| | | | | | | This reverts commit b78c00d44495ca2ef685d25537e4078b10598a63. Next commit fixes the error this commit introduced with many monsters losing their attacks... oops!
* Revert "Clean up aux code a bit."Robert Burnham2011-11-271-1/+1
| | | | | | | | | | This reverts commit 4cde183eca711078bdf6e2d9a0ec6ff6275875d5. This commit breaks hydra, black mamba, and who knows how many other forms of combat. I'll review the content (most of which is probably desirable) and once I figure out what was breaking the combat for these monsters, I'll re-implement and push everything else in this commit back.
* Clean up aux code a bit.elliptic2011-11-261-1/+1
| | | | | Passing allow_unarmed around everywhere wasn't actually doing anything, and can_do_unarmed was misleading.
* Fix compile errorsYRobert Burnham2011-11-221-0/+1
|
* Merge branch 'master' into unified_combat_controlRobert Burnham2011-04-261-5/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: crawl-ref/source/actor.cc crawl-ref/source/delay.cc crawl-ref/source/directn.cc crawl-ref/source/directn.h crawl-ref/source/fight.cc crawl-ref/source/files.cc crawl-ref/source/mon-act.cc crawl-ref/source/monster.cc crawl-ref/source/mpr.h crawl-ref/source/player.cc crawl-ref/source/shopping.cc
| * 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.
* | Merge several player/monster diverged methodsRobert Burnham2011-04-251-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Combines various monster/player methods. Some of the merges are less optimized than others, but they serve well as a functional merge for the time beng. Merged methods include calc_base_unarmed_damage, calc_base_weapon_damage and the three wrapper methods in fight.cc which were responsible for instantiating the melee_fight object and starting the whole process. you_attack, monster_attack, and monsters_fight are all now in fight_melee Once completed, fight_melee will also loop, handling each of a monster(s) various attacks.
* | Remove sparsely used wrapper methodRobert Burnham2011-04-121-2/+0
| | | | | | | | | | | | In addition to monster_attack (MvP) and monsters_fight (MvM), there was a monster_attack_actor which was either (MvP OR MvM) and was only used for in the _handle_reaching method of mons-act.cc.
* | Remove wrapper function calc_your_to_hitRobert Burnham2011-04-111-4/+0
| | | | | | | | | | | | | | Was only used in player.cc to display to_hit-related information. Wrapper function declared an instance of melee_attack and called the actual calc_to_hit methods that we use for combat. Why can't we do this in the player method itself?
* | Crude join of player and monster to_hitRobert Burnham2011-04-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Joins the two to_hit methods into a single method (fairly crudely) simpy by checking if attacker is player, do {paste of player_to_hit} else, do {paste of monster_to_hit}. Adds/Removes some pending/incomplete todos as necessary, also removes an unnecessary method used for calculating and displaying player_to_hit deterministically. Creates a new fight function (fight_melee) which will be the new handler of combat once the rewrite is done.
* | Relocate melee_attack class to own cc fileRobert Burnham2011-03-241-26/+3
| | | | | | | | | | | | | | | | | | | | Completes the move of the majority of the melee_attack class method definitions from fight.cc to melee_attack.cc (the amount of content that was moved out of fight.cc resulted in git flagging fight.cc as being renamed to melee_attack.cc and fight.cc being recreated [with much less content]). This commit also allows the new attack class (with melee_class inheriting from it) to compile, it does not appear that much functionality has changed with this massive restructuring of the code.
* | Implement basic layout for attack phasesRobert Burnham2011-03-181-0/+10
|/
* Massive spacing fixes: "( spaces after parentheses )".Adam Borowski2010-10-151-2/+2
| | | | | | 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.
* Turn "final effects" into a generic system. Fix water elec not working for ↵Adam Borowski2010-09-241-10/+0
| | | | monsters.
* Rename class "monsters" to "monster".Robert Vollmert2010-09-051-3/+3
|
* Implement chaos-brand melee effects for being engulfed in CLOUD_CHAOS (Mu).Darshan Shaligram2010-07-031-0/+2
|
* Bring sanity to enums by making them diffable/patchable.Adam Borowski2010-06-081-3/+3
|
* Add several Jiyva specific mutations, Jiyva tweaksShayne Halvorson2010-05-261-1/+2
| | | | | | | | | Adds six new slime-related mutations that only Jiyva can give. Jiyva's royal jelly effect now spawns short-lived friendly slimes. Passive jelly drops occur under penance to prevent using penance to avoid item loss Stat altering occurs less frequently Signed-off-by: Robert Vollmert <rvollmert@gmx.net>
* Roll back player_aux_unarmed rewrite.Robert Vollmert2010-05-061-17/+3
| | | | | | | | | | | | As discussed privately. A new rewrite will come. This reverts commit 607bea974114ffd0be153a0af52302bbb04038df. This reverts commit 58b8890cabd409396c4eb1972fd0249d8971c5d7. This reverts commit f8e18373932f005fecaadaab00c341f6b6958183. This reverts commit 870de8f6f67f7b462f1eb17a5f53cb34535f4a60. This reverts commit 279291369dd4dea4e7c1454fc00b29a7f088fab2. This reverts part of commit 5a59108b0370ed3aa353192bbec306f7249258b1, namely the player_aux_unarmed part.
* Rewrite player_aux_unarmed for maintainabilityRobert Burnham2010-05-041-3/+17
| | | | Also adds in monstrous code for DS monstrous mutation sets.
* Make melee_attack::player_aux_unarmed() a little clearer.Robert Vollmert2010-04-261-1/+3
| | | | | | | | | | Also corrects aux to-hit calculation (as far as I can tell), though this should only affect vampires. Whoever is responsible for the vampire aux unarmed code might want to reevaluate. Is it really intended that a vampire never gets auxiliary kicks and headbutts, and a punch only in one sixth of cases?
* Revert "Weapon parameter for calc_your_attack_delay."Robert Vollmert2010-04-151-1/+1
| | | | This reverts commit 5cbf957b1b2b979fdc6dc8aa3c31f3bae6eb2c5f.
* Weapon parameter for calc_your_attack_delay.Robert Vollmert2010-04-151-1/+1
|
* calc_your_attack_delay() gives access to attack delay.Robert Vollmert2010-04-151-0/+2
|
* Revert weapon delay calculation changes.Robert Vollmert2010-04-141-4/+0
| | | | | | | | | | | | | | The delay formulas are too complicated to analyze. It turns out that not only is attack delay randomized in melee_attack::player_apply_attack_delay, but even base weapon delay in melee_attack::player_weapon_speed goes through randomization. This reverts commit 25ba707d26259f7a35da9367a31df9184fd89b60. This reverts commit 59cb47231f09c696c38ef72956e962c5b9cea191. This reverts commit cea96c26d7185e3e46af5ff9497a6a240bd1a2a0. This reverts commit e2c10d8fc5747b45025b8a48d6c3aa7b9300d6d3. This reverts commit 43f9de964ec341f165fe942904758e08d56364d8.
* Calculated expected attack delay.Robert Vollmert2010-04-141-1/+3
| | | | | | | calc_your_attack_delay gets a scale parameter, and an implementation of R_EXPECTED which is correct except for the hand-and-a-half plus shield case, since I'm lacking a formula for the expected value of min(1dN+1dK, 1dN+1dK).
* Weapon parameter for calc_your_attack_delay.Robert Vollmert2010-04-141-1/+1
|
* calc_your_attack_delay() gives access to attack delay.Robert Vollmert2010-04-141-0/+2
| | | | | | It currently only allows computing minimal and maximal delay (aside an actual random value) since the distribution isn't that straight forward.
* Split out melee_attack from fight.h.Robert Vollmert2010-02-111-208/+0
| | | | | This means fight.h doesn't need to include artefact.h anymore, reducing dependencies.
* Don't combine armour and shields when reporting what made the PC miss a ↵Darshan Shaligram2010-01-301-2/+3
| | | | melee attack.
* Allow stabbing of friendly monsters.Robert Vollmert2010-01-251-1/+2
| | | | | | | | | | | | | I hope this is uncontroversial (allowing to stab friends, not stabbing friends itself). It makes a lot of sense to be able to catch them off-guard. Mostly flavour -- I don't think the gameplay effect will be huge. Let me know if I missed something! Ally stabs do damage like confused stabs. The messages fit nicely: "You catch %s completely off-guard!" "You strike %s from behind!"