summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.h
Commit message (Collapse)AuthorAgeFilesLines
* Disallow intrinsic reaching attacks (turtles) from reach-attacking at full ↵Darshan Shaligram2010-01-111-0/+2
| | | | diagonals (2,2).
* Add snapping turtles, alligator snapping turtles and sea snakes to the ↵Darshan Shaligram2010-01-081-1/+1
| | | | | | Shoals, remove yaktaurs, centaurs and stone giants. Snapping turtles get reaching attacks. Sea snakes get strong venom.
* Make auto-travel killing toadstools saner.Jude Brown2009-12-251-0/+1
| | | | | | | | | Use wielded_weapon_check, though in this instance do not print a prompt. This means that if you have previously been asked about your weapon and say yes, it will kill toadstools while autoexploring. This means no more "Really attack while wielding your bow?" prompts, and it also should obey no-attack/etc inscriptions.
* Un-underpopulate '4's by adding sixfirhy: elec theme, unorthodox timings.Adam Borowski2009-11-261-1/+1
| | | | | | | | | | | | | | | Sixfirhies move in bursts: speed 30, but act only on 4 turns out of 12. They also get a bonus to moving compared to other actions (move cost 60%). Damage brand is AF_ELEC -- it's unproportionately dangerous, so the numbers only look small. Also, electricity heals them! It won't bring the back from over the edge if physical part of damage got them to 0 hp or less, in this case, they'll explode instead. Keeping with the long tradition of Crawl's demon names, the credit for this one goes to timecircuits' cat.
* Fix an issue with noise generation in melee combatCharles Otto2009-11-141-1/+1
| | | | | | | | | | | | | | | Noise generated by attacking in melee range is handled by melee_attack::handle_noise. handle_noise was using defender->pos() as the point of origin for the noise, but defender->pos() is not reliable in some situations, if a monster is killed its position is reset to zero. I added a coord_def parameter to handle_noise to use as the point of origin instead of trying to use defender->pos and made all calls to handle_monster store the defender's position prior to damage being applied. Aside from creating noise in the wrong area calling noisy with a position of (0, 0) can cause an assertion failure at mon-behv.cc, line 1609 in some situations.
* fight: Generate noise on fightingMatthew Cline2009-11-081-0/+5
| | | | | | | | | Very rough draft of "make noise when fighting". Needs extensive play-testing and tuning. Noise scales linearly with damage done, and also linearly with noise_factor, which is determined by weapon type (clubs make more noise than dagger) or monster attack type (tail slaps make more noise than stinging). Plus, a litle extra noise is added on for the flaming and electrocution brands.
* fight: base_damage member unused, removingMatthew Cline2009-11-081-1/+0
|
* Merge mons_holiness() into monster::holiness(), and add an is_unholy()David Lawrence Ramsey2009-10-311-1/+0
| | | | convenience function.
* Electrocution discharge in water ala FR 1637214abrahamwl2009-10-281-0/+13
| | | | | | | | | | | | | | | | | | | Weapons of electrocution now discharge in water, if the target is touching the water and not rElec, hitting all adjacent water-touching non-rElec creatures for about half the normal electrocution damage. Particularly notable new code is the implementation of an area-of-effect callback for beams, as well as a function and structure for weapon effects that should only happen after the target would have died, if it was going to die, and therefore cannot safely make use of its data. Issues that still need to be decided: - How doe Xom feel about this? (eg. If creatures hurt themselves this way.) - Should it ask you if you want to attack when you know the discharge will hit yourself?
* Cleanup in melee_attack.Robert Vollmert2009-10-061-1/+0
| | | | | potential_damage is only really used in one method, so move it there as a local variable.
* Drop obsolete CVS last-committed headers ($Author$).Adam Borowski2009-10-061-2/+0
|
* * Moved most hard-coded non-standard unrandart behaviour to art-func.h,zelgadis2009-06-271-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specifically code for equipping, unequpping, an equipped unrandart doing something every time world_reacts() is called (special wield effects), melee hit effects, and evoking. Left hardcoded outside of art-func.h: * Sword of Cerebov temproarily downgrading the defender's fire resistance. * Staff of Olgreb boosting poison spells, as if it were a staff of poison. * Vampire's Tooth always getting maximal vampiric drain. * Mace of Variablity's initial pluses being chosen at creation time. * Since what used to be special wield effects is now handled very differently, noisy weapons and the lantern of shadows effects are handled with player attributes rather than SPWLD_NOISES and SPWLD_SHADOW. * Unrandarts can now have an elemental colour for their colour (currently only used for the Mace of Variability). * Unrandarts' value modification, being special, and being evil are now handled in art-data.txt rather than being hardcoded. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10055 c06c8d41-db1a-0410-9941-cceddc491573
* First part of the merger of fixed artefacts into unrandom artefactszelgadis2009-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (further changes will be much smaller). Breaks savefile compatibility, and bumps the major savefile version up to 6. Some changes made to some tiles files, but it hasn't been tested with a tiles build. Overview of changes: * Unrand artefacts are now defined in art-data.txt and is turned into C code via util/art-data.pl. This has the dual advantage of being more readable by humans, and that if the unrand data structure changes then you can just change util/art-data.pl and regenerate the C code rather than having to change some 70 different C structs by hand. * util/art-data.pl automatically updates NO_UNRANDARTS, and also automatically generates an enumeration of all the unrands which are equal to their item.special field. * randart.cc and randart.h have been renamed to artefact.cc and artefact.h, since the files covers all types of artefacts, and the differences between randarts, unrandarts and (former) fixed arts have been minimized since the terms were introduced. Also renamed unrand.h to art-data.h * The brands and resistances of former fixed arts are now handled via artefact properties, but the rest of their special behaviours are still hardcoded. * Unrandarts are now distinguished between normal and "special", with the special ones currently just being identical to the list of the formed fixed arts. Special unrandarts are randomly generated less often than normal unrandarts, can be generated in the Abyss if they've been lost, can't be picked up by monsters, and can't be affected by Tukima's Dance. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10035 c06c8d41-db1a-0410-9941-cceddc491573
* Since fixed artefacts are going to be folded into unrandarts, and unrandartszelgadis2009-06-081-1/+1
| | | | | | | | | | | have already become almost identical to randarts, change "randart" to "artefact" everywhere except for things that deal exclusively with randarts. Artefact related files will be renamed later. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9921 c06c8d41-db1a-0410-9941-cceddc491573
* Make paralysed creatures auto-stabbable and brand them appropriately.haranp2009-02-151-0/+1
| | | | | | | Petrified creatures are still only may-stabbable. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9085 c06c8d41-db1a-0410-9941-cceddc491573
* Restore a monster's attitude from the beginning of the attack if itharanp2009-02-061-0/+3
| | | | | | | | | changes during the attack and the monster is about to die, so that you don't get Okawaru piety for killing an ally just before you receive the penance. Fixes [2436051]. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8925 c06c8d41-db1a-0410-9941-cceddc491573
* Prevent confused monsters from drifting towards the center of theharanp2009-02-011-31/+4
| | | | | | | | level. Fixes [2472560]. Code cleanups in _handle_monster_move(). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8870 c06c8d41-db1a-0410-9941-cceddc491573
* Clean up rotting in melee attacks to not kill the target directly and to dolorous2009-01-201-0/+1
| | | | | | | use special_damage_msg, as with draining. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8636 c06c8d41-db1a-0410-9941-cceddc491573
* Rename cleansing flame resistance to holy energy resistance, and clean dolorous2009-01-191-0/+1
| | | | | | | up holy wrath weapon checks. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8595 c06c8d41-db1a-0410-9941-cceddc491573
* Consolidate the player and monster draining functions in fight.cc, make dolorous2009-01-181-2/+0
| | | | | | | | | monster draining take multiple levels of negative energy resistance into account, and only set the necromancy conduct if draining actually took place, as with draining beams. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8551 c06c8d41-db1a-0410-9941-cceddc491573
* Add an unchivalric attack type for petrifying monsters.dolorous2009-01-171-0/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8479 c06c8d41-db1a-0410-9941-cceddc491573
* Remove atk and def from melee_attack.haranp2009-01-131-6/+11
| | | | | | | | | | | | Rewrite some code to use actor methods instead of calling things directly. In theory, attacker_as_monster() and defender_as_monster() are hacks; any calls to them that can be replaced by calls to actor methods should be. Fix some inconsistencies with monster bleeding and summoned creatures. (This should probably go into actor::can_bleed().) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8444 c06c8d41-db1a-0410-9941-cceddc491573
* Refix [2484631], in a way that won't require changes to draining or dolorous2009-01-091-0/+1
| | | | | | | | | rotting attacks: Put the draining attack code back where it was, and instead explicitly check for a death-by-banishment when determining whether to skip chaos_killed_defender(). Sorry for any confusion. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8342 c06c8d41-db1a-0410-9941-cceddc491573
* Changed weights of the brands a chaos weapon might simulate and the weight ofzelgadis2008-12-101-0/+10
| | | | | | | | | | | | | | | | | | | the various chaos effects, to make chaos brand less powerful. Added berserk and miscast effects for chaos effects, plus chaos weapons will occasionally give a message-only miscast effect if it would otherwise have done nothing. Added several effects that have a chance of happening to an attacker every time it uses a chaos brand/AF_CHAOS: dropping through temporary a shaft, having the stairs move out from under them, the weapon making a loud noise. Monsters killed by a chaos weapon/AF_CHAOS have a chance of immediately turning into a zombie (assuming the monster didn't leave a corpse; chaos effects don't (yet) use up corpses). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7804 c06c8d41-db1a-0410-9941-cceddc491573
* Add some chaos attacks/weapons. Missiles and launchers of chaos fire a bolt ofzelgadis2008-12-011-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | a random type (including enchantments, which isn't so good since they don't have a visible beam). Might want to add BEAM_CHAOS and make it a beam of that. Weapons of chaos either does a random brand effect (fire, poison, etc) or a random chaos effect (which includes cloning the attack victim). The AF_CHAOS monster attack flavour either does a random monster flavour or chaos effect (same chaos effects as for weapons). The relative frequency of all the different effects/brands/flavours no doubt needs adjustment. All of this is currently only available via Xom. 10% of all common-type demons sent in by Xom will be chaos spawn (the only kind that use AF_CHAOS, and never randomly generated otherwise). All item gifts from Xom which are generated with a brand will have their brand switched to chaos (this should probably be made to happen less than 100% of the time). And finally one of Xom's bad acts is to upgrade a non-branded weapon of a nearby hostile monster to a chaos brand (this might need to be made less (or more) common). Oh, and if a randart has a brand which would be identified if it were merely an ego weapon, it now identifies the RAP_BRAND property of the randart. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7704 c06c8d41-db1a-0410-9941-cceddc491573
* Clean up sticky flame handling.dolorous2008-11-071-0/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7409 c06c8d41-db1a-0410-9941-cceddc491573
* Remove pre-Stone Soup change history from source files, and push it allj-p-e-g2008-09-141-4/+0
| | | | | | | | | | into a file crawlhistory.txt in docs/obsolete. I used a perl script to do this under the assumption that all these change logs used the same system following the keyword "Change History". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6930 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1986261: patrolling monsters not interrupting their patrol to huntj-p-e-g2008-06-061-2/+3
| | | | | | | | | | | | 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
* Clean up the unchivalric attack routine a bit.dolorous2008-05-171-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5101 c06c8d41-db1a-0410-9941-cceddc491573
* Enable handling of long-distance unchivalric attacks, and increase the dolorous2008-05-171-0/+16
| | | | | | | | penalty from 4 to 5 for consistency with similar attacks frowned upon by the good gods. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5100 c06c8d41-db1a-0410-9941-cceddc491573
* Add more whitespace fixes.dolorous2008-05-151-5/+5
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5049 c06c8d41-db1a-0410-9941-cceddc491573
* Batch of tiny changes for MSVC compiles.pauldubois2008-03-101-1/+1
| | | | | | | | | | | | | | | Most of these fall into the category: - don't use struct to refer to a class, and vice versa - msvc doesn't like unistd.h or dirent.h Doesn't fix all the struct/class problems; I think I'll silence those for now and move on because it's not all that important. Tested on OS X. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3571 c06c8d41-db1a-0410-9941-cceddc491573
* [Bug 1907221] Add "Modified for Crawl Reference" statement and author to aj-p-e-g2008-03-081-1/+1
| | | | | | | | huge number of files. Also correct file name comments. No coding changes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3539 c06c8d41-db1a-0410-9941-cceddc491573
* More resist fixes.dshaligram2008-01-101-3/+5
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3242 c06c8d41-db1a-0410-9941-cceddc491573
* Monsters get multilevel resists (incomplete). Monster data needs to bedshaligram2008-01-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | adjusted per monster to hand out the right resists. The current MR_RES_FIRE gives one level of resistance only. Added a real ghost structure, discarded the old ghost values array. Adjusted bones file format so bones will work out-of-the-box with Hearse. Breaks bones format, older bones will be rejected. Fixed some maps with bad DEPTHs. Added more safe answers in Y/N prompts, added a check to make it less likely that Crawl will spin in a tight loop reading input from a closed tty. (Experimental) !a will override existing foe of friendlies in LOS. Blademasters no longer pick up stuff to throw (Erik). Zombies of swimming things are also swimming things. Currently applies only to zombies explicitly placed in .des files, since fish zombies cannot be generated otherwise (can of worms). Morgue is now saved before showing the inventory and other boring end-of-game stuff. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3231 c06c8d41-db1a-0410-9941-cceddc491573
* Fix problem of friendly monsters not using any energy when there'szelgadis2007-10-151-1/+1
| | | | | | | nothing around to fight and they're right next to the player. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2467 c06c8d41-db1a-0410-9941-cceddc491573
* [1808968] Using the weapons of the demon lords in combat angers TSO and Zin.dshaligram2007-10-071-0/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2365 c06c8d41-db1a-0410-9941-cceddc491573
* Split off portions of externs.h and enum.h into other files. Thezelgadis2007-09-151-0/+12
| | | | | | | | | | | | | crawl_environment, player and monsters classes have been left in externs.h, which necessitates that all of the enums references by those classes stay in enums.h, since you can't forward declare an enum. However, it's a start. Also, portions of misc.{cc,h} have been split off into traps.{cc,h}, place.{cc,h} and terrain.{cc,h} git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2095 c06c8d41-db1a-0410-9941-cceddc491573
* Identification overhaul part II. Okay, not really. ;)j-p-e-g2007-09-101-1/+1
| | | | | | | | Applying Matthew's latest patch (1789869): Identify items you see monsters use. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2068 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed incorrect use of It vs Something in attack messages.dshaligram2007-08-091-2/+4
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1981 c06c8d41-db1a-0410-9941-cceddc491573
* Made item_def::base_type into object_class_type, instead of unsigned char.haranp2007-04-261-1/+1
| | | | | | | | | | | Flushed out a few bugs as a result, specifically: 1. Some monsters (e.g., orcs) can now get blowguns as they were intended to (look at the makeitem.cc change); 2. Acquirement will no longer attempt to give you the books of minor magic if you've found them (look at the effects.cc change.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1374 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed monsters that are not in sight being identified by name if they'redshaligram2007-04-111-0/+14
| | | | | | | | attacking a monster that is in sight. Implemented AF_MUTATE for pulsating lumps. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1288 c06c8d41-db1a-0410-9941-cceddc491573
* Updated changes list.dshaligram2007-03-291-0/+3
| | | | | | | | | | Give Lugonu's retribution more of the Abyss/distortion theme. Added extra check for Sif Muna gifts. Reduced spatial vortex base damage, but give them a distortion attack. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1118 c06c8d41-db1a-0410-9941-cceddc491573
* Import 4.1 TSO stab warning.dshaligram2007-03-111-0/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1019 c06c8d41-db1a-0410-9941-cceddc491573
* Monster attack refactoring. Likely to be buggy.dshaligram2007-02-241-3/+37
| | | | | | Fixed tracer explosion beams generating clouds. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@959 c06c8d41-db1a-0410-9941-cceddc491573
* Break up you_attack() into a slew of smaller functions. The functions aredshaligram2007-02-121-2/+125
| | | | | | | | | | | | | still fairly tangled, but they're better than the old monster. The idea is to also put monster-vs-player and monster-vs-monster into the melee_attack framework so that refactoring combat code with elements of 4.1 becomes easier. This is a big refactoring, so it's likely to be buggy. Some of the combat diagnostics - notably the damage rolls - are also AWOL. Will fix going forward. Note: The combat code is still classic b26. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@950 c06c8d41-db1a-0410-9941-cceddc491573
* Merged stone_soup r15:451 into trunk.dshaligram2006-11-221-1/+7
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@452 c06c8d41-db1a-0410-9941-cceddc491573
* Clean up a mistake in the SVN import.nlanza2006-08-131-0/+52
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10 c06c8d41-db1a-0410-9941-cceddc491573