summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
Commit message (Collapse)AuthorAgeFilesLines
* Apply recent commits to 0.4, including Matthew's evil zoo fix.j-p-e-g2008-07-091-2/+1
| | | | | | | Now how do I change the properties to native again? git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6465 c06c8d41-db1a-0410-9941-cceddc491573
* Update documentation for 0.4.j-p-e-g2008-07-081-10/+5
| | | | | | | Apply recent commits. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6458 c06c8d41-db1a-0410-9941-cceddc491573
* Apply previous fixes to 0.4.j-p-e-g2008-07-081-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6450 c06c8d41-db1a-0410-9941-cceddc491573
* Another clean up, and add some new weapon speech.j-p-e-g2008-07-071-12/+15
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6439 c06c8d41-db1a-0410-9941-cceddc491573
* Fix the old issue of switching to the butchering tool before actuallyj-p-e-g2008-07-071-6/+3
| | | | | | | | | | | | | | | | | | | | deciding on which corpse to butcher. Now, if there's no eligible tool to automatically switch to (or the autoswitch option is false) you get prompted at the beginning of the butchering routine but you don't actually switch weapons or take off your gloves until right before you start butchering. Obviously, the same applies when autoswitching. This means you don't lose a turn anymore if you change your mind in-between. I really hope I haven't introduced other bugs this way but a fix was badly in need since I'd changed the automatic weapon swap to take a turn just as the manual swap does. Also fix swap_when_safe so that it also working when the real weapon is on slot 'a' (== 0) which will probably be the norm rather than an exception. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6437 c06c8d41-db1a-0410-9941-cceddc491573
* Add a function x_chance_in_y(x,y) to replace the variousj-p-e-g2008-07-061-7/+9
| | | | | | | | random2(y) < x checks, e.g. x_chance_in_y(weight, totalweight). This should make things a bit more readable. Apply it to a number of files. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6428 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 2011201: Disallow summoned orcs from joining a worshipper of Beogh.j-p-e-g2008-07-051-1/+1
| | | | | | | | Fix 2011258: Consolidate named orcs correctly in the monster list. Fix 2010542: Patrolling monsters forgetting the player too quickly. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6408 c06c8d41-db1a-0410-9941-cceddc491573
* Disallow vampires from draining summoned creatures to be consistent withj-p-e-g2008-07-041-31/+35
| | | | | | | | | | | | | summoned creatures being incapable of bleeding on the floor. This makes things more difficult for Vampires; on the other hand there was a (more or less) recent change that lets them regain 1 hp *per turn* when draining corpses. We might also increase the duration of blood potions... Apart from that, various clean-ups. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6393 c06c8d41-db1a-0410-9941-cceddc491573
* Since hostile monsters aren't supposed to violate sanctuary, move the dolorous2008-07-021-1/+8
| | | | | | | message for it into a DEBUG_DIAGNOSTICS #ifdef. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6317 c06c8d41-db1a-0410-9941-cceddc491573
* Add more miscellaneous minor fixes.dolorous2008-07-021-8/+8
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6314 c06c8d41-db1a-0410-9941-cceddc491573
* When laying down Sanctuary make all pets inside it stop attacking and movezelgadis2008-07-021-29/+81
| | | | | | | | | | | | | | | | | | | towards you. You can get them to attack while inside Sanctuary by giving them an order to attack a specific monster, and if they do attack and violate Sanctuary then it will be removed. Attempting to give such an order will give a warning that it might violate Sanctuary. Prevent confused and berserking pets from violating Sanctuary, since you can't order them not to. Prevent monsters fleeing Sanctuary from attacking monsters which are blocking their flight path. The player attacking him/her-self because of confusion no longer vilates Sanctuary. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6312 c06c8d41-db1a-0410-9941-cceddc491573
* Simplify.dolorous2008-06-301-6/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6243 c06c8d41-db1a-0410-9941-cceddc491573
* Don't count an attack as unchivalrous if the attacker can't see the defender,zelgadis2008-06-301-7/+3
| | | | | | | | | | | | which includes the defender being invisble, being behind opaque clouds, and being behind a wall when hit with an area attack. Before the code was only checking invisibility, which doesn't take into account LOS blocking things like opaque clouds and walls. Don't give a duplicate message when hitting a giant spore or ball lightning. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6239 c06c8d41-db1a-0410-9941-cceddc491573
* Misc. minor cleanups. (Yes, a huge amount of them but still...)j-p-e-g2008-06-261-1/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6146 c06c8d41-db1a-0410-9941-cceddc491573
* Swap '.' and '!' in the targetting interface.j-p-e-g2008-06-221-2/+2
| | | | | | | | | | Forbid bats wearing hats/caps or rings. (That makes amulets the only type of equipment Vampires can keep on when transforming.) To make up for it, increase their damage stats again. Also fix it being possible to (un)equip the allowed items in Tiles while in bat form. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6055 c06c8d41-db1a-0410-9941-cceddc491573
* Simplify.dolorous2008-06-191-4/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5990 c06c8d41-db1a-0410-9941-cceddc491573
* Outsource the tutorial descriptions of skills, and make them searchablej-p-e-g2008-06-181-6/+13
| | | | | | | | | | | | in the database. Apply Zaba's patch to view skills from the skill menu ('m'). The melee, ranged and magic skills currently only have really generic descriptions shamelessly copied from the tutorial. There's a front end function get_skill_description that appends extra information like what types of unarmed attacks the current character is capable of (kicking, clawing, punching, ...) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5955 c06c8d41-db1a-0410-9941-cceddc491573
* Simplify.dolorous2008-06-171-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5918 c06c8d41-db1a-0410-9941-cceddc491573
* Fix attack conduct handling to register more than one conduct for an dolorous2008-06-171-4/+4
| | | | | | | | | | | | | | | attack again. For example, if you make an unchivalric attack on a neutral monster, both the "unchivalric attack" and "attack neutral" conducts will be handled again, instead of just the former (big oops). Passing a constant-sized array of god_conduct_triggers and adding wrapper functions to enable and disable them all is not the most elegant solution, but I don't quite have the time or the understanding right now to rewrite the god_conduct_trigger class to handle more than one conduct at once, and this does work in the meantime. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5914 c06c8d41-db1a-0410-9941-cceddc491573
* Add spacing fixes.dolorous2008-06-171-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5910 c06c8d41-db1a-0410-9941-cceddc491573
* Use more wrappers, and add more cleanups.dolorous2008-06-161-11/+10
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5893 c06c8d41-db1a-0410-9941-cceddc491573
* Add yet another spacing fix.dolorous2008-06-151-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5869 c06c8d41-db1a-0410-9941-cceddc491573
* Add more spacing fixes.dolorous2008-06-151-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5868 c06c8d41-db1a-0410-9941-cceddc491573
* Add more minor cosmetic fixes.dolorous2008-06-151-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5865 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1994279: Crash when checking ?v (version information).j-p-e-g2008-06-151-3/+7
| | | | | | | Fix 1994352: Buggy message after an invisible monster blocks an attack. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5847 c06c8d41-db1a-0410-9941-cceddc491573
* Fix tutorial message about gaining a skill being shown outside tutorial.j-p-e-g2008-06-151-10/+12
| | | | | | | | Move damage reduction for petrified monsters out of the stab check and into the general damage calculation. Still 1/3. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5846 c06c8d41-db1a-0410-9941-cceddc491573
* * Add a prompt when attacking monsters with an inappropriate weapon orj-p-e-g2008-06-141-8/+32
| | | | | | | | | | | | | | | | | | | | | | | | when attempting to use (controlled) berserk while wielding an inappropriate weapon. (FR 1956656) * Make monsters stop patrolling/travelling if they change levels (or are banished). * Disable the friendly pickup toggle for characters unable to use them. Currently, only worshippers of TSO and Beogh are capable of gaining allies that are permanent (not summoned), permanently friendly (not charmed) and intelligent enough to pick up stuff (no zombies). I don't know if you keep your friends if you leave TSO. If so, the toggle should be enabled while that is the case (i.e. if you're still worshipping a good god) * Re-order the wizmode commands in the help screen. They're now not listed strictly alphabetically anymore, but rather sorted into different categories that should make actually finding commands easier. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5819 c06c8d41-db1a-0410-9941-cceddc491573
* AutoID the curse status of a monster wielded cursed ranged weapon if saidj-p-e-g2008-06-121-0/+7
| | | | | | | | | | | monster is trying to hit you with it. Don't give away what weapon a monster is carrying if it is not actually wielding it, especially not in the form of "A goblin, wielding a sling." that is shortly followed by "The goblin wields a sling." :p git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5763 c06c8d41-db1a-0410-9941-cceddc491573
* Implement the Petrify spell in a rather basic variant, and replace the j-p-e-g2008-06-121-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | player spell "Paralyse" with it, i.e. not the wand/potion/misc. effects. Petrify is a 4th level spell of the Enchantment/Transmigrations school (a unique combination, I believe), all other values (incl. the level) were shamelessly stolen from Paralysis. Anyway, it consists of two elements (so I actually added TWO new enchantments), Petrifying and Petrified. A monster that is petrifying cannot move around but can perform actions like hitting adjacent monsters or casting spells at a slowed rate (1.5 of the normal cost). Once this sub-enchantment runs out (happens faster) the monster cannot move or act anymore, so it works like Paralysis. The damage you do during stabbing is one third of what you'd do otherwise, for both states of enchantment, and for both stabbing counts as unchivalric behaviour. It has not been implemented as a monster spell, and ghosts of characters that had it will use Paralyse instead. Consequently, the effect on the player (in self targetting) only handles the Petrified part. Numbers, esp. enchantment timeout, will need tweaking. They're currently Petrifying: cturn = 50 / _mod_speed(10, mons->speed); Petrified: cturn = std::max(8, 150 / (1 + modded_speed(mons, 5))) because I wanted the first to always run out faster than the second, but at the same time make the ratio of Petrifying/Petrified tilt in favour of the first for powerful monsters. The numbers are more or less made up, and tested with different monsters in wizard mode. Still, could be anything between too weak and overpowered, though the latter is more likely. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5761 c06c8d41-db1a-0410-9941-cceddc491573
* Lower chance of vampiric bite during bat form, and if it happens, halvej-p-e-g2008-06-081-10/+17
| | | | | | | healing and nutrition gain. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5606 c06c8d41-db1a-0410-9941-cceddc491573
* Nerf damage of the bat transformation. Reduced fromj-p-e-g2008-06-071-17/+20
| | | | | | | | | | | | | | | | 2 + skill(unarmed_combat)/3 to 2 + rnd(skill(unarmed_combat)/5 + 1) Also replace the menu_colour_prefix colouring for prompts and the like to use message_colour instead, so those "msg" abbreviations in food_colouring.txt actually have an effect now, and players can disable colouring of prompts etc. (respects channels) while leaving it on in the inventory. I'm leaving the menu_colour_prefix function in for now, in case it can be used somewhere else. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5558 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1986261: patrolling monsters not interrupting their patrol to huntj-p-e-g2008-06-061-7/+17
| | | | | | | | | | | | the player (Whoops!) Fix 1945669: Monsters attacking via reaching still getting secondary unarmed attacks. And... we're down to one page of bug reports, yay! :D git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5500 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1986252: double "Blech! You need xy!" messagej-p-e-g2008-06-061-9/+11
| | | | | | | | | | | | | | Fix 1966204: make non-amphibious undead capable of drowning or the equivalent thereof When you see a weapon with the returning ego return (to you or a monster) set the properties known along with the brand (because artefacts can't be id'd by throwing alone, anyway). This helps alleviate BR 1958616, but doesn't solve the problem with the curse status being unknown. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5499 c06c8d41-db1a-0410-9941-cceddc491573
* Fix mimics not teleporting when attacked by reaching or airstrike, and aj-p-e-g2008-06-051-1/+1
| | | | | | | few (really) minor adjustments on monster pathfinding. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5487 c06c8d41-db1a-0410-9941-cceddc491573
* Fix summoned monsters spattering blood.j-p-e-g2008-06-031-9/+16
| | | | | | | Fix menu colouring giving away unknown evil items. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5456 c06c8d41-db1a-0410-9941-cceddc491573
* Disallow unchivalric spell attacks from daevas.dolorous2008-06-031-6/+9
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5449 c06c8d41-db1a-0410-9941-cceddc491573
* Modify the intertravel prompt to not even ask for Pandemonium (since youj-p-e-g2008-06-011-4/+4
| | | | | | | | | | cannot leave the level) and just start travelling to your last travel target (if you had one). This solves BR 1843746, but there's no feedback when trying to travel to a target that cannot be reached. (No "I don't know how to get there.") Still, definitely an improvement. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5405 c06c8d41-db1a-0410-9941-cceddc491573
* Add minor cosmetic fixes.dolorous2008-05-291-4/+4
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5324 c06c8d41-db1a-0410-9941-cceddc491573
* monsters::lose_energy() now takes optional paramaters to multiply and/orzelgadis2008-05-261-0/+3
| | | | | | | | | | | divide (rounded up) the amount of energy lost. When a monster's attack is warded off the energy consumed is half that of what the attack would normally have taken, a change from it not taking any energy at all. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5249 c06c8d41-db1a-0410-9941-cceddc491573
* Fix aborting unchivalric attacks costing a turn.j-p-e-g2008-05-251-26/+36
| | | | | | | | | | | | | | | | | | Implement ordering your friends to stay where they are. To do this, I've added a new variable to the monster struct: patrol_point, that is set by the new t sub-command "Wait here!" Once this is set, monsters will spend their time wandering around within the LOS radius centred on the patrol point. If they are attacked, or the player or other friends are attacked, they'll stop wandering to fight, but once the foe is gone, they continue doing so. Currently, the only way to make them stop again is to issue another command, "Follow me!" that is basically the already existing "Come here!" command. I've also added a "Stop fighting!" command that for non-patrolling monsters has the same effect as "Follow me!" - patrolling monsters are supposed to take up their wanderings again. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5247 c06c8d41-db1a-0410-9941-cceddc491573
* And name the consolidated function properly.dolorous2008-05-251-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5239 c06c8d41-db1a-0410-9941-cceddc491573
* Consolidate the setting of the "standard" attack conducts.dolorous2008-05-251-1/+6
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5238 c06c8d41-db1a-0410-9941-cceddc491573
* Consolidate the attack warning prompts for both melee and beams, and use dolorous2008-05-251-43/+1
| | | | | | | | | the prompts properly with Burn/Freeze, Smite, and Airstrike. Also, move the now-single function for this into misc.cc, since I can't think of a better location right now. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5235 c06c8d41-db1a-0410-9941-cceddc491573
* Add minor cosmetic fixes.dolorous2008-05-241-5/+5
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5224 c06c8d41-db1a-0410-9941-cceddc491573
* And put it in the right place again.dolorous2008-05-241-19/+7
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5222 c06c8d41-db1a-0410-9941-cceddc491573
* Handle the warning prompt for melee attacks while in a sanctuary in dolorous2008-05-241-0/+17
| | | | | | | | melee_attack::attack() instead of _move_player(), so that melee attacks made using Ctrl-key sequences also show it. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5221 c06c8d41-db1a-0410-9941-cceddc491573
* Apply beam tracer prompt to helpless/fleeing etc. creatures whenj-p-e-g2008-05-231-3/+3
| | | | | | | | | | | | | worshipping an appropriate god. I'm simply reusing dolorous unchivalric methods here. :) Also, don't prompt for harmless beams. Still TODO: Make the message differentiate between target and obstacles, and clean up the code a bit. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5193 c06c8d41-db1a-0410-9941-cceddc491573
* Add spacing fix.dolorous2008-05-191-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5144 c06c8d41-db1a-0410-9941-cceddc491573
* Comment fix.dolorous2008-05-191-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5142 c06c8d41-db1a-0410-9941-cceddc491573
* Improve the "Really attack..." prompts a bit.dolorous2008-05-191-3/+4
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5141 c06c8d41-db1a-0410-9941-cceddc491573