summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libutil.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix possessive of "himself".Neil Moore2014-08-081-4/+1
| | | | Apparently I completely forgot to clean up after my copy-pasting.
* TidyNicholas Feinberg2014-08-071-5/+5
|
* Don't say "itself's" etc.Neil Moore2014-08-071-0/+18
|
* Remove stuffNicholas Feinberg2014-07-291-387/+3
| | | | | | | .cc, moving its contents into the new stepdown.cc and strings.cc. (The latter also got many donations from libutil.h.) Down with stuff! Up the new flesh!
* Avoid conflict with libraries' HAVE_*Neil Moore2014-07-121-1/+1
|
* Don't redefine strlcpy if it already exists.Neil Moore2014-05-311-0/+2
| | | | | | | Check for strlcpy at compile time and define our version only if necessary. This should fix recurrent warnings on Macs (and probably other BSDs).
* Remove Shedureaverb2014-05-131-5/+5
| | | | | They never really worked as enemies - their only unique aspect, partner resurrection, was just annoying.
* Simplify.Neil Moore2014-03-281-3/+1
| | | | Also allow nonexistent things like hell-raiju to pluralise correctly.
* Remove giant amoebaeChris Campbell2014-02-241-5/+1
| | | | | | | | They were almost identical to slime creatures except without the merging ability, and barely appeared outside of a few vaults anyway. Split their weight mostly between brown oozes and slime creatures in vaults and Slime branch spawns. Removed a couple of Slime-only vaults that placed only giant amoebae, possibly they would be fine with slime creatures instead.
* Drop double newlines where they seem to serve no purpose.Adam Borowski2013-12-211-2/+0
| | | | | Sometimes, they're there to emphasize a break between two sections of code, which is good. In a majority of cases, though, they're just inconsistent.
* [txc] Allow breaking lines between 2 tags.Raphael Langella2013-12-121-0/+2
| | | | | | | | | | | | This helps readability quite a lot. Although it means that putting a whitespace between 2 tags should be avoided when possible, because it might be removed on unwrap (both by txc and crawl), if the line break happens to be on this specific whitespace. Quite unlikely, but if it does happen, it can be fixed by using a non-breaking space (0xA0). Note that it works by inserting a line feed (\f) between tags which is later removed. This makes lines containing consecutive tags to have a slightly shorter maximal length.
* Add a <nomouse> tag to avoid duplicating text for console and webtiles.Raphael Langella2013-12-071-0/+2
|
* Correctly pluralise raiju as raiju.Steve Melenchuk2013-11-281-0/+2
|
* Drop tagstring.{cc,h}Adam Borowski2013-11-291-0/+9
| | | | A whole file for four lines of code.
* Remove sighup_save_and_exit().Adam Borowski2013-11-251-8/+1
| | | | | | | | | | As the comment said, every single use of this function was a save-corrupting bug. Too bad, there's one case left: on Unix, HUP will fclose(stdin), which can immediately fail due to fclose() using malloc (free() to be exact), and then it still relies on undefined behaviour which sometimes works only because ncurses does weird things behind our back.
* Unbreak win32 tile builds.Adam Borowski2013-11-251-2/+6
| | | | Sadly, if this pseudo-signal ever happens, it will kill a game without saving.
* Allow graceful shutdown rather than a forced save (win32 console).Adam Borowski2013-11-251-7/+4
| | | | | | This injects a fake key code into the input stream, making the syscall return. The pseudo-signal handler thread will then wait forever (for a value of "forever" of 15 seconds).
* More formatting fixes for return (...);Neil Moore2013-11-151-6/+6
|
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-10/+10
|
* Add big fat (but not fat or scary enough) warnings about save corruption.Adam Borowski2013-10-291-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | On a modern computer, crawl tends to process commands fast enough that closing the game is likely to happen during some waiting for event loop, and thus typically not cause not cause a lock-up or memory corruption but "merely" allow cheating. This is not acceptable, and once in a while you get more classical results of doing naughty stuff from a signal handler. One way of fixing this would be setting a flag (seen_hups) and killing any functions that wait for an event. This can be tricky because: * ncurses like to sabotage EINTR. We need to abort it both on SIGHUP and on SIGWINCH, without race conditions. The documentation says SIGWINCH is supposed to return a pseudo key code, KEY_RESIZE but this doesn't seem to be working. Not sure how to abort it on HUP. * win32's console functions don't have an equivalent to EINTR. Perhaps injecting a fake key with WriteConsoleInput would work? * same for tiles and Android. * yesno() without a safeanswer will loop forever
* Allow easily aborting mapstat.Adam Borowski2013-10-131-0/+13
| | | | Ctrl-C should probably be enabled during database rebuild, too.
* Reformat multi-line array literals.Adam Borowski2013-10-051-2/+4
|
* Remove an unnecessary pluralisation caseChris Campbell2013-08-091-2/+0
|
* Rename unborn deep dwarf to unborn, change glyph to LChris Campbell2013-08-091-1/+1
| | | | | | The notable thing about them is being undead with scary spells (making L an appropriate glyph) - they don't make any sense as deep dwarves since they have no way to heal.
* New water monster for Forest: Thorn LotusDracoOmega2013-06-241-2/+5
| | | | | | | | These are very slow moving (but faster acting) aquatic plants that can fire volleys of thorns, intended to fill a lower-tier support role for water encounters. They are permaconfused, with the intent of this randomized movement being to simulate 'drifting' along the currents of the water.
* Merge branch 'master' into djinnAdam Borowski2013-05-291-0/+1
|\
| * New monster: JiangshiDracoOmega2013-05-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are a comparatively straightforward melee threat to help shore up and vary the backbone of Crypt after the reduction in skeletal warriors and major zombies. Moreover, they have faster-than-average movement, a quality in short supply in the branch. They have two vampiric claw attacks and sixfirhy-like movement, except more erratic and slower overall (accounting for the turns they skip, they have an effective movement speed of a little under 16 and an action speed around 9.5) This commit also replaces the plain vampires in vampire mage bands with jiangshi.
* | Gather some smokeless fire, and call in DJ Inn.Adam Borowski2013-04-281-0/+5
|/
* Add support for a :nowrap tag at the beginning of descriptions.Raphael Langella2013-02-071-0/+13
| | | | | | | | | | | | Instruct the game that the entry doesn't need to be unwrapped, and the (upcoming) new transifex interface to not wrap it. For some entries, like in tutorial, wrapping actually impair readability and can make it hard or impossible to achieve proper formatting. More tags could be added to give meta information on entries which could help translations. I'm thinking of stuff like :gender or :plural. They could take a value too. They'd need to be parsed earlier though (db loading?) and stored somewhere.
* improved background and restore routines for Android; now traps WM_ACTIVEEVENTChris West2013-01-191-16/+2
| | | | instead of using callbacks
* fixed issue with crawl not closing when sent to background in AndroidChris West2013-01-191-2/+16
|
* Fix a compiler warning (unused function in tile builds).Adam Borowski2012-12-171-8/+2
|
* Don't abort local tile games when a controlling terminal gets closed.Adam Borowski2012-12-131-1/+8
| | | | | | | | | | They were saved from a signal handler, which is likely to result in corrupted sabes (as the game state is inconsistent), or at least in crashes. Note that EVERY SINGLE CALL to sighup_save_and_exit() is a bug: corrupting saves, allowing cheats, etc -- and in the only legitimate use, it's code redundant with CMD_SAVE.
* Fix [foo|bar]-style substitutions not being resolved properly in some cases.Adam Borowski2012-11-241-1/+1
|
* Remove unnecessary includes from header files.Jay3.14152012-10-231-0/+1
| | | | | | | | | | 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.
* Add spelling fixes.David Lawrence Ramsey2012-10-121-2/+3
|
* Improve speech syntax: capitalization and random substrings.Jay3.14152012-10-131-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. @The_monster@ shouts, "I hate you, @CAPS@ @player_name@ @NOCAPS@!" will result in the actual player name being capitalized. (Spaces are trimmed.) 2. @The_monster@ says, "I am [very ||really ] hungry." will randomly result in "I am very hungry", "I am hungry" or "I am really hungry". If the pattern turns up a lot, you need to assign weights to the different choices, or you require nested random sets, you'll need to stick to the old fallback of defining ad hoc @keywords@. Otherwise, this should make things somewhat simpler. Works for both monster and weapon speech, including shouts, noisy weapons and the Singing Sword. I've also taken the liberty to update the speech documentation, which still listed the old website (!) and pointed users looking for advice to the newsgroup). Conflicts: crawl-ref/source/art-func.h crawl-ref/source/libutil.cc crawl-ref/source/libutil.h Signed-off-by: Florian Diebold <flodiebold@gmail.com>
* Android port.frogbotherer2012-09-081-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2 files are added to the root of the repository: * AndroidAppSettings.cfg: settings file required for Android SDL port. Will change on each minor release to reset configuration. * AndroidBuild.sh: script called by the Android SDL port to commence building the game itself It might be nice to be able to move them elsewhere, but for now, their presence here is required. The build process is documented in docs/develop/android.txt There's a TOUCH_UI compiler flag which sets all the things specific to a touch screen interface. There has been a large amount of changes in the Makefile for redefining where the dat/, saves/, etc. directories go, because the "install" part of the make isn't the final destination for these files under Android - the environment we deploy to is a separate device from the build environment. There is also a number of changes to the tiles interface. Some are specific to the TOUCH_UI, but others are also changed in USE_TILE_LOCAL. Touch only: * 'a'bilities menu goes straight to menu without prompting first * tap menu header to toggle/submit * menu instead of prompt to select which corpse to butcher * same for eating food from the floor (those 2 could go in local tiles too) * show_more defaults to false and less --more-- messages * pickup mode defaults to menu * defaults for tile_layout_priority is different (commands are more important than inventory) * popup for yes/no prompts, level-up stat gain and swapping rings (should be used for all prompts, and probably local tiles too) * spell casting: force selection menu * map mode: left-click rather than right-click for mouse mode; autotravel on left-click removed * remove skills training and memorisation panels Also local tiles (some could also be integrated in webtiles): * commands below description are clickable * clickable shopping menu (uses PrecisionMenu) * split the command panel in 2 (common actions and system commands) * add a map command panel * tapping or left-clicking the player is smarter: * picks up the item if there's one on the tile, otherwise * shows pick-up menu if there's several items on the tile, otherwise * traverses stairs (or enters a portal or shop) if one is present, otherwise * prays if an altar is present, otherwise * waits one turn * right-clicking the map enters map mode and brings the map commands tab to the front; map mode stays until exited rather than upon release of mouse Some more details can be found in android_patch_notes.txt on #5677 (although some TODOs are already obsolete). Signed-off-by: Raphael Langella <raphael.langella@gmail.com>
* Use std namespace.Raphael Langella2012-08-261-100/+88
| | | | | | | | | | | | | I had to rename distance() (in coord.h) to distance2() because it conflicts with the STL function to compare 2 iterators. Not a bad change given how it returns the square of the distance anyway. I also had to rename the message global variable (in message.cc) to buffer. I tried to fix and improve the coding style has much as I could, but I probably missed a few given how huge and tedious it is. I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool and util/levcomp.*, because I have no clue about those.
* Drop a bunch of parentheses from return statements.Adam Borowski2012-08-081-1/+1
| | | | | This is incomplete, partially because of me getting bored, partially because of doubts about the point of leaving simple addition/etc in parentheses.
* Properly pluralise "marigold" -> "marigolds".Neil Moore2012-08-011-1/+1
| | | | | | Currently irrelevant (@_colour_name_@ is used as an adjective and thus never pluralised), but really the self-"plural" should be restricted to the mass noun "gold" and not to its compounds.
* Add more item types to the AP menu.Jon Knapp2012-08-011-1/+2
| | | | | | | | This is a combination of 4 commits: added food and misc items to the AP menu catagorized foods in the AP menu and added gold reduced food categories to two small autopickup menu bugfixes
* Weak-ass text popup for --help on Windows tiles.Adam Borowski2012-07-161-0/+4
| | | | | | | | | It uses MessageBoxW() which has two flaws: * you can't copy&paste text * columns are badly misaligned I guess the former is what Windows users are already used to, but the latter looks abysmal.
* Some more return deparenthesization.Adam Borowski2012-07-051-1/+1
|
* Remove parentheses around return (simple_function_call).Adam Borowski2012-07-051-1/+1
| | | | For way too paranoid and underinclusive values of "simple".
* String scalars are scalars, too.Adam Borowski2012-07-051-2/+2
|
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-29/+29
|
* Fix tiles/console database untagging.Eino Keskitalo2012-06-281-1/+1
|
* <webtiles> and <localtiles> tags.Adam Borowski2012-06-271-21/+22
|
* Fix <console> logic being reversed.Adam Borowski2012-06-271-1/+1
|