summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-util.h
Commit message (Collapse)AuthorAgeFilesLines
* headers: fix inconsistent struct/class forward declarationsSteven Noonan2009-12-291-1/+1
| | | | | | | Some classes were erroneously referred to as 'struct' in forward declarations, and vice versa. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* Customisable clouds!Jude Brown2009-12-281-2/+4
| | | | | | | | | | | | | | | | | | | | | cloud_struct now has members for colour, name, and tile; colour will be used instead of the default colour of the cloud type, and will be used to recolour the tile of the cloud (if it exists). Name will be used to rebrand the cloud's description, and also alter the message generate while standing in a cloud. Finally, tile can be used to completely customise the tile used for the cloud. The value is stored as a string in order to maintain save compatibility across ASCII and tiles. A random tile (found using tile_main_count) from that set will also be used, however, no duration effects will be applied. Recoloured cloud tiles using just the colour code should be possible, though aren't yet fully tested. This commit bumps TAG_MAJOR_VERSION: changing marshalling of the FogMachine Lua code causes nasty crashes on reloading saved games. Otherwise, I don't think I broke anything else. :-)
* zap_type_to_spell(): get spell which causes zapMatthew Cline2009-11-181-0/+2
| | | | | | Go backwards from a zap_type to the spell which caused it (or would have caused it if it were a spell). Currently only handles zap types which wands use.
* Remove the Divinations school.Adam Borowski2009-11-151-1/+0
|
* Add an is_holy() function to the actor interface.David Lawrence Ramsey2009-11-091-1/+1
| | | | | | | | | | | | This is consistent with similar functions in that it checks not only for MH_HOLY holiness, but whether the monster is a priest of a good god (currently, there are none) and whether it uses holy spells (currently, there are none after the changes described below). Minor and Major Healing are now enchantments rather than holy spells. The beam code treats them as such; wands of healing aren't holy items the way e.g. wands of draining are evil items; and unholy monsters (among others, Lom Lobon!) can cast these spells.
* Replace uses of spelltype_name with spelltype_long_name.Vsevolod Kozlov2009-11-081-2/+0
|
* Remove unnecessary header include.Robert Vollmert2009-10-311-2/+1
|
* Implement FR 2872334 'don't auto-target neutrals' by replacing most uses of ↵Charles Otto2009-10-061-1/+1
| | | | TARG_ENEMY with TARG_HOSTILE.
* Drop obsolete CVS last-committed headers ($Author$).Adam Borowski2009-10-061-2/+0
|
* Clean up includes a bit.David Lawrence Ramsey2009-09-301-2/+0
|
* Generalize the check for Vehumet supported spells. Add Shatter and Lee's ↵evktalo2009-09-301-0/+2
| | | | | | Rapid Deconstruction (SPELL_FRAGMENTATION) to the list. Signed-off-by: evktalo <evktalo@users.sourceforge.net>
* Vehumet modifications. Remove the warding effect, replace it with extended ↵Charles Otto2009-09-301-1/+2
| | | | | | | | range for conjurations spells. Starting at **** piety reduce the cost of high level (>=5) conjurations and summonings spells by 1. (Additional wording tweaks by Eino) Signed-off-by: evktalo <evktalo@users.sourceforge.net>
* Add more spelling fixes.David Lawrence Ramsey2009-09-241-1/+1
|
* Take range information from the beam if applicable in spell_direction().haranp2009-02-041-1/+2
| | | | | | | Implements [2553289]. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8889 c06c8d41-db1a-0410-9941-cceddc491573
* Expand effect applicator functions to take an actor parameter, and use dolorous2009-01-191-13/+17
| | | | | | | | it for holy word in order to generalize it. This way, monsters as well as players may be able to use it in the future. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8598 c06c8d41-db1a-0410-9941-cceddc491573
* Rename Transmigration -> Transmutation.j-p-e-g2009-01-111-1/+1
| | | | | | | | Move randart spellbook tiles into subfolder /artefact, like for other artefacts. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8415 c06c8d41-db1a-0410-9941-cceddc491573
* First draft of the spell noisyness system: spells cast by the player and byzelgadis2008-12-131-24/+2
| | | | | | | | | | | | | | | | | | | | | | | wizard/priest monsters now make noise, with the loudness depending upon level and spell disciplines: conjuration spells have a loudness equal to their level, spells containing only air and/or poison equal to 50% of their level (rounded up), and everything else to 75% of the level (rounded up). This undoudedtly needs rebalancing, and a better level+disciplines -> loudness formula. Also, each spell can have it's loudness tweaked from the default via the noise_mod field of the spell_desc field in spl-data.h, for those spells whose desired loudness don't quite fit into whatever formula is used. The messages used to announce a spell have been moved out to source/dat/database/monspell.txt, which uses the same format and conventions as monspeak.txt. So far this has just been used to make invisible wizard/priest monsters give a message to the player if the player can hear them cast, and also to make curse skulls and Murray not "gesture wildly". However, it could be used to give a greater variety of spell announcement messages based upon the spell used or the monster's type/species/genus, and/or to give multi-part messages. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7820 c06c8d41-db1a-0410-9941-cceddc491573
* Non-weighted themed randart spellbooks, and prices for randart spellbooks.zelgadis2008-12-051-0/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7746 c06c8d41-db1a-0410-9941-cceddc491573
* Savefile compatibility breakage from keeping track of which spells have beenzelgadis2008-12-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | seen. Implemented fixed-level randart spell books, which is all randart spellbooks as of now. All my attempts at sorting the spell list so that spells with the same schools group together have utterly failed. Got rid of the hackish "non-monster origin is stored in item.orig_monnum as (-origin - 2)" logic, replaced with the slightly less hackish "-origin". Added the two enumerations IT_SRC_START and IT_SRC_SHOP to do it. Also, origin_is_god_gift() and origin_is_acquirement() can retrieve the god/source of the item so that you don't have to do the negation and typecasting yourself. Added some new spell flags: * SPFLAG_BATTLE for non-conjuration spells which are still combat/battle related (branding spells and single school attack spells like "Pain"), * SPFLAG_CARD for spells which are card-type effects which don't show up in ordinary spellbooks (Tomb of Doroklohe and (I assume) Disintigrate) * SPFLAG_TESTING for spells which are only used for testing (Debugging Ray) * SPFLAG_DEVEL for spells that are still under development (Crush, Disrupt, and Detect Magic). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7742 c06c8d41-db1a-0410-9941-cceddc491573
* Implement FR 1894211: All transformations will now cause your equipmentj-p-e-g2008-10-261-5/+0
| | | | | | | | | | | | | | | | | | to meld into your body than rather than being removed, so that when untransforming you don't have to put everything on again. * Wielded stuff cannot be melded, and does not yet use the autoswap function. * As before, the low-level transformation spells refuse to work with cursed equipment. * The messages are unnecessarily spammy if you change forms while already transformed (first everything is re-equipped, then unequipped again). Conversely, on simply untransforming the lack of messages might be confusing. * Might be buggy, feedback welcome! git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7300 c06c8d41-db1a-0410-9941-cceddc491573
* Ranges redone. bolt no longer has a rangeMax, just a range.haranp2008-09-251-0/+7
| | | | | | | | | Almost all ranges are now capped by LOS. There are still some things missing, most noticeably randomizing ranges for the range-1-to-2 spells (e.g. Flame Tongue.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6984 c06c8d41-db1a-0410-9941-cceddc491573
* Massive overhaul to move towards coord_def().haranp2008-07-301-3/+6
| | | | | | | | | | This might have introduced some bugs: I now get intermittent crashes on startup (this might have to do with the changes to special_room.) Sorry about that - committing before I need to do any more big conflict resolutions. Fixes coming later. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6732 c06c8d41-db1a-0410-9941-cceddc491573
* Implemented monster spell miscasts. Spell miscasting is now handledzelgadis2008-07-291-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by the MiscastEffect class, which has helper methods to make most of the non-helper code agnostic with respect to whether the miscaster is the player or a monster. Mummy death curses now affect monsters, and Zot traps now directly affect friendly and good-neutral monsters. In wizard mode you can force the player or a monster to miscast by targeting it and pressing 'M'. Todo/issues/notes: * Clouds now have a killer_type in addition to a kill_category. * There aren't any divination monster miscast effects yet. * Many of the harmless message-only miscast effects are missing monster messages. * If a monster actually miscasts a spell (not getting a mummy death curse or setting off a Zot trap) and this kills both the monster and the player then the wrong monster will be listed in hiscore entry. Since monsters can't do true spell miscasts yet, this can wait. * There was old, non-functioning code making Zot traps heal, haste or turn invisible hostile monsters that triggered it. I fixed it and then commented it out. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6723 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 2021696: allow_self_target = no even forbidding self-targetting forj-p-e-g2008-07-281-1/+2
| | | | | | | | | | area effect spells (now prompts) Fix 2028704: spell view toggle 'I' preventing forgetting spell slot 'I' Allow intelligent summoned monsters to equip themselves. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6703 c06c8d41-db1a-0410-9941-cceddc491573
* More cleanups.haranp2008-07-241-27/+10
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6669 c06c8d41-db1a-0410-9941-cceddc491573
* Pan overhaul:dshaligram2008-07-201-0/+1
| | | | | | | | | | | | | | | Allow monsters (including player ghosts) to use fire storm and ice storm, give Lom Lobon ice storm and Cerebov fire storm. Lom Lobon also gets conjure ball lightning. Mnoleg gets Summon Horrible Things instead of polymorph/shadow creatures. Gloorx gets symbol of torment instead of summon demon. Hellion hellfire burst now behaves the same way for both hellion vs player and hellion vs monster. Merged monster vs player and m vs m handling for direct spell effects such as smiting. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6621 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 2015315 by not even bothering to prompt for spells with thej-p-e-g2008-07-111-1/+1
| | | | | | | SPFLAG_NOT_SELF flag. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6492 c06c8d41-db1a-0410-9941-cceddc491573
* Only apply targeting via monster list to spells and such wherej-p-e-g2008-07-021-1/+1
| | | | | | | targeting monsters is actually needed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6338 c06c8d41-db1a-0410-9941-cceddc491573
* Bug 2005002: Allow friendly and neutral-good monsters to cast spells while inzelgadis2008-06-291-0/+3
| | | | | | | | | sanctuary, and allow hostile and neutral monsters to cast spells once outside of sanctuary as long as it won't harm anything inside of sanctuary. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6205 c06c8d41-db1a-0410-9941-cceddc491573
* Add whitespace fix.dolorous2008-06-181-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5938 c06c8d41-db1a-0410-9941-cceddc491573
* Add whitespace fixes.dolorous2008-04-201-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4399 c06c8d41-db1a-0410-9941-cceddc491573
* Fixes to compile with Visual C++. Moved direct.cc and direct.h to directn.* ↵dshaligram2008-04-191-1/+1
| | | | | | to avoid conflict with VC++ direct.h header. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4390 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed spell name cache asserting on invalid spells.dshaligram2008-04-011-0/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4017 c06c8d41-db1a-0410-9941-cceddc491573
* "?/" can now be used to look up items. A side effect of this is thatzelgadis2007-12-061-0/+1
| | | | | | | | | | | | | item descriptions have been moved to dat/descript/items.txt and dat/descript/unident.txt. STL maps are now used to look up exact matches for the names of monsters, features and spells, so that looking them up with "?/" won't get too slow if there's a large descriptions DB and each key has to be tested if its a monster/spell/etc. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3009 c06c8d41-db1a-0410-9941-cceddc491573
* Spell changes: strengthened stone arrow and the storms, weakened bolts of ↵dshaligram2007-10-251-1/+1
| | | | | | | | fire and cold, and crystal spear. (Re)allow partial spell names when using &Z in wizmode. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2543 c06c8d41-db1a-0410-9941-cceddc491573
* Added fog machine Lua map markers. Needs a C interface to make it usablezelgadis2007-10-181-2/+3
| | | | | | | | | | | | | | | in level generation. Clouds now have a "spread rate" field, which by default uses the same per-cloud-type rate as before (normal spread rate for steam, grey smoke and black smoke, no spreading for other cloud types). Might want to make the spread rate decrease as the cloud spreads (currently it remains unchanged). Added new dungeon event type "entered level", to complement "entering level". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2489 c06c8d41-db1a-0410-9941-cceddc491573
* Refix &Z crash-fix, which didn't actually fix the crash. :Pdshaligram2007-10-051-1/+0
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2335 c06c8d41-db1a-0410-9941-cceddc491573
* ?/ now asks if you want to describe a monster, spell, or feature, andzelgadis2007-09-241-0/+3
| | | | | | | | | | | | | | | | | | | filters out matches if they aren't of the desired type. If there's more than one match, after selecting a match to look at, exiting from the description will return you to the menu, rather than to the dungeon. If you've asked for monsters, you can toggle sorting of the menu between alphabetical and by aproximated monster toughness (this probably still needs some work, since it seems to say that ordinary worms are tougher than brain worms). Only the monster symbol is coloured when showing a menu of monsters to describe. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2185 c06c8d41-db1a-0410-9941-cceddc491573
* Introduces three new wall types, translucent versions of the normalzelgadis2007-09-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rock wall, stone wall and permanent rock wall. These are for use in vaults, and are never randomly generated. Magically translucent versions of the normal wall types are used, rather than glass, so we don't have to figure out how glass would react to things like digging and Shatter, but can re-use the code for the normal wall types. I've tried to fix all the places where the old code assumes that any square which is visible to the player has no walls between it and the player, but I've probably missed lots; this will require a lot of play testing before its ready for non-developers. viewwindow() now has two calls to losight(), the second one determining what squares would be visible if all translucent walls were made transparent, so that there's a quick way to see if there's any translucent walls between the player and a square. This second call to losight() doesn't cause any noticeable slowdown for me, but it might on an older system. Other than viewwindow() making a second call to losight(), there shouldn't be any changes to game-play or game-logic if there aren't any translucent walls around. The wizard blinking command (&b) has been changed so that it ignores all normal restrictions except for needing to see the target square and not landing on monsters; if the player lands on a wall square it's changed to floor. Wizard blinking also doesn't increase magical contamination. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2145 c06c8d41-db1a-0410-9941-cceddc491573
* Split off portions of externs.h and enum.h into other files. Thezelgadis2007-09-151-0/+24
| | | | | | | | | | | | | 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
* Applied Enne's fix to 1795522: "show_beam shouldn't workj-p-e-g2007-09-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | when just looking..." While I was at it, I also added another parameter needs_path that is set to false for spells that can be applied directly to a target (SPFLAG_GRID, SPFLAG_TARGET) such as Smiting, Conjure Flame or Freezing Cloud, so for these the initial beam path doesn't show, even if the option should be set to true. Note "initial beam path" - you can still toggle it to show the path anyway. For cases such as this we might enforce not drawing the path but there would have to be some kind of feedback, so the player doesn't go crazy trying to toggle the option. ;) I'll probably do it later, once I've found a way to give the information. Or would that be too spoily, in any case? git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2091 c06c8d41-db1a-0410-9941-cceddc491573
* Lots and lots of type safety.haranp2007-07-081-2/+2
| | | | | | | | Caught a bug in the definition of shadows (isn't it lucky that BLACK == MST_NO_SPELLS?) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1788 c06c8d41-db1a-0410-9941-cceddc491573
* Spell power strings now reflect power caps.haranp2007-05-071-0/+4
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1413 c06c8d41-db1a-0410-9941-cceddc491573
* Type safety, cast cleanups, etc.haranp2007-05-011-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1401 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed surges being all wrong (1705614.)haranp2007-04-231-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1345 c06c8d41-db1a-0410-9941-cceddc491573
* More code cleanups and type safety.haranp2007-04-141-2/+2
| | | | | | | Fixed a semi-bug (undefined behaviour) in undead_cannot_memorise(). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1302 c06c8d41-db1a-0410-9941-cceddc491573
* Added ice statues.dshaligram2007-04-091-18/+26
| | | | | | | | | | Monster spells now use spell_type instead of the old mon_spell_type. Fixed buggy behaviour when banished from Labyrinth. DGL_WHEREIS was not including current time, fixed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1275 c06c8d41-db1a-0410-9941-cceddc491573
* Cleaned up clouds and threw out the foo_MON values from the cloud enum. Thedshaligram2007-03-221-2/+3
| | | | | | | | | | | creator of the cloud is now remembered with the cloud, so kills from friendlies' poison clouds are credited appropriately. Increased MAX_CLOUDS to 180. Breaks save compatibility. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1076 c06c8d41-db1a-0410-9941-cceddc491573
* Move spell targeting before miscast check. Not everything is moved - spellsdshaligram2007-03-141-1/+4
| | | | | | | | | | with weird targeting (like Conjure Flame) still target after the miscast check. Tweaked targeting prompt slightly. Don't dock turn for zapping non-wand. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1039 c06c8d41-db1a-0410-9941-cceddc491573
* direction() cleanup, stage 2: look_around is gone, everything unifiedharanp2007-01-251-1/+2
| | | | | | | | | | | | into a single function (well, two.) Since '>' is taken, '!' is now used for requesting that the beam stop short at a specific point. However, this is currently buggy: ' ', '.' and '!' all do the same thing for now - the beam will *always* stop right there. Fixing this will need a bit of hacking at the zapping functions. Don't worry, it'll get done. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@887 c06c8d41-db1a-0410-9941-cceddc491573