Thread: [crawl-ref-commits] SF.net SVN: crawl-ref: [3084] trunk/crawl-ref (Page 2) (2024)

Status: Beta

Brought to you by:castamir,dploog,evktalo,neilmoore,and 3 others

  • Summary
  • Files
  • Reviews
  • Support
  • Mailing Lists
  • Tickets ▾
    • Bugs
    • Feature Requests
    • Patches
  • News
  • Git ▾
    • crawl-ref
    • freetype
    • libpng
    • lua
    • luajit
    • pcre
    • sdl
    • sdl-image
    • sqlite
    • More...
  • SVN

Menu▾▴

  • crawl-ref-builds
  • crawl-ref-commits
  • crawl-ref-discuss

crawl-ref-commits

[crawl-ref-commits] SF.net SVN: crawl-ref: [3084] trunk/crawl-ref

From: <zel...@us...> - 2007-12-17 10:03:49

Revision: 3084 Author: zelgadisDate: 2007-12-17 02:03:47 -0800 (Mon, 17 Dec 2007)Log Message:-----------Experimental "improved" explore algorithm which can be turned on byadding "explore_improved=true" to crawlrc. The intent is to reducebacktracking and zig-zagging during auto-explore. Currently only workswith non-greedy explore since I can't yet figure out how to intelligentlycombine it with greediness.Modified Paths:-------------- trunk/crawl-ref/docs/crawl_options.txt trunk/crawl-ref/source/acr.cc trunk/crawl-ref/source/externs.h trunk/crawl-ref/source/files.cc trunk/crawl-ref/source/initfile.cc trunk/crawl-ref/source/player.cc trunk/crawl-ref/source/travel.ccModified: trunk/crawl-ref/docs/crawl_options.txt===================================================================--- trunk/crawl-ref/docs/crawl_options.txt2007-12-17 06:38:07 UTC (rev 3083)+++ trunk/crawl-ref/docs/crawl_options.txt2007-12-17 10:03:47 UTC (rev 3084)@@ -40,11 +40,11 @@ scroll_margin 4-g Travel and Exploration. travel_delay, travel_avoid_terrain,- explore_greedy, explore_stop, tc_reachable,+ explore_greedy, explore_stop, explore_improved, tc_reachable, tc_dangerous, tc_excluded, tc_exclude_circle,- travel_stop_message, runrest_ignore_message, + travel_stop_message, runrest_ignore_message, runrest_ignore_poison, runrest_ignore_monster,- trapwalk_safe_hp + trapwalk_safe_hp 4-h Stashes. stash_tracking, stash_filter 4-i Command Enhancements.@@ -631,6 +631,11 @@ last explore_stop line will override all previous explore_stop lines. +explore_improved = false+ If set to true explore will used an expiremental improved algorithm+ which is meant to reduce backtracking and zig-zagging. Currently+ only works with non-greedy explore.+ tc_reachable = blue tc_dangerous = cyan tc_disconnected = darkgreyModified: trunk/crawl-ref/source/acr.cc===================================================================--- trunk/crawl-ref/source/acr.cc2007-12-17 06:38:07 UTC (rev 3083)+++ trunk/crawl-ref/source/acr.cc2007-12-17 10:03:47 UTC (rev 3084)@@ -3661,6 +3661,7 @@ { move_x = random2(3) - 1; move_y = random2(3) - 1;+ you.reset_prev_move(); } const int new_targ_x = you.x_pos + move_x;@@ -3755,6 +3756,9 @@ if (!move_player_to_grid(targ_x, targ_y, true, false, swap)) return; + you.prev_move_x = move_x;+ you.prev_move_y = move_y;+ move_x = 0; move_y = 0; @@ -3766,7 +3770,11 @@ // BCR - Easy doors single move if (targ_grid == DNGN_CLOSED_DOOR && Options.easy_open && !attacking)+ { open_door(move_x, move_y, false);+ you.prev_move_x = move_x;+ you.prev_move_y = move_y;+ } else if (!targ_pass && !attacking) { stop_running();Modified: trunk/crawl-ref/source/externs.h===================================================================--- trunk/crawl-ref/source/externs.h2007-12-17 06:38:07 UTC (rev 3083)+++ trunk/crawl-ref/source/externs.h2007-12-17 10:03:47 UTC (rev 3084)@@ -552,6 +552,9 @@ int x_pos; int y_pos; + int prev_move_x;+ int prev_move_y;+ int hunger; FixedVector<char, NUM_EQUIP> equip; @@ -740,6 +743,9 @@ // changing x_pos and y_pos directly. void moveto(int x, int y); void moveto(const coord_def &c);++ coord_def prev_move() const;+ void reset_prev_move(); bool in_water() const; bool can_swim() const;@@ -1643,6 +1649,9 @@ // How much more eager greedy-explore is for items than to explore. int explore_item_greed;++ // Some experimental improvments to explore+ bool explore_improved; std::vector<sound_mapping> sound_mappings; std::vector<colour_mapping> menu_colour_mappings;Modified: trunk/crawl-ref/source/files.cc===================================================================--- trunk/crawl-ref/source/files.cc2007-12-17 06:38:07 UTC (rev 3083)+++ trunk/crawl-ref/source/files.cc2007-12-17 10:03:47 UTC (rev 3084)@@ -909,6 +909,10 @@ you.transit_stair, stair_taken, DNGN_UNSEEN); unwind_bool ylev(you.entering_level, true, false); + // Going up/down stairs, going through a portal, or being banished+ // means the previous x/y movement direction is no longer valid.+ you.reset_prev_move();+ const bool make_changes = (load_mode != LOAD_RESTART_GAME && load_mode != LOAD_VISITOR); Modified: trunk/crawl-ref/source/initfile.cc===================================================================--- trunk/crawl-ref/source/initfile.cc2007-12-17 06:38:07 UTC (rev 3083)+++ trunk/crawl-ref/source/initfile.cc2007-12-17 10:03:47 UTC (rev 3084)@@ -684,6 +684,8 @@ explore_item_greed = 10; explore_greedy = false;++ explore_improved = false; target_zero_exp = false; target_wrap = true;@@ -2412,6 +2414,10 @@ { explore_greedy = read_bool(field, explore_greedy); }+ else if (key == "explore_improved")+ {+ explore_improved = read_bool(field, explore_improved);+ } else if (key == "stash_tracking") { stash_tracking =Modified: trunk/crawl-ref/source/player.cc===================================================================--- trunk/crawl-ref/source/player.cc2007-12-17 06:38:07 UTC (rev 3083)+++ trunk/crawl-ref/source/player.cc2007-12-17 10:03:47 UTC (rev 3084)@@ -5271,6 +5271,9 @@ x_pos = 0; y_pos = 0; + prev_move_x = 0;+ prev_move_y = 0;+ running.clear(); travel_x = 0; travel_y = 0;@@ -6227,9 +6230,23 @@ crawl_view.set_player_at(c); if (real_move)+ {+ you.reset_prev_move(); dungeon_events.fire_position_event(DET_PLAYER_MOVED, c);+ } } +coord_def player::prev_move() const+{+ return coord_def(prev_move_x, prev_move_y);+}++void player::reset_prev_move()+{+ prev_move_x = 0;+ prev_move_y = 0;+}+ bool player::asleep() const { return (duration[DUR_SLEEP] > 0);Modified: trunk/crawl-ref/source/travel.cc===================================================================--- trunk/crawl-ref/source/travel.cc2007-12-17 06:38:07 UTC (rev 3083)+++ trunk/crawl-ref/source/travel.cc2007-12-17 10:03:47 UTC (rev 3084)@@ -850,8 +850,58 @@ static void explore_find_target_square() { travel_pathfind tp;- tp.set_floodseed(coord_def(you.x_pos, you.y_pos), true);+ coord_def seed = you.pos(); + // "Improved" explore: keep moving in a line along the same+ // direction as the previous move, stop if we hit a barrier or+ // something that would slow us down, and use *that* as the+ // floodout seed. This is meant to:+ //+ // 1) Prevent explore from sticking its head in a room and then+ // backing out even though the room has unexplored corners+ // because there are unexplored squares closer than the corners.+ //+ // 2) Similarly, prevent the bevahior of going a little bit down+ // a long, straight corridor only to back out of it because+ // the nearest unexplored square in that corridor is+ // LOS_RADIUS + 1 squares away, which is further away than+ // another unexplored square which is in the opposite direction.+ // + // 3) Prevent the annoying zig-zag when exploring open spaces.+ //+ // We stop at squres that would slow us down so that we won't slog+ // across a bunch of shallow water just for the sake of going in+ // a straight line.+ //+ // Not yet used with greedy explore because I can't figure out+ // how to combined it with greediness in a way that won't display+ // weird or uninuitive behavior.+ if (you.running != RMODE_EXPLORE_GREEDY && Options.explore_improved+ && (you.prev_move_x || you.prev_move_y))+ {+ coord_def prev_move_delta = you.prev_move();++ dungeon_feature_type feature;+ do {+ seed += prev_move_delta;+ feature = grd(seed);+ } while (is_travelsafe_square(seed.x, seed.y)+ && is_traversable(feature)+ && feature_traverse_cost(feature) == 1);++ seed -= prev_move_delta;++ // Has moving along the straight line found an unexplored+ // square? If so, just use that square as the target.+ if (!is_terrain_seen(seed + prev_move_delta) && seed != you.pos())+ {+ you.running.x = seed.x;+ you.running.y = seed.y;+ return;+ }+ }+ tp.set_floodseed(seed, true);+ coord_def whereto = tp.pathfind( static_cast<run_mode_type>(you.running.runmode) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [3109] trunk/crawl-ref

From: <zel...@us...> - 2007-12-21 07:12:49

Revision: 3109 Author: zelgadisDate: 2007-12-20 23:12:38 -0800 (Thu, 20 Dec 2007)Log Message:-----------Another small improvement to the anti-zigzag algorithm. Also, thepathological case took only 20% more turns, not 50% more.Modified Paths:-------------- trunk/crawl-ref/docs/crawl_options.txt trunk/crawl-ref/source/travel.ccModified: trunk/crawl-ref/docs/crawl_options.txt===================================================================--- trunk/crawl-ref/docs/crawl_options.txt2007-12-21 06:32:59 UTC (rev 3108)+++ trunk/crawl-ref/docs/crawl_options.txt2007-12-21 07:12:38 UTC (rev 3109)@@ -636,7 +636,7 @@ auto-explore. On average it increases the number of turns taken by about 0.9%, sometimes actually speeding it up slightly and sometimes increasing the turns taken by up to 5%, with- pathological cases causing a 50% increase.+ pathological cases causing a 20% increase. tc_reachable = blue tc_dangerous = cyanModified: trunk/crawl-ref/source/travel.cc===================================================================--- trunk/crawl-ref/source/travel.cc2007-12-21 06:32:59 UTC (rev 3108)+++ trunk/crawl-ref/source/travel.cc2007-12-21 07:12:38 UTC (rev 3109)@@ -928,15 +928,17 @@ // Has moving along the straight line found an unexplored // square?- if (!is_terrain_seen(target + delta) && target != you.pos())+ if (!is_terrain_seen(target + delta) && target != you.pos()+ && target != whereto) { // Auto-explore is only zigzagging if the prefered // target (whereto) and the anti-zigzag target are // close together. if (grid_distance(target.x, target.y, whereto.x, whereto.y) <= 5- && (distance(target.x, target.y,- whereto.x, whereto.y) <= 34))+ && distance(target.x, target.y,+ whereto.x, whereto.y) <= 34)+ //&& t_dist - w_dist <= 14) { set_target_square(target); return;This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [3140] trunk/crawl-ref

From: <dsh...@us...> - 2007-12-29 04:54:48

Revision: 3140 Author: dshaligramDate: 2007-12-28 20:54:46 -0800 (Fri, 28 Dec 2007)Log Message:-----------[1849483] Wielded weapons are ignored when looking for missiles to fire, and fire_items_start defaults to 'a' again.Modified Paths:-------------- trunk/crawl-ref/docs/crawl_options.txt trunk/crawl-ref/init.txt trunk/crawl-ref/source/initfile.cc trunk/crawl-ref/source/item_use.ccModified: trunk/crawl-ref/docs/crawl_options.txt===================================================================--- trunk/crawl-ref/docs/crawl_options.txt2007-12-28 18:11:47 UTC (rev 3139)+++ trunk/crawl-ref/docs/crawl_options.txt2007-12-29 04:54:46 UTC (rev 3140)@@ -1084,11 +1084,12 @@ 4-k Missiles. ----------------- -fire_items_start = c- Sets the first inventory item to consider. Default is c.+fire_items_start = a+ Sets the first inventory item to consider when selecting+ missiles to fire. The default is a. fire_order = launcher, return, -fire_order += javelin / dart / stone / rock / spear / net / handaxe+fire_order += javelin / dart / stone / rock / spear / net / handaxe / dagger Controls the order of items autoselected for firing. Items should be separated by commas and items that appear first get higher priority. You can use multiple fire_order lines - all Modified: trunk/crawl-ref/init.txt===================================================================--- trunk/crawl-ref/init.txt2007-12-28 18:11:47 UTC (rev 3139)+++ trunk/crawl-ref/init.txt2007-12-29 04:54:46 UTC (rev 3140)@@ -213,9 +213,9 @@ ##### 4-kFiring Commands ####################### #-# fire_items_start = c-# fire_order = launcher, return, dart / stone / javelin, -# fire_order += dagger, spear, handaxe, club+# fire_items_start = a+# fire_order = launcher, return+# fire_order += javelin / dart / stone / rock / spear / net / handaxe / dagger ##### 4-lChannels ############################## #Modified: trunk/crawl-ref/source/initfile.cc===================================================================--- trunk/crawl-ref/source/initfile.cc2007-12-28 18:11:47 UTC (rev 3139)+++ trunk/crawl-ref/source/initfile.cc2007-12-29 04:54:46 UTC (rev 3140)@@ -706,11 +706,12 @@ flush_input[ FLUSH_ON_MESSAGE ] = false; flush_input[ FLUSH_LUA ] = true; - fire_items_start = 2; // start at slot 'c'+ fire_items_start = 0; // start at slot 'a' // Clear fire_order and set up the defaults. set_fire_order("launcher, return, "- "javelin / dart / stone / rock / spear / net / handaxe",+ "javelin / dart / stone / rock /"+ " spear / net / handaxe / dagger", false); item_stack_summary_minimum = 5;Modified: trunk/crawl-ref/source/item_use.cc===================================================================--- trunk/crawl-ref/source/item_use.cc2007-12-28 18:11:47 UTC (rev 3139)+++ trunk/crawl-ref/source/item_use.cc2007-12-29 04:54:46 UTC (rev 3140)@@ -1281,7 +1281,7 @@ static bool fire_item_okay(const item_def &item, unsigned flags) { return (fire_item_matches(item, flags)- && !(you.equip[EQ_WEAPON] == item.link && item_cursed(item)));+ && you.equip[EQ_WEAPON] != item.link); } static int find_fire_item_matching(unsigned fire_type, int start,This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [3441] trunk/crawl-ref

From: <j-...@us...> - 2008-02-18 15:51:31

Revision: 3441 Author: j-p-e-gDate: 2008-02-18 07:51:08 -0800 (Mon, 18 Feb 2008)Log Message:-----------First batch of Paul's patches:1896018: cycle ammo with '('1895278: no (v)iewing of unreadable books1895075: cancel Ely's abilities without costFix 1894920: fix overly long dungeon overviewAlso fix 1884145: weapon swap ignoring {!w}Modified Paths:-------------- trunk/crawl-ref/docs/crawl_manual.txt trunk/crawl-ref/source/abl-show.cc trunk/crawl-ref/source/acr.cc trunk/crawl-ref/source/command.cc trunk/crawl-ref/source/describe.cc trunk/crawl-ref/source/enum.h trunk/crawl-ref/source/item_use.cc trunk/crawl-ref/source/overmap.cc trunk/crawl-ref/source/spl-book.cc trunk/crawl-ref/source/spl-book.hModified: trunk/crawl-ref/docs/crawl_manual.txt===================================================================--- trunk/crawl-ref/docs/crawl_manual.txt2008-02-15 21:33:27 UTC (rev 3440)+++ trunk/crawl-ref/docs/crawl_manual.txt2008-02-18 15:51:08 UTC (rev 3441)@@ -655,22 +655,29 @@ sometimes. Note that this is just a typing shortcut and is not functionally different to wielding these items normally. -You can press '(' or ')' to show your primary (wielded) and secondary+You can press ')' to show your primary (wielded) and secondary (slot b) weapons, as well as the preferred missiles (to be shot when using 'f' to fire). ( Ammunition: --------------If you would rather pick off monsters from a safe distance, you will -need ammunition for your sling, bow, or other appropriate launcher. -Several kinds of ammunition, such as javelins, are effective when simply -thrown; other kinds require you to wield an appropriate device to -inflict worthwhile damage. Ammunition has only one "plus" value, which -affects both accuracy and damage. If you have ammunition suitable for -what you are wielding, the 'f' command will choose the first lot in your -inventory, or you can use the 't' command to throw anything. If you are -using the right kind of hand weapon, you will "shoot" the ammunition, -otherwise you will "throw" it. At times it is also sensible to throw ++If you would rather pick off monsters from a safe distance, you will+need ammunition for your sling, bow, or other appropriate launcher.+Several kinds of ammunition, such as javelins, are effective when simply+thrown; other kinds require you to wield an appropriate device to+inflict worthwhile damage. Ammunition has only one "plus" value, which+affects both accuracy and damage.++The 'f' command fires a piece of ammunition, chosen from lots suitable+for your weapon and defaulting to your preferred lot (or "quiver"),+typically the last lot you fired. Use the '(' command if you want to+change your quiver without firing. Use the 't' command to throw+anything.++Regardless of their mnemonics, if you are using the right kind of hand+weapon both 'f' and 't' will make you "shoot" the ammunition.+Otherwise, you will "throw" it. At times it is also sensible to throw weapons like spears, daggers, or hand axes. The interface for shooting or throwing things is also used for zappingModified: trunk/crawl-ref/source/abl-show.cc===================================================================--- trunk/crawl-ref/source/abl-show.cc2008-02-15 21:33:27 UTC (rev 3440)+++ trunk/crawl-ref/source/abl-show.cc2008-02-18 15:51:08 UTC (rev 3441)@@ -1603,7 +1603,7 @@ case ABIL_ELYVILON_LESSER_HEALING: if (!cast_healing( 3 + (you.skills[SK_INVOCATIONS] / 6) ))- break;+ return false; exercise( SK_INVOCATIONS, 1 ); break;@@ -1615,7 +1615,7 @@ case ABIL_ELYVILON_HEALING: if (!cast_healing( 10 + (you.skills[SK_INVOCATIONS] / 3) ))- break;+ return false; exercise( SK_INVOCATIONS, 3 + random2(5) ); break;@@ -1629,7 +1629,7 @@ case ABIL_ELYVILON_GREATER_HEALING: if (!cast_healing( 20 + you.skills[SK_INVOCATIONS] * 2 ))- break;+ return false; exercise( SK_INVOCATIONS, 6 + random2(10) ); break;Modified: trunk/crawl-ref/source/acr.cc===================================================================--- trunk/crawl-ref/source/acr.cc2008-02-15 21:33:27 UTC (rev 3440)+++ trunk/crawl-ref/source/acr.cc2008-02-18 15:51:08 UTC (rev 3441)@@ -1222,6 +1222,7 @@ case CMD_INSCRIBE_ITEM: case CMD_TOGGLE_AUTOPRAYER: case CMD_MAKE_NOTE:+ case CMD_CYCLE_QUIVER_FORWARD: mpr("You can't repeat that command."); return false; @@ -2257,6 +2258,18 @@ macro_add_query(); break; + case CMD_CYCLE_QUIVER_FORWARD:+ {+ const int cur = you.quiver[get_quiver_type()];+ if (cur != ENDOFPACK)+ {+ const int next = get_fire_item_index((cur+1) % ENDOFPACK, true, false);+ you.quiver[get_quiver_type()] = next;+ you.quiver_change = true;+ }+ break;+ }+ case CMD_LIST_WEAPONS: list_weapons(); break;@@ -3302,8 +3315,8 @@ case '{': return CMD_INSCRIBE_ITEM; case '[': return CMD_LIST_ARMOUR; case ']': return CMD_LIST_EQUIPMENT;+ case '(': return CMD_CYCLE_QUIVER_FORWARD; case ')': return CMD_LIST_WEAPONS;- case '(': return CMD_LIST_WEAPONS; case '\\': return CMD_DISPLAY_KNOWN_OBJECTS; case '\'': return CMD_WEAPON_SWAP; case '`': return CMD_PREV_CMD_AGAIN;Modified: trunk/crawl-ref/source/command.cc===================================================================--- trunk/crawl-ref/source/command.cc2008-02-15 21:33:27 UTC (rev 3440)+++ trunk/crawl-ref/source/command.cc2008-02-18 15:51:08 UTC (rev 3441)@@ -1593,7 +1593,8 @@ "<h>Player Character Information:\n" "<w>@</w> : display character status\n" "<w>[</w> : display worn armour\n"- "<w>(</w> : display current weapons (also <w>)</w>)\n"+ "<w>(</w> : cycle current ammunition\n"+ "<w>)</w> : display current weapons\n" "<w>\"</w> : display worn jewellery\n" "<w>C</w> : display experience info\n" "<w>^</w> : show religion screen\n"@@ -1611,8 +1612,7 @@ "<w>;</w> : examine occupied tile\n" "<w>x</w> : eXamine surroundings/targets\n" "<w>X</w> : eXamine level map\n"- "<w>O</w> : show dungeon Overview\n"- " \n",+ "<w>O</w> : show dungeon Overview\n", true, true, cmdhelp_textfilter,45); cols.add_formatted(@@ -1677,7 +1677,6 @@ cols.add_formatted( 1, " \n"- " \n" "Crawl usually considers every item it\n" "sees as a stash. When using a value\n" "different from <green>stash_tracking = all</green>, you\n"Modified: trunk/crawl-ref/source/describe.cc===================================================================--- trunk/crawl-ref/source/describe.cc2008-02-15 21:33:27 UTC (rev 3440)+++ trunk/crawl-ref/source/describe.cc2008-02-18 15:51:08 UTC (rev 3441)@@ -1621,6 +1621,10 @@ break; case OBJ_BOOKS:+ if (! player_can_read_spellbook( item ))+ description << "This book is beyond your current level of understanding.$$";+ break;+ case OBJ_SCROLLS: case OBJ_POTIONS: case OBJ_ORBS:@@ -1686,7 +1690,8 @@ getch(); } -static void show_item_description(const item_def &item)+// Return true if spells can be shown to player+static bool show_item_description(const item_def &item) { clrscr(); @@ -1697,6 +1702,8 @@ if (item.has_spells()) {+ if (item.base_type == OBJ_BOOKS && !player_can_read_spellbook( item ))+ return false; formatted_string fs; item_def dup = item; spellbook_contents( dup, @@ -1705,7 +1712,10 @@ : RBOOK_USE_STAFF, &fs ); fs.display(2, -2);+ return true; }++ return false; } static bool describe_spells(const item_def &item)@@ -1739,8 +1749,9 @@ { for (;;) {- show_item_description(item);- if (item.has_spells())+ const bool spells_shown = show_item_description(item);++ if (spells_shown) { cgotoxy(1, wherey()); textcolor(LIGHTGREY);Modified: trunk/crawl-ref/source/enum.h===================================================================--- trunk/crawl-ref/source/enum.h2008-02-15 21:33:27 UTC (rev 3440)+++ trunk/crawl-ref/source/enum.h2008-02-18 15:51:08 UTC (rev 3441)@@ -446,6 +446,7 @@ CMD_REMOVE_ARMOUR, CMD_WEAR_JEWELLERY, CMD_REMOVE_JEWELLERY,+ CMD_CYCLE_QUIVER_FORWARD, CMD_LIST_WEAPONS, CMD_LIST_ARMOUR, CMD_LIST_JEWELLERY,Modified: trunk/crawl-ref/source/item_use.cc===================================================================--- trunk/crawl-ref/source/item_use.cc2008-02-15 21:33:27 UTC (rev 3440)+++ trunk/crawl-ref/source/item_use.cc2008-02-18 15:51:08 UTC (rev 3441)@@ -190,12 +190,6 @@ if (!can_wield(NULL, true)) return (false); - if (you.duration[DUR_SURE_BLADE])- {- mpr("The bond with your blade fades away.");- you.duration[DUR_SURE_BLADE] = 0;- }- int item_slot = 0; // default is 'a' if (auto_wield)@@ -215,9 +209,6 @@ || (you.inv[item_slot].base_type == OBJ_MISCELLANY && you.inv[item_slot].sub_type != MISC_RUNE_OF_ZOT); - // Reset the warning counter.- you.received_weapon_warning = false;- // Prompt if not using the auto swap command, or if the swap slot // is empty. if (item_slot != PROMPT_GOT_SPECIAL &&@@ -237,10 +228,35 @@ canned_msg( MSG_OK ); return (false); }- else if (item_slot == PROMPT_GOT_SPECIAL) // '-' or bare hands+ else if (item_slot == you.equip[EQ_WEAPON]) {+ mpr("You are already wielding that!");+ return (true);+ }++ // now we really change weapons (most likely, at least)+ if (you.duration[DUR_SURE_BLADE])+ {+ mpr("The bond with your blade fades away.");+ you.duration[DUR_SURE_BLADE] = 0;+ }+ // Reset the warning counter.+ you.received_weapon_warning = false;++ if (item_slot == PROMPT_GOT_SPECIAL) // '-' or bare hands+ { if (you.equip[EQ_WEAPON] != -1) {+ // can we safely unwield this item?+ if (has_warning_inscription(you.inv[you.equip[EQ_WEAPON]], OPER_WIELD))+ {+ std::string prompt = "Really unwield ";+ prompt += you.inv[you.equip[EQ_WEAPON]].name(DESC_INVENTORY);+ prompt += '?';+ if (!yesno(prompt.c_str(), false, 'n'))+ return (false);+ }+ if (!unwield_item(show_weff_messages)) return (false); @@ -256,15 +272,13 @@ return (true); } - if (item_slot == you.equip[EQ_WEAPON])- {- mpr("You are already wielding that!");- return (true);- }- if (!can_wield(&you.inv[item_slot], true)) return (false); + // for non-auto_wield cases checked above+ if (auto_wield && !check_warning_inscriptions(you.inv[item_slot], OPER_WIELD))+ return (false);+ if (!safe_to_remove_or_wear(you.inv[item_slot], false)) return (false); Modified: trunk/crawl-ref/source/overmap.cc===================================================================--- trunk/crawl-ref/source/overmap.cc2008-02-15 21:33:27 UTC (rev 3440)+++ trunk/crawl-ref/source/overmap.cc2008-02-18 15:51:08 UTC (rev 3441)@@ -325,7 +325,8 @@ disp += shoptype_to_string(ci_shops->second); ++column_count; }- disp += "\n";+ if (!shops_present.empty())+ disp += "\n"; // print portals if ( !portals_present.empty() )@@ -420,13 +421,13 @@ disp += depth_str; disp += ":</white> "; disp += get_level_annotation(li);- disp += + "\n";+ disp += "\n"; } } } } - return disp;+ return disp.substr(0, disp.find_last_not_of('\n')+1); } template <typename Z, typename Key>Modified: trunk/crawl-ref/source/spl-book.cc===================================================================--- trunk/crawl-ref/source/spl-book.cc2008-02-15 21:33:27 UTC (rev 3440)+++ trunk/crawl-ref/source/spl-book.cc2008-02-18 15:51:08 UTC (rev 3441)@@ -1000,7 +1000,7 @@ // Returns false if the player cannot read/memorize from the book, // and true otherwise. -- bwr-static bool player_can_read_spellbook( const item_def &book )+bool player_can_read_spellbook( const item_def &book ) { if (book.base_type != OBJ_BOOKS) return (true);Modified: trunk/crawl-ref/source/spl-book.h===================================================================--- trunk/crawl-ref/source/spl-book.h2008-02-15 21:33:27 UTC (rev 3440)+++ trunk/crawl-ref/source/spl-book.h2008-02-18 15:51:08 UTC (rev 3441)@@ -51,6 +51,8 @@ bool player_can_memorise(const item_def &book); bool learn_spell(int book = -1); +bool player_can_read_spellbook( const item_def &book );+ spell_type which_spell_in_book(int sbook_type, int spl); // returns amount practised (or -1 for abort)This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [3482] trunk/crawl-ref

From: <pau...@us...> - 2008-02-29 09:46:56

Revision: 3482 Author: paulduboisDate: 2008-02-29 01:46:50 -0800 (Fri, 29 Feb 2008)Log Message:-----------FR 1900612Patch 1901093Merge 't' functionality into 'f'.Firing interface allows selection of inventory item by hitting 'i'.Items selected through the inventory interface will not be quivered.Firing interface prints "Firing", "Throwing", "Awkwardly throwing"depending on the item selected.In-game documentation and manual updated.Modified Paths:-------------- trunk/crawl-ref/docs/crawl_manual.txt trunk/crawl-ref/source/acr.cc trunk/crawl-ref/source/command.cc trunk/crawl-ref/source/enum.h trunk/crawl-ref/source/item_use.cc trunk/crawl-ref/source/item_use.hModified: trunk/crawl-ref/docs/crawl_manual.txt===================================================================--- trunk/crawl-ref/docs/crawl_manual.txt2008-02-29 09:32:40 UTC (rev 3481)+++ trunk/crawl-ref/docs/crawl_manual.txt2008-02-29 09:46:50 UTC (rev 3482)@@ -542,7 +542,7 @@ displayed, and what commands there are to use them: ) weapons (use 'w'ield)-( ammunition (use 't'hrow or 'f'ire)+( ammunition (use 'f'ire) [ armour (use 'W'ear and 'T'ake off) % food (use 'e'at; also 'D'issect for corpses) ? scrolls (use 'r'ead)@@ -663,17 +663,18 @@ inflict worthwhile damage. Ammunition has only one "plus" value, which affects both accuracy and damage. -The 'f' command fires a piece of ammunition, chosen from lots suitable-for your weapon and defaulting to your preferred lot (or "quiver"),-typically the last lot you fired. Use the '(' command if you want to-change your quiver without firing. Use the 't' command to throw-anything.+The 'f' command fires or throws a piece of ammunition, typically+chosen from lots suitable for your weapon and defaulting to the last+lot you fired (your "quiver"). -Regardless of their mnemonics, if you are using the right kind of hand-weapon both 'f' and 't' will make you "shoot" the ammunition.-Otherwise, you will "throw" it. At times it is also sensible to throw-weapons like spears, daggers, or hand axes.+The firing interface also allows you to manually select an item to+throw; but it may not be very effective if you lack the correct+launcher. At times it is sensible to throw weapons like spears,+daggers, or hand axes. +Use the '(' command if you want to change your quiver without+firing.+ The interface for shooting or throwing things is also used for zapping wands and casting certain spells, and is described in detail in section I (Targeting).Modified: trunk/crawl-ref/source/acr.cc===================================================================--- trunk/crawl-ref/source/acr.cc2008-02-29 09:32:40 UTC (rev 3481)+++ trunk/crawl-ref/source/acr.cc2008-02-29 09:46:50 UTC (rev 3482)@@ -1902,47 +1902,8 @@ wield_weapon(false); break; - case CMD_THROW:- if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)- {- canned_msg(MSG_PRESENT_FORM);- break;- }- else if (you.attribute[ATTR_HELD])- {- mpr("You cannot throw anything while held in a net!");- break;- }- if (Options.tutorial_left)- Options.tut_throw_counter++;- throw_anything();- break;- case CMD_FIRE:- if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)- {- canned_msg(MSG_PRESENT_FORM);- break;- }- else if (you.attribute[ATTR_HELD])- {- const item_def *weapon = you.weapon();- if (!weapon || !is_range_weapon(*weapon))- {- mpr("You cannot throw anything while held in a net!");- break;- }- else if (weapon->sub_type != WPN_BLOWGUN)- {- mprf("You cannot shoot with your %s while held in a net!",- weapon->name(DESC_BASENAME).c_str());- break;- }- // else shooting is possible- }- if (Options.tutorial_left)- Options.tut_throw_counter++;- shoot_thing();+ fire_thing(); break; case CMD_WEAR_ARMOUR:@@ -3261,7 +3222,6 @@ case 'q': return CMD_QUAFF; case 'r': return CMD_READ; case 's': return CMD_SEARCH;- case 't': return CMD_THROW; case 'v': return CMD_EXAMINE_OBJECT; case 'w': return CMD_WIELD_WEAPON; case 'x': return CMD_LOOK_AROUND;Modified: trunk/crawl-ref/source/command.cc===================================================================--- trunk/crawl-ref/source/command.cc2008-02-29 09:32:40 UTC (rev 3481)+++ trunk/crawl-ref/source/command.cc2008-02-29 09:46:50 UTC (rev 3482)@@ -593,7 +593,9 @@ static const char *targeting_help_2 = "<h>Firing or throwing a missile:\n" "<w>Ctrl-P</w> : cycle to previous missile.\n"- "<w>Ctrl-N</w> : cycle to next missile.\n";+ "<w>Ctrl-N</w> : cycle to next missile.\n"+ "<w>i</w> : choose from inventory.\n"+; // Add the contents of the file fp to the scroller menu m.@@ -1523,8 +1525,7 @@ "<w>]</w> : show inventory of equipped items\n" "<w>v</w> : View item description\n" "<w>{</w> : inscribe item\n"- "<w>t</w> : Throw/shoot an item\n"- "<w>f</w> : Fire first available missile\n"+ "<w>f</w> : Fire or throw an item\n" "<w>e</w> : Eat food (but tries floor first)\n" "<w>q</w> : Quaff a potion\n" "<w>z</w> : Zap a wand\n"Modified: trunk/crawl-ref/source/enum.h===================================================================--- trunk/crawl-ref/source/enum.h2008-02-29 09:32:40 UTC (rev 3481)+++ trunk/crawl-ref/source/enum.h2008-02-29 09:46:50 UTC (rev 3482)@@ -440,7 +440,7 @@ CMD_EVOKE, CMD_WIELD_WEAPON, CMD_WEAPON_SWAP,- CMD_THROW,+ CMD_THROW, // unused now CMD_FIRE, CMD_WEAR_ARMOUR, CMD_REMOVE_ARMOUR,Modified: trunk/crawl-ref/source/item_use.cc===================================================================--- trunk/crawl-ref/source/item_use.cc2008-02-29 09:32:40 UTC (rev 3481)+++ trunk/crawl-ref/source/item_use.cc2008-02-29 09:46:50 UTC (rev 3482)@@ -28,6 +28,7 @@ #include "AppHdr.h" #include "item_use.h" +#include <sstream> #include <string.h> #include <stdlib.h> #include <stdio.h>@@ -82,6 +83,10 @@ static bool drink_fountain(); static bool enchant_armour(); +static int _fire_prompt_for_item(std::string& err);+static bool _fire_validate_item(int selected, std::string& err);+static std::string _fire_get_noitem_reason();+ // Rather messy - we've gathered all the can't-wield logic from wield_weapon() // here. bool can_wield(const item_def *weapon, bool say_reason,@@ -1194,53 +1199,6 @@ return true; } // end takeoff_armour() -void throw_anything( int slot )-{- struct bolt beam;- int throw_slot;-- if (you.duration[DUR_BERSERKER])- {- canned_msg(MSG_TOO_BERSERK);- return;- }- else if (inv_count() < 1)- {- canned_msg(MSG_NOTHING_CARRIED);- return;- }-- if (slot != -1)- throw_slot = slot;- else- throw_slot = prompt_invent_item( "Throw which item? (* to show all)",- MT_INVLIST,- OBJ_MISSILES, true, true, true, 0, NULL,- OPER_THROW );- if (throw_slot == PROMPT_ABORT)- {- canned_msg( MSG_OK );- return;- }-- if (throw_slot == you.equip[EQ_WEAPON]- && (item_cursed( you.inv[you.equip[EQ_WEAPON]] )))- {- mpr("That thing is stuck to your hand!");- return;- }- else- {- if ( wearing_slot(throw_slot) )- {- mpr("You are wearing that object!");- return;- }- }-- throw_it(beam, throw_slot);-} // end throw_anything()- static bool fire_item_matches(const item_def &item, unsigned fire_type) { if (!is_valid_item(item))@@ -1399,32 +1357,71 @@ return (item); } -static void announce_ammo(int item)-{- mesclr();- mprf("Firing%s: %s",- get_fire_item_index((item + 1) % ENDOFPACK, true, false) != item?- " (^N/^P - change)" : "", - you.inv[item].name(DESC_INVENTORY_EQUIP).c_str());-}- class fire_target_behaviour : public targeting_behaviour { public:- fire_target_behaviour(int it) : item(it), need_prompt(false) { }- command_type get_command(int key = -1);- bool should_redraw();- void announce_new_ammo(bool redraw = true);+ fire_target_behaviour()+ : item(ENDOFPACK), selected_from_inventory(false), need_prompt(false)+ {+ item = get_fire_item_index();+ } + // targeting_behaviour API+ virtual command_type get_command(int key = -1);+ virtual bool should_redraw();++ void message_ammo_prompt(const std::string* pre_text=0);+ public: int item;+ bool selected_from_inventory; bool need_prompt;--private:- void find_next_ammo();- void find_prev_ammo(); }; +void fire_target_behaviour::message_ammo_prompt(const std::string* pre_text)+{+ bool no_other_items;+ {+ const int next_item = get_fire_item_index((item + 1) % ENDOFPACK, true, false);+ no_other_items = (next_item == ENDOFPACK || next_item == item);+ }+ + mesclr();++ if (pre_text)+ {+ mpr(pre_text->c_str());+ }++ {+ std::ostringstream msg;+ if (item == ENDOFPACK) msg << "Firing ";+ else {+ const item_def& item_def = you.inv[item];+ const launch_retval projected = is_launched(&you, you.weapon(), item_def);+ if (projected == LRET_FUMBLED) msg << "Awkwardly throwing ";+ else if (projected == LRET_LAUNCHED) msg << "Firing ";+ else if (projected == LRET_THROWN) msg << "Throwing ";+ else msg << "Buggy ";+ }+ + msg << (no_other_items ? "(i - change)" : "(^n ^p i - change)")+ << ": ";++ if (item == ENDOFPACK) {+ msg << "<red>" << _fire_get_noitem_reason() << "</red>";+ } else {+ const char* color = (selected_from_inventory ? "grey" : "w");+ msg << "<" << color << ">"+ << you.inv[item].name(DESC_INVENTORY_EQUIP)+ << "</" << color << ">";+ }++ // XXX: use another channel that doesn't spam the message log?+ formatted_message_history(msg.str(), MSGCH_PROMPT);+ }+}+ bool fire_target_behaviour::should_redraw() { if (need_prompt)@@ -1444,15 +1441,38 @@ { case '(': case CONTROL('N'):- find_next_ammo();+ case CONTROL('P'): {+ const int direction = (key == CONTROL('N')) ? +1 : -1;+ const int start = (item + ENDOFPACK + direction) % ENDOFPACK;+ const int next = get_fire_item_index(start, (direction==1), false);+ if (next != item && next != ENDOFPACK)+ {+ item = next;+ selected_from_inventory = false;+ }+ // Do this stuff unconditionally to make the prompt redraw+ message_ammo_prompt();+ need_prompt = true; break;- case CONTROL('P'):- find_prev_ammo();- break;+ }++ case 'i': {+ std::string err;+ const int selected = _fire_prompt_for_item(err);+ if (selected != ENDOFPACK &&+ _fire_validate_item(selected, err))+ {+ item = selected;+ selected_from_inventory = true;+ }+ message_ammo_prompt( err.length() ? &err : NULL );+ need_prompt = true;+ return CMD_NO_CMD;+ } case '?': show_targeting_help(); redraw_screen();- announce_new_ammo(item);+ message_ammo_prompt(); need_prompt = true; return (CMD_NO_CMD); }@@ -1460,46 +1480,18 @@ return targeting_behaviour::get_command(key); } -void fire_target_behaviour::announce_new_ammo(bool redraw)+static bool _fire_choose_item_and_target(int& item, dist& target) {- announce_ammo(item);- need_prompt = redraw;-}--void fire_target_behaviour::find_next_ammo()-{- const int start = (item == ENDOFPACK - 1)? 0 : item + 1;- const int next = get_fire_item_index(start, true, false);-- // We should never get back ENDOFPACK.- if (next != item)+ fire_target_behaviour beh;+ beh.message_ammo_prompt();+ message_current_target(); // XXX: this stuff should be done by direction()+ direction( target, DIR_NONE, TARG_ENEMY, false, true, NULL, &beh );+ + if (beh.item == ENDOFPACK) {- item = next;- announce_new_ammo();+ canned_msg(MSG_OK);+ return false; }-}--void fire_target_behaviour::find_prev_ammo()-{- const int start = (item == 0)? ENDOFPACK - 1 : item - 1;- const int next = get_fire_item_index(start, false, false);-- // We should never get back ENDOFPACK.- if (next != item)- {- item = next;- announce_new_ammo();- }-}--static bool choose_fire_target(dist &target, int &item)-{- announce_ammo(item);- message_current_target();-- fire_target_behaviour beh(item);- direction( target, DIR_NONE, TARG_ENEMY, false, true, NULL, &beh );- if (!target.isValid) { if (target.isCancel)@@ -1521,48 +1513,136 @@ return (true); } -void shoot_thing(void)+// Bring up an inventory screen and have user choose an item.+// Returns an item slot, or ENDOFPACK on abort/failure+// On failure, returns error text, if any.+static int _fire_prompt_for_item(std::string& err) {- if (you.duration[DUR_BERSERKER])+ if (inv_count() < 1) {- canned_msg(MSG_TOO_BERSERK);- flush_input_buffer( FLUSH_ON_FAILURE ); - return;+ // canned_msg(MSG_NOTHING_CARRIED); // Hmmm... + err = "You aren't carrying anything.";+ return ENDOFPACK; } - int item = get_fire_item_index();+ int slot = prompt_invent_item( "Fire/throw which item? (* to show all)",+ MT_INVLIST,+ OBJ_MISSILES, true, true, true, 0, NULL,+ OPER_THROW );+ if (slot == PROMPT_ABORT)+ {+ err = "Nothing selected.";+ return ENDOFPACK;+ }+ return slot;+} - if (item == ENDOFPACK)+// Return false and err text if this item can't be fired.+static bool _fire_validate_item(int slot, std::string& err)+{+ if (slot == you.equip[EQ_WEAPON]+ && item_cursed(you.inv[slot])) {- // Tell the user why we might have skipped their missile- unwind_var<int> unwind_festart(Options.fire_items_start, 0);- unwind_var<bool> unwind_inscription(Hack_Ignore_F_Inscription, true);- const int skipped_item = get_fire_item_index();- if (skipped_item == ENDOFPACK)+ err = "That thing is stuck to your hand!";+ return false;+ }+ else if ( wearing_slot(slot) )+ {+ err = "You are wearing that object!";+ return false;+ }+ return true;+}++// Return true if warning is given+static bool _fire_warn_if_impossible()+{+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)+ {+ canned_msg(MSG_PRESENT_FORM);+ return true;+ }+ if (you.attribute[ATTR_HELD])+ {+ const item_def *weapon = you.weapon();+ if (!weapon || !is_range_weapon(*weapon)) {- mpr("No suitable missiles.");+ mpr("You cannot throw anything while held in a net!");+ return true; }- else if (skipped_item < unwind_festart.original_value())+ else if (weapon->sub_type != WPN_BLOWGUN) {- mprf("No suitable missiles (fire_items_start = '%c', "- "ignoring item on '%c').",- index_to_letter(unwind_festart.original_value()),- index_to_letter(skipped_item));+ mprf("You cannot shoot with your %s while held in a net!",+ weapon->name(DESC_BASENAME).c_str());+ return true; }- else- {- mprf("No suitable missiles (ignoring '=f'-inscribed item on '%c').",+ // else shooting is possible+ }+ if (you.duration[DUR_BERSERKER])+ {+ canned_msg(MSG_TOO_BERSERK);+ return true;+ }+ return false;+}++static std::string _fire_get_noitem_reason()+{+ const int cur_item = get_fire_item_index();+ if (cur_item != ENDOFPACK)+ {+ // Shouldn't be calling this if there is a good default item!+ return std::string("Buggy.");+ }++ // Tell the user why we might have skipped their missile+ unwind_var<int> unwind_festart(Options.fire_items_start, 0);+ unwind_var<bool> unwind_inscription(Hack_Ignore_F_Inscription, true);+ const int skipped_item = get_fire_item_index();+ char buf[200];+ if (skipped_item == ENDOFPACK)+ {+ return std::string("No suitable missiles.");+ }+ else if (skipped_item < unwind_festart.original_value())+ {+ // no room for showing index_to_letter(skipped_item);+ snprintf(buf, 200,+ "Nothing suitable (fire_items_start = '%c').",+ index_to_letter(unwind_festart.original_value()));+ return std::string(buf);+ }+ else+ {+ snprintf(buf, 200,+ "Nothing suitable (ignored '=f'-inscribed item on '%c').", index_to_letter(skipped_item));- }- flush_input_buffer( FLUSH_ON_FAILURE );+ return std::string(buf);+ }+}++// if item == -1, prompt the user.+void fire_thing(int item)+{+ if (_fire_warn_if_impossible())+ {+ flush_input_buffer( FLUSH_ON_FAILURE ); return; }+ + if (Options.tutorial_left)+ Options.tut_throw_counter++; dist target;- bolt beam;- if (choose_fire_target(target, item)- && check_warning_inscriptions(you.inv[item], OPER_FIRE))+ if (item == -1) {+ if (! _fire_choose_item_and_target(item, target))+ return; + }++ if (check_warning_inscriptions(you.inv[item], OPER_FIRE))+ {+ bolt beam; throw_it( beam, item, false, 0, &target ); } }@@ -4602,8 +4682,7 @@ return; case OBJ_MISSILES:- if (check_warning_inscriptions(you.inv[idx], OPER_THROW))- throw_anything(idx);+ fire_thing(idx); return; case OBJ_ARMOUR:Modified: trunk/crawl-ref/source/item_use.h===================================================================--- trunk/crawl-ref/source/item_use.h2008-02-29 09:32:40 UTC (rev 3481)+++ trunk/crawl-ref/source/item_use.h2008-02-29 09:46:50 UTC (rev 3482)@@ -104,15 +104,9 @@ * *********************************************************************** */ int get_fire_item_index(int start_from = 0, bool forward = true, bool check_quiver = true);-void shoot_thing(void);+void fire_thing(int item=-1); -// last updated 12may2000 {dlb}-/* ***********************************************************************- * called from: acr- * *********************************************************************** */-void throw_anything(int slot = -1);- quiver_type get_quiver_type(void); // last updated 12may2000 {dlb}This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [3505] trunk/crawl-ref

From: <j-...@us...> - 2008-03-02 22:29:39

Revision: 3505 Author: j-p-e-gDate: 2008-03-02 14:28:28 -0800 (Sun, 02 Mar 2008)Log Message:-----------Make Options.race and Options.class translate correctly, no matter whether the old or new species/classes order is used.Entails some more unborking of newgame.cc.Also: make Esc leave the species selection screen (synonym for 'X', quit thegame), and use it to jump back to species selection from all other selection possibilities (class, book, weapon, god) as a synonym for Bksp.Modified Paths:-------------- trunk/crawl-ref/docs/crawl_options.txt trunk/crawl-ref/init.txt trunk/crawl-ref/source/clua.cc trunk/crawl-ref/source/debug.cc trunk/crawl-ref/source/describe.cc trunk/crawl-ref/source/hiscores.cc trunk/crawl-ref/source/initfile.cc trunk/crawl-ref/source/libgui.cc trunk/crawl-ref/source/monspeak.cc trunk/crawl-ref/source/newgame.cc trunk/crawl-ref/source/newgame.h trunk/crawl-ref/source/output.cc trunk/crawl-ref/source/player.cc trunk/crawl-ref/source/player.h trunk/crawl-ref/source/view.ccModified: trunk/crawl-ref/docs/crawl_options.txt===================================================================--- trunk/crawl-ref/docs/crawl_options.txt2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/docs/crawl_options.txt2008-03-02 22:28:28 UTC (rev 3505)@@ -7,8 +7,8 @@ The contents of this text are: 1- Starting Screen.- name, remember_name, weapon, book,- chaos_knight, death_knight, priest, + name, remember_name, use_old_selection_order,+weapon, book, chaos_knight, death_knight, priest, race, class, random_pick 2- File System and Sound. crawl_dir, morgue_dir, save_dir, sound@@ -169,6 +169,12 @@ name prompt - hitting Enter at the name prompt will simply reuse your old name if remember_name is set. +use_old_selection_order = false+ If set to true, the character selection screen will offer +species and classes in the order of version 0.3 and earlier.+Note that this needs to be set before the "race" or "class" +options(see below), or they won't be interpreted correctly.+ weapon = (random | short sword | hand axe | spear | mace | trident) Specifying the weapon option allows you to bypass the weapon selection screen. Note that tridents are restricted to only @@ -198,10 +204,6 @@ The above options (weapons and class options) will override where appropriate. -use_old_selection_order = false- If set to true, the character selection screen will offer -species and classes in the order of version 0.3 and earlier.- 2- File System. ================ Modified: trunk/crawl-ref/init.txt===================================================================--- trunk/crawl-ref/init.txt2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/init.txt2008-03-02 22:28:28 UTC (rev 3505)@@ -35,6 +35,7 @@ # # name = Delilah # remember_name = false+# use_old_selection_order = false # weapon = (random | short sword | hand axe | spear | mace | trident) # chaos_knight = (Xom | Makhleb | random) # death_knight = (necromancy | Yredelemnul | random)@@ -42,7 +43,6 @@ # race = (Human |...| Merfolk | random) # class = (Fighter |...| Wanderer | random) # random_pick = true-# use_old_selection_order = false ##### 2- File System ############################################### #Modified: trunk/crawl-ref/source/clua.cc===================================================================--- trunk/crawl-ref/source/clua.cc2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/source/clua.cc2008-03-02 22:28:28 UTC (rev 3505)@@ -27,6 +27,7 @@ #include "mapdef.h" #include "message.h" #include "mon-util.h"+#include "newgame.h" #include "output.h" #include "player.h" #include "randart.h"Modified: trunk/crawl-ref/source/debug.cc===================================================================--- trunk/crawl-ref/source/debug.cc2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/source/debug.cc2008-03-02 22:28:28 UTC (rev 3505)@@ -75,6 +75,7 @@ #include "monstuff.h" #include "mon-util.h" #include "mutation.h"+#include "newgame.h" #include "ouch.h" #include "place.h" #include "player.h"Modified: trunk/crawl-ref/source/describe.cc===================================================================--- trunk/crawl-ref/source/describe.cc2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/source/describe.cc2008-03-02 22:28:28 UTC (rev 3505)@@ -49,6 +49,7 @@ #include "message.h" #include "monstuff.h" #include "mon-util.h"+#include "newgame.h" #include "player.h" #include "randart.h" #include "religion.h"Modified: trunk/crawl-ref/source/hiscores.cc===================================================================--- trunk/crawl-ref/source/hiscores.cc2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/source/hiscores.cc2008-03-02 22:28:28 UTC (rev 3505)@@ -48,6 +48,7 @@ #include "libutil.h" #include "message.h" #include "mon-util.h"+#include "newgame.h" #include "ouch.h" #include "place.h" #include "player.h"Modified: trunk/crawl-ref/source/initfile.cc===================================================================--- trunk/crawl-ref/source/initfile.cc2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/source/initfile.cc2008-03-02 22:28:28 UTC (rev 3505)@@ -38,6 +38,7 @@ #include "libutil.h" #include "message.h" #include "mon-util.h"+#include "newgame.h" #include "player.h" #include "religion.h" #include "stash.h"@@ -331,12 +332,7 @@ if (index == -1) index = get_species_index_by_name( str.c_str() ); - // skip over the extra draconians here- if (index > SP_RED_DRACONIAN)- index -= (SP_CENTAUR - SP_RED_DRACONIAN - 1);-- // SP_HUMAN is at 1, therefore we must subtract one.- return ((index != -1) ? index_to_letter( index - 1 ) : 0); + return ((index != -1) ? index_to_letter( index ) : 0); } static int str_to_class( const std::string &str )Modified: trunk/crawl-ref/source/libgui.cc===================================================================--- trunk/crawl-ref/source/libgui.cc2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/source/libgui.cc2008-03-02 22:28:28 UTC (rev 3505)@@ -26,6 +26,7 @@ #include "guic.h" #include "message.h" #include "mon-util.h"+#include "newgame.h" #include "player.h" #include "stash.h" #include "state.h"Modified: trunk/crawl-ref/source/monspeak.cc===================================================================--- trunk/crawl-ref/source/monspeak.cc2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/source/monspeak.cc2008-03-02 22:28:28 UTC (rev 3505)@@ -34,6 +34,7 @@ #include "monstuff.h" #include "mon-util.h" #include "mstuff2.h"+#include "newgame.h" #include "player.h" #include "spells2.h" #include "spells4.h"Modified: trunk/crawl-ref/source/newgame.cc===================================================================--- trunk/crawl-ref/source/newgame.cc2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/source/newgame.cc2008-03-02 22:28:28 UTC (rev 3505)@@ -253,6 +253,150 @@ : new_jobs_order[index]); } +static const char * Species_Abbrev_List[ NUM_SPECIES ] =+ { "XX", "Hu", "HE", "GE", "DE", "SE", "MD", "Ha",+ "HO", "Ko", "Mu", "Na", "Gn", "Og", "Tr", "OM",+ // the draconians+ "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr",+ "Ce", "DG", "Sp", "Mi", "DS", "Gh", "Ke", "Mf", "Vp",+ // placeholders+ "HD", "El" };++int get_species_index_by_abbrev( const char *abbrev )+{+ COMPILE_CHECK(ARRAYSIZE(Species_Abbrev_List) == NUM_SPECIES, c1);+ + for (unsigned i = 0; i < ARRAYSIZE(old_species_order); i++)+ {+ const int sp = (Options.use_old_selection_order ? old_species_order[i]+ : new_species_order[i]);++ if (tolower( abbrev[0] ) == tolower( Species_Abbrev_List[sp][0] )+ && tolower( abbrev[1] ) == tolower( Species_Abbrev_List[sp][1] ))+ {+ return i;+ }+ }++ return (-1);+}++int get_species_index_by_name( const char *name )+{+ unsigned int i;+ int sp = -1;++ std::string::size_type pos = std::string::npos;+ char lowered_buff[80];++ strncpy( lowered_buff, name, sizeof( lowered_buff ) );+ strlwr( lowered_buff );++ for (i = 0; i < ARRAYSIZE(old_species_order); i++)+ {+ const species_type real_sp+ = (Options.use_old_selection_order ? old_species_order[i]+ : new_species_order[i]);++ const std::string lowered_species =+ lowercase_string(species_name(real_sp,1));+ pos = lowered_species.find( lowered_buff );+ if (pos != std::string::npos)+ {+ sp = i;+ if (pos == 0) // prefix takes preference+ break;+ }+ }++ return (sp);+}++const char *get_species_abbrev( int which_species )+{+ ASSERT( which_species > 0 && which_species < NUM_SPECIES );++ return (Species_Abbrev_List[ which_species ]);+}++static const char * Class_Abbrev_List[ NUM_JOBS ] =+ { "Fi", "Wz", "Pr", "Th", "Gl", "Ne", "Pa", "As", "Be", "Hu",+ "Cj", "En", "FE", "IE", "Su", "AE", "EE", "Cr", "DK", "VM",+ "CK", "Tm", "He", "Re", "St", "Mo", "Wr", "Wn" };++static const char * Class_Name_List[ NUM_JOBS ] =+ { "Fighter", "Wizard", "Priest", "Thief", "Gladiator", "Necromancer",+ "Paladin", "Assassin", "Berserker", "Hunter", "Conjurer", "Enchanter",+ "Fire Elementalist", "Ice Elementalist", "Summoner", "Air Elementalist",+ "Earth Elementalist", "Crusader", "Death Knight", "Venom Mage",+ "Chaos Knight", "Transmuter", "Healer", "Reaver", "Stalker",+ "Monk", "Warper", "Wanderer" };++int get_class_index_by_abbrev( const char *abbrev )+{+ COMPILE_CHECK(ARRAYSIZE(Class_Abbrev_List) == NUM_JOBS, c1);+ COMPILE_CHECK(ARRAYSIZE(Class_Name_List) == NUM_JOBS, c2);+ + for (unsigned int i = 0; i < ARRAYSIZE(old_jobs_order); i++)+ {+ const job_type job+ = (Options.use_old_selection_order ? old_jobs_order[i]+ : new_jobs_order[i]);+ + if (tolower( abbrev[0] ) == tolower( Class_Abbrev_List[job][0] )+ && tolower( abbrev[1] ) == tolower( Class_Abbrev_List[job][1] ))+ {+ return i;+ }+ }++ return (-1);+}++const char *get_class_abbrev( int which_job )+{+ ASSERT( which_job < NUM_JOBS );++ return (Class_Abbrev_List[ which_job ]);+}++int get_class_index_by_name( const char *name )+{+ char *ptr;+ char lowered_buff[80];+ char lowered_class[80];++ strncpy( lowered_buff, name, sizeof( lowered_buff ) );+ strlwr( lowered_buff );++ int cl = -1;+ for (unsigned int i = 0; i < ARRAYSIZE(old_jobs_order); i++)+ {+ const int job = (Options.use_old_selection_order ? old_jobs_order[i]+ : new_jobs_order[i]);+ + strncpy( lowered_class, Class_Name_List[job], sizeof( lowered_class ) );+ strlwr( lowered_class );++ ptr = strstr( lowered_class, lowered_buff );+ if (ptr != NULL)+ {+ cl = i;+ if (ptr == lowered_class) // prefix takes preference+ break;+ }+ }++ return (cl);+}++const char *get_class_name( int which_job )+{+ ASSERT( which_job < NUM_JOBS );++ return (Class_Name_List[ which_job ]);+}+ static void reset_newgame_options(void) { ng_race = ng_cls = 0;@@ -1641,9 +1785,9 @@ int keyin = 0; clrscr(); book.base_type = OBJ_BOOKS;- book.quantity = 1;- book.plus = 0;- book.special = 1;+ book.quantity = 1;+ book.plus = 0;+ book.special = 1; // using the fact that CONJ_I and MINOR_MAGIC_I are both // fire books, CONJ_II and MINOR_MAGIC_II are both ice books@@ -1693,25 +1837,29 @@ keyin = c_getch(); - if (keyin == CK_BKSP || keyin == ' ')- return false;- if (keyin == 'X')+ switch (keyin) {+ case 'X': cprintf(EOL "Goodbye!"); end(0);+ break;+ case CK_BKSP:+ case ESCAPE:+ case ' ':+ return false;+ case '\r':+ case '\n':+ if ( Options.prev_book != SBT_NO_SELECTION )+ {+ if ( Options.prev_book == SBT_RANDOM )+ keyin = '*';+ else+ keyin = ('a' + Options.prev_book - 1);+ }+ default:+ break; }- } while (keyin != '*' && - ((keyin != '\r' && keyin != '\n') ||- Options.prev_book == SBT_NO_SELECTION ) &&- (keyin < 'a' || keyin >= ('a' + numbooks)));-- if ( keyin == '\r' || keyin == '\n' )- {- if ( Options.prev_book == SBT_RANDOM )- keyin = '*';- else- keyin = ('a' + Options.prev_book - 1);- }+ } while (keyin != '*' && (keyin < 'a' || keyin >= ('a' + numbooks))); } if (Options.random_pick || Options.book == SBT_RANDOM || keyin == '*')@@ -1726,7 +1874,6 @@ return true; } - static bool choose_weapon() { const weapon_type startwep[5] = { WPN_SHORT_SWORD, WPN_MACE,@@ -1791,31 +1938,33 @@ keyin = c_getch(); - if (keyin == CK_BKSP || keyin == ' ')- return false;-- if (keyin == 'X')+ switch (keyin) {+ case 'X': cprintf(EOL "Goodbye!"); end(0);- }+ break;+ case CK_BKSP:+ case CK_ESCAPE:+ case ' ':+ return false;+ case '\r':+ case '\n':+ if (Options.prev_weapon != WPN_UNKNOWN)+ {+ if (Options.prev_weapon == WPN_RANDOM)+ keyin = '*';+ else+ {+ for (int i = 0; i < num_choices; ++i)+ if (startwep[i] == Options.prev_weapon)+ keyin = 'a' + i;+ }+ }+ } }- while (keyin != '*' && - ((keyin != '\r' && keyin != '\n') - || Options.prev_weapon == WPN_UNKNOWN) &&- (keyin < 'a' || keyin > ('a' + num_choices)));+ while (keyin != '*' && (keyin < 'a' || keyin > ('a' + num_choices))); - if (keyin == '\r' || keyin == '\n')- {- if (Options.prev_weapon == WPN_RANDOM)- keyin = '*';- else- {- for (int i = 0; i < num_choices; ++i)- if (startwep[i] == Options.prev_weapon)- keyin = 'a' + i;- }- } if (keyin != '*' && effective_stat_bonus(startwep[keyin-'a']) > -4) {@@ -1836,12 +1985,14 @@ break; } keyin += 'a';+ ng_weapon = WPN_RANDOM; }+ else+ {+ ng_weapon = startwep[keyin-'a'];+ } you.inv[0].sub_type = startwep[keyin-'a'];- ng_weapon = (Options.random_pick || Options.weapon == WPN_RANDOM- || keyin == '*') ? WPN_RANDOM- : you.inv[0].sub_type; return true; }@@ -2215,14 +2366,18 @@ if (blankOK) { if (Options.prev_name.length() && Options.remember_name)+ { cprintf(EOL "Press <Enter> for \"%s\", or . to be prompted later." EOL, Options.prev_name.c_str());+ } else+ { cprintf(EOL "Press <Enter> to answer this after race and " "class are chosen." EOL);+ } } cprintf(EOL "What is your name today? ");@@ -2998,6 +3153,7 @@ switch (keyn) { case 'X':+ case ESCAPE: cprintf(EOL "Goodbye!"); end(0); break;@@ -3228,8 +3384,8 @@ cprintf(EOL "Goodbye!"); end(0); break;+ case CK_BKSP: case ESCAPE:- case CK_BKSP: case ' ': if (keyn != ' ' || you.species == SP_UNKNOWN) {@@ -3556,50 +3712,68 @@ "Random"); } - getkey:- keyn = c_getch();+ do {+ keyn = c_getch(); - if ((keyn == '\r' || keyn == '\n')- && Options.prev_pr != GOD_NO_GOD)- {- keyn = Options.prev_pr == GOD_ZIN? 'a' :- Options.prev_pr == GOD_YREDELEMNUL? 'b' :- Options.prev_pr == GOD_BEOGH? 'c' :- '*';+ if ((keyn == '\r' || keyn == '\n')+ && Options.prev_pr != GOD_NO_GOD)+ {+ keyn = Options.prev_pr == GOD_ZIN? 'a' :+ Options.prev_pr == GOD_YREDELEMNUL? 'b' :+ Options.prev_pr == GOD_BEOGH? 'c' :+ '*'; - }+ } - switch (keyn)- {- case CK_BKSP:- case ' ':- return false;- case 'X':- cprintf(EOL "Goodbye!");- end(0);- break;- case '*':- you.religion = coinflip()? GOD_ZIN : GOD_YREDELEMNUL;- if (you.species == SP_HILL_ORC && coinflip())- you.religion = GOD_BEOGH;- break;- case 'a':- you.religion = GOD_ZIN;- break;- case 'b':- you.religion = GOD_YREDELEMNUL;- break;- case 'c':- if (you.species == SP_HILL_ORC)+ switch (keyn) {- you.religion = GOD_BEOGH;+ case 'X':+ cprintf(EOL "Goodbye!");+ end(0); break;- } // else fall through- default:- goto getkey;- }-- ng_pr = keyn == '*'? GOD_RANDOM : you.religion;+ case CK_BKSP:+ case ESCAPE:+ case ' ':+ return false;+ case '\r':+ case '\n':+ if (Options.prev_pr == GOD_NO_GOD+ || Options.prev_pr == GOD_BEOGH+ && you.species != SP_HILL_ORC)+ {+ break;+ }+ if (Options.prev_pr != GOD_RANDOM)+ {+ Options.prev_pr+ = static_cast<god_type>(Options.prev_pr);+ break;+ }+ keyn = '*'; // for ng_pr setting+ // fall-through for random+ case '*':+ you.religion = coinflip()? GOD_ZIN : GOD_YREDELEMNUL;+ if (you.species == SP_HILL_ORC && coinflip())+ you.religion = GOD_BEOGH;+ break;+ case 'a':+ you.religion = GOD_ZIN;+ break;+ case 'b':+ you.religion = GOD_YREDELEMNUL;+ break;+ case 'c':+ if (you.species == SP_HILL_ORC)+ {+ you.religion = GOD_BEOGH;+ break;+ } // else fall through+ default:+ break;+ }+ } while (you.religion == GOD_NO_GOD);+ + ng_pr = (keyn == '*'? GOD_RANDOM : you.religion); } } break;@@ -4147,41 +4321,46 @@ "Random"); } - getkey1:- keyn = c_getch();-- if ((keyn == '\r' || keyn == '\n')- && Options.prev_dk != DK_NO_SELECTION)- {- keyn = Options.prev_dk == DK_NECROMANCY? 'a' :- Options.prev_dk == DK_YREDELEMNUL? 'b' :- '*';- }+ do {+ keyn = c_getch(); - switch (keyn)- {- case CK_BKSP:- case ' ': - return false;- case 'X':- cprintf(EOL "Goodbye!");- end(0);- break;- case '*':- choice = coinflip()? DK_NECROMANCY : DK_YREDELEMNUL;- break;- case 'a':- cprintf(EOL "Very well.");- choice = DK_NECROMANCY;- break;- case 'b':- choice = DK_YREDELEMNUL;- break;- default:- goto getkey1;- }-- ng_dk = keyn == '*'? DK_RANDOM : choice;+ switch (keyn)+ {+ case 'X':+ cprintf(EOL "Goodbye!");+ end(0);+ break;+ case CK_BKSP:+ case ESCAPE:+ case ' ':+ return false;+ case '\r':+ case '\n':+ if (Options.prev_dk == DK_NO_SELECTION)+ break;+ + if (Options.prev_dk != DK_RANDOM)+ {+ choice = Options.prev_dk;+ break;+ }+ keyn = '*'; // for ng_dk setting+ // fall-through for random+ case '*':+ choice = coinflip()? DK_NECROMANCY : DK_YREDELEMNUL;+ break;+ case 'a':+ cprintf(EOL "Very well.");+ choice = DK_NECROMANCY;+ break;+ case 'b':+ choice = DK_YREDELEMNUL;+ default:+ break;+ }+ } while (choice == DK_NO_SELECTION);+ + ng_dk = (keyn == '*'? DK_RANDOM : choice); } switch (choice)@@ -4263,47 +4442,53 @@ { textcolor(BROWN); cprintf(EOL "Enter - %s" EOL,- Options.prev_ck == GOD_XOM? "Xom" :- Options.prev_ck == GOD_MAKHLEB? "Makhleb" :- "Random");+ Options.prev_ck == GOD_XOM? "Xom" :+ Options.prev_ck == GOD_MAKHLEB? "Makhleb"+ : "Random"); textcolor(LIGHTGREY); } - getkey2:-- keyn = c_getch();-- if ((keyn == '\r' || keyn == '\n') - && Options.prev_ck != GOD_NO_GOD)+ do {- keyn = Options.prev_ck == GOD_XOM? 'a' :- Options.prev_ck == GOD_MAKHLEB? 'b' :- '*';- }+ keyn = c_getch(); - switch (keyn)- {- case CK_BKSP:- case ' ':- return false;- case 'X':- cprintf(EOL "Goodbye!");- end(0);- break;- case '*':- you.religion = coinflip()? GOD_XOM : GOD_MAKHLEB;- break;- case 'a':- you.religion = GOD_XOM;- break;- case 'b':- you.religion = GOD_MAKHLEB;- break;- default:- goto getkey2;- }-- ng_ck = keyn == '*'? GOD_RANDOM : you.religion;+ switch (keyn)+ {+ case 'X':+ cprintf(EOL "Goodbye!");+ end(0);+ break;+ case CK_BKSP:+ case CK_ESCAPE:+ case ' ':+ return false;+ case '\r':+ case '\n':+ if (Options.prev_ck == GOD_NO_GOD)+ break;+ + if (Options.prev_ck != GOD_RANDOM)+ {+ you.religion = static_cast<god_type>(Options.prev_ck);+ break;+ }+ keyn = '*'; // for ng_ck setting+ // fall-through for random+ case '*':+ you.religion = (coinflip()? GOD_XOM : GOD_MAKHLEB);+ break;+ case 'a':+ you.religion = GOD_XOM;+ break;+ case 'b':+ you.religion = GOD_MAKHLEB;+ // fall through+ default:+ break;+ }+ } while (you.religion == GOD_NO_GOD);+ + ng_ck = (keyn == '*'? GOD_RANDOM : you.religion); } if (you.religion == GOD_XOM)Modified: trunk/crawl-ref/source/newgame.h===================================================================--- trunk/crawl-ref/source/newgame.h2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/source/newgame.h2008-03-02 22:28:28 UTC (rev 3505)@@ -13,8 +13,19 @@ #define NEWGAME_H -// last updated 12may2000 {dlb} /* ***********************************************************************+ * called from: initfile+ * *********************************************************************** */+int get_species_index_by_abbrev( const char *abbrev );+int get_species_index_by_name( const char *name );+const char *get_species_abbrev( int which_species );++int get_class_index_by_abbrev( const char *abbrev );+int get_class_index_by_name( const char *name );+const char *get_class_abbrev( int which_job );+const char *get_class_name( int which_job );++/* *********************************************************************** * called from: acr * *********************************************************************** */ bool new_game();Modified: trunk/crawl-ref/source/output.cc===================================================================--- trunk/crawl-ref/source/output.cc2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/source/output.cc2008-03-02 22:28:28 UTC (rev 3505)@@ -34,6 +34,7 @@ #include "item_use.h" #include "menu.h" #include "message.h"+#include "newgame.h" #include "ouch.h" #include "player.h" #include "religion.h"Modified: trunk/crawl-ref/source/player.cc===================================================================--- trunk/crawl-ref/source/player.cc2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/source/player.cc2008-03-02 22:28:28 UTC (rev 3505)@@ -3871,14 +3871,14 @@ res = (adj ? "Orcish" : genus ? "Orc" : "Hill Orc"); break; - case SP_GNOME: res = (adj ? "Gnomish" : "Gnome"); break;- case SP_OGRE: res = (adj ? "Ogreish" : "Ogre"); break;- case SP_TROLL: res = (adj ? "Trollish" : "Troll"); break;- case SP_DEMIGOD: res = (adj ? "Divine" : "Demigod"); break;- case SP_DEMONSPAWN: res = (adj ? "Demonic" : "Demonspawn" ); break;- case SP_GHOUL: res = (adj ? "Ghoulish" : "Ghoul"); break;- case SP_MERFOLK: res = (adj ? "Merfolkian" : "Merfolk"); break;- default: res = (adj ? "Yakish" : "Yak"); break;+ case SP_GNOME: res = (adj ? "Gnomish" : "Gnome"); break;+ case SP_OGRE: res = (adj ? "Ogreish" : "Ogre"); break;+ case SP_TROLL: res = (adj ? "Trollish" : "Troll"); break;+ case SP_DEMIGOD: res = (adj ? "Divine" : "Demigod"); break;+ case SP_DEMONSPAWN: res = (adj ? "Demonic" : "Demonspawn" ); break;+ case SP_GHOUL: res = (adj ? "Ghoulish" : "Ghoul"); break;+ case SP_MERFOLK: res = (adj ? "Merfolkian" : "Merfolk"); break;+ default: res = (adj ? "Yakish" : "Yak"); break; } } return res;@@ -4572,139 +4572,6 @@ return; } // end set_mp() --static const char * Species_Abbrev_List[ NUM_SPECIES ] = - { "XX", "Hu", "HE", "GE", "DE", "SE", "MD", "Ha",- "HO", "Ko", "Mu", "Na", "Gn", "Og", "Tr", "OM",- // the draconians- "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr",- "Ce", "DG", "Sp", "Mi", "DS", "Gh", "Ke", "Mf", "Vp",- // placeholders- "HD", "El" };--int get_species_index_by_abbrev( const char *abbrev )-{- int i;- ASSERT(ARRAYSIZE(Species_Abbrev_List) == NUM_SPECIES);- for (i = SP_HUMAN; i < NUM_SPECIES; i++)- {- if (tolower( abbrev[0] ) == tolower( Species_Abbrev_List[i][0] )- && tolower( abbrev[1] ) == tolower( Species_Abbrev_List[i][1] ))- {- break;- }- }-- return ((i < NUM_SPECIES) ? i : -1);-}--int get_species_index_by_name( const char *name )-{- int i;- int sp = -1;-- std::string::size_type pos = std::string::npos;- char lowered_buff[80];-- strncpy( lowered_buff, name, sizeof( lowered_buff ) );- strlwr( lowered_buff );-- for (i = SP_HUMAN; i < NUM_SPECIES; i++)- {- const std::string lowered_species =- lowercase_string(species_name(static_cast<species_type>(i),0));- pos = lowered_species.find( lowered_buff );- if (pos != std::string::npos)- {- sp = i;- if (pos == 0) // prefix takes preference- break;- }- }-- return (sp);-}--const char *get_species_abbrev( int which_species )-{- ASSERT( which_species > 0 && which_species < NUM_SPECIES );-- return (Species_Abbrev_List[ which_species ]);-}---static const char * Class_Abbrev_List[ NUM_JOBS ] = - { "Fi", "Wz", "Pr", "Th", "Gl", "Ne", "Pa", "As", "Be", "Hu", - "Cj", "En", "FE", "IE", "Su", "AE", "EE", "Cr", "DK", "VM", - "CK", "Tm", "He", "Re", "St", "Mo", "Wr", "Wn" };--static const char * Class_Name_List[ NUM_JOBS ] = - { "Fighter", "Wizard", "Priest", "Thief", "Gladiator", "Necromancer",- "Paladin", "Assassin", "Berserker", "Hunter", "Conjurer", "Enchanter",- "Fire Elementalist", "Ice Elementalist", "Summoner", "Air Elementalist",- "Earth Elementalist", "Crusader", "Death Knight", "Venom Mage",- "Chaos Knight", "Transmuter", "Healer", "Reaver", "Stalker",- "Monk", "Warper", "Wanderer" };--int get_class_index_by_abbrev( const char *abbrev )-{- int i;-- for (i = 0; i < NUM_JOBS; i++)- {- if (tolower( abbrev[0] ) == tolower( Class_Abbrev_List[i][0] )- && tolower( abbrev[1] ) == tolower( Class_Abbrev_List[i][1] ))- {- break;- }- }-- return ((i < NUM_JOBS) ? i : -1);-}--const char *get_class_abbrev( int which_job )-{- ASSERT( which_job < NUM_JOBS );-- return (Class_Abbrev_List[ which_job ]);-}--int get_class_index_by_name( const char *name )-{- int i;- int cl = -1;-- char *ptr;- char lowered_buff[80];- char lowered_class[80];-- strncpy( lowered_buff, name, sizeof( lowered_buff ) );- strlwr( lowered_buff );-- for (i = 0; i < NUM_JOBS; i++)- {- strncpy( lowered_class, Class_Name_List[i], sizeof( lowered_class ) );- strlwr( lowered_class );-- ptr = strstr( lowered_class, lowered_buff );- if (ptr != NULL)- {- cl = i;- if (ptr == lowered_class) // prefix takes preference- break;- }- }-- return (cl);-}--const char *get_class_name( int which_job ) -{- ASSERT( which_job < NUM_JOBS );-- return (Class_Name_List[ which_job ]);-}- void contaminate_player(int change, bool statusOnly) { // get current contamination levelModified: trunk/crawl-ref/source/player.h===================================================================--- trunk/crawl-ref/source/player.h2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/source/player.h2008-03-02 22:28:28 UTC (rev 3505)@@ -396,19 +396,6 @@ * *********************************************************************** */ void set_mp(int new_amount, bool max_too); --/* ***********************************************************************- * called from: newgame- * *********************************************************************** */-int get_species_index_by_abbrev( const char *abbrev );-int get_species_index_by_name( const char *name );-const char *get_species_abbrev( int which_species );--int get_class_index_by_abbrev( const char *abbrev );-int get_class_index_by_name( const char *name );-const char *get_class_abbrev( int which_job );-const char *get_class_name( int which_job );- // last updated 19apr2001 {gdl} /* *********************************************************************** * called from:Modified: trunk/crawl-ref/source/view.cc===================================================================--- trunk/crawl-ref/source/view.cc2008-03-02 17:50:52 UTC (rev 3504)+++ trunk/crawl-ref/source/view.cc2008-03-02 22:28:28 UTC (rev 3505)@@ -57,6 +57,7 @@ #include "misc.h" #include "monstuff.h" #include "mon-util.h"+#include "newgame.h" #include "overmap.h" #include "player.h" #include "religion.h"This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [3597] trunk/crawl-ref

From: <dp...@us...> - 2008-03-11 12:51:24

Revision: 3597 Author: dploogDate: 2008-03-11 05:51:12 -0700 (Tue, 11 Mar 2008)Log Message:-----------First step towards easy switching off the major interface changes(monster colours, command keys, butchering interface).The macros in /docs/034_command_keys.txt all work but the loadingprocess seems to not (always) take place. In other words: Help!Modified Paths:-------------- trunk/crawl-ref/docs/crawl_options.txt trunk/crawl-ref/init.txtAdded Paths:----------- trunk/crawl-ref/docs/034_command_keys.txt trunk/crawl-ref/docs/034_monster_glyphs.txtRemoved Paths:------------- trunk/crawl-ref/docs/monster_glyphs.txtAdded: trunk/crawl-ref/docs/034_command_keys.txt===================================================================--- trunk/crawl-ref/docs/034_command_keys.txt (rev 0)+++ trunk/crawl-ref/docs/034_command_keys.txt2008-03-11 12:51:12 UTC (rev 3597)@@ -0,0 +1,56 @@+# This file contains macros for using 0.3.4 command keys instead of the +# new set from 0.4.++# If you want to use it, add the following line to your init.txt:+# : crawl.read_options('docs/034_command_keys.txt')++# Note that the 'v'iew item command is not available anymore. You can+# get the same functionality by pressing the item slot in the inventor.++# annotate level (Ctrl-I)+M:\{9}+A:!++# auto-explore (Ctrl-O)+M:\{15}+A:o++# shout/tell allies+M:!+A:t++# experience information+M:C+A:E++# evoke+M:E+A:v++# dungeon overview+M:O+A:\{15}++# cast spell+M:Z+A:z++# close door+M:c+A:C++# open door+M:o+A:O++# throw+M:t+A:fi++# zap wand+M:z+A:Z++# butcher+M:D+A:cAdded: trunk/crawl-ref/docs/034_monster_glyphs.txt===================================================================--- trunk/crawl-ref/docs/034_monster_glyphs.txt (rev 0)+++ trunk/crawl-ref/docs/034_monster_glyphs.txt2008-03-11 12:51:12 UTC (rev 3597)@@ -0,0 +1,301 @@+# The release of Dungeon Crawl 0.4 brought with it an +# overhaul of monster colours and monster glyphs. +#+# The goal of this change was to put monsters into more +# consistent groups (e.g. group jackals with hounds,+# move slugs into a group of their own) and to follow +# a more consistent colour scheme where similar+# monster would have similar colours (e.g. orc priest+# and elf priest are both coloured green now) and the +# higher level (and thus more dangerous) version of +# an early monster would get the brighter colour. +# As an example of the latter, the orc sorceror has+# been recoloured to light magenta because the orc+# wizard (the easier orc mage version) glyph is +# coloured magenta. Also, the colours of some pairings +# including small snake/snake and yaktaur/yaktaur +# have been switched, following the same rule.+# Another important point of the change was to avoid+# the use of dark grey, which can be unreadable on some +# systems, and use light grey, white, or blue or another +# colour in its stead, as appropriate.+#+# We think that as a result of these changes monsters+# are coloured more consistently, and that their +# difficulty level should be easier to grasp for newbies.+# At the same time we realize that this change might be+# hard on experienced players. Of course we hope that +# you will be able to adapt, but in case there are +# changes you really cannot accept, here are the options+# necessary to make the glyphs of all affected monsters+# show up as they did in version 0.3.4. +#+# You'll find a table comparing old and new settings at +# the end of this file.++###########################+# features+###########################++feature = granite statue { , , lightgrey}+feature = orcish idol { , , darkgrey}++###########################+# monsters+###########################++# orcs+mon_glyph = orc : lightred+mon_glyph = Urug : red+mon_glyph = orc warrior : yellow+mon_glyph = orc priest : lightgreen+mon_glyph = orc knight : lightcyan+mon_glyph = orc high priest : green+mon_glyph = orc sorcerer : darkgrey+mon_glyph = orc warlord : red++# elves+mon_glyph = elf : darkgrey+mon_glyph = deep elf soldier : cyan+mon_glyph = deep elf mage : lightred+mon_glyph = deep elf fighter : lightblue+mon_glyph = deep elf summoner : yellow+mon_glyph = deep elf knight : blue+mon_glyph = deep elf conjurer : lightgreen+mon_glyph = deep elf priest : lightgrey+mon_glyph = deep elf high priest : darkgrey+mon_glyph = deep elf demonologist : magenta+mon_glyph = deep elf sorcerer : red+mon_glyph = deep elf annihilator : green+mon_glyph = deep elf master archer : lightmagenta++# lizards+mon_glyph = giant newt : lightgreen+mon_glyph = giant lizard : green++# snakes and naga+mon_glyph = small snake : lightgreen+mon_glyph = snake : green+mon_glyph = black snake : darkgrey+mon_glyph = greater naga : red+mon_glyph = naga mage : lightred++# draconians and dragons+mon_glyph = lindwurm : lightgreen d+mon_glyph = black draconian : darkgrey+mon_glyph = green draconian : lightgreen+mon_glyph = draconian zealot : lightblue+mon_glyph = draconian annihilator : green+mon_glyph = steam dragon : lightgrey+mon_glyph = mottled dragon : magenta+mon_glyph = shadow dragon : darkgrey+mon_glyph = death drake : darkgrey++# hounds+mon_glyph = hound : brown+mon_glyph = warg : darkgrey+mon_glyph = hog : lightred+mon_glyph = hell hound : darkgrey+mon_glyph = hell-hog : red+mon_glyph = jackal : yellow j++# slugs and snails+mon_glyph = elephant slug : lightgrey m+mon_glyph = giant slug : green m+mon_glyph = giant snail : lightgreen m++# other natural monsters+mon_glyph = giant ant : darkgrey+mon_glyph = queen ant : darkgrey+mon_glyph = giant bat : darkgrey+mon_glyph = yaktaur : lightred+mon_glyph = yaktaur captain : red+mon_glyph = manticore : brown m+mon_glyph = minotaur : lightred m+mon_glyph = quokka : lightgrey+mon_glyph = scorpion : darkgrey+mon_glyph = killer bee larva : lightgrey+mon_glyph = spiny worm : darkgrey+mon_glyph = giant beetle : darkgrey+mon_glyph = giant mosquito : darkgrey+mon_glyph = cyclops : brown+mon_glyph = death ooze : darkgrey+mon_glyph = big kobold : red+mon_glyph = deep troll : darkgrey+mon_glyph = black bear : darkgrey+mon_glyph = death yak : darkgrey++# unnatural monsters+mon_glyph = toenail golem : lightgrey+mon_glyph = crystal golem : white+mon_glyph = gargoyle : darkgrey g+mon_glyph = metal gargoyle : cyan g+mon_glyph = molten gargoyle : red g++# undead+mon_glyph = shadow demon : darkgrey+mon_glyph = shadow imp : darkgrey+mon_glyph = Shadow Fiend : darkgrey+mon_glyph = soul eater : darkgrey+mon_glyph = neqoxec : magenta+mon_glyph = demonic crawler : darkgrey+mon_glyph = necromancer : darkgrey+mon_glyph = quasit : lightgrey q+mon_glyph = boggart : darkgrey+mon_glyph = curse skull : darkgrey+mon_glyph = necrophage : darkgrey+mon_glyph = lich : white+mon_glyph = ancient lich : darkgrey+mon_glyph = mummy : white+mon_glyph = greater mummy : darkgrey+mon_glyph = wraith : darkgrey+mon_glyph = player ghost : darkgrey++# unique monsters+mon_glyph = Gloorx Vloq : darkgrey+mon_glyph = Margery : red+mon_glyph = Frederick : darkgrey+++#########################################################+# Table of old vs. new colours and, occasionally, glyphs+#########################################################+#+# feature old colour new colour+# ------- ---------- ----------+# granite statue lightgrey darkgrey+# orcish idol darkgrey red+#+# monster old colour new colour+# ------- ---------- ----------+# orcs+# orc lightred red+# Urug red yellow+# orc warrior yellow lightred+# orc priest lightgreen green+# orc knight lightcyan cyan+# orc high priest green lightgreen+# orc sorcerer darkgrey lightmagenta+# orc warlord red lightcyan+#+# monster old colour new colour+# ------- ---------- ----------+# elves+# elf darkgrey red+# deep elf soldier cyan red+# deep elf mage lightred magenta+# deep elf fighter lightblue lightred+# deep elf summoner yellow brown+# deep elf knight blue cyan+# deep elf conjurer lightgreen blue+# deep elf priest lightgrey green+# deep elf high priest darkgrey lightgreen+# deep elf demonologist magenta yellow+# deep elf sorcerer red lightmagenta+# deep elf annihilator green lightblue+# deep elf master archer lightmagenta lightgrey+#+# monster old colour new colour+# ------- ---------- ----------+# lizards+# giant newt lightgreen green+# giant lizard green lightgreen+#+# monster old colour new colour+# ------- ---------- ----------+# snakes and naga+# small snake lightgreen green+# snake green lightgreen+# black snake darkgrey blue+# greater naga red lightred+# naga mage lightred red+#+# monster old colour new colour+# ------- ---------- ----------+# draconians and dragons+# lindwurm lightgreen d lightcyan l+# black draconian darkgrey blue+# green draconian lightgreen green+# draconian zealot lightblue lightgreen+# draconian annihilator green lightblue+# steam dragon lightgrey blue+# mottled dragon magenta lightmagenta+# shadow dragon darkgrey magenta+# death drake darkgrey lightgrey+#+# monster old colour new colour+# ------- ---------- ----------+# hounds+# jackal yellow j brown h+# hound brown lightgrey+# warg darkgrey white+# hog lightred red+# hell hound darkgrey lightcyan+# hell-hog red lightred+#+# monster old colour new colour+# ------- ---------- ----------+# slugs and snails+# elephant slug lightgrey m lightgrey j+# giant slug green m green j+# giant snail lightgreen m lightgreen j+#+# monster old colour new colour+# ------- ---------- ----------+# other natural monsters+# giant ant darkgrey red+# queen ant darkgrey lightgrey+# giant bat darkgrey lightgrey+# yaktaur lightred red+# yaktaur captain red lightred+# manticore brown m red H+# minotaur lightred m red t+# quokka lightgrey white+# scorpion darkgrey lightgrey+# killer bee larva lightgrey yellow+# spiny worm darkgrey lightgreen+# giant beetle darkgrey blue+# giant mosquito darkgrey white+# cyclops brown yellow+# death ooze darkgrey magenta+# big kobold red yellow+# deep troll darkgrey yellow+# black bear darkgrey blue+# death yak darkgrey yellow+#+# monster old colour new colour+# ------- ---------- ----------+# unnatural monsters+# toenail golem lightgrey red+# crystal golem white green+# gargoyle darkgrey g darkgrey 9+# metal gargoyle cyan g cyan 9+# molten gargoyle red g red 9+#+# monster old colour new colour+# ------- ---------- ----------+# undead and demons+# shadow demon darkgrey magenta+# shadow imp darkgrey magenta+# Shadow Fiend darkgrey magenta+# soul eater darkgrey magenta+# neqoxec magenta lightmagenta+# demonic crawler darkgrey green+# necromancer darkgrey white+# quasit lightgrey q lightgrey 5+# boggart darkgrey magenta+# curse skull darkgrey lightcyan+# necrophage darkgrey lightgrey+# lich white lightgrey+# ancient lich darkgrey white+# mummy white lightgrey+# greater mummy darkgrey white+# wraith darkgrey white+# player ghost darkgrey white+#+# monster old colour new colour+# ------- ---------- ----------+# unique monsters+# Frederick darkgrey green+# Gloorx Vloq darkgrey lightgrey+# Margery red lightredModified: trunk/crawl-ref/docs/crawl_options.txt===================================================================--- trunk/crawl-ref/docs/crawl_options.txt2008-03-11 10:33:01 UTC (rev 3596)+++ trunk/crawl-ref/docs/crawl_options.txt2008-03-11 12:51:12 UTC (rev 3597)@@ -1727,4 +1727,4 @@ Example: # Set the monster glyphs back to the way they were in 0.3.4-: crawl.read_options('docs/monster_glyphs.txt')+: crawl.read_options('docs/034_monster_glyphs.txt')Deleted: trunk/crawl-ref/docs/monster_glyphs.txt===================================================================--- trunk/crawl-ref/docs/monster_glyphs.txt2008-03-11 10:33:01 UTC (rev 3596)+++ trunk/crawl-ref/docs/monster_glyphs.txt2008-03-11 12:51:12 UTC (rev 3597)@@ -1,301 +0,0 @@-# The release of Dungeon Crawl 0.4 brought with it an -# overhaul of monster colours and monster glyphs. -#-# The goal of this change was to put monsters into more -# consistent groups (e.g. group jackals with hounds,-# move slugs into a group of their own) and to follow -# a more consistent colour scheme where similar-# monster would have similar colours (e.g. orc priest-# and elf priest are both coloured green now) and the -# higher level (and thus more dangerous) version of -# an early monster would get the brighter colour. -# As an example of the latter, the orc sorceror has-# been recoloured to light magenta because the orc-# wizard (the easier orc mage version) glyph is -# coloured magenta. Also, the colours of some pairings -# including small snake/snake and yaktaur/yaktaur -# have been switched, following the same rule.-# Another important point of the change was to avoid-# the use of dark grey, which can be unreadable on some -# systems, and use light grey, white, or blue or another -# colour in its stead, as appropriate.-#-# We think that as a result of these changes monsters-# are coloured more consistently, and that their -# difficulty level should be easier to grasp for newbies.-# At the same time we realize that this change might be-# hard on experienced players. Of course we hope that -# you will be able to adapt, but in case there are -# changes you really cannot accept, here are the options-# necessary to make the glyphs of all affected monsters-# show up as they did in version 0.3.4. -#-# You'll find a table comparing old and new settings at -# the end of this file.--###########################-# features-###########################--feature = granite statue { , , lightgrey}-feature = orcish idol { , , darkgrey}--###########################-# monsters-###########################--# orcs-mon_glyph = orc : lightred-mon_glyph = Urug : red-mon_glyph = orc warrior : yellow-mon_glyph = orc priest : lightgreen-mon_glyph = orc knight : lightcyan-mon_glyph = orc high priest : green-mon_glyph = orc sorcerer : darkgrey-mon_glyph = orc warlord : red--# elves-mon_glyph = elf : darkgrey-mon_glyph = deep elf soldier : cyan-mon_glyph = deep elf mage : lightred-mon_glyph = deep elf fighter : lightblue-mon_glyph = deep elf summoner : yellow-mon_glyph = deep elf knight : blue-mon_glyph = deep elf conjurer : lightgreen-mon_glyph = deep elf priest : lightgrey-mon_glyph = deep elf high priest : darkgrey-mon_glyph = deep elf demonologist : magenta-mon_glyph = deep elf sorcerer : red-mon_glyph = deep elf annihilator : green-mon_glyph = deep elf master archer : lightmagenta--# lizards-mon_glyph = giant newt : lightgreen-mon_glyph = giant lizard : green--# snakes and naga-mon_glyph = small snake : lightgreen-mon_glyph = snake : green-mon_glyph = black snake : darkgrey-mon_glyph = greater naga : red-mon_glyph = naga mage : lightred--# draconians and dragons-mon_glyph = lindwurm : lightgreen d-mon_glyph = black draconian : darkgrey-mon_glyph = green draconian : lightgreen-mon_glyph = draconian zealot : lightblue-mon_glyph = draconian annihilator : green-mon_glyph = steam dragon : lightgrey-mon_glyph = mottled dragon : magenta-mon_glyph = shadow dragon : darkgrey-mon_glyph = death drake : darkgrey--# hounds-mon_glyph = hound : brown-mon_glyph = warg : darkgrey-mon_glyph = hog : lightred-mon_glyph = hell hound : darkgrey-mon_glyph = hell-hog : red-mon_glyph = jackal : yellow j--# slugs and snails-mon_glyph = elephant slug : lightgrey m-mon_glyph = giant slug : green m-mon_glyph = giant snail : lightgreen m--# other natural monsters-mon_glyph = giant ant : darkgrey-mon_glyph = queen ant : darkgrey-mon_glyph = giant bat : darkgrey-mon_glyph = yaktaur : lightred-mon_glyph = yaktaur captain : red-mon_glyph = manticore : brown m-mon_glyph = minotaur : lightred m-mon_glyph = quokka : lightgrey-mon_glyph = scorpion : darkgrey-mon_glyph = killer bee larva : lightgrey-mon_glyph = spiny worm : darkgrey-mon_glyph = giant beetle : darkgrey-mon_glyph = giant mosquito : darkgrey-mon_glyph = cyclops : brown-mon_glyph = death ooze : darkgrey-mon_glyph = big kobold : red-mon_glyph = deep troll : darkgrey-mon_glyph = black bear : darkgrey-mon_glyph = death yak : darkgrey--# unnatural monsters-mon_glyph = toenail golem : lightgrey-mon_glyph = crystal golem : white-mon_glyph = gargoyle : darkgrey g-mon_glyph = metal gargoyle : cyan g-mon_glyph = molten gargoyle : red g--# undead-mon_glyph = shadow demon : darkgrey-mon_glyph = shadow imp : darkgrey-mon_glyph = Shadow Fiend : darkgrey-mon_glyph = soul eater : darkgrey-mon_glyph = neqoxec : magenta-mon_glyph = demonic crawler : darkgrey-mon_glyph = necromancer : darkgrey-mon_glyph = quasit : lightgrey q-mon_glyph = boggart : darkgrey-mon_glyph = curse skull : darkgrey-mon_glyph = necrophage : darkgrey-mon_glyph = lich : white-mon_glyph = ancient lich : darkgrey-mon_glyph = mummy : white-mon_glyph = greater mummy : darkgrey-mon_glyph = wraith : darkgrey-mon_glyph = player ghost : darkgrey--# unique monsters-mon_glyph = Gloorx Vloq : darkgrey-mon_glyph = Margery : red-mon_glyph = Frederick : darkgrey---#########################################################-# Table of old vs. new colours and, occasionally, glyphs-#########################################################-#-# feature old colour new colour-# ------- ---------- -----------# granite statue lightgrey darkgrey-# orcish idol darkgrey red-#-# monster old colour new colour-# ------- ---------- -----------# orcs-# orc lightred red-# Urug red yellow-# orc warrior yellow lightred-# orc priest lightgreen green-# orc knight lightcyan cyan-# orc high priest green lightgreen-# orc sorcerer darkgrey lightmagenta-# orc warlord red lightcyan-#-# monster old colour new colour-# ------- ---------- -----------# elves-# elf darkgrey red-# deep elf soldier cyan red-# deep elf mage lightred magenta-# deep elf fighter lightblue lightred-# deep elf summoner yellow brown-# deep elf knight blue cyan-# deep elf conjurer lightgreen blue-# deep elf priest lightgrey green-# deep elf high priest darkgrey lightgreen-# deep elf demonologist magenta yellow-# deep elf sorcerer red lightmagenta-# deep elf annihilator green lightblue-# deep elf master archer lightmagenta lightgrey-#-# monster old colour new colour-# ------- ---------- -----------# lizards-# giant newt lightgreen green-# giant lizard green lightgreen-#-# monster old colour new colour-# ------- ---------- -----------# snakes and naga-# small snake lightgreen green-# snake green lightgreen-# black snake darkgrey blue-# greater naga red lightred-# naga mage lightred red-#-# monster old colour new colour-# ------- ---------- -----------# draconians and dragons-# lindwurm lightgreen d lightcyan l-# black draconian darkgrey blue-# green draconian lightgreen green-# draconian zealot lightblue lightgreen-# draconian annihilator green lightblue-# steam dragon lightgrey blue-# mottled dragon magenta lightmagenta-# shadow dragon darkgrey magenta-# death drake darkgrey lightgrey-#-# monster old colour new colour-# ------- ---------- -----------# hounds-# jackal yellow j brown h-# hound brown lightgrey-# warg darkgrey white-# hog lightred red-# hell hound darkgrey lightcyan-# hell-hog red lightred-#-# monster old colour new colour-# ------- ---------- -----------# slugs and snails-# elephant slug lightgrey m lightgrey j-# giant slug green m green j-# giant snail lightgreen m lightgreen j-#-# monster old colour new colour-# ------- ---------- -----------# other natural monsters-# giant ant darkgrey red-# queen ant darkgrey lightgrey-# giant bat darkgrey lightgrey-# yaktaur lightred red-# yaktaur captain red lightred-# manticore brown m red H-# minotaur lightred m red t-# quokka lightgrey white-# scorpion darkgrey lightgrey-# killer bee larva lightgrey yellow-# spiny worm darkgrey lightgreen-# giant beetle darkgrey blue-# giant mosquito darkgrey white-# cyclops brown yellow-# death ooze darkgrey magenta-# big kobold red yellow-# deep troll darkgrey yellow-# black bear darkgrey blue-# death yak darkgrey yellow-#-# monster old colour new colour-# ------- ---------- -----------# unnatural monsters-# toenail golem lightgrey red-# crystal golem white green-# gargoyle darkgrey g darkgrey 9-# metal gargoyle cyan g cyan 9-# molten gargoyle red g red 9-#-# monster old colour new colour-# ------- ---------- -----------# undead and demons-# shadow demon darkgrey magenta-# shadow imp darkgrey magenta-# Shadow Fiend darkgrey magenta-# soul eater darkgrey magenta-# neqoxec magenta lightmagenta-# demonic crawler darkgrey green-# necromancer darkgrey white-# quasit lightgrey q lightgrey 5-# boggart darkgrey magenta-# curse skull darkgrey lightcyan-# necrophage darkgrey lightgrey-# lich white lightgrey-# ancient lich darkgrey white-# mummy white lightgrey-# greater mummy darkgrey white-# wraith darkgrey white-# player ghost darkgrey white-#-# monster old colour new colour-# ------- ---------- -----------# unique monsters-# Frederick darkgrey green-# Gloorx Vloq darkgrey lightgrey-# Margery red lightredModified: trunk/crawl-ref/init.txt===================================================================--- trunk/crawl-ref/init.txt2008-03-11 10:33:01 UTC (rev 3596)+++ trunk/crawl-ref/init.txt2008-03-11 12:51:12 UTC (rev 3597)@@ -1,3 +1,15 @@+# NOTE FOR PLAYERS OF OLD VERSIONS (DCSS 0.3.4 or before):+#+# Uncomment the following three options if you want to disable 0.4's+# changes to the interface: command keys, monster colours, and the +# butchering interface. (New players should go ignore these lines.)+#+# : crawl.read_options('docs/034_command_keys.txt')+# : crawl.read_options('docs/034_monster_glyphs.txt')+# always_confirm_butcher = true+++ # Crawl Init file # # On Unix systems (such as Mac OS X, Linux and the BSDs), you must copy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [3612] trunk/crawl-ref

From: <dp...@us...> - 2008-03-12 16:52:47

Revision: 3612 Author: dploogDate: 2008-03-12 09:52:42 -0700 (Wed, 12 Mar 2008)Log Message:-----------Document Ctrl-D.Modified Paths:-------------- trunk/crawl-ref/docs/crawl_macros.txt trunk/crawl-ref/docs/crawl_manual.txt trunk/crawl-ref/source/command.ccModified: trunk/crawl-ref/docs/crawl_macros.txt===================================================================--- trunk/crawl-ref/docs/crawl_macros.txt2008-03-12 16:43:37 UTC (rev 3611)+++ trunk/crawl-ref/docs/crawl_macros.txt2008-03-12 16:52:42 UTC (rev 3612)@@ -26,9 +26,7 @@ How to create macros and keymaps? ================================= -The simplest way is in-game: Press the '~' key (this may be a bit-awkward on certain keyboard layouts, see below for how to edit the-macro.txt file directly and for an example how to remap it), select+The simplest way is in-game: Press either the '~' key or Ctrl-D, select 'm' to define a macro, then choose a key to assign for your macro and enter the command sequence. For some keys (or key combinations), Crawl will display a strange number (for example \{13} for the Return key).@@ -93,16 +91,7 @@ substitute your own keys here as these may not always work for you. -The first example will map the '0' key to '~', so that you can press-'0' to define macros in-game as described above, in case you have-troubles using '~' on your keyboard layout.--# 0: add macro-K:0-A:~---'@' is another character that may not work by default on some keyboard+'@' is a character that may not work by default on some keyboard layouts. The following should remedy that by mapping '@' to '@'. # @: display character statusModified: trunk/crawl-ref/docs/crawl_manual.txt===================================================================--- trunk/crawl-ref/docs/crawl_manual.txt2008-03-12 16:43:37 UTC (rev 3611)+++ trunk/crawl-ref/docs/crawl_manual.txt2008-03-12 16:52:42 UTC (rev 3612)@@ -1157,10 +1157,10 @@ wielding etc.), so is not recommended. Macroing 'a' to some other key will only change the command key 'a'. -You can set up key maps and macros in-game with the ~ key; this also -allows for saving all current key bindings and macros. Alternatively, -you can directly edit the macros.txt file. For more information on both-and for examples, see crawl_macros.txt.+You can set up key maps and macros in-game with the ~ key (Ctrl-D will+also work); this also allows for saving all current key bindings and +macros. Alternatively, you can directly edit the macros.txt file. For +more information on both and for examples, see crawl_macros.txt. Crawl supports a large number of options that allow for great flexibility in the interface. They are fully documented in the file@@ -2291,7 +2291,7 @@ ?/ Describe a monster, spell or feature. You can enter a partial name or a regex instead of the full name.- ~ Add or save macros and key mappings.+ ~ or Ctrl-D Add or save macros and key mappings. = Reassign inventory/spell/abilities letters. _ Read messages (when playing online; not for local games).Modified: trunk/crawl-ref/source/command.cc===================================================================--- trunk/crawl-ref/source/command.cc2008-03-12 16:43:37 UTC (rev 3611)+++ trunk/crawl-ref/source/command.cc2008-03-12 16:52:42 UTC (rev 3612)@@ -1559,7 +1559,7 @@ "<w>!</w> : annotate the dungeon level\n" "<w>#</w> : dump character to file\n" "<w>:</w> : add note (use <w>?:</w> to read notes)\n"- "<w>~</w> : add macro\n"+ "<w>~</w> : add macro (also <w>Ctrl-D</w>)\n" "<w>=</w> : reassign inventory/spell letters\n" "<w>_</w> : read messages (online play only)" " \n",This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [3764] trunk/crawl-ref

From: <dp...@us...> - 2008-03-20 21:14:10

Revision: 3764 Author: dploogDate: 2008-03-20 14:14:03 -0700 (Thu, 20 Mar 2008)Log Message:-----------Fixed readme.txt.Renamed level-design.txt to level_design.txt.Modified Paths:-------------- trunk/crawl-ref/readme.txtAdded Paths:----------- trunk/crawl-ref/docs/level_design.txtRemoved Paths:------------- trunk/crawl-ref/docs/level-design.txtDeleted: trunk/crawl-ref/docs/level-design.txt===================================================================--- trunk/crawl-ref/docs/level-design.txt2008-03-20 21:09:20 UTC (rev 3763)+++ trunk/crawl-ref/docs/level-design.txt2008-03-20 21:14:03 UTC (rev 3764)@@ -1,1381 +0,0 @@-How to make levels for Dungeon Crawl Stone Soup-===============================================--Contents: A. Introduction- B. Sample map- C. Map symbols- D. Header information- E. Conditionalising levels- F. Validating levels- G. Hints for level makers- H. Lua reference- I. Feature names- J. Map statistics- K. Portal vaults--A. Introduction--------------------All fixed level information resides in various .des files to be found in-the dat directory. If you are interested in adding some vaults, say, start-with the existing ones and modify them. Currently, the following .des files-are in use:-- bazaar.des - entrances to bazaar portal vaults, and bazaars proper- crypt.des - Crypt:5, Tomb:1, Tomb:2, Tomb:3- elf.des - Elf:7- entry.des - entry vaults (each game - but not tutorial games - uses one of- these premade maps for the vicinity of the entrance)- float.des - floating vaults- hells.des - hell entrances, Geryon's vestibule, Coc:7, Tar:7, Dis:7, Geh:7- hive.des - hive entrances, Hive:4- lab.des - labyrinths exits and flavour vaults- lair.des - lair entrances, Shoals:5, Swamp:5, Snake:5, Slime:6- large.des - all regular vaults which have ORIENT:encompass/northwest etc.- mini.des - minivaults (no ORIENT line at all)- orc.des - orcish mine entrances, orc only vaults- pan.des - vaults of the Pan demon lords, Pan minivaults- portal.des - portal vaults entrances- temple.des - Ecumenical Temples, and Temple entrances- vaults.des - entrances for the Vaults, and Vaults:8- zot.des - Zot:5---Kinds of Vaults-----------------The different kinds of vaults used by Crawl are described briefly below. In-most cases, when the dungeon builder places a vault on a level, the rest of the-level (assuming the vault is not a full-map vault) is generated as-rooms+corridors. The only exceptions to this are branch entry vaults and-minivaults, both of which are placed after the rest of the level is generated,-and therefore do not influence level generation.--* Entry vault:--A map designed for D:1, which (usually) contains the primary upstair { and is-always tagged "entry". A player starting a new game will usually land in an-entry vault.---* Branch entry vault, or branch portal vault:--A map containing the entry to a branch - either a branch stair (such as the-stair to the Orcish Mines), or a branch portal (a portal to Hell, say). Always-tagged "<branchname>_entry".---* Special level:--A map for a location of significance in the game, such as the Ecumenical-Temple, or the end of branches such as level 5 of the Snake Pit (Snake:5).-Special level maps usually have a PLACE: attribute.---* Random vaults:--Random vaults may be randomly generated at any level in the dungeon. Random-vault maps are selected by the dungeon builder based on their DEPTH:-attributes.---* Random minivaults:--Random minivaults are small maps that are placed onto a level that the-dungeon builder has already constructed fully otherwise (the level may-include other vaults).--Minivaults are distinguished from normal vaults solely by the absence-of an ORIENT: declaration. Any map without a specified ORIENT: is a-minivault.---B. Sample Map------------------Before going into the technical details of the level-file syntax,-let's look at an example - a branch entry for the Ecumenical Temple --to see what a map definition looks like.--# name below:-NAME: a_useless_temple_entry_02-# header section below:-ORIENT: float-CHANCE: 5-TAGS: temple_entry-FLAGS: no_rotate-SHUFFLE: de-SUBST: 1=12.-MONS: butterfly, plant-ITEM: stone, w:10 any book / w:90 nothing-# actual map below:-MAP-xx1@2xx-x1wWw2x-ewwOwwd-x2www1x-xx1.1xx-ENDMAP--Every map consists of a name, a header and the actual map (the order-is not important as long as the name comes first, but stick to this-order for consistency).--Lines starting with # are comments. The keywords available are-explained briefly after the example map and in detail in the following-sections.--"ORIENT: float" tells the level builder that this entry can be anywhere on the- level; other ORIENT: values can force a map to one edge of the- level.-"CHANCE: 5" makes the map appear less often (default is 10).-"TAGS: temple_entry" turns the 'O' on the map into stairs to the Temple.-"FLAGS: no_rotate" forbids rotation (but mirroring is still allowed).-"SHUFFLE: de" may replace all 'd' with 'e' in the map.-"SUBST: 1=12." may replace each '1' with either '1' or '2' or '.'.-"MONS: butterfly, plant" turns all '1' into butterflies, and '2' into plants.-"ITEM: stone" turns all 'd' into stones.-"ITEM: w:10 any book / w:90 nothing" turns all 'e' into a book- (with 10% chance) or creates no object (with 90% chance).--The symbols on the map:- x - rock wall- w - water (could be deep or shallow)- W - shallow water- . - plain floor- @ - entry point (this square will be connected to the rest of the map)- O - stairs to the Temple- 1 - first monster from the list (here butterfly) - note the SUBST: 1=12.- 2 - second monster from the list (plant)- d - first item from the list (here stones)- e - second item from the list (here occassionally a book)---D. Map symbols-------------------Terrain--------- x - rock wall (DNGN_ROCK_WALL)- X - permanent rock wall - always undiggable (DNGN_PERMAROCK_WALL)- c - stone wall - only affected by Shatter (DNGN_STONE_WALL)- m - clear rock wall (DNGN_CLEAR_ROCK_WALL)- n - clear stone wall - only affected by Shatter (DNGN_CLEAR_STONE_WALL)- o - clear permanent rock wall - always undiggable (DNGN_CLEAR_PERMAROCK_WALL)- v - metal wall - grounds electricity (DNGN_METAL_WALL)- b - crystal wall - reflects cold and fire (DNGN_GREEN_CRYSTAL_WALL)- a - wax wall - can melt (DNGN_WAX_WALL)-- . - floor (DNGN_FLOOR)- + - closed door (DNGN_CLOSED_DOOR)- = - secret door (DNGN_SECRET_DOOR)-- W - shallow water- w - deep water - can be randomly turned into shallow water by the- level-builder; you can prevent this conversion with the no_pool_fixup TAG.- Also, water may automatically receive water creatures! For entry- vaults, avoid this with the no_monster_gen TAG or KMASK.- l - lava - again, use the no_monster_gen TAG or KMASK for entry vaults!--Features---------- @ - entry point - must be on outside edge. If you use ORIENT: float, and do- not use any @, the dungeon builder will connect at least one floorspace on- the edge of your map to the rest of the level; if there is no floorspace- on the edge of your map, it will be isolated.- }{ - Stone stairs - You must be able to reach these from each other. The- { upstair is also the stair on which the player will enter the- dungeon for entry vaults.- )( - Stone stairs, set 2.- ][ - Stone stairs, set 3.-- >< - escape hatches - you can leave the level by these but will usually- not land on stairs/hatches-- I - orcish idol (does nothing)-- ^ - random trap.- ~ - random trap suitable for the branch and depth the map is being used.-- A - Vestibule gateway (opened by Horn).- B - Altar. These are assigned specific types (eg of Zin etc) in dungeon.cc,- in order.- C - Random Altar.-- F - Usually a Granite Statue, but may be Orange or Silver or Ice (1 in 100)- G - Granite statue (does nothing) - you can see through but not walk through.- Also, sight-based effects like smiting work past granite statues, as does- apportation.-- T - Water fountain- U - Magic fountain- V - Permanently dry fountain--Note: Due to the level maker having seen incremental improvements over-the years, there are some inconsistencies. For examples, dangerous-statues (orange, silver, ice) are now genuine monsters. In particular,-the 'H' and 'S' glyphs should be dispensed with (but many older vaults-use them, of course) - especially as there's no glyph for ice statues.--Also, the most of the other feature glyphs can be replaced with KFEAT:-lines. The same goes for some item glyphs ('R', 'Z') which-could be replaced by KITEM: lines.--Items------- $ - gold- % - normal item- * - higher level item (good)- | - acquirement-level item (almost guaranteed excellent)- O - place an appropriate rune here. For portal vaults, place the portal here.- P - maybe place a rune here (50%)- R - honeycomb (2/3) or royal jelly (1/3)- Z - the Orb of Zot- d-k - item array item. See section below on ITEM: arrays for more info.--Monsters---------- 0 - normal monster- 9 - +5 depth monster- 8 - (+2) * 2 depth monster (aargh!). Can get golden dragons and titans- this way.- 1-7 - monster array monster. See section below on MONS: arrays for more- information---D. Header information--------------------------(All declarations apart from NAME: are translated to Lua function-calls behind the scenes. See the Lua reference for more information.)--NAME: a_string- Each map must have a unique name. Underscores and digits are ok.--ORIENT: (float |encompass | north | northwest | ... | southeast)-- Some kind of ORIENT: line is mandatory for vaults; skipping- ORIENT: makes your map a minivault. As a rule of thumb, if- you're writing a small random map, skip the ORIENT: line and- make it a minivault. For special levels and (branch) entry- vaults, you do need an ORIENT: line.-- * "float": The dungeon builder puts your vault wherever it wants to.- * "some_direction": The vault lies along that side of the map:- xxxxxxxxxx xxxxxxxxxxxxx- xORIENT:Nx xORIENT:NW|..- x.VAULT..x x.VAULT...|..- x--------x x---------|..- xrest....x xrest........- x...of...x x.....of.....- x...levelx x.......level- ...which brings us to padding. With any some_direction orientation,- you need 6 layers of x-padding along any level-edge that the vault- borders. For instance, if your map is ORIENT: north, you must have a- 6 deep border of rock wall (or any other kind of wall) along the- northern, eastern, and western edges of the map.- * "encompass": the vault completely occupies the entire level.- Padding is needed on all 4 sides.-- ORIENT: float vaults need no padding and give a lot of- flexibility to the dungeon generator; float should generally- be preferred to other ORIENT: settings for new vaults.---DEPTH: For random vaults, branch entry vaults, and minivaults, this- specifies the range of levels where the vault may be placed- in the dungeon. E.g.-- DEPTH: 7-20-- DEPTH: does not force a map to be placed in a particular place; it- applies only when the dungeon builder is looking for a random vault- or minivault, so you can control at what depths your vault gets- placed.-- A simple DEPTH: declaration that does not specify a branch- applies to all branches. A map declared with depth 7-20 could- be used in the Lair, for instance. (Lair:1 will be treated as- a depth of 12 if the Lair entrance is on D:11.)-- You can constrain a map by branch:-- DEPTH: Lair:7-9-- (Anywhere between levels 7-9 of the Lair, inclusive.)-- You can apply multiple constraints in one DEPTH line,- comma-separated:-- DEPTH: 7-20, !12-14-- (Anywhere in the dungeon between depths 7-20, but not on levels- 12-14.)-- DEPTH: 7-20, !Orc-- (Anywhere in the dungeon between depths 7-20, but never in the Orcish- Mines.)-- DEPTH: Lair:*-- (Anywhere in the Lair. Can also be expressed as "DEPTH: Lair".)-- Maps that do not specify a DEPTH: attribute will inherit their depth- constraints from the closest preceding default-depth: line. If there- is no preceding default-depth directive in the .des file, the map will- have no DEPTH: constraint. Note that maps without a DEPTH: constraint- cannot be selected as random vaults or minivaults.--CHANCE: (number with 10 being default)- For entry vaults and any other vaults randomly picked from among- a set, this type of line affects the likelihood of the given vault- being picked in a given game. The default CHANCE: is 10. The- likelihood of a vault getting picked is:- [vault's CHANCE: / sum of all CHANCE:s of vaults of that type]--PLACE: Used to specify certain special levels. Existing special levels are:- Temple, Hell, Dis:7, Geh:7, Coc:7, Tar:7, Hive:4, Vault:8, Snake:5,- Elf:7, Slime:6, Blade, Zot:5, Tomb:1, Tomb:2, Tomb:3, Swamp:5.-- PLACE can also be used to specify arbitrary places, like D:3, which- will force the map (or one of the maps with PLACE: D:3) to be picked- when D:3 is generated.-- PLACE cannot be used to specify places in the Abyss, Pandemonium,- or Labyrinths.-- PLACE can be used with random vaults and minivaults for testing them.--TAGS: Tags go an a TAGS: line and are space-separated. Valid tags are:- * "allow_dup": Vaults are normally used only once per game. If you- have a vault that can be used more than once, use allow_dup to tell- the dungeon builder that the vault can be reused.- * "dummy": this tag indicates that the vault is a stub; if the dungeon- builder picks a dummy vault, it pretends no vault was selected.- Dummies are used to reduce the probability of other vaults at the- same depth / place.- * "entry": this tag MUST be there for a vault to be pickable as an- entry vault.- * "generate_awake": Monsters placed (using MONS, KMONS) in this vault- will be generated awake.- * "no_item_gen": Prevents random item generation in the vault.- Items explicitly placed by the vault are not affected.- * "mini_float": applicable only to minivaults, requests that- the dungeon builder pick random exits from the minivault and- connect it to the rest of the level, similar to the exit behaviour- for floating vaults.- * "no_monster_gen": Prevents random monster generation at the time of- the vault's creation. Highly advised for entry vaults with a- player-hostile geography, MUST-HAVE for those with water/lava.- Can be applied only to particular symbols with KMASK.- * "no_pool_fixup": prevents water squares next to land from being- randomly converted from deep water (the default) to shallow.- * "branch_entry" eg. "orc_entry", "lair_entry" etc.- If chosen, these maps will contain the stairs for that- branch. Use "O" to place the stairs. If a branch has very- few entries, a dummy entry is advisable to make sure the- player doesn't get bored of the same few entries recycled- ad nauseam.- * "mnoleg" or the name of some other pandemonium lord. This makes- the map eligible for said pan lord's lair.- * "uniq_BAR": (uniq_ with any suffix) specifies that only one of- the vaults with this tag can be used in a game.- * "no_rotate": Normally, the dungeon builder can, at its whim,- rotate your vault. This flag tells it, "hey, don't do that to my- vault!"- * "no_hmirror": Like no_rotate, but for horizontal mirroring.- * "no_vmirror": Like no_rotate, but for vertical mirroring.-- Pre-0.3 Crawl distinguished between TAGS and FLAGS. 0.3 and- newer Crawls treat TAGS and FLAGS as synonyms.--LFLAGS: Persistent, changeable per-level flags which affect game- behavior (FLAGS just controls how the vault is placed); should- only be used for vaults with ORIENT encompass or with PLACE.- This causes a level's flags to be set when the level is first- created. These flags can later be altered using Lua markers;- see the slime pit vault in lair.des, and the vaults in hell.des- and elf.des for examples.-- Valid flags are: no_tele_control, which prevents the player- from using teleport control; not_mappable, which prevents- the player from remembering where they've been (like in- the Abyss), and no_magic_map, which prevents magic mapping- from working.--BFLAGS: Persistent, changeable per-*branch* flags which affect game- behavior; should only be used for vaults which go on the fist- level of a particular branch. These flags can later be altered- using Lua markers; see the Tomb vaults in vaults.lua for an- example.-- Valid flags are: no_tele_control, which prevents the player- from using teleport control; not_mappable, which prevents- the player from remembering where they've been (like in- the Abyss), and no_magic_map, which prevents magic mapping- from working.--FLOORCOL: blue- FLOORCOL: allows you to set the floor colour for the level- the vault appears in. Should only be used for bazaars and- other portal vaults.--ROCKCOL: yellow- ROCKCOL: allows you to set the colour of rock walls for the- level the vault appears in. Should only be used for bazaars and- other portal vaults.--ITEM: (list of items, separated by comma)- These are used to help place specified items at specific places- within a vault. They create an array with up to 8 positions. What's- in the first position in the array will be used when the dungeon- builder sees a "d" in the vault definition, the second will be used- for "e"s, etc. Positions are comma-separated; several ITEM: lines- are possible as well. The following defines letters 'd' - 'g':- ITEM: stone, ring mail, meat ration, ring of hunger-- Positions can contain multiple possibilities, one of which the- builder will choose randomly. Separate such multiple possibilities- using a slash. Note that "nothing" (without the quotes) is a valid- possibility. The random choice is done for each individual occurence- of the letter. You can also give possibilities a "weight," which- affects their chance of being picked. The default weight is 10. You- can abbreviate "weight:30" by "w:30". The chance to pick a- possibility is- [possibility's weight: / sum of all weight:s in that array position]-- For example, the following line makes letter 'd' into a bread ration- with 50% chance, or apple or orange with 25% chance each:-- ITEM: bread ration / w:5 apple / w:5 orange-- Modifiers:- * "q:N" sets the item quantity to N (if N > 0). Does nothing- if the item is not stackable.- * "no_uniq" prevents the item from being turned into an artefact.- * "good_item" makes the builder try to make the item a good one- (acquirement quality). - * "level:N" sets the object's item level (can't be used with- "good_item"). If set to -2 then the object's item level will- be the same as a "*" symbol item (five plus twice the- vault's level number).- * "any" by itself gives a random choice; you can combine "any" with- "good_item."- * "any book", "any misc" etc. gives a random item of that class.- Valid item class names are: gold, weapon, missile, armour,- wand, food, scroll, jewelry, potion, book, staff, orb,- misc, carrion. All of these are usable in map definitions,- apart from "orb" and "carrion".- * "race:race_name", where "race_name" is "elven", "dwarven"- or "orcish"; it can also be "none" or "no_race" to prevent- the item from being randomly being made racial. Has no effect- if the item can't take that kind of racial setting.- NOTE: Can result in a non-racial item if used with "any" and- the chosen item isn't compatible with the desired race.- * "ego:ego_name", where "ego_name" is something like- "running", "fire_resistance", and so on; "none" can be used- to prevent the item from getting an ego. The item must- be fully specified, so trying "any weapon ego:vorpal" or- "any armour ego:positive_energy" will result in an error.- Trying to give an ego to something which can't accept an- ego will also result in an error.-- WARNING: While checks are done to make sure that an armour- ego isn't given to a weapon, a weapon ego to a missile,- and so on, and also to make sure that egos are only given- to amrours, weapons and missiles, no other checking is- done. Thus it is possible to create a demonic weapon of- holy wrath or a helmet of running.- - Limitations: You can't specify curse status, specificy- pluses or number of charges, force a randart or give fixedarts.- You also can't lay down corpses, skeletons, or chunks.--MONS: (list of monsters)- These are used to help place specific monsters at specific places- in a vault. They create an array with up to 7 positions. What's in- the first position in the array will be used when the dungeon- builder sees a "1" in the vault definition, the second for "2,"- etc. Note that if, for example, you place a 3 on the map, but your- MONS: line has no third position, the 3 will be filled with- RANDOM_MONSTER.- You can use weights as for ITEM: lines.-- Individual monsters may be prefixed with the "generate_awake"- (without the quotes). Use this sparingly:- MONS: generate_awake giant beetle-- Monsters can also be given colours that override their default- colour. Use this *very* sparingly:- MONS: col:darkgrey fungus-- Note that 8, 9, 0 also place monsters (see the table).-- A monster can be given specific items by following the monster- name with a semi-colon and then with an item list as described- in ITEM:, but with slashes replaced with pipes and commas replaced- with periods. For example:- MONS: orc ; katana | quick blade . chain mail | scale mail-- will generate an orc wielding either a katana or a quick blade- and wearing either a chain mail or a scale mail. Randarts are- never generated, and ego items are only generated if the ego- is explicitly stated. Note that any items that the monster was- originally generated with will be removed and destroyed. This- can be used force a monster to have no items whatsoever:- MONS: orc; nothing- - Items given to an orc or an elf will be made orcish or elven- unless the item's race type is explicitly set otherwise. -- Limitations: If an item in the item list has alternatives,- there's no way to force all monsters dervied from that monster- spec to choose the same alternative. If a monster is given- a random launcher, there is no way to force the ammo type to- match the launcher type.--COLOUR: . = green / blue:5 / red / none- COLOUR: allows you to attach explicit colours to any feature.- Explicit colours will override the default colour for that- feature. The example shown above colours all . (floor) in the- map green, blue, red, or unchanged (use the default colour).-- You can use : to specify that all glyphs get the same colour:- COLOUR: x : red / blue- will colour all rock walls in the map red, or all rock- walls blue.-- COLOUR: should be used very sparingly, and only for features- where it won't cause confusion (i.e.: never re-colour features- like lava!)--SHUFFLE: def, 12/3?- This allows you to randomly permute glyphs on the map. There are- two ways:-- SHUFFLE: 123w (i.e. list of glyphs, NOT slash-separated)- could, for example, swap all occurences of "1" with "2", as well as- swapping all "3" with "w" (or any other of the 24 possibilities).-- SHUFFLE: 12/3w (i.e. list of slash-separated blocks of same size)- will either do nothing or swap all "1" with "3" and then also swap- "2" with "w" everywhere.-- Several SHUFFLE: lines can be used, and mixed with SUBST:, and the- shuffles and substitutions will be applied in order. You can also- put multiple SHUFFLEs on one line, comma-separated. Shuffles cannot- use , or /. All spaces are stripped before shuffling.--SUBST: ?=xc, !:bv, 1=2 1:100- The SUBST: directive allows you to specify a placeholder symbol- that is replaced with a random glyph from a set. For instance:-- SUBST: ? = TUV- replaces occurrences of ? with one of TUV. Since whitespaces are- irrelevant, this is the same as- SUBST: ? = T U V-- SUBST: ? = T:20 U V- makes T twice as likely to be used as U or V (the default weight- is 10). Note that there has to be at least one space before and- after T:20 and that whitespace in T:20 is not permitted.-- SUBST: ? : TUV- replaces occurrences of ? with one of TUV, and guarantees that all- occurrences of ? will get the same replacement symbol.-- The placeholder and replacement symbols can be any non-space,- printable character, including : and =, apart from commas. For- example, the following is valid:- SUBST: = = +=:123def"-- SUBST: lines can safely replace symbols with themselves, as in:- SUBST: w = wW-- Multiple SUBST: lines can be used, and mixed with SHUFFLE:, and- will be applied in order. Multiple substitutions can be performed- on one line, using commas.--NSUBST: ? = 3:w / *:l-- NSUBST is similar to SUBST, replacing placeholders with- replacement values. Unlike SUBST, however, it allows you to- replace different instances of the same placeholder with- completely different substitutions. For instance:-- ? = 3:w / *:l-- replaces three occurrences (randomly selected) of ? with w- and all others with l.-- You can use complex SUBST specifications:-- ? = 3= w .:15 A / *: =+CF-- This is equivalent to SUBST: ? = w .:15 A for three ? and- SUBST: ? : =+CF for all the others.-- You use any number of NSUBST specifiers:-- ? = wW / l / A / 1234-- Each specifier is preceded by the number of symbols to apply- it to, followed by : or = (: to use one substitution for all- occurrences, = to randomly pick for each occurrence). If you- omit the initial N: or N=, then 1= is assumed, except for the- last spec where *= is assumed.--KFEAT: Z = C / needle trap / antique armour shop / altar_zin- The KFEAT: directive allows you to specify a placeholder symbol- that is replaced with another symbol, named feature, trap, or- shop. For example, the line above will replace occurrences of Z- with C (random altar), a needle trap, an antique armour shop, or- an altar of Zin. Different instances of Z may receive different- replacements. To force a single replacement for all Z, use:-- KFEAT: Z : C / needle trap / antique armour shop-- You'll notice that 'Z' is the symbol of the Orb of Zot. Kxxx- directives allow you to assign arbitrary definitions to any symbol.-- KFEAT features are specified as a feature name (see section I- for a full list of feature names). As another example, you can- place a portal to the Abyss as:-- KFEAT: A = enter_abyss-- If you want no feature as an option in a KFEAT line, use '.' or- 'floor'. If you do not want to specify the type of shop, use- 'any shop' or 'random shop'.-- The placeholder used by KFEAT can be shared by KITEM and KMONS;- see below. If the placeholder is shared, all defined Kxxxx- operations for the placeholder are performed. Also, all Kxxx- lines accept weights as for MONS or ITEM.--KMONS: ? = orc priest / w:3 deep elf priest-- KMONS: allows you to specify a placeholder symbol that indicates- the position of a monster (or monsters).- Using KMONS: allows you to exceed the 7 slot limit for monsters.- It is also useful if you want to place a monster on a non-floor- square (used in association with a KFEAT:). For example,- KFEAT: Z = W- KMONS: Z = rat- places a rat on a shallow water square for all occurrences of Z.-- KMONS: also allows you to specify alternative monsters if the- primary monster you want to place is unavailable (because it- is a unique that was already generated). For instance, if you want- to generate one of Terence, Michael or Erica or a generic human- (whoever is available, in that order, you can use):- KMONS: n = Terence, Michael, Erica, human- Or if you want to pick randomly:- KMONS: n = Terence / Michael / Erica, human--KMASK: Z = no_monster_gen-- KMASK allows you set or unset various masks for particular- symbols, rather than for the entire vault like if you did it- with TAGS. Valid masks are-- * "no_item_gen": Prevents random item on that symbol. Items- explicitly placed on that symbol aren't affected.- * "no_monster_gen": Prevents random monster generation on that- symbol. MUST-HAVE for those with water/lava symbols in- entry vaults.- * "no_pool_fixup": prevents a water square next to land from being- randomly converted from deep water (the default) to shallow.- * "no_secret_doors": prevents a door from randomly being turned- into a secret door.-- For example-- KMASK: W = no_monster_gen-- will prevent monsters from randomly being generated on shallow- water squares. Note that if shuffling and substitutions cause- W to end up as water 10% of the time and floor 90% of the time,- then those floor squares will still have no_monster_gen set, but- that's still a higher degree of control than you get with TAGS.-- If TAGS has been used to set a mask for the entire vault, you- can use KMASK to remove that mask from particular symbols.- For instance:-- TAGS: no_monster_gen- KMASK: W = !no_monster_gen-- would make it so that monsters are only randomly generated- on shallow water squares.--KITEM: ? = potion of healing / potion of restore abilities- KITEM: places the specified item at all occurrences of the- placeholder. It can be combined with KFEAT: and KMONS: lines for- the same placeholder.-- You can use "gold" or "$" to place gold:- KITEM: ? = nothing / gold- KITEM: ? = nothing / $-- You can use q: to specify quantities:- KITEM: ? = q:100 gold-- KITEM: allows you to place multiple items on the same square:- KITEM: ? = bread ration, potion of water, potion of porridge--MARKER: A = feat:<feature_name> or timer:-- A marker ties a square on the map to a game-trigger of some- sort (which depends on the marker and what feature it is on).-- The portals to the Hells in the Vestibule of Hell are each- annotated with feature markers like this:-- MARKER: D=feat:enter_dis, G=feat:enter_gehenna-- When the horn is sounded, the stone arch at D becomes the- portal to Dis, the arch at G becomes the portal to Gehenna,- etc. This behaviour applies only to the Vestibule of Hell.-- Timer feature markers set a timer on a particular square;- when time runs out, the feature at that square is changed- (usually to floor). For instance:-- MARKER: A = timer: 500-1000-- Sets a timer that's between 500-1000 turns, inclusive, at the- end of which whatever feature is on A gets converted to floor.-- You can specify the final feature with a feat: qualifier:-- MARKER: A = timer: 500 feat:deep_water-- This sets a timer for exactly 500 turns, and changes the- feature to deep water at the end of it.-- Feature names used in markers must be names matching the- names in the source code. There's a full list of feature- names in section I (Feature names) at the end of this- document.---E. Conditionalising levels--------------------------------Crawl translates level (.des) files into Lua code chunks and runs-these chunks to produce the final level that is generated. While you-don't need to use Lua for most levels, using Lua allows you to-conditionalise or randomise levels with greater control.--Let's take a simple example of randomisation:--NAME: random_test-# Put it on D:1 so it's easy to test.-PLACE: D:1-ORIENT: float-MAP-xxxxxxxxxxxxxxxxxxx-x........{........x-xxxAxxxxxBxxxxxCxxx-xxx.xxxxx.xxxxx.xxx-xxx@xxxxx@xxxxx@xxx-ENDMAP--Now let's say you want A, B, and C to be randomly rock or floor, but B-should be floor if both A and C are rock. Here's one way to do it (add-these lines to the map definition):--: local asolid, csolid-: if crawl.random2(2) == 0 then-: asolid = true-: subst("A = x")-: else-: subst("A = .")-: end-: if crawl.random2(2) == 0 then-: csolid = true-: subst("C = x")-: else-: subst("C = .")-: end-: if asolid and csolid then-: subst("B = .")-: else-: subst("B = .x")-: end--This code uses crawl.random2(N) which returns a number from 0 to N-1-(in this case, returns 0 or 1). So we give A a 50% chance of being-rock, and the same for C. If we made both A and C rock, we force B to-be floor, otherwise we use a subst that gives B the same 50% chance of-being rock.--You can conditionalise on various factors, such as player experience-level:--NAME: condition_002-DEPTH: 1-27-ORIENT: float-: if you.xl() > 18 then-MONS: greater mummy-: else-MONS: deep elf priest / deep elf sorcerer / deep elf demonologist-: end-MAP-xxxxxx-x1...x-x1...+-x1...x-xxxxxx-ENDMAP--Or based on where the map is being generated:--NAME: condition_003-DEPTH: Elf:*, Orc:*-ORIENT: float-: if you.branch() == "Orc" then-MONS: orc priest, orc high priest-: else-MONS: deep elf priest, deep elf high priest-: end-MAP-xxxxxx-x1...x-x2...+-x1...x-xxxxxx-ENDMAP--When conditionalising maps, remember that your Lua code executes in-two contexts:--1) An initial compilation phase before the game starts.-2) The actual mapgen phase when the dungeon builder is at work.--In context (1), you will not get useful answers from the Crawl Lua API-in general, because the game hasn't started. This is generally-ignorable (as in the case above) because the compilation phase just-checks the syntax of your Lua code. If you conditionalise your map,-however, you may run into compile failures. Take this variant, which-(incorrectly) attempts to conditionalise the map:--NAME: condition_004-DEPTH: Elf:*, Orc:*-ORIENT: float-: if you.branch() == "Orc" then-MONS: orc priest, orc high priest-MAP-xxxxxx-x1...x-x2.I.+-x1...x-xxxxxx-ENDMAP-: elseif you.branch() == "Elf" then-MONS: deep elf priest, deep elf high priest-MAP-xxxxxx-x1...x-x2.U.+-x1...x-xxxxxx-ENDMAP-: end--This map will break the compile with the cryptic message "Must define-map." (to compound the confusion, the line number for this error will-be the first line number of the map following the buggy map).--This error is because although the map is Elf or Orc only, at compile-time, the branch is *neither* Elf nor Orc, so the level-compiler-thinks you've neglected to define a map.--Lua code can detect the compile phase using crawl.game_started() which-returns true only when the player has started a game (and will return-false when the map is being initially compiled).--For more details on the available Lua API and syntax, see the Lua-reference section.---F. Validating levels--------------------------If you have a map with lots of transforms (SUBST and SHUFFLE), and-want to guarantee that the map is sane after the transforms, you can-use a validation hook.--To take a very contrived example:--NAME: contrived_001-PLACE: D:2-ORIENT: float-TAGS: no_pool_fixup-SUBST: .=.w-SUBST: c=x.-MAP-xxxxxx-x{.+.c-x..+>x-xxxxxx-ENDMAP--This map has a chance of leaving the player stuck on the upstair-without access to the rest of the level if the two floor squares near-the doors are substituted with deep water (from the SUBST line), or-the 'c' glyph is substituted with rock. Since a cut-off vault is-uncool, you can force connectedness with the rest of the level:--validate {{ return has_exit_from_glyph('{') }}--The has_exit_from_glyph() function returns true if it is possible to-leave the vault (without digging, etc.) from the position of the {-glyph. (This takes things like the merfolk ability to swim into-account, so a merfolk character may see deep water between the stair-and door.)--The validate Lua returns false (or nil) to indicate that the map is-invalid, which will force the dungeon builder to reapply transforms-(SUBST and SHUFFLE) and validate the map again. If the map fails-validation enough times, the dungeon builder will discard the entire-level and retry (this may cause a different map to be selected,-bypassing the buggy map).--Going back to the example, if you just want to ensure that the player-can reach the > downstair, you can use:--validate {{ return glyphs_connected('{', '>') }}--NOTE: You cannot use the colon-prefixed syntax for validation Lua. If-you have a big block of code, use the multiline syntax:--validate {{- -- This level is always cool.- crawl.mpr("This level is guaranteed perfect!")- return true-}}---G. Hints for level makers-------------------------------* Technical stuff:-- If your map is not a minivault or a floating vault, make sure the- side(s) forming the border have a rock wall padding at least 6 deep. For- instance, if your map is ORIENT: north, you must have a 6 deep border of- rock wall (or any other kind of wall) along the northern, eastern, and- western edges of the map. If you're doing a fullscreen map (encompass),- you must pad all around the map with 6 layers of wall.-- You do not have to place all of the stairs unless the level is full- screen, in which case you must place all except the extra stairs (> and- <). The <> stairs can be put anywhere and in any quantities but do not- have to be there. Any of the other stairs which are not present in the- vault will be randomly placed outside it. Also generally try to avoid- rooms with no exit (use at least > or < to make it possible for players- to get away).-- Minivaults can use explicit @ exits, or be completely surrounded by- one space of floor for accessibility. Alternatively, you can request- that the dungeon builder pick appropriate exits as it does for- floating vaults by using the "mini_float" tag.-- The entry point '@' must be present for all vaults (except- full-screen vaults where it must not, and floating vaults and- minivaults where it is optional). All @ will be connected to floor- space in the rest of the map (multiple @ close together may merge- into the same exit corridor). Make sure that no part of your entry- level can be cut off! If no @ is present in a floating vault (and- there are no doors on the edge of the map, see below), the level- builder will use one or more random floor spaces '.' or doors at the- circumference as exits. Note that it is not possible to predict- which spaces the level builder will choose to connect; if you need- predictability, use explicit @ exits on the edge.-- The level-builder will also implicitly treat doors and secret doors- on the edge of a map as explicit exits (the same as using @) and- connect them to the rest of the level.-- Not using @ and allowing the level-builder to pick exits is- acceptable in floating vaults, but when you use no @'s with this- feature in mind, please add comments stating this - else somebody- may just add @'s later on. :)-- Non-rectangular maps will be padded (to the right) with rock walls- (or with floor spaces for minivaults) for the smallest rectangle- containing them. Unfortunately.-- Entry levels should be rather small. Their intention is to provide some- atmosphere for the starting room, not to get a grip on the whole of D:1.- Minivaults should be rather small, as well, in order to increase the- chances they may actually be chosen during level generation.--* Randomise!- The level making syntax is now very supportive for making a single map- appear in many versions. Use the SHUFFLE: and SUBST: directives and look- at the existing entry vaults. Besides reducing tedium, this avoids giving- veterans a spoiled edge. For example, if a secret chamber with loot is- always at the same place, it's a no-brainer for those who know. The same- goes for traps. This is much less so if there are several places for the- chamber (or trap) and there's even a chance it doesn't exist.-- You can also use CHANCE to create modified versions of the same map. In- order to do this, make several maps and endow each with a chance such- that the sum of chances add up to 10.-- Randomisation does not just apply to layout: you could also have- different monster population sets (for example make a branch end skewed- for either melee or ranged opponents), or perhaps couple difficulty to- loot.--* Not too much loot.- For example, entry vaults should in general have very little loot - in- particular no good_xxx or '*' items lest they might give incentive for- start-scumming. For random vaults, there needn't be loot at all and, in- any case, there shouldn't be too much of it. Compare with the branch ends- rich in treasure (Tomb:3, Cocytus etc.) to get a feeling for this.--* Have a theme.- It is often worthwhile (to me at least) to have a theme in mind before- making the actual level. For entry vaults, something simple like- 'fortress' or 'forest' may be enough. For later (or larger) maps, try- to think of distinguishing features your map may have. Being cool can- be good enough, but possessing some gameplay value (for example by being- easier for particular skills/capabilities like ranged attacks or- necromancy or Traps & Doors) is even better.--* Testing your maps.- This is easy for entry vaults. Temporarily introducing a CHANCE: 5000- will make your entry appear almost always. For other vaults, you can- for the moment declare them as entry vaults with a huge CHANCE: as- above (and preferably in wizard mode). For more intricate things like- new branch ends, you have to resort to wizard mode and use the &~ command- to go directly to the place where the map is used, say Snake:5. You may want- to use a high CHANCE: again, if the map has alternatives (like Snake:5, or- Coc:7). Minivaults can also be tested by adding a PLACE: to the definition,- which makes it very likely that the minivault will appear in the chosen- level.-- Larger vaults can be conjured up in wizard mode using the &L command.- You don't need to specify the full name of the vault, a substring which- uniquely determines the vault is enough. You can playtest portal vaults- using the &P wizard command. Branch ends can be conveniently tested with- the &~ command.-- If the .des file syntax is incorrect, Crawl will tell you on which line of- which des file it found the syntax error, making for easier debugging.--* Be fair!- Crawl is hard but try to balance your monsters. While it is true that Orc:1- can show an orcish knight, this is very rare. Hence it's probably a bad idea- to use orcish knights for an entry to the Orcish Mines.-- Phrased more generally, do not use OOD (out-of-depth) monsters unless you- really know what you want.-- Be especially fair when creating entry vaults. If your entry is too hard,- it might get just trashed. Keep in mind that your vault will be played- very very often, so even small chances of something stupid happening- (like creation of a really nasty monster) will kick in often enough.--* Minivaults vs random vaults.- Minivaults are handled very differently from regular vaults and special- levels. They're placed *after* normal map generation, whereas normal- vaults are placed before generating the rest of the level. There's no- way to guarantee generation of a minivault on a particular level, although- using a PLACE: attribute makes the dungeon builder try very hard to place- the minivault on the specified level. Regular vaults can always be forced to- appear using a PLACE: attribute.-- Technically, you make a minivault like a normal floating vault but- without an ORIENT: line. Note that minivaults used to be exclusively of- size 12x12 but this restriction is gone. Still, the smaller the better.-- Where possible, use minivaults instead of regular vaults, because the dungeon- builder has greater freedom with the rest of the level layout when using- minivaults.--* levdes.vim.- If you use vim, the levdes.vim syntax highlighting script (provided- in the dat directory) can make level-editing far more pleasant by colouring- different features in maps and syntax-highlighting .des-file syntax. vim is- available for nearly all operating systems, including Windows.---H. Lua reference----------------------How maps are processed-------------------------Crawl uses Lua heavily when dealing with .des files:--* Level files are compiled into a series of Lua chunks. Each map can- have one or more Lua chunks associated with it: the prelude, the- body, and a validation chunk. The body is mandatory, but prelude and- validation chunks are necessary only if your map needs validation or- fancy selection criteria.--* When first compiling a .des file, Crawl compiles each map's Lua- chunks, then compiles and runs the prelude, body and validation- immediately to verify that the Lua code is not broken. Lua errors at- this stage will cause Crawl to exit with an error message (hopefully- relevant). Note that the validation Lua chunk's return code is- completely ignored at this stage - it is only run to check for- syntax errors in the code.--* When a new game is started, Crawl will run the Lua preludes for all- maps (most maps should have no prelude - map preludes slow the game- down). At this point, preludes can change the map's placement or- availability.--* When the dungeon builder selects a map (based on TAGS, DEPTH,- PLACE), it re-runs the map prelude and the map body, applies- transforms (SUBST, SHUFFLE) if any, then calls the map's validation- Lua. If the map passes validation, the dungeon builder continues- with level-generation; otherwise, it restarts from the map prelude.--The global prelude---------------------Every .des file can have (at the start of the file) Lua code that is-not associated with any specific map, but with all maps in the file.-This is called the global prelude. The global prelude is run before-running any other Lua code in the file, once during compilation, and-once at start of game.--You can use the global prelude to define functions and set up globals-that the rest of the maps in the .des file use. If you have a lot of-common code, you should probably add it to dungeon.lua instead.--Syntax for using Lua in .des files-------------------------------------* Colon-prefixed lines are individual Lua lines, extending to the end- of the line. E.g.-- : crawl.mpr("Hello")-- Colon-prefixed lines are always in the main Lua chunk, unless they occur- before any map definitions, in which case they go to the global prelude.--* Lua blocks for the main (body) Lua- lua {{ <code> }}- or- lua {{- <code>- }}--NOTE: Colon-prefixed lines, or lua {{ }} blocks defined before any-map's NAME: directive will add the Lua code to the global prelude.--* Lua blocks for the prelude:- prelude {{ <code> }}- or- prelude {{- <code>- }}--* Lua blocks for the validate chunk:- validate {{ <code> }}- or- validate {{- <code>- }}---Debugging Lua----------------Since Lua action happens in the guts of Crawl, it can be hard to tell-what's going on. Lua debugging involves the time-honoured method of-peppering your code with print statements:--* Use error() or print() for compile-time work (i.e. when Crawl reads- the .des file). Note that print() just writes to the terminal and- keeps going, while error() forces Crawl to exit immediately (at- compile time; errors during level-generation are handled- differently).--* Use crawl.mpr() for output when the game has started (at- level-generation time).--It's very important that your finished level never croaks during-level-generation. A Lua error at this stage is considered a validation-failure.---Lua API reference-------------------a. The Map.-b. Global game state.-c. Character information.---Lua API - the Map--------------------Lua functions dealing with the map are mostly grouped under the "dgn"-module. For convenience, .des file Lua chunks are run in an environment-such that function calls written as:-- fn(x, y, ...)--are translated to-- dgn.fn(map, x, y, ...)--where "map" is the reference to the map that the currently executing-Lua chunk belongs to. This is only for Lua chunks that belong to a-map, Lua code in the global prelude does not get this treatment-(because the global prelude is not associated with any map).--Functions in the dgn module:--default_depth, name, depth, place, tags, tags_remove, chance, weight,-orient, shuffle, shuffle_remove, subst, subst_remove, map, mons, item,-kfeat, kitem, kmons, grid, points_connected, gly_point, gly_points,-original_map, glyphs_connected, orig_glyphs_connected, orig_gly_point,-orig_gly_points, load_des_file, feature_number, feature_name,-dgn_event_type, register_listener, remove_listener, remove_marker,-num_matching_markers, feature_desc, feature_desc_at, item_from_index,-mons_from_index, change_level_flags, change_branch_flags----Lua API - global game state------------------------------The "crawl" module provides functions that describe the game state or-provide utility methods.--mpr, mesclr, random2, coinflip, one_chance_in, redraw_screen,-input_line, c_input_line, getch, kbhit, flush_input, sendkeys,-playsound, runmacro, bindkey, setopt, msgch_num, msgch_name, regex,-message_filter, trim, split, game_started, err_trace, args---Lua API - character information----------------------------------The "you" module provides functions that describe the player character.--turn_is_over, spells, abilities, name, race, class, god, hp, mp,-hunger, strength, intelligence, dexterity, xl, exp, res_poison,-res_fire, res_cold, res_draining, res_shock, res_statdrain,-res_mutation, res_slowing, gourmand, levitating, flying, transform,-stop_activity, floor_items, where, branch, subdepth, absdepth---I. Feature Names---------------------These are the feature names usable in MARKER declarations:--unseen, rock_wall, stone_wall, closed_door, metal_wall, secret_door,-green_crystal_wall, orcish_idol, wax_wall, permarock_wall,-silver_statue, granite_statue, orange_crystal_statue,-statue_reserved_1, statue_reserved_2, lava, deep_water, shallow_water,-water_stuck, floor, exit_hell, enter_hell, open_door, trap_mechanical,-trap_magical, trap_iii, undiscovered_trap, enter_shop,-enter_labyrinth, stone_stairs_down_i, stone_stairs_down_ii,-stone_stairs_down_iii, rock_stairs_down, stone_stairs_up_i,-stone_stairs_up_ii, stone_stairs_up_iii, rock_stairs_up, enter_dis,-enter_gehenna, enter_cocytus, enter_tartarus, enter_abyss, exit_abyss,-stone_arch, enter_pandemonium, exit_pandemonium, transit_pandemonium,-builder_special_wall, builder_special_floor, enter_orcish_mines,-enter_hive, enter_lair, enter_slime_pits, enter_vaults, enter_crypt,-enter_hall_of_blades, enter_zot, enter_temple, enter_snake_pit,-enter_elven_halls, enter_tomb, enter_swamp, enter_shoals,-enter_reserved_2, enter_reserved_3, enter_reserved_4,-return_from_orcish_mines, return_from_hive, return_from_lair,-return_from_slime_pits, return_from_vaults, return_from_crypt,-return_from_hall_of_blades, return_from_zot, return_from_temple,-return_from_snake_pit, return_from_elven_halls, return_from_tomb,-return_from_swamp, return_from_shoals, return_reserved_2,-return_reserved_3, return_reserved_4, enter_portal_vault,-exit_portal_vault, altar_zin, altar_shining_one, altar_kikubaaqudgha,-altar_yredelemnul, altar_xom, altar_vehumet, altar_okawaru,-altar_makhleb, altar_sif_muna, altar_trog, altar_nemelex_xobeh,-altar_elyvilon, altar_lugonu, altar_beogh, blue_fountain,-dry_fountain_i, sparkling_fountain, dry_fountain_ii, dry_fountain_iii,-dry_fountain_iv, dry_fountain_v, dry_fountain_vi, dry_fountain_vii,-dry_fountain_viii, permadry_fountain---J. Map Statistics----------------------Full-debug Crawl builds (this does not include normal Crawl builds-that have wizard-mode) can produce map generation statistics. To-generate statistics, run crawl from the command-line as:--crawl -mapstat--This will generate 100 Crawl dungeons and report on the maps used in a-file named "mapgen.log" in the working directory.--You can change the number of dungeons to generate:--crawl -mapstat 10--Will generate 10 dungeons. If you merely want statistics on the-probabilities of the levels, use:--crawl -mapstat 1---K. Portal Vaults---------------------Portal vaults are vaults accessed by portals in the dungeon (bazaars-are a special case of portal vaults). You can create custom portal-vaults as follows:--Define a vault to hold the portal itself:--# Bare-bones portal vault entry-NAME: portal_generic_entry-TAGS: allow_dup-ORIENT: float-MARKER: O = lua:one_way_stair { desc = "A portal to places unknown", \- dst = "generic_portal" }-KFEAT: O = enter_portal_vault-MAP-O-ENDMAP--Portal entries must contain a portal vault entry (enter_portal_vault).-This feature must always have a marker that provides the portal with a-description ("A portal to places unknown") and a destination-("generic_portal").--This will produce a portal, but attempting to use it will trigger an-ASSERT since there's no map for the destination. So we create a-destination map like so:--NAME: portal_generic_generic-# Tag must match dst value of portal in entry.-TAGS: generic_portal allow_dup-ORIENT: encompass-MONS: ancient lich-KFEAT: > = exit_portal_vault-MAP-xxxxxxxxxxx-x111111111x-x1A111111>x-x111111111x-xxxxxxxxxxx-ENDMAP--Note that the entry point into the map will be a stone arch. You must-provide an exit to the dungeon explicitly (KFEAT: > =-exit_portal_vault) or the player will not be able to leave.--Stairs will not work right in portal vaults, do not use them.--You can use multiple maps with the destination tag (generic_portal),-and the dungeon builder will pick one at random.Copied: trunk/crawl-ref/docs/level_design.txt (from rev 3762, trunk/crawl-ref/docs/level-design.txt)===================================================================--- trunk/crawl-ref/docs/level_design.txt (rev 0)+++ trunk/crawl-ref/docs/level_design.txt2008-03-20 21:14:03 UTC (rev 3764)@@ -0,0 +1,1381 @@+How to make levels for Dungeon Crawl Stone Soup+===============================================++Contents: A. Introduction+ B. Sample map+ C. Map symbols+ D. Header information+ E. Conditionalising levels+ F. Validating levels+ G. Hints for level makers+ H. Lua reference+ I. Feature names+ J. Map statistics+ K. Portal vaults++A. Introduction+-----------------++All fixed level information resides in various .des files to be found in+the dat directory. If you are interested in adding some vaults, say, start+with the existing ones and modify them. Currently, the following .des files+are in use:++ bazaar.des - entrances to bazaar portal vaults, and bazaars proper+ crypt.des - Crypt:5, Tomb:1, Tomb:2, Tomb:3+ elf.des - Elf:7+ entry.des - entry vaults (each game - but not tutorial games - uses one of+ these premade maps for the vicinity of the entrance)+ float.des - floating vaults+ hells.des - hell entrances, Geryon's vestibule, Coc:7, Tar:7, Dis:7, Geh:7+ hive.des - hive entrances, Hive:4+ lab.des - labyrinths exits and flavour vaults+ lair.des - lair entrances, Shoals:5, Swamp:5, Snake:5, Slime:6+ large.des - all regular vaults which have ORIENT:encompass/northwest etc.+ mini.des - minivaults (no ORIENT line at all)+ orc.des - orcish mine entrances, orc only vaults+ pan.des - vaults of the Pan demon lords, Pan minivaults+ portal.des - portal vaults entrances+ temple.des - Ecumenical Temples, and Temple entrances+ vaults.des - entrances for the Vaults, and Vaults:8+ zot.des - Zot:5+++Kinds of Vaults+---------------+The different kinds of vaults used by Crawl are described briefly below. In+most cases, when the dungeon builder places a vault on a level, the rest of the+level (assuming the vault is not a full-map vault) is generated ... [truncated message content]

[crawl-ref-commits] SF.net SVN: crawl-ref: [3869] trunk/crawl-ref

From: <pau...@us...> - 2008-03-25 08:42:10

Revision: 3869 Author: paulduboisDate: 2008-03-25 01:42:05 -0700 (Tue, 25 Mar 2008)Log Message:-----------fix: 'fi' should not put item in quiver.fix: 'fi' inventory selection menu uses @fN instead of @tN inscription.undo: Always go to the first item in fire_order when firing the last of an ammo. There was a case that didn't do this, to be "convenient", but I think consistency is better.Modified Paths:-------------- trunk/crawl-ref/docs/crawl_manual.txt trunk/crawl-ref/source/item_use.ccModified: trunk/crawl-ref/docs/crawl_manual.txt===================================================================--- trunk/crawl-ref/docs/crawl_manual.txt2008-03-25 04:18:58 UTC (rev 3868)+++ trunk/crawl-ref/docs/crawl_manual.txt2008-03-25 08:42:05 UTC (rev 3869)@@ -668,15 +668,17 @@ The 'f' command fires or throws a piece of ammunition, typically chosen from lots suitable for your weapon and defaulting to the last-lot you fired (your "quiver"). Note that the item you will shoot with-'f' is display on the main screen beneath your wielded weapon. See-Appendix 6 (Inscriptions) for inscriptions which let you fine-tune the-list of items to choose from.+lot you fired with that weapon (your "quiver"). Note that the item you+will shoot with 'f' is displayed on the main screen beneath your+wielded weapon. See Appendix 6 (Inscriptions) for inscriptions which+let you fine-tune the list of items to choose from. The firing interface also allows you to manually select an item to-throw; but it may not be very effective if you lack the correct-launcher. At times it is sensible to throw weapons like spears,-daggers, or hand axes.+throw with 'i'; but it may not be very effective if you lack the+correct launcher. At times it is sensible to throw weapons like+spears, daggers, or hand axes. If you manually select a piece of ammo+this way, it is assumed to be a one-time use, and your quiver will not+be changed. Use the '(' command if you want to change your quiver without firing.@@ -2571,13 +2573,13 @@ Inscriptions as shortcuts --------------------------You can use inscriptions to define shortcuts for easy access to items, +You can use inscriptions to define shortcuts for easy access to items, regardless of their actual inventory letter. For example, if an item's-inscription contains "@w9", you can type 'w9' in order to wield it. -Instead of the 9, any other digit works as well. And instead of 'w'ield,-any other command used for handling items can be used: 'e'at, r'ead, -'q'uaff, 'z'ap, etc. Using "@*9" will make any action command followed -by '9' use this item.+inscription contains "@w9", you can type 'w9' in order to wield it.+Instead of the 9, any other digit works as well. And instead of+'w'ield, any other command used for handling items can be used: 'e'at,+r'ead, 'q'uaff, 'z'ap, 'f'ire, etc. Using "@*9" will make any action+command followed by '9' use this item. Safety inscriptions -------------------Modified: trunk/crawl-ref/source/item_use.cc===================================================================--- trunk/crawl-ref/source/item_use.cc2008-03-25 04:18:58 UTC (rev 3868)+++ trunk/crawl-ref/source/item_use.cc2008-03-25 08:42:05 UTC (rev 3869)@@ -1494,7 +1494,7 @@ static bool _fire_choose_item_and_target(int& item, dist& target) { fire_target_behaviour beh;- bool was_chosen = (item != -1);+ const bool was_chosen = (item != -1); if (was_chosen) beh.item = item; // force item to be the prechosen one@@ -1515,12 +1515,14 @@ return (false); } - // Okay, valid target; if the user chose different ammo, quiver it.+ // If ammo was chosen via 'fi', it's not supposed to get quivered.+ // Otherwise, if the user chose different ammo, quiver it. // Same for items selected in tile mode. if (was_chosen || beh.item != item) { item = beh.item;- if (you.inv[beh.item].quantity > 1)++ if (! beh.selected_from_inventory) { you.quiver[get_quiver_type()] = beh.item; you.quiver_change = true;@@ -1545,7 +1547,7 @@ int slot = prompt_invent_item( "Fire/throw which item? (* to show all)", MT_INVLIST, OBJ_MISSILES, true, true, true, 0, NULL,- OPER_THROW );+ OPER_FIRE ); if (slot == PROMPT_ABORT) { err = "Nothing selected.";@@ -1639,6 +1641,7 @@ } // if item == -1, prompt the user.+// if item passed, it will be put into the quiver. void fire_thing(int item) { if (_fire_warn_if_impossible())This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [3872] trunk/crawl-ref

From: <j-...@us...> - 2008-03-25 11:07:48

Revision: 3872 Author: j-p-e-gDate: 2008-03-25 04:07:45 -0700 (Tue, 25 Mar 2008)Log Message:-----------Tiles:* Fix cursed wielded weapons being throwable. (Whoops!)* Improve logic for mouse-over information in inventory.Add Confusing Touch ("Touch") and Sure Blade ("Blade") to thestatus output. I've moved BWpn into line 3 to make space forthe others. Still, the status can get positively cluttered.Apply coding convention to static methods in output.cc.Modified Paths:-------------- trunk/crawl-ref/docs/crawl_options.txt trunk/crawl-ref/source/dat/descript/spells.txt trunk/crawl-ref/source/item_use.cc trunk/crawl-ref/source/libgui.cc trunk/crawl-ref/source/output.cc trunk/crawl-ref/source/travel.cc trunk/crawl-ref/source/tutorial.ccModified: trunk/crawl-ref/docs/crawl_options.txt===================================================================--- trunk/crawl-ref/docs/crawl_options.txt2008-03-25 09:05:27 UTC (rev 3871)+++ trunk/crawl-ref/docs/crawl_options.txt2008-03-25 11:07:45 UTC (rev 3872)@@ -11,7 +11,7 @@ 1- Starting Screen. name, remember_name, use_old_selection_order,-weapon, book, chaos_knight, death_knight, priest, + weapon, book, chaos_knight, death_knight, priest, race, class, random_pick 2- File System and Sound. crawl_dir, morgue_dir, save_dir, sound@@ -79,7 +79,7 @@ 4-o Tiles Options. show_items, title_screen, tile_player_col, tile_monster_col, tile_neutral_col, tile_friendly_col, -tile_item_col, tile_unseen_col, tile_floor_col, tile_wall_col, + tile_item_col, tile_unseen_col, tile_floor_col, tile_wall_col, tile_mapped_wall_col, tile_door_col, tile_downstairs_col, tile_upstairs_col, tile_feature_col, tile_trap_col, tile_water_col, tile_lava_col, tile_excluded_col@@ -1271,7 +1271,7 @@ show_items = <glyphs> This option controls the order and presence of items in the tiles inventory. By default, its value is !?/%=([)X}+\_. The underscore- represents empty slots.+ represents empty slots, the dot items on the floor. title_screen = true When this is set to true, the graphical title screen will beModified: trunk/crawl-ref/source/dat/descript/spells.txt===================================================================--- trunk/crawl-ref/source/dat/descript/spells.txt2008-03-25 09:05:27 UTC (rev 3871)+++ trunk/crawl-ref/source/dat/descript/spells.txt2008-03-25 11:07:45 UTC (rev 3872)@@ -307,10 +307,6 @@ This spell extracts the vile and poisonous essences from a corpse. A rotten corpse may produce a stronger potion. You probably don't want to drink the results. %%%%-Glamour--This spell is an Elvish magic, which draws upon the viewing creature's credulity and the caster's comeliness to charm, confuse or render comatose. -%%%% Greater Healing This spell heals a large amount of damage to the caster's body. Modified: trunk/crawl-ref/source/item_use.cc===================================================================--- trunk/crawl-ref/source/item_use.cc2008-03-25 09:05:27 UTC (rev 3871)+++ trunk/crawl-ref/source/item_use.cc2008-03-25 11:07:45 UTC (rev 3872)@@ -1497,7 +1497,15 @@ const bool was_chosen = (item != -1); if (was_chosen)+ {+ if (you.equip[EQ_WEAPON] == item+ && item_cursed(you.inv[item]))+ {+ mpr("You can't fire a cursed item!");+ return false;+ } beh.item = item; // force item to be the prechosen one+ } beh.message_ammo_prompt(); message_current_target(); // XXX: this stuff should be done by direction()@@ -3511,10 +3519,8 @@ mpr("You don't have anything to inscribe."); return; }- item_slot = prompt_invent_item(- "Inscribe which item? ", - MT_INVLIST, - OSEL_ANY );+ item_slot = prompt_invent_item("Inscribe which item? ",+ MT_INVLIST, OSEL_ANY ); if (item_slot == PROMPT_ABORT) { canned_msg( MSG_OK );@@ -3534,7 +3540,7 @@ } you.inv[item_slot].inscription = std::string(buf);- you.wield_change = true;+ you.wield_change = true; you.quiver_change = true; } elseModified: trunk/crawl-ref/source/libgui.cc===================================================================--- trunk/crawl-ref/source/libgui.cc2008-03-25 09:05:27 UTC (rev 3871)+++ trunk/crawl-ref/source/libgui.cc2008-03-25 11:07:45 UTC (rev 3872)@@ -1185,6 +1185,49 @@ return id; } +// assumes the item is equipped in the first place!+static bool _is_true_equipped_item(item_def item)+{+ // weapons and staves are only truly equipped if wielded+ if (item.link == you.equip[EQ_WEAPON])+ return (item.base_type == OBJ_WEAPONS || item.base_type == OBJ_STAVES);++ // cursed armour and rings are only truly equipped if *not* wielded+ return (item.link != you.equip[EQ_WEAPON]);+}++// returns whether there's any action you can take with an item in inventory+// apart from dropping it+static bool _can_use_item(item_def item, bool equipped)+{+ // vampires can drain corpses+ if (item.base_type == OBJ_CORPSES)+ {+ return (you.species == SP_VAMPIRE+ && item.sub_type != CORPSE_SKELETON+ && !food_is_rotten(item)+ && mons_has_blood(item.plus));+ }++ // mummies can't do anything with food or potions+ if (you.species == SP_MUMMY)+ return (item.base_type != OBJ_POTIONS && item.base_type != OBJ_FOOD);++ if (equipped && item_cursed(item))+ {+ // misc. items/rods can always be evoked, cursed or not+ if (item.base_type == OBJ_MISCELLANY || item_is_rod(item))+ return true;+ + // you can't unwield/fire a wielded cursed weapon/staff+ // but cursed armour and rings can be unwielded without problems+ return (!_is_true_equipped_item(item));+ }+ + // in all other cases you can use the item in some way+ return true;+}+ static int _handle_mouse_motion(int mouse_x, int mouse_y, bool init) { int cx = -1;@@ -1308,31 +1351,28 @@ desc += EOL "[Shift-R-Click] Eat (e)"; } }- else+ else // in inventory { desc = you.inv[ix].name(DESC_INVENTORY_EQUIP); + // FIX ME: Might have to allow wielding as a secondary action+ // for arrows (Sticks to Snakes), skeletons (Boneshards),+ // chunks/potions of blood (Sublimation of Blood) if (display_actions) { int type = you.inv[ix].base_type;+ const bool equipped = itemlist_iflag[cx] & TILEI_FLAG_EQUIP; desc += EOL; - if ((type != OBJ_CORPSES- || you.species == SP_VAMPIRE- && you.inv[ix].sub_type != CORPSE_SKELETON- && you.inv[ix].special >= 100)- && (you.species != SP_MUMMY- || you.inv[ix].base_type != OBJ_POTIONS- && you.inv[ix].base_type != OBJ_FOOD))+ if (_can_use_item(you.inv[ix], equipped)) { desc += "[L-Click] "; - if (itemlist_iflag[cx] & TILEI_FLAG_EQUIP)+ if (equipped) { if (you.equip[EQ_WEAPON] == ix && type != OBJ_MISCELLANY- && (!item_is_rod(you.inv[ix])- || !item_type_known(you.inv[ix])))+ && !item_is_rod(you.inv[ix])) { if (type == OBJ_JEWELLERY || type == OBJ_ARMOUR || type == OBJ_WEAPONS || type == OBJ_STAVES)@@ -1418,7 +1458,12 @@ } desc += EOL "[R-Click] Info";- desc += EOL "[Shift-L-Click] Drop (d)";+ // has to be non-equipped or non-cursed to drop+ if (!equipped || !_is_true_equipped_item(you.inv[ix])+ || !item_cursed(you.inv[ix]))+ {+ desc += EOL "[Shift-L-Click] Drop (d)";+ } } } update_tip_text(desc.c_str());Modified: trunk/crawl-ref/source/output.cc===================================================================--- trunk/crawl-ref/source/output.cc2008-03-25 09:05:27 UTC (rev 3871)+++ trunk/crawl-ref/source/output.cc2008-03-25 11:07:45 UTC (rev 3872)@@ -48,7 +48,7 @@ #endif #include "view.h" -static int bad_ench_colour( int lvl, int orange, int red )+static int _bad_ench_colour( int lvl, int orange, int red ) { if (lvl > red) return (RED);@@ -58,7 +58,7 @@ return (YELLOW); } -static void dur_colour( int colour, bool running_out )+static void _dur_colour( int colour, bool running_out ) { if (running_out) textcolor( colour );@@ -110,19 +110,19 @@ } #ifdef USE_TILE-int draw_colour_bar(int val, int max_val, int old_val, int old_disp,- int ox, int oy, unsigned short default_colour,- unsigned short change_colour, unsigned short empty_colour)+static int _draw_colour_bar(int val, int max_val, int old_val, int old_disp,+ int ox, int oy, unsigned short default_colour,+ unsigned short change_colour,+ unsigned short empty_colour)+{+ ASSERT(val <= max_val); -{ if (max_val <= 0)- { return -1;- } - // Don't redraw colour bars during running/resting- // *unless* we'll stop doing so after that- if (you.running > 1 && is_resting() && val != max_val)+ // Don't redraw colour bars while resting+ // *unless* we'll stop doing so right after that+ if (you.running >= 2 && is_resting() && val != max_val) return -1; const int width = crawl_view.hudsz.x - ox - 1;@@ -158,8 +158,8 @@ static int old_val = 0; static int old_disp = 0; - old_disp = draw_colour_bar(val, max_val, old_val, old_disp, ox, oy, - default_colour, change, empty);+ old_disp = _draw_colour_bar(val, max_val, old_val, old_disp, ox, oy,+ default_colour, change, empty); old_val = val; } @@ -174,12 +174,12 @@ static int old_val = 0; static int old_disp = 0; - old_disp = draw_colour_bar(val, max_val, old_val, old_disp, ox, oy, - default_colour, change, empty);+ old_disp = _draw_colour_bar(val, max_val, old_val, old_disp, ox, oy,+ default_colour, change, empty); old_val = val; } -static int count_digits(int val)+static int _count_digits(int val) { if (val > 999) return 4;@@ -191,7 +191,7 @@ } #endif -static std::string describe_hunger()+static std::string _describe_hunger() { bool vamp = (you.species == SP_VAMPIRE); @@ -241,8 +241,8 @@ cprintf("/%d", you.max_magic_points ); #ifdef USE_TILE- int col = count_digits(you.magic_points) +- count_digits(you.max_magic_points) + 1;+ int col = _count_digits(you.magic_points)+ + _count_digits(you.max_magic_points) + 1; for (int i = 12-col; i > 0; i--) cprintf(" "); draw_mp_bar(you.magic_points, you.max_magic_points);@@ -282,9 +282,9 @@ cprintf( " (%d)", max_max_hp ); #ifdef USE_TILE- int col = count_digits(you.hp)+count_digits(you.hp_max) + 1;+ int col = _count_digits(you.hp) + _count_digits(you.hp_max) + 1; if (max_max_hp != you.hp_max)- col += count_digits(max_max_hp) + 3;+ col += _count_digits(max_max_hp) + 3; for (int i = 15-col; i > 0; i--) cprintf(" "); draw_hp_bar(you.hp, you.hp_max);@@ -374,7 +374,7 @@ cgotoxy(5, 5, GOTO_STAT); if (you.duration[DUR_STONEMAIL])- dur_colour( BLUE, (you.duration[DUR_STONEMAIL] <= 6) );+ _dur_colour( BLUE, (you.duration[DUR_STONEMAIL] <= 6) ); else if (you.duration[DUR_ICY_ARMOUR] || you.duration[DUR_STONESKIN]) textcolor( LIGHTBLUE ); // no end of effect warning @@ -512,7 +512,7 @@ textcolor( RED ); break; }- const std::string state = describe_hunger();+ const std::string state = _describe_hunger(); if (!state.empty()) cprintf(state.c_str()); @@ -525,8 +525,8 @@ } // For colors, see comment at _print_stats_line1-// Prints pray, holy, teleport, regen, insulation, fly/lev, invis, silence,-// breath, bargain, sage+// Prints: pray, holy, teleport, regen, insulation, fly/lev, invis, silence,+// conf. touch, bargain, sage static void _print_stats_line2() { cgotoxy(1, 16, GOTO_STAT);@@ -542,7 +542,7 @@ if (you.duration[DUR_REPEL_UNDEAD]) {- dur_colour( LIGHTGREY, (you.duration[DUR_REPEL_UNDEAD] <= 4) );+ _dur_colour( LIGHTGREY, (you.duration[DUR_REPEL_UNDEAD] <= 4) ); cprintf( "Holy " ); } @@ -555,24 +555,24 @@ if (you.duration[DUR_DEFLECT_MISSILES]) { - dur_colour( MAGENTA, (you.duration[DUR_DEFLECT_MISSILES] <= 6) );+ _dur_colour( MAGENTA, (you.duration[DUR_DEFLECT_MISSILES] <= 6) ); cprintf( "DMsl " ); } else if (you.duration[DUR_REPEL_MISSILES]) {- dur_colour( BLUE, (you.duration[DUR_REPEL_MISSILES] <= 6) );+ _dur_colour( BLUE, (you.duration[DUR_REPEL_MISSILES] <= 6) ); cprintf( "RMsl " ); } if (you.duration[DUR_REGENERATION]) {- dur_colour( BLUE, (you.duration[DUR_REGENERATION] <= 6) );+ _dur_colour( BLUE, (you.duration[DUR_REGENERATION] <= 6) ); cprintf( "Regen " ); } if (you.duration[DUR_INSULATION]) {- dur_colour( BLUE, (you.duration[DUR_INSULATION] <= 6) );+ _dur_colour( BLUE, (you.duration[DUR_INSULATION] <= 6) ); cprintf( "Ins " ); } @@ -582,57 +582,59 @@ if (wearing_amulet( AMU_CONTROLLED_FLIGHT )) {- dur_colour( you.light_flight()? BLUE : MAGENTA,+ _dur_colour( you.light_flight()? BLUE : MAGENTA, (you.duration[DUR_LEVITATION] <= 10 && !perm) ); cprintf( "Fly " ); } else {- dur_colour(BLUE, (you.duration[DUR_LEVITATION] <= 10 && !perm));+ _dur_colour(BLUE, (you.duration[DUR_LEVITATION] <= 10 && !perm)); cprintf( "Lev " ); } } if (you.duration[DUR_INVIS]) {- dur_colour( BLUE, (you.duration[DUR_INVIS] <= 6) );+ _dur_colour( BLUE, (you.duration[DUR_INVIS] <= 6) ); cprintf( "Invis " ); } if (you.duration[DUR_SILENCE]) {- dur_colour( BLUE, (you.duration[DUR_SILENCE] <= 5) );+ _dur_colour( BLUE, (you.duration[DUR_SILENCE] <= 5) ); cprintf( "Sil " ); } - // Perhaps this should be reversed to show when it can be used?- // In that case, it should be probably be GREEN, and we'd have- // to check to see if the player does have a breath weapon. -- bwr- if (you.duration[DUR_BREATH_WEAPON] &&- wherex() < get_number_of_cols() - 5)+ if (you.duration[DUR_CONFUSING_TOUCH]+ && wherex() < get_number_of_cols() - 5) {- textcolor( YELLOW ); // no warning- cprintf( "BWpn " );+ _dur_colour( BLUE, (you.duration[DUR_SILENCE] <= 20) );+ cprintf("Touch"); }- + if (you.duration[DUR_BARGAIN] && wherex() < get_number_of_cols() - 5) {- dur_colour( BLUE, (you.duration[DUR_BARGAIN] <= 15) );+ _dur_colour( BLUE, (you.duration[DUR_BARGAIN] <= 15) ); cprintf( "Brgn " ); } if (you.duration[DUR_SAGE] && wherex() < get_number_of_cols() - 5) {- dur_colour( BLUE, (you.duration[DUR_SAGE] <= 15) );+ _dur_colour( BLUE, (you.duration[DUR_SAGE] <= 15) ); cprintf( "Sage " ); } + if (you.duration[DUR_SURE_BLADE] && wherex() < get_number_of_cols() - 5)+ {+ textcolor( BLUE );+ cprintf( "Blade " );+ } textcolor( LIGHTGREY ); } // For colors, see comment at _print_stats_line1-// Prints confused, beheld, fire, poison, disease, rot,-// held, glow, swift, fast, slow+// Prints confused, beheld, fire, poison, disease, rot, held, glow,+// swift, fast, slow, breath static void _print_stats_line3() { cgotoxy(1, 17, GOTO_STAT);@@ -668,19 +670,19 @@ // We skip marking "quite" poisoned and instead mark the // levels where the rules for dealing poison damage change // significantly. See acr.cc for that code. -- bwr- textcolor( bad_ench_colour( you.duration[DUR_POISONING], 5, 10 ) );+ textcolor( _bad_ench_colour( you.duration[DUR_POISONING], 5, 10 ) ); cprintf( "Pois " ); } if (you.disease) {- textcolor( bad_ench_colour( you.disease, 40, 120 ) );+ textcolor( _bad_ench_colour( you.disease, 40, 120 ) ); cprintf( "Sick " ); } if (you.rotting) {- textcolor( bad_ench_colour( you.rotting, 4, 8 ) );+ textcolor( _bad_ench_colour( you.rotting, 4, 8 ) ); cprintf( "Rot " ); } @@ -692,16 +694,15 @@ if (you.backlit()) {- textcolor(- you.magic_contamination > 5 ?- bad_ench_colour( you.magic_contamination, 15, 25 )- : LIGHTBLUE );+ textcolor(you.magic_contamination > 5 ?+ _bad_ench_colour( you.magic_contamination, 15, 25 )+ : LIGHTBLUE ); cprintf( "Glow " ); } if (you.duration[DUR_SWIFTNESS]) {- dur_colour( BLUE, (you.duration[DUR_SWIFTNESS] <= 6) );+ _dur_colour( BLUE, (you.duration[DUR_SWIFTNESS] <= 6) ); cprintf( "Swift " ); } @@ -712,13 +713,23 @@ } else if (you.duration[DUR_HASTE] && !you.duration[DUR_SLOW]) {- dur_colour( BLUE, (you.duration[DUR_HASTE] <= 6) );+ _dur_colour( BLUE, (you.duration[DUR_HASTE] <= 6) ); cprintf( "Fast" ); } + // Perhaps this should be reversed to show when it can be used?+ // In that case, it should be probably be GREEN, and we'd have+ // to check to see if the player does have a breath weapon. -- bwr+ if (you.duration[DUR_BREATH_WEAPON] && wherex() < get_number_of_cols() - 5)+ {+ textcolor( YELLOW ); // no warning+ cprintf( "BWpn " );+ }+ textcolor( LIGHTGREY ); } +#ifndef USE_TILE static int _average_hp(const monsters* mon) { const monsterentry* me = get_monster_data(mon->type);@@ -735,18 +746,22 @@ // will break saves a little bit though. const mon_attitude_type a1 = mons_attitude(m1); const mon_attitude_type a2 = mons_attitude(m2);- if (a1 < a2) return true;- else if (a1 > a2) return false;+ if (a1 < a2)+ return true;+ else if (a1 > a2)+ return false; // sort by difficulty... but want to avoid information leaks too. Hm. const int xp1 = _average_hp(m1); const int xp2 = _average_hp(m2);- if (xp1 > xp2) return true;- else if (xp1 < xp2) return false;+ if (xp1 > xp2)+ return true;+ else if (xp1 < xp2)+ return false; // This last so monsters of the same type clump together- if (m1->type < m2->type) return true;- else if (m1->type > m2->type) return false;+ if (m1->type < m2->type)+ return true; return false; }@@ -791,15 +806,17 @@ } #if DEBUG_DIAGNOSTICS- cprintf(" av%d %d/%d", _average_hp(mon), mon->hit_points, mon->max_hit_points);+ cprintf(" av%d %d/%d", _average_hp(mon), mon->hit_points,+ mon->max_hit_points); #endif // Friendliness -- maybe use color instead? { const mon_attitude_type att = mons_attitude(mon);- switch (att) {- case ATT_FRIENDLY: cprintf(" (friendly)"); break;- case ATT_NEUTRAL: cprintf(" (neutral)"); break;+ switch (att)+ {+ case ATT_FRIENDLY: cprintf(" (friendly)"); break;+ case ATT_NEUTRAL: cprintf(" (neutral)"); break; case ATT_HOSTILE: /*cprintf(" (hostile)")*/; break; } }@@ -829,9 +846,7 @@ std::sort(mons.begin(), mons.end(), _by_attitude_and_experience); // Print the monsters!- for (int i_print = 0, i_mons=0;- i_print < max_print;- ++ i_print)+ for (int i_print = 0, i_mons=0; i_print < max_print; ++i_print) { // i_mons is incremented by _print_next_monster_desc cgotoxy(1, start_row+i_print, GOTO_MLIST);@@ -843,6 +858,7 @@ } } }+#endif void print_stats(void) {@@ -968,10 +984,13 @@ if (equip == EQ_BOOTS && (you.species == SP_CENTAUR || you.species == SP_NAGA))+ { return "Barding";+ } if (equip < 0 || equip >= NUM_EQUIP) return "";+ return s_equip_slot_names[equip]; } @@ -985,8 +1004,10 @@ return -1; } -static const char* determine_color_string( int level ) {- switch ( level ) {+static const char* _determine_color_string( int level )+{+ switch ( level )+ { case 3: case 2: return "<lightgreen>";@@ -1002,6 +1023,7 @@ } } +// old overview screen, now only used for dumping std::vector<formatted_string> get_full_detail(bool calc_unid, long sc) { char buf[1000];@@ -1143,11 +1165,11 @@ "%sLife Prot.: %s\n" "%sRes.Poison: %s\n" "%sRes.Elec. : %s\n",- determine_color_string(rfire), itosym3(rfire),- determine_color_string(rcold), itosym3(rcold),- determine_color_string(rlife), itosym3(rlife),- determine_color_string(rpois), itosym1(rpois),- determine_color_string(relec), itosym1(relec));+ _determine_color_string(rfire), itosym3(rfire),+ _determine_color_string(rcold), itosym3(rcold),+ _determine_color_string(rlife), itosym3(rlife),+ _determine_color_string(rpois), itosym1(rpois),+ _determine_color_string(relec), itosym1(relec)); cols.add_formatted(1, buf, false); const int rsust = player_sust_abil(calc_unid);@@ -1160,10 +1182,10 @@ "%sRes.Mut. : %s\n" "%sRes.Slow : %s\n" "%sClarity : %s\n \n",- determine_color_string(rsust), itosym1(rsust),- determine_color_string(rmuta), itosym1(rmuta),- determine_color_string(rslow), itosym1(rslow),- determine_color_string(rclar), itosym1(rclar));+ _determine_color_string(rsust), itosym1(rsust),+ _determine_color_string(rmuta), itosym1(rmuta),+ _determine_color_string(rslow), itosym1(rslow),+ _determine_color_string(rclar), itosym1(rclar)); cols.add_formatted(1, buf, true); {@@ -1218,10 +1240,10 @@ "%sWarding : %s\n" "%sConserve : %s\n" "%sRes.Corr. : %s\n",- determine_color_string(rinvi), itosym1(rinvi),- determine_color_string(rward), itosym1(rward),- determine_color_string(rcons), itosym1(rcons),- determine_color_string(rcorr), itosym1(rcorr));+ _determine_color_string(rinvi), itosym1(rinvi),+ _determine_color_string(rward), itosym1(rward),+ _determine_color_string(rcons), itosym1(rcons),+ _determine_color_string(rcorr), itosym1(rcorr)); cols.add_formatted(2, buf, false); int saplevel = you.mutation[MUT_SAPROVOROUS];@@ -1239,19 +1261,21 @@ postgourmand = itosym3(saplevel); } snprintf(buf, sizeof buf, "%s%s%s",- determine_color_string(saplevel), pregourmand, postgourmand);+ _determine_color_string(saplevel), pregourmand, postgourmand); cols.add_formatted(2, buf, false); cols.add_formatted(2, " \n", false); if ( scan_randarts(RAP_PREVENT_TELEPORTATION, calc_unid) )+ { snprintf(buf, sizeof buf, "%sPrev.Telep.: %s",- determine_color_string(-1), itosym1(1));+ _determine_color_string(-1), itosym1(1));+ } else { const int rrtel = !!player_teleport(calc_unid); snprintf(buf, sizeof buf, "%sRnd.Telep. : %s",- determine_color_string(rrtel), itosym1(rrtel));+ _determine_color_string(rrtel), itosym1(rrtel)); } cols.add_formatted(2, buf, false); @@ -1262,20 +1286,19 @@ "%sCtrl.Telep.: %s\n" "%sLevitation : %s\n" "%sCtrl.Flight: %s\n",- determine_color_string(rctel), itosym1(rctel),- determine_color_string(rlevi), itosym1(rlevi),- determine_color_string(rcfli), itosym1(rcfli));+ _determine_color_string(rctel), itosym1(rctel),+ _determine_color_string(rlevi), itosym1(rlevi),+ _determine_color_string(rcfli), itosym1(rcfli)); cols.add_formatted(2, buf, false); return cols.formatted_lines(); } -static std::string status_mut_abilities(void);+static std::string _status_mut_abilities(void); // helper for print_overview_screen-static void _print_overview_screen_equip(- column_composer& cols,- std::vector<char>& equip_chars)+static void _print_overview_screen_equip(column_composer& cols,+ std::vector<char>& equip_chars) { const int e_order[] = {@@ -1538,14 +1561,14 @@ "%sSust.Abil.: %s\n" "%sRes.Mut. : %s\n" "%sRes.Slow : %s\n",- determine_color_string(rfire), itosym3(rfire),- determine_color_string(rcold), itosym3(rcold),- determine_color_string(rlife), itosym3(rlife),- determine_color_string(rpois), itosym1(rpois),- determine_color_string(relec), itosym1(relec),- determine_color_string(rsust), itosym1(rsust),- determine_color_string(rmuta), itosym1(rmuta),- determine_color_string(rslow), itosym1(rslow));+ _determine_color_string(rfire), itosym3(rfire),+ _determine_color_string(rcold), itosym3(rcold),+ _determine_color_string(rlife), itosym3(rlife),+ _determine_color_string(rpois), itosym1(rpois),+ _determine_color_string(relec), itosym1(relec),+ _determine_color_string(rsust), itosym1(rsust),+ _determine_color_string(rmuta), itosym1(rmuta),+ _determine_color_string(rslow), itosym1(rslow)); cols.add_formatted(0, buf, false); int saplevel = you.mutation[MUT_SAPROVOROUS];@@ -1563,7 +1586,7 @@ postgourmand = itosym3(saplevel); } snprintf(buf, sizeof buf, "%s%s%s",- determine_color_string(saplevel), pregourmand, postgourmand);+ _determine_color_string(saplevel), pregourmand, postgourmand); cols.add_formatted(0, buf, false); @@ -1581,21 +1604,21 @@ "%sRes.Corr. : %s\n" "%sClarity : %s\n" "\n",- determine_color_string(rinvi), itosym1(rinvi),- determine_color_string(rward), itosym1(rward),- determine_color_string(rcons), itosym1(rcons),- determine_color_string(rcorr), itosym1(rcorr),- determine_color_string(rclar), itosym1(rclar));+ _determine_color_string(rinvi), itosym1(rinvi),+ _determine_color_string(rward), itosym1(rward),+ _determine_color_string(rcons), itosym1(rcons),+ _determine_color_string(rcorr), itosym1(rcorr),+ _determine_color_string(rclar), itosym1(rclar)); cols.add_formatted(1, buf, false); if ( scan_randarts(RAP_PREVENT_TELEPORTATION, calc_unid) ) snprintf(buf, sizeof buf, "\n%sPrev.Telep.: %s",- determine_color_string(-1), itosym1(1));+ _determine_color_string(-1), itosym1(1)); else { const int rrtel = !!player_teleport(calc_unid); snprintf(buf, sizeof buf, "\n%sRnd.Telep. : %s",- determine_color_string(rrtel), itosym1(rrtel));+ _determine_color_string(rrtel), itosym1(rrtel)); } cols.add_formatted(1, buf, false); @@ -1606,9 +1629,9 @@ "%sCtrl.Telep.: %s\n" "%sLevitation : %s\n" "%sCtrl.Flight: %s\n",- determine_color_string(rctel), itosym1(rctel),- determine_color_string(rlevi), itosym1(rlevi),- determine_color_string(rcfli), itosym1(rcfli));+ _determine_color_string(rctel), itosym1(rctel),+ _determine_color_string(rlevi), itosym1(rlevi),+ _determine_color_string(rcfli), itosym1(rcfli)); cols.add_formatted(1, buf, false); std::vector<char> equip_chars;@@ -1627,7 +1650,7 @@ overview.add_text(" "); - overview.add_text(status_mut_abilities());+ overview.add_text(_status_mut_abilities()); while (true) {@@ -1647,7 +1670,7 @@ // creates rows of short descriptions for current // status, mutations and abilities-std::string status_mut_abilities()+std::string _status_mut_abilities() { //---------------------------- // print status informationModified: trunk/crawl-ref/source/travel.cc===================================================================--- trunk/crawl-ref/source/travel.cc2008-03-25 09:05:27 UTC (rev 3871)+++ trunk/crawl-ref/source/travel.cc2008-03-25 11:07:45 UTC (rev 3872)@@ -825,10 +825,8 @@ you.running.stop(); #ifdef USE_TILE // redraw colour bars now as that's blocked during runmode- if (you.hp != you.hp_max)- draw_hp_bar(you.hp, you.hp_max);- if (you.magic_points != you.max_magic_points)- draw_mp_bar(you.magic_points, you.max_magic_points);+ draw_hp_bar(you.hp, you.hp_max);+ draw_mp_bar(you.magic_points, you.max_magic_points); #endif } Modified: trunk/crawl-ref/source/tutorial.cc===================================================================--- trunk/crawl-ref/source/tutorial.cc2008-03-25 09:05:27 UTC (rev 3871)+++ trunk/crawl-ref/source/tutorial.cc2008-03-25 11:07:45 UTC (rev 3872)@@ -2040,6 +2040,7 @@ } } }+ ostr << "\n"; Options.tutorial_events[TUT_SEEN_SPBOOK] = 0; break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [3873] trunk/crawl-ref

From: <j-...@us...> - 2008-03-25 11:17:31

Revision: 3873 Author: j-p-e-gDate: 2008-03-25 04:17:23 -0700 (Tue, 25 Mar 2008)Log Message:-----------Change a few forgotten z/Z command listings in the tutorial.Modified Paths:-------------- trunk/crawl-ref/docs/crawl_options.txt trunk/crawl-ref/source/tutorial.ccModified: trunk/crawl-ref/docs/crawl_options.txt===================================================================--- trunk/crawl-ref/docs/crawl_options.txt2008-03-25 11:07:45 UTC (rev 3872)+++ trunk/crawl-ref/docs/crawl_options.txt2008-03-25 11:17:23 UTC (rev 3873)@@ -1296,11 +1296,11 @@ tile_excluded_col = darkcyan These options allow configuring the colours used for the minimap of-the dungeon level. + the dungeon level. tile_player_col - colour of player position, as well as of map centre during level map mode ('X') tile_monster_col - colour of hostile monsters- tile_neutral_col - colour of neutral monsters+ tile_neutral_col - colour of neutral monsters tile_friendly_col - colour of friendly monsters tile_item_col - colour of known or detected items tile_unseen_col - colour of unseen areas (usually stone)Modified: trunk/crawl-ref/source/tutorial.cc===================================================================--- trunk/crawl-ref/source/tutorial.cc2008-03-25 11:07:45 UTC (rev 3872)+++ trunk/crawl-ref/source/tutorial.cc2008-03-25 11:17:23 UTC (rev 3873)@@ -516,7 +516,7 @@ "To move your character, use the numpad; try Numlock both on and off. " "If your system has no number pad, or if you are familiar with the vi " "keys, movement is also possible with <w>hjklyubn</w>. A basic "- "command list can be found under <w>?</w>, and the most "+ "command list can be found under <w>??</w>, and the most " "important commands will be explained to you as it becomes necessary."; mesclr(); formatted_message_history(text, MSGCH_TUTORIAL, 0, get_tutorial_cols());@@ -679,7 +679,7 @@ Options.tutorial_left = 0; text = "Congrats! You survived until the end of this tutorial - be sure to "- "try the other ones as well. Note that the help screen (<w>?</w>) "+ "try the other ones as well. Note that the help screen (<w>??</w>) " "will look different from now on. Here's a last playing hint:"; formatted_message_history(text, MSGCH_TUTORIAL, 0, get_tutorial_cols());@@ -724,7 +724,7 @@ text = "Crawl has a macro function built in: press <w>~m</w> " "to define a macro by first specifying a trigger key (say, " "<w>F1</w>) and a command sequence, for example "- "<w>Za+.</w>. The latter will make the <w>F1</w> "+ "<w>za+.</w>. The latter will make the <w>F1</w> " "key always zap the spell in slot a at the nearest monster. " "For more information on macros, type <w>?~</w>."; break;@@ -1057,7 +1057,7 @@ #ifndef USE_TILE " ('<w>/</w>')" #endif- ". Type <w>z</w> to zap it.";+ ". Type <w>Z</w> to zap it."; break; case TUT_SEEN_SPBOOK:@@ -1071,7 +1071,7 @@ << "that you can read by typing <w>r</w>. " "If it's a spellbook you'll then be able to memorise " "spells via <w>M</w> and cast a memorised spell with "- "<w>Z</w>.";+ "<w>z</w>."; if (you.religion == GOD_TROG) {@@ -1366,7 +1366,7 @@ "(the Spellcasting skill also does this). For now, " "you should try to memorise the second spell of your " "starting book with <w>Mcb</w>, which can then be "- "zapped with <w>Zb</w>.";+ "zapped with <w>zb</w>."; } break; @@ -1678,7 +1678,7 @@ "If you miss, <w>"; if (spells)- result += "Zap";+ result += "zap"; else result += "ff"; @@ -1916,7 +1916,7 @@ break; } case OBJ_WANDS:- ostr << "The magic within can be unleashed by <w>z</w>apping it.";+ ostr << "The magic within can be unleashed by <w>Z</w>apping it."; Options.tutorial_events[TUT_SEEN_WAND] = 0; break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [3937] trunk/crawl-ref

From: <j-...@us...> - 2008-03-29 18:30:33

Revision: 3937 Author: j-p-e-gDate: 2008-03-29 11:30:31 -0700 (Sat, 29 Mar 2008)Log Message:-----------Rename part of the documentation:tables.txt -> aptitudes.txtcrawl_macros.txt -> macros_guide.txtcrawl_options.txt -> options_guide.txtAnd while I already was at it, I added windows style linebreaksfor ssh_guide.txt and monster_speech.txt, as well. Since I'vesomehow managed to uninstall my notepad (ages ago), opening and changing such files is always a bit fiddly, and I hope thischange doesn't hurt anyone else.crawl_manual.txt will also eventually need these, but we haven't yet decided on the new name.Also update monster_speech.txt (yet again), and add hounds sniffing the ground to monspeak.txt as an in-game hint for blood scent.Modified Paths:-------------- trunk/crawl-ref/docs/crawl_manual.txt trunk/crawl-ref/docs/monster_speech.txt trunk/crawl-ref/docs/ssh_guide.txt trunk/crawl-ref/source/command.cc trunk/crawl-ref/source/dat/database/monspeak.txt trunk/crawl-ref/source/tutorial.ccAdded Paths:----------- trunk/crawl-ref/docs/aptitudes.txt trunk/crawl-ref/docs/macros_guide.txt trunk/crawl-ref/docs/options_guide.txtRemoved Paths:------------- trunk/crawl-ref/docs/crawl_macros.txt trunk/crawl-ref/docs/crawl_options.txt trunk/crawl-ref/docs/tables.txtAdded: trunk/crawl-ref/docs/aptitudes.txt===================================================================--- trunk/crawl-ref/docs/aptitudes.txt (rev 0)+++ trunk/crawl-ref/docs/aptitudes.txt2008-03-29 18:30:31 UTC (rev 3937)@@ -0,0 +1,150 @@+TABLES OF APTITUDES++The following three tables describe all aptitudes of the various races for the+various skills. These are not necessary for winning in Crawl, neither explicit+nor implicit. The qualitative information behind this sheet (ie. which species+is good at which tasks) can be obtained in two other, less sophisticated ways:+- read the species section in the manual about strengths and weaknesses+- look which combinations of race and class are possible.++If you consider figuring out such things yourself to be fun, stop reading now.+Otherwise, just go ahead. The lower a value, the better the aptitude. 100 is +the Human standard. Please note that many things affect how quick a character +will actually learn a skill. Thus the numbers below are good enough for +comparisons among races, but not necessarily among skills.++The abbreviations used for the skills are:++General skills, Experience Melee and Ranged Combat Spellcasting and Magic+-------------------------- ----------------------- ----------------------+Arm - Armour Fgt - Fighting Spc - Spellcasting+Ddg - Dodging SBl - Short Blades Coj - Conjurations+Sth - Stealth LBl - Long Blades Enc - Enchantments+Stb - Stabbing Axs - Axes Sum - Summonings+Shd - Shields M&F - Maces & Flails Nec - Necromancy+T&D - Traps & Doors Pla - Polearms Trl - Translocations+ Stv - Staves Trm - Transmigration+Inv - Invocations U C - Unarmed Combat Div - Divinations+Evo - Evocations+ Thr - Throwing Fir - Fire Magic+ Slg - Slings Ice - Ice Magic+Exp - Experience Bws - Bows Air - Air Magic+ Crb - Crossbows Ear - Earth Magic+ Drt - Darts Poi - Poison Magic+++ Arm Ddg Sth Stb Shd T&D Inv Evo Exp+---------------------------------------------------------------------+Human 100 100 100 100 100 100 100 100 100+High Elf 110 90 90 110 110 100 100 90 150+Grey Elf 140 75 70 100 140 100 100 90 140+Deep Elf 140 70 65 80 140 100 100 90 140+Sludge Elf 140 70 75 100 130 100 100 110 120+Mountain Dwarf 60 110 150 130 70 80 100 60 130+Hill Orc 90 140 150 100 80 100 100 100 100+Merfolk 160 60 90 70 100 120 100 100 120+Halfling 150 70 60 70 130 100 100 90 100+Gnome 150 70 70 80 120 70 120 60 110+Kobold 140 70 60 70 130 100 100 80 100+Spriggan 170 50 50 50 180 60 130 70 130+Naga 150 150 40 100 140 100 100 100 120+Centaur 180 170 200 170 180 150 100 130 140+Ogre 140 150 200 150 110 200 130 170 140+Ogre-Mage 170 130 100 130 150 150 100 100 150+Troll 150 130 250 150 150 200 150 180 150+Minotaur 80 80 130 100 80 120 130 170 140+Kenku 90 90 100 80 100 100 160 100 130+Draconian Red 200 120 120 100 100 100 100 100 130+ White 200 120 120 100 100 100 100 100 130+ Green 200 120 120 100 100 100 100 100 130+ Yellow 200 120 120 100 100 100 100 100 130+ Grey 200 120 120 100 100 100 100 100 130+ Black 200 120 120 100 100 100 100 100 130+ Purple 200 120 120 100 100 100 100 90 130+ Mottled 200 120 120 100 100 100 100 100 130+ Pale 200 120 120 100 100 100 100 90 130+Demigod 110 110 110 110 110 110 110 110 160+Demonspawn 110 110 110 110 110 110 80 110 140+Mummy 140 140 140 140 140 140 140 140 150+Ghoul 110 110 80 100 110 120 110 130 120+Vampire 140 90 50 90 110 100 160 100 150+---------------------------------------------------------------------+ Arm Ddg Sth Stb Shd T&D Inv Evo Exp+++ Fgt SBl LBl Axs M&F Pla Stv U C Thr Slg Bws Crb Drt+---------------------------------------------------------------------+Human 100 100 100 100 100 100 100 100 100 100 100 100 100+High Elf 100 70 70 130 150 150 100 130 80 140 60 100 90+Grey Elf 140 90 95 140 160 160 100 130 80 130 70 100 90+Deep Elf 150 100 105 150 165 165 100 130 80 135 75 75 75+Sludge Elf 80 110 110 130 140 140 100 80 70 100 100 100 100+Mountain Dwarf 70 80 90 65 70 110 120 100 120 120 150 90 120+Hill Orc 70 100 80 70 80 80 110 90 100 130 120 120 130+Merfolk 80 70 90 140 150 50 130 90 100 150 140 140 100+Halfling 120 60 100 120 150 160 130 140 60 50 70 90 50+Gnome 100 75 100 100 130 140 130 110 100 80 100 90 60+Kobold 80 60 100 110 140 150 110 100 60 70 80 90 50+Spriggan 150 90 140 150 160 180 150 130 90 70 70 100 70+Naga 100 100 100 100 100 100 120 100 120 120 120 120 120+Centaur 100 120 110 110 110 110 110 100 60 75 60 85 80+Ogre 100 140 120 100 100 110 120 130 100 150 150 180 150+Ogre-Mage 100 110 100 100 100 100 100 100 150 150 150 150 150+Troll 140 150 150 150 130 150 150 100 130 180 180 180 180+Minotaur 70 70 70 70 70 70 70 80 90 90 90 90 90+Kenku 100 75 75 75 75 75 75 80 90 100 80 80 90+Draconian Red 90 100 100 100 100 100 100 100 120 120 120 120 120+ White 90 100 100 100 100 100 100 100 120 120 120 120 120+ Green 90 100 100 100 100 100 100 100 120 120 120 120 120+ Yellow 90 100 100 100 100 100 100 100 120 120 120 120 120+ Grey 90 100 100 100 100 100 100 100 120 120 120 120 120+ Black 90 100 100 100 100 100 100 100 120 120 120 120 120+ Purple 90 100 100 100 100 100 100 100 120 120 120 120 120+ Mottled 90 100 100 100 100 100 100 100 120 120 120 120 120+ Pale 90 100 100 100 100 100 100 100 120 120 120 120 120+Demigod 110 110 110 110 110 110 110 110 110 110 110 110 110+Demonspawn 100 110 110 110 110 110 110 110 110 110 110 110 110+Mummy 100 140 140 140 140 140 140 140 140 140 140 140 140+Ghoul 80 110 110 110 110 110 110 80 130 130 130 130 130+Vampire 110 90 100 110 140 110 140 90 140 140 140 140 140+---------------------------------------------------------------------+ Fgt SBl LBl Axs M&F Pla Stv U C Thr Slg Bws Crb Drt+++ Spc Coj Enc Sum Nec Trl Trm Div Fir Ice Air Ear Poi+---------------------------------------------------------------------+Human 100 100 100 100 100 100 100 100 100 100 100 100 100+High Elf 70 90 70 110 130 90 90 110 100 100 70 130 130+Grey Elf 60 90 50 90 130 80 80 80 90 90 60 150 110+Deep Elf 55 80 50 80 70 75 75 75 90 90 80 100 80+Sludge Elf 70 130 130 90 90 100 60 130 80 80 80 80 80+Mountain Dwarf 160 120 150 150 160 150 120 130 70 130 150 70 130+Hill Orc 150 100 120 120 100 150 160 160 100 100 150 100 110+Merfolk 100 140 90 100 150 140 60 80 160 80 150 150 80+Halfling 130 130 100 120 150 100 150 140 100 100 90 100 120+Gnome 120 100 100 110 130 130 120 120 100 100 170 60 130+Kobold 110 110 110 105 105 100 110 130 100 100 100 100 100+Spriggan 60 160 50 150 120 50 60 70 140 140 120 120 100+Naga 100 100 100 100 100 100 100 100 100 100 100 100 60+Centaur 140 120 110 120 120 120 120 130 120 120 120 120 130+Ogre 220 180 220 200 150 200 200 200 150 150 200 120 150+Ogre-Mage 70 100 80 100 100 100 100 100 100 100 100 100 100+Troll 200 160 200 160 150 160 160 200 160 160 200 120 160+Minotaur 180 170 170 170 170 170 170 170 170 170 170 170 170+Kenku 100 60 160 70 80 150 150 180 90 120 90 120 100+Draconian Red 100 100 120 100 100 100 100 100 70 135 100 100 100+ Green 100 100 120 100 100 100 100 100 100 100 100 100 70+ White 100 100 120 100 100 100 100 100 135 70 100 100 100+ Yellow 100 100 120 100 100 100 100 100 100 100 100 100 100+ Grey 100 100 120 100 100 100 100 100 100 100 100 100 100+ Black 100 100 120 100 100 100 100 100 100 100 70 135 100+ Purple 70 100 90 100 100 100 100 100 100 100 100 100 100+ Mottled 100 100 120 100 100 100 100 100 80 100 100 100 100+ Pale 100 100 120 100 100 100 100 100 90 100 90 100 100+Demigod 110 110 110 110 110 110 110 110 110 110 110 110 110+Demonspawn 100 100 110 100 90 110 110 110 100 110 110 110 100+Mummy 100 140 140 140 100 140 140 140 140 140 140 140 140+Ghoul 120 130 130 120 100 120 120 120 150 90 150 90 100+Vampire 100 160 90 100 90 140 90 120 140 100 100 120 120+---------------------------------------------------------------------+ Spc Coj Enc Sum Nec Trl Trm Div Fir Ice Air Ear Poi\ No newline at end of fileDeleted: trunk/crawl-ref/docs/crawl_macros.txt===================================================================--- trunk/crawl-ref/docs/crawl_macros.txt2008-03-29 14:12:00 UTC (rev 3936)+++ trunk/crawl-ref/docs/crawl_macros.txt2008-03-29 18:30:31 UTC (rev 3937)@@ -1,152 +0,0 @@-Macros and Keymaps-==================--What are macros and keymaps? The simple explanation is:--Command macros make keys into commands.-Keymaps make keys into other keys.--Or a bit more verbose:--For the most part, people will probably want command macros. They allow-for things like making a key run a sequence of commands (e.g.-associating a key stroke to the casting of a certain spell) without-having to worry about messing up what that key does at prompts (e.g.-you can macro a number or letter without worrying about it making the-substitution when you're trying to drop an item).--Keymaps are for when you want to fix layout and behavioural problems on-your keyboard (i.e. unrecognised numpad sequences can by mapped into-their numbers, foreign keyboard layouts can be modified to be more-comfortable). There are also special sets of keymaps for the level map,-the targeting mode and confirmation prompts, which allow for mappings-that are restricted to just those situations.---How to create macros and keymaps?-=================================--The simplest way is in-game: Press either the '~' key or Ctrl-D, select-'m' to define a macro, then choose a key to assign for your macro and-enter the command sequence. For some keys (or key combinations), Crawl-will display a strange number (for example \{13} for the Return key).-These numbers are the key codes for certain non-alpanumeric keys and-can vary between different systems.--By default, most upper- and lowercase alphanumeric keys are already-assigned functions in Crawl. While you are free to remap those keys as-well, it might be best to start with some of the currently unused keys,-such as Tab or the function keys (F1 to F12), possibly combined with-Ctrl, Shift or both. On some systems, it may also be possible to-incorporate the Alt (Meta) key.--Defining keymaps works in exactly the same way. Just press 'k'-(default), 'x' (level-map), 't' (targeting) or 'c' (confirmation)-instead of 'm' after pressing '~'.--After defining such a macro or keymap, you should test it. If you are -comfortable with it, you should then save the macro. To save all macros -and keymaps, press '~' and then 's' to save macros at the tilde prompt).---The macro.txt file-==================--Macros and keymaps are stored in a file called macro.txt in your main-Crawl directory or your home directory. You can change where the file-is read from and written to by specifying an alternate directory on-the command line with -macro <dir> or with the crawl_dir option in your-init file (see crawl_options.txt for details). The macro.txt file is-human readable and editable, but you might have to figure out the key-codes for non-alphanumeric keys through in-game experimentation or-external utilities.--Lines beginning with the '#' are comments and will be ignored. Note-that Crawl won't necessarily preserve your comments when saving macros-and keymaps to the macro.txt file.--Each macro definition consists of exactly two lines. The first one-describes the macro trigger key and consists of "M:" followed by the-character or keycode of that key (for example 'a', 'A' or \{9} for-the A, Shift-A or Tab keys). The second one describes the macro action-and consists of "A:" followed by the command sequence to be associated-with the above key (for example "zap" for zapping the spell in slot a-at the previous target). Individual macro definitions should be-separated by empty lines.--For keymaps just replace the "M:" on the first line of the definiton-with one of the following:-"K:" default, -"K1:" level-map, -"K2:" targeting or -"K3:" confirmation.---Examples-========--This section contains some examples to give you an idea what macros and-keymaps can be used for. Note that for the sake of completeness, both-key line and command line are given, but that you should probably-substitute your own keys here as these may not always work for you.---'@' is a character that may not work by default on some keyboard-layouts. The following should remedy that by mapping '@' to '@'.--# @: display character status-K:\{17}-A:@---Playing a summoner can be annoying because you often need to cast the-same spells multiple times in a row, each casting requiring multiple-keystrokes. This macro allows casting the spell in slot 'a' with a-single keystroke. Note that you can redefine spell slots with the '='-key. We emphasise again that the F1 key may get a different code on-your system.--# F1: cast spell 'a'-M:\{368}-A:za---Now that we've taken care of summoning, we still need to command our-summoned creatures. The following macro should make that easier as-well. Note that this macro assumes that the default_target option is-set to true (it is by default; see crawl_options.txt for details).--# Tab: Order allies to attack your previous or the nearest target-M:\{9}-A:!a.---Conjurers need a slightly different macros for casting, such as this-one, as they need to press '.' or Return to confirm firing at a target.-Again, this macro assumes that the default_target option is set to-true.--# F1: cast spell 'a' at your previous or the nearest target-M:\{368}-A:za.---However, even conjurers might not always want to fire at their previous-target, so the following set of macros allows them to cast the spell-in slot 'a' and then cycle through the available targets with the same-key and then confirming with the same key we used for firing in the-previous macro. This example also tries to illustrate how to take-advantage of the fact that keys can have different functions in the-different keymaps.--# Shift-F1: cast spell 'a'-M:\{1392}-A:za--# Shift-F1: cycle through targets when in targetting mode-K2:\{1392}-A:+--# F1: fire at target when in targetting mode-K2:\{368}-A:.Modified: trunk/crawl-ref/docs/crawl_manual.txt===================================================================--- trunk/crawl-ref/docs/crawl_manual.txt2008-03-29 14:12:00 UTC (rev 3936)+++ trunk/crawl-ref/docs/crawl_manual.txt2008-03-29 18:30:31 UTC (rev 3937)@@ -450,7 +450,7 @@ for a detailed description of all skills present in Crawl. The ease with which a character learns a skill depends solely on race. These aptitudes are hinted at in the list of species (see Appendix 1). For the-curious, the full table can be checked in tables.txt (also from the+curious, the full table can be checked in aptitudes.txt (also from the help game during play). It is not necessary to bother with the numbers in order to win! @@ -1174,11 +1174,11 @@ You can set up key maps and macros in-game with the ~ key (Ctrl-D will also work); this also allows for saving all current key bindings and macros. Alternatively, you can directly edit the macros.txt file. For -more information on both and for examples, see crawl_macros.txt.+more information on both and for examples, see macros_guide.txt. Crawl supports a large number of options that allow for great flexibility in the interface. They are fully documented in the file-crawl_options.txt. The options themselves are set in the file+options_guide.txt. The options themselves are set in the file ~/.crawlrc (for UNIX systems - copy over init.txt to ~/.crawlrc) or init.txt (for Windows). @@ -2156,7 +2156,7 @@ become confusing, since there are also several modes; here is the full list. Some commands are particularly useful in combination with certain interface options; such options are mentioned in the list. For a -description of them, please look into crawl_options.txt. For a more +description of them, please look into options_guide.txt. For a more terse list of all commands, use '??' in-game. Most modes (targeting, level map, interlevel travel) also have help menus via '?' on their own. @@ -2620,7 +2620,7 @@ +f item is included when cycling ammunition You can use the autoinscribe option to have some items automatically -inscribed. See crawl_options.txt for details. Some examples are+inscribed. See options_guide.txt for details. Some examples are autoinscribe = royal jell:=g autoinscribe = wand of healing:!z Deleted: trunk/crawl-ref/docs/crawl_options.txt===================================================================--- trunk/crawl-ref/docs/crawl_options.txt2008-03-29 14:12:00 UTC (rev 3936)+++ trunk/crawl-ref/docs/crawl_options.txt2008-03-29 18:30:31 UTC (rev 3937)@@ -1,1748 +0,0 @@-Guide to Crawl's options-========================--This document explains all of the options in the latest version of -Dungeon Crawl Stone Soup. These options are set in the init.txt file -located in the Crawl directory (the directory containing crawl.exe on -Windows and DOS). On Unix systems, you need to set options in the -~/.crawlrc file (a file named .crawlrc in your home directory).--The contents of this text are:--1- Starting Screen.- name, remember_name, use_old_selection_order,- weapon, book, chaos_knight, death_knight, priest, - race, class, random_pick-2- File System and Sound.- crawl_dir, morgue_dir, save_dir, sound-3- Lua files.- lua_file,- base.lua, stash.lua, wield.lua, kills.lua, - runrest.lua, gearset.lua, eat.lua, pickup.lua, - trapwalk.lua-4- Interface. -4-a Dropping and Picking up.- autopickup, autopickup_exceptions, default_autopickup,- autopickup_no_burden, pickup_thrown, pickup_dropped,- assign_item_slot, drop_mode, pickup_mode, drop_filter-4-b Targeting. - target_zero_exp, target_oos, target_los_first,- default_target, target_unshifted_dirs-4-c Passive Sightings (Detection and Remembrance).- detected_monster_colour, detected_item_colour, - remembered_monster_colour, colour_map, clean_map-4-d Branding (Item and Monster Highlighting).- friend_brand, neutral_brand, stab_brand, may_stab_brand,- heap_brand, feature_item_brand, trap_item_brand-4-e Level Map Functions.- level_map_cursor_step, level_map_title, item_colour-4-f Viewport Display Options.- view_max_width, view_max_height, view_lock_x,- view_lock_y, view_lock, center_on_scroll,- symmetric_scroll, scroll_margin_x, scroll_margin_y,- scroll_margin-4-g Travel and Exploration. - travel_delay, travel_avoid_terrain,- explore_greedy, explore_stop, explore_improved,- tc_reachable, tc_dangerous, tc_disconnected,- tc_excluded, tc_exclude_circle,- travel_stop_message, runrest_ignore_message,- runrest_ignore_poison, runrest_ignore_monster,- trapwalk_safe_hp-4-h Stashes.- stash_tracking, stash_filter, annotate_item_class-4-i Command Enhancements.- auto_list, easy_open, easy_unequip, easy_confirm, - easy_butcher, always_confirm_butcher,- easy_quit_item_prompts, easy_exit_menu, - default_autoprayer, sort_menus-4-j Message and Display Improvements.- hp_warning, mp_warning, hp_colour, mp_colour,- status_caption_colour, delay_message_clear,- message_colour, show_inventory_weights, show_turns,- show_beam, item_stack_summary_minimum, list_rotten,- menu_colour, menu_colour_prefix_id,- menu_colour_prefix_class-4-k Missiles.- fire_items_start, fire_order, fire_quiver_behavior-4-l Message Channels.- plain, prompt, god, pray, duration, danger, food, warning,- recovery, talk, talk_visual, intrinsic_gain, mutation,- monster_spell, monster_enchant, monster_damage, - rotten_meat, equipment, floor, multiturn, examine, - examine_filter, diagnostics, tutorial-4-m Inscriptions.- autoinscribe-4-n Macro related Options.- flush.failure, flush.command, flush.message,- macro_meta_entry, additional_macro_file-4-o Tiles Options.- show_items, title_screen, tile_player_col,- tile_monster_col, tile_neutral_col, tile_friendly_col, - tile_item_col, tile_unseen_col, tile_floor_col, tile_wall_col, - tile_mapped_wall_col, tile_door_col, tile_downstairs_col,- tile_upstairs_col, tile_feature_col, tile_trap_col,- tile_water_col, tile_lava_col, tile_excluded_col-5- Character Dump.-5-a Items and Kills.- kill_map, dump_kill_places, dump_item_origins, - dump_item_origin_price, dump_message_count, dump_order-5-b Notes.- user_note_prefix, note_items, note_monsters,- ood_interesting, note_hp_percent, note_skill_levels,- note_all_skill_levels, note_skill_max, note_all_spells,- note_messages-6- Miscellaneous.-6-a All OS.- mouse_input, wiz_mode, use_ascii, classic_item_colours,- colours, char_set, cset_ascii, cset_ibm, cset_dec,- cset_unicode, feature, mon_glyph--6-b DOS and Windows.- dos_use_background_intensity-6-c Unix.- background, use_fake_cursor--7- Inline Lua.-7-a Executing lua.-7-b Conditional options.-7-c Including external files.------------------------------------------------------------------------------------There are three broad types of Crawl options: true/false values-(booleans), arbitrary values, and lists of values. In this document,-options are usually described with their default values (if there is a-default); this should also explain which of the above-mentioned types-it is. Each option should have some remarks on how it's typically used-- but keep in mind that the options you want to use depend on your-playing style and sometimes also on your operating system.--The standard init.txt distributed with Crawl includes all boolean-options, commented out. The commented-out values are always the-_non-defaults_, so you can toggle boolean options by uncommenting-them.--There are two styles you can use to set options. The classic-name=value syntax, one option per-line:- remember_name = true- explore_greedy = false- drop_mode = multi--And the NetHack-style combined option line:- OPTION = remember_name, !explore_greedy, drop_mode:multi--The second style is useful to specify simple options in a few lines,-but it cannot be used for options that take complex lists of values-(such as the autopickup_exceptions option).--Some options need a path as an argument; here you have to use a-filesystem path suitable for your system. Other options accept regular-expressions (regexes): here you can simply use ordinary strings, adapt-the suggested regexes to your needs or search the internet for regex-syntax.--For long option names, you can define option aliases by doing:- alias := long_option_name-For instance, you can use:- ae := autopickup_exceptions-and thereafter use "ae" instead of "autopickup_exceptions":- ae = >uselessness, >inaccuracy--If you get stuck or some things just won't seem to work properly, -please ask for help on the newsgroup rec.games.roguelike.misc. Please -flag queries with '-crawl-', as other roguelikes are also discussed -there.---1- Starting Screen.-====================--The following options are a convenience to help you quickly start your -game of Crawl.--name = Delilah- If set, that's the name all your Crawl characters will get. --remember_name = true- Crawl remembers the options (class, race etc.) you used to - create your last character. You may recycle them in the - starting screen for a new character. If this option is set to - true, Crawl will also remember the last name you used.-- If you use this option and want to enter a name _after_ - choosing your race and class, you must enter . at the initial - name prompt - hitting Enter at the name prompt will simply - reuse your old name if remember_name is set.- -use_old_selection_order = false- If set to true, the character selection screen will offer - species and classes in the order of version 0.3 and earlier.- Note that this needs to be set before the "race" or "class" - options (see below), or they won't be interpreted correctly.--weapon = (random | short sword | hand axe | spear | mace | trident)- Specifying the weapon option allows you to bypass the weapon - selection screen. Note that tridents are restricted to only - merfolk and gladiators, but you'll get the standard query in - illegal cases.--book = (flame | fire | ice | cold | summ | summoning | random)- Several spellcasting classes can choose their starting - spellbook. Note flame=fire and ice=cold and summ=summoning.--chaos_knight = (Xom | Makhleb | random)--death_knight = (necromancy | Yredelemnul | random)--priest = (Zin | Yredelemnul | Beogh | random)- The above three make in advance the additional choices for - Chaos Knights, Death Knights, and Priests (Beogh for HO only).--race = (Human |...| Merfolk | random)- The usual abbreviations (Hu, HE, etc.) work.--class = (Fighter |...| Wanderer | random)- Here again the abbreviations (Fi, Wi, Pr, etc.) can be used.--random_pick = false- The random_pick option will randomly generate a character.- The above options (weapons and class options) will override - where appropriate.--2- File System.-================--crawl_dir = <path>- Directory for reading macro.txt. - It should end with the path delimiter.--morgue_dir = morgue- Directory where morgue dumps files (morgue*.txt and - morgue*.lst) as well as character dumps files are written.--save_dir = saves- Directory where saves and bones are stored. This option may be - ignored depending on the settings used to compile Crawl, but - should be honoured for the official Crawl binaries.--sound = <regex>:<path to sound file>- Plays the sound file if a message contains regex. The regex - should not include commas or colons. For example- sound = LOW HITPOINT WARNING:sound\sounds2\danger3.wav- Getting appropriate sound files may be difficult. Check other- roguelikes or old computer RPGs. Alternatively, ask for help - in the newsgroup rec.games.roguelike.misc.---3- Lua files.-==============--Lua files are scripts which can provide existing commands with a new-meaning or create new commands (to be used in macros). To use Lua-files, Crawl needs to be compiled with support for user Lua scripts.-You can if your Crawl has Lua support by hitting V in-game. The list-of features Crawl displays should include "Lua user scripts".--Lua files are included using the lua_file option (one file per line):--lua_file = <path/name.lua>--The available stock Lua scripts are- stash.lua -- annotates the stash file for better searching - (Ctrl-F). Searching for 'Long blades' will also turn- up all weapons with the long blade skill. Similarly, - you can use 'altar','portal' etc. Also, you can look - for spellbooks ('book'), artefacts ('artefact'), and - ego items ('ego'). - wield.lua -- shows more intelligent options when using 'w?'- kills.lua -- improves the Vanquished Creatures list in dump files; - currently gives three lists (Vanquished, Friendly, - Others)- runrest.lua -- allows overriding certain stop conditions when - running- New options: runrest_ignore_poison, - runrest_ignore_message, runrest_ignore_monster- gearset.lua -- provides commands for switching of complete sets via - macro- New macroable functions: rememberkit, swapkit- eat.lua -- prompts to eat chunks in inventory.- pickup.lua -- smarter autopickup.- trapwalk.lua -- allows travel to cross certain traps if you have - enough HP.--Also see section 7 on inline Lua fragments.---4- Interface.-==============--4-a Picking up and Dropping.-----------------------------------autopickup = $?!+"/%- The above is the default list. The valid symbols are- ) Weapons- ( Missiles- [ Armour- / Wands- % Food- ? Scrolls- " or = Jewellery- ! Potions- + or : Books- \ or | Staves- 0 Orbs- } Misc. items- X Corpses- $ Gold- Note that _whether_ items are picked up automatically or not, is - controlled by the in-game toggle Ctrl-A. Also note that picking - up takes a turn, but only one turn (regardless of the number of - items). If you teleport or blink onto a square with interesting - items, these will not be picked up.--autopickup_exceptions = <pickup-regex, >don't-pickup-regex, ...- A set of regexes that force matching items to be picked up (if - prefixed with <), or never picked up (if prefixed with >). - Excludes (>) take precedence over includes (<), so if the same - item is matched by both an exclude and an include, it will not - be subject to autopickup.-- An example:- autopickup_exceptions = <curare-tipped needle- Forces autopickup to grab all curare-tipped needles, even if - missiles are not set in the "autopickup" option.-- Whitespace between <> and the match expression is significant, - so the following won't work:- autopickup_exceptions = < ebony casket-- autopickup_exceptions replace the older ban_pickup. Using- autopickup_exceptions = >uselessness, >inaccuracy- is the same as using- ban_pickup = uselessness, inaccuracy-- If the regexes are not prefixed with < or >, > is implied, so- the option setting above can also be written as- autopickup_exceptions = uselessness, inaccuracy-- You can use multiple autopickup_exceptions lines. Some examples:- autopickup_exceptions = inaccuracy, scrolls? of paper, - autopickup_exceptions = immolation, curse (armour|weapon), - autopickup_exceptions = uselessness, noise, torment-- Note that if pickup.lua has been sourced, you won't need to set- autopickup exceptions for potions except maybe for very special - cases.--default_autopickup = true- When set to false, the game starts with autopickup turned off. - You can still toggle autopickup in-game with Ctrl-A.--autopickup_no_burden = false- When set, autopickup will not pick up items which would increase- your burden status (from unencumbered to burdened, or from - encumbered to overloaded.)--pickup_thrown = true- pickup_thrown = true causes autopickup to pick up thrown/fired - missiles, which can make life much easier for hunter types. Be - aware that autopickup uses a turn, though it won't trigger if - there are hostile monsters in sight.--pickup_dropped = false- pickup_dropped lets autopickup affect objects you've dropped. - Set to false to block autopickup for dropped objects. This can - be convenient.--assign_item_slot = (forward | backward)- When picking up items, the inventory slot into which the item - goes is normally the first free slot from a-zA-Z (this is the - default "forward" behaviour). Setting assign_item_slot to - "backward" changes the slot assignment to the first letter after - the last slot. - For instance, if you have items on 'a' and 'c', then with- assign_item_slot = forward, the next item will go into 'b',- assign_item_slot = backward, the next item will go to 'd' - instead.- With "backward", items dropped/fired and picked up later are - more likely to get their old slot back.--drop_mode = (multi | single)- Single is the classic behaviour; when you select an inventory - letter, that item will be dropped immediately. Multidrop allows - you to select multiple items to be dropped. (You can also switch - to multidrop from the classic drop menu using the '@' key).-- Multidrop is the default and can be very convenient, but be - aware that every item dropped takes one turn. (This is different - from picking up.) - When selecting multidrops, the top right corner shows the - estimated number of turns.-- The order in which items get dropped is from top to bottom in - the inventory listing, but equipped items will be dropped last, - and may be dropped out of order.--pickup_mode = (multi | single | auto:X)- Single is the classical behaviour (and default): when picking up - items, you are prompted for them one by one. Multi makes a menu - appear, where you can choose which items to pick up. Note that - no matter how many items you choose, picking up will always take - one turn.- If pickup_mode is auto:X, where X is some number (for example, - auto:5), then pickup will give a menu if there are at least X - items on your square, and will prompt one by one otherwise.--drop_filter = <regex>- When selecting items using the global (de)select keys (',' or - '-') in a multidrop menu, you can choose to select only items - that match a search regex using this option.-- For instance, to quickly select carrion and rotting chunks of - meat, you could use:- drop_filter = skeleton, rotting, corpse- Other choices can come in handy as well, e.g. if you want to - regularly sacrifice all weapons except axes, use:- drop_filter = axe, broadaxe-- When a drop_filter is set, using the select/deselect keys will - set/clear selection of items that match the filter - expression(s).--4-b Targeting.----------------------target_zero_exp = false- Set to false to disable targeting zero exp monsters (i.e. - plants) in hostile targeting mode. This is usually convenient to - do.--target_oos = true- When cycling through items with 'x' look-around, setting - target_oos to true allows you to jump the cursor to dungeon - features (<> for stairs, Tab for shops, ^ for traps) and stashes - (with the '*' and '/' keys) that are outside line-of-sight but - in the main view. This is most sensibly used in connection with - stash_tracking = all (see 4-g). - Also see target_los_first below.--target_los_first = true- When cycling through items/features with the 'x' look-around - command, setting target_los_first to true will force the cursor - to squares in line-of-sight before going to squares outside LOS.--default_target = true- If set to true (the default), targeting will start on either- your previous target (if it is still visible) or the closest- monster (if not) rather than on the character. If no monsters- are in view, targeting will start on the character regardless.-- If default_target = false, the targeting cursor will always - start aimed at the character.-- default_target is mutually exclusive with- target_unshifted_dirs. Using default_target will automatically- disable target_unshifted_dirs.--target_unshifted_dirs = false- If set to true, targeting will use the old Stone Soup 0.1 /- Crawl 4.0 targeting keymap where unshifted direction keys fire- in that direction immediately. The default is to use the new- targeting keymap where unshifted direction keys move the- targeting cursor (and shifted directions fire in the given- direction immediately).-- If you use target_unshifted_dirs, default_target will be- automatically disabled.--4-c Passive Sightings (detectied or remembered entities).--------------------------------------------------------------detected_monster_colour = lightred- Monsters found by detect creatures will be coloured this colour.--detected_item_colour = green- Items found by detect items will be given this colour.--remembered_monster_colour = darkgrey- The colour for monsters you have seen before. Note that the- value of this option is meaningless if you set clean_map.--colour_map = true- Colours out of sight map features on the playing screen.--clean_map = false- Cleans up out of sight monsters and clouds on the map. This is - like pressing Ctrl-C (clearing both main screen and level map) - all the time.- Setting this to true can be disconcerting for summoners.--4-d Branding (Item and monster highlighting).----------------------------------------------------Branding refers to displaying particular monsters (e.g. summons) or-items in a special way; special as in reversing fore- and background.-There are several branding choices (these will not work everywhere; it-depends on OS and terminal):- standout -- often the same as reverse, might be underline or - dim- bold -- used by colour curses for brightening foreground - colours- blink -- used by colour curses for brightening background - colours- reverse -- this will probably work- dim -- probably no effect- underline -- this will probably work- highlight:colour -- set background colour of branded monsters to - "colour"-The last can be abbreviated to hi:colour.-See part Technical (6-) for dos_use_background_intensity under Windows -and DOS.--By default, only two of the item brands are active (and set to reverse):- heap_brand, feature_item_brand-They can be deactivated by setting them to "none".--friend_brand = none- Brand friends in some way. This is very helpful for summoners. - E.g.- friend_brand = hi:green- shows friends with a green background. If the friend is itself - green, it'll show up as black on green.--neutral_brand = none- Brand neutral monsters in some way. Useful both to get out of- a neutral monster's path, and to avoid accidentally killing it.- E.g.- neutral_brand = hi:darkgrey- shows neutrals with a dark grey background. Since there are- no darkgrey monster glyphs anymore, this works fine.--stab_brand = none- Some deities object to you stabbing monsters. Certain classes - specialise in stabbing monsters. Still other characters are - happy if they spot a monster before the monster spots them. In - all these cases, it helps to identify monsters that are unaware - of the character (and hence susceptible to being stabbed) without - using the 'x' command. All the normal 'brand' options apply. For - example- stab_brand = hi:blue--may_stab_brand = none- Stabbing may be possible even if the monster is not asleep (if- it's confused or distracted, for instance). This option brands- monsters that you *might* be able to stab.--heap_brand = reverse- Brand heaps of items (more than one item or stack).--feature_item_brand = reverse- Brands features (stairs, shops, altars) that would otherwise be - hidden by items. If you use this brand, the items on the square - are hidden by the feature symbol and the feature symbol is - branded.--trap_item_brand = none- Brands traps that would otherwise be hidden by items. If you - use this brand, the items on the square are hidden by the trap- symbol (^) and the trap symbol is branded.--4-e Level Map Functions.-------------------------------level_map_cursor_step = 7- How many squares the cursor moves on the level map when using - Shift-direction or * direction.--level_map_title = true- Whether to show the level name at the top of the level map - screen.--item_colour = true- Colours items on level-map.--4-f Viewport Display Options-----------------------------------The viewport is the portion of the map that is displayed during normal-play. The viewport is 33x17 by default, but if you use larger terminal-sizes, you can set these options to allow the game to show a larger-viewport. (These options are not fully available on DOS.)--None of these options affects gameplay. In particular, your character's-line-of-sight is unaffected by these options.--view_max_width = 33- Sets the maximum width of the viewport. Making this larger- will allow Crawl to show a wider viewport on larger terminals.--view_max_height = 17- Similar to view_max_width, but sets the maximum height.--* Note that using large viewports can slow the game down.--view_lock_x = true- Keeps the player character centered horizontally in the- viewport, continuously scrolling the viewport to match the- PC's movements. If this is not set, the player character can- move horizontally within the viewport, and the viewport will- scroll only when the character's line-of-sight reaches the- left or right edge.--view_lock_y = true- Keeps the character centered vertically in the viewport.--view_lock = true- Aliased option that sets both view_lock_x and view_lock_y.--center_on_scroll = false- If this is set, the viewport centers on the player character- whenever it scrolls (this option is irrelevant if view_lock_x- and view_lock_y are set).--symmetric_scroll = true- If this is set, the viewport will scroll in a manner consistent- with the character movement that caused the scroll.-- To illustrate, let's say the PC is at the lower edge of the- viewport, but is near the horizontal center. Now the PC moves- diagonally down and right, forcing the viewport to scroll up- one line. If symmetric_scroll is set, the viewport will also- scroll left one column to match the PC's diagonal movement. If- symmetric_scroll is not set, the viewport will only scroll up,- not horizontally. symmetric_scroll can be less disorienting- than free scrolling.-- This option is not relevant if view_lock or center_on_scroll- are set.--scroll_margin_x = 2- How far from the left or right edges scrolling starts. By- default, if the PC's circle of line-of-sight is closer than- two squares from the edge, the viewport scrolls. If set at- zero, the viewport scrolls only when the LOS circle reaches- the viewport edge.--scroll_margin_y = 2- How far from the top or bottom edges scrolling starts.--scroll_margin = 2- An aliased option that sets both scroll_margin_x and - scroll_margin_y.--4-g Travel and Exploration.----------------------------------travel_delay = 20- How long travel waits after each move (milliseconds). Depends on- platform. Setting to -1 will jump to end of travel - you will - not see the individual moves.--travel_avoid_terrain = (shallow water | deep water)- Prevent travel from routing through shallow water. By default, - this option is commented out. For merfolk and/or characters with - permanent levitation, - travel_avoid_terrain = shallow water, deep water- will prevent travel or explore from going through any water.--explore_greedy = true- Greedy explore travels to items that are eligible for autopickup - in addition to exploring the level, but is otherwise identical - to regular explore. Greedy explore is only available with- stash_tracking = all (for any other value of stash_tracking, - normal explore behaviour is used). Greedy explore is also best - with pickup_dropped = false. Explore greed is disabled if you're- temporarily unable to pick up items (from uncontrolled - levitation, for instance).--explore_stop = items,greedy_items,stairs,shops,altars,gates- Explore will stop for one of these conditions. Whatever you- set this option to, anything that stops travel will also stop- explore. Multiple explore_stop lines are cumulative if you use- explore_stop += options, otherwise the last explore_stop =- options line will override all previous explore_stop lines.-- If you include greedy_items in your explore_stop, greedy- explore will stop and announce items that are eligible for- autopickup (greedy explore otherwise announces only items that- are not eligible for autopickup, since autopickup will produce- its own message and stop greedy explore anyway).--explore_improved = false- If set to true explore will attempt to reduce zig-zagging during- auto-explore. On average it increases the number of turns taken- by about 0.9%, sometimes actually speeding it up slightly and- sometimes increasing the turns taken by up to 5%, with- pathological cases causing a 13% increase.--tc_reachable = blue-tc_dangerous = cyan-tc_disconnected = darkgrey-tc_excluded = lightmagenta-tc_exclude_circle = red- The above five settle the colouring of the level map ('X'). - They are - reachable: all squares safely reachable (without leaving the- level)- dangerous: squares which are only connected to you via traps,- etc.- disconnected: squares which cannot be reached without leaving- the level- excluded: the colour for the centre of travel exclusions - (Ctrl-X)- excluded_circle: the colour for travel exclusions apart from - centre --travel_stop_message = <list of regexes>- Travel will always stop upon hitpoint loss, confusion, stat - drain, getting encumbered, catching sight of a non-friendly - monster, and teleporting. In addition, a message containing one - of the expressions in travel_stop_message will stop travel. For - example, - travel_stop_message = Something appears- stops travel if Xom grants us a gift suddenly. To limit a - substring match to a message channel, prefix the substring with - the channel name and a colon (see section 4-k below on Message - Channels). For instance, if you want travel to stop when you're - hit by divine retribution, you could use:- travel_stop_message = god:wrath finds you- If you'd like to stop travel for any message sent to a - particular channel, use a travel_stop_message line with that - message channel name and a colon alone. For example, if you're - playing a ghoul:- travel_stop_message = rotten_meat:- Stop travel for any god messages (including prayer)- travel_stop_message = god:- Multiple travel_stop_message lines can be used.--runrest_ignore_message = <string>- This only works if runrest.lua has already been sourced in - init.txt. Any message containing the string will *not* stop your - run. E.g.- runrest_ignore_message = offer a prayer,prayer is over- runrest_ignore_message = pleased with you,exalted- (useful in conjunction with autoprayer.)-- Note that monster talk and dungeon noises already do not - interrupt running or resting, by default. --runrest_ignore_poison = <poison damage>:<minimum hp>- This only works if runrest.lua has already been sourced in - init.txt. Poison damage of x will be ignored if you have at - least y hp if you've defined a runrest_ignore_poison = x:y - option. Running here means shift-running and resting only. Only - one runrest_ignore_poison line is considered. Note that for - this work, you should also tell Crawl to ignore the - "You feel sick" messages. For example,- runrest_ignore_message = You feel.*sick- runrest_ignore_poison = 4:100 --runrest_ignore_monster = <string>:<distance>- This only works if runrest.lua has already been sourced in - init.txt.-- Any monster containing the string will only interrupt your- activity if the distance between you and the monster is- less than the specified number. E.g. with- runrest_ignore_monster = fish:3- all of big fish, jellyfish, giant goldfish and lavafish will be - considered safe for travel, explore and resting as long as the - distance is at least 3.--trapwalk_safe_hp = <trap_name>:<minimum_hp>, ...- This only works if trapwalk.lua has already been sourced in - init.txt. Any square containing one of the listed trap types - will be considered safe for travel if your hp is greater than or - equal to the number connected to the trap in question.-- All the existing trap types can be used, but in practice only - the mechanical traps (dart, bolt, arrow, needle, spear, axe, - blade) make sense. Note that travel tries to avoid traps if this - is easily possible. Defaults to none. For example,- trapwalk_safe_hp = dart:15, needle:25, spear:50--trap_prompt = true- If trap_prompt is set to true Crawl will use the trapwalk_safe_hp- values to decide whether the player should be prompted before- stepping on a mechanical trap. Note that you'll always be prompted- for non-mechanical traps.--4-h Stashes.-------------------stash_tracking = (all | explicit | dropped)- A stash is a heap of items tracked by Crawl. You can search in - your stashes with Ctrl-F. This options rules how stashes are - generated. When stash_tracking is set to 'all' (the default), - the game marks any square where it sees any object as a stash. - That gives you a comprehensive list of everything your character - sees in the dungeon, but may slow the game down and use too much - memory on older computers.-- With 'explicit', you have to explicitly tell the game what - squares you want it to keep track of. You do that by stepping - onto the square containing your stash of goodies and hitting - Ctrl+S. The game will now keep track of what's on the square, - when you add and remove stuff from your stash. You can also - inscribe an item with "=s" to automatically mark a square as a - stash whenever that item is dropped. If you remove everything - from that square, the game will stop tracking the square - altogether. You can also erase a stash square with Ctrl-E. - Explicitly marked stashes will never be sacrificed by a - Nemelex Xobeh worshipper.- - When stash_tracking is set to 'dropped', any square where you - drop something becomes a stash, and the game keeps track of all - such squares. You can still use Ctrl-S and Ctrl-E as above.--stash_filter = <list of numbers>- This option allows filtering certain classes of items when - searching stashes.- For example:- stash_filter = 14, 4:21- filters corpses (14) as well as food of the subtype chunks (4:21).--annotate_item_class = false- This only works if stash.lua has already been sourced in - init.txt. Automatically annotates items with their object class, - e.g. weapon or wand, for stash searching.--4-i Command Enhancements.--------------------------------auto_list = true- When set (the default), the appropriate inventory items are- automatically listed for commands like eat and read. This is - like immediately hitting '?', and can be confusing to beginners - because they won't get to see the prompts. This option does not - apply to spell casting... Conjurers would probably find that - really annoying. --easy_open = true- Open doors by moving on to them. Highly convenient. Note that - travel and exploration will automatically open doors depending - on this option.--easy_unequip = true- Allows auto removal of armour and jewellery when dropping it. --easy_confirm = (none | safe)- Make confirmation questions easier to answer:- none = force capitals on Y/N questions- safe = force only on questions that will end game (default)- WARNING TO KEYPAD USERS: The number 7 is mapped to the letter - 'y', which can result in accidentally answering yes to - questions.--easy_butcher = true- If true, auto-switch to an appropriate uncursed weapon for - butchery. For such tools any special messages are ignored. If - false, you have to wield the tool manually.--always_confirm_butcher = false- If true, always request confirmation before butchering. If - false, butchering will proceed automatically if there is exactly - one corpse on the square. If there are multiple corpses on a - square, you will always be prompted, regardless of this option.--easy_quit_item_prompts = true- Setting this option to true allows the quitting of item listing - with Space (as well as Escape, which always works). These lists - are essentially all of those that are requesting an inventory - item and accept '?' and '*'. The identify list will never easy - quit. --easy_exit_menu = true- In multidrop (and pickup) menus, paging past the end will drop - out of the menu if easy_exit_menu is true.--default_autoprayer = false- When set to true, the game will start with automatic prayers. - This option can be toggled in-game with Ctrl-V.-- Automatic prayers take a turn like manual prayers and happen - only if- - there is no hostile monster in sight- - some further conditions (like not standing at an altar)- Note that even when you're praying, you can renew prayer - anytime. Also note the option safe_zero_exp (see 4-a) decides - whether zero experience monsters (like plants) are considered - hostile.- If you use autoprayer, you might want to set - runrest_ignore_message to ignore the prayer messages (see the- documentation for runrest_ignore_message).--sort_menus = [menu:](true | false | auto:X)[:sort_order]- Controls if and how items are sorted in inventory and pickup- menus.-- When sort_menus = false (the default), items are not sorted, and- will be ordered by inventory letter (or in the order they're- stacked for items on the floor).-- When sort_menus = true, items are sorted by base name, qualified- name, curse status and quantity.-- If sort_menus = auto:X, items are sorted if there are at least- X items in the same category. For instance:- sort_menus = auto:5- will sort item classes that have at least 5 items.... [truncated message content]

[crawl-ref-commits] SF.net SVN: crawl-ref: [3981] trunk/crawl-ref

From: <j-...@us...> - 2008-03-31 14:13:34

Revision: 3981 Author: j-p-e-gDate: 2008-03-31 07:13:33 -0700 (Mon, 31 Mar 2008)Log Message:-----------Modify manual and readme to really list the new doc names, and key settings.Add vampires to manual (still needs reference to aptitudes etc.!)and reorder classes according to the new job order.Re-introduce 't' as a synonym for 'f' in targetting, but don't document it anymore. (It's only in convenience to older players, anyway.) Also, change default wand inscription from !z to !Z, butuse a hack to check for either.Oh, and restrict Blood Evaporate effect to Stinking cloud, Fireand Steam (the latter two like !Rage).Modified Paths:-------------- trunk/crawl-ref/docs/crawl_manual.txt trunk/crawl-ref/readme.txt trunk/crawl-ref/source/direct.cc trunk/crawl-ref/source/enum.h trunk/crawl-ref/source/invent.cc trunk/crawl-ref/source/item_use.cc trunk/crawl-ref/source/spells4.ccModified: trunk/crawl-ref/docs/crawl_manual.txt===================================================================--- trunk/crawl-ref/docs/crawl_manual.txt2008-03-31 13:45:05 UTC (rev 3980)+++ trunk/crawl-ref/docs/crawl_manual.txt2008-03-31 14:13:33 UTC (rev 3981)@@ -44,14 +44,14 @@ arrows, and an Elven magician. The prime aim of the tutorials is to explain Crawl's interface. They do not focus on 'optimal' gameplay (also, many experienced players share different views on the latter). -The tutorial has a special help screen (viewed by pressing '?') and ends-when you reach the seventh experience level.+The tutorial has a special help screen (viewed by pressing '??') and+ends when you reach the seventh experience level. Detailed instructions for playing Crawl follow. To simplify this manual, we assume that you use the standard distribution and that you've not changed the default options. If you don't want to read the whole manual and would prefer a short summary of the important points,-look at the quick-start guide (readme.txt) and learn as you play.+look at the quick-start guide (quickstart.txt) and learn as you play. You can also read these documents while playing Crawl, by hitting '?' at the help menu.@@ -92,7 +92,7 @@ The choice of species affects several important characteristics, in particular the speed at which you learn different skills. This is very -important, and helps to differentiate clearly the many available races. +important, and helps to clearly differentiate the many available races. The following factors are species-dependent: Major:@@ -306,17 +306,18 @@ possible for adventurers who have at least three magical runes of Zot. The bottoms of several branches contain such runes. -Occasionally you will find an archway (displayed as '\' or as an actual+Occasionally you will find an archway (displayed as '`' or as an actual arch); these lead to special places like shops, magical labyrinths, and Hell. Depending on which type of archway it is, you can enter it by typing '<' or '>'. Doors and Traps ----------------Doors can be usually be opened by just walking into them (there is an-option for disabling this); else this can also be done with either the -'O' command. They can be closed with the 'C command. Pressing Ctrl plus-a direction or '*', followed by a direction, will open/close doors, too.+Doors can usually be opened by just walking into them (there is an+option for disabling this); else this can also be done using the 'O'+command. They can be closed with the 'C' command. Pressing Ctrl plus+a direction, or '*', followed by a direction, will open/close doors,+too. If there is no door in the indicated space, both Ctrl-direction and * direction will attempt to attack any monster which may be standing there (this is the only way to attack a friendly creature hand-to-hand). If @@ -379,10 +380,10 @@ usually save real time. If you like the use of automated exploration, take note of the option-setting 'explore_greedy = true' in the init file. This will cause Crawl-to run to and pick up all items seen which are on the autopickup list. -It also makes the character go to piles of items, in order to check the-contents.+setting 'explore_greedy = true' (default setting) in the init file. This+will cause Crawl to run to and pick up all items seen which are on the+autopickup list. It also makes the character go to piles of items, in+order to check the contents. Stashes and Searching ---------------------@@ -398,11 +399,10 @@ all weapons training the long blades skill) or general terms like 'shop', 'altar', 'portal', 'artefact', 'dart trap', etc. -The above assumes that use of the default option 'stash_tracking =-all'. If for some reasons (e.g. to speed up performance) you've-changed the value of the stash_tracking option, you can press Ctrl-S-to tell Crawl that a given square is considered a stash. Ctrl-E will-manually erase stashes.+The above assumes use of the default option 'stash_tracking = all'. If+for some reason (e.g. to speed up performance) you've changed the value+of the stash_tracking option, you can press Ctrl-S to tell Crawl that a+given square is considered a stash. Ctrl-E will manually erase stashes. The Goal --------@@ -427,13 +427,13 @@ If you don't like the standard keyset (either because some keys do not work properly, or because you want to decrease the amount of typing-necessary), you can use keymaps and macros. See crawl_macro.txt in the-Docs directory, or read it from the in-game help menu.+necessary), you can use keymaps and macros. See macros_guide.txt in the+/docs directory, or read it from the in-game help menu. ---------------------------------------------------------------------------------+------------------------------------------------------------------------ E. EXPERIENCE AND SKILLS---------------------------------------------------------------------------------+------------------------------------------------------------------------ When you kill monsters, you gain experience points (XP). You receive half normal experience for monsters killed by friendly creatures. When @@ -451,8 +451,8 @@ with which a character learns a skill depends solely on race. These aptitudes are hinted at in the list of species (see Appendix 1). For the curious, the full table can be checked in aptitudes.txt (also from the-help game during play). It is not necessary to bother with the numbers-in order to win!+help screen during play), though it is not necessary to bother with the+numbers in order to win! You can see your character's skills by pressing the 'm' key; the higher the level of a skill, the better you are at it. Every time your @@ -477,7 +477,7 @@ elsewhere. It can happen that the pool grows rather large in this way; the maximum is 20000 experience points. -Occasionally you find a manual of a skill which allows to make quick+Occasionally you may find a manual of a skill which allows to make quick progress in this area. Whenever you read it, all free experience is transferred into exercising this particular skill. This can be done until the manual crumbles, which will occur after a random number of @@ -526,11 +526,11 @@ When playing Crawl, you will undoubtedly want to develop a feeling for the different monster types. For example, some monsters leave edible corpses, others don't, and still others do so sometimes. Guided by-intuition, you will soon figure out which monsters make the best-meals. Likewise, ranged or magic attackers will prove a different kind-of threat from melee fighters. Learn from past deaths and remember-which monsters pose the most problems. If particular monsters are-giving you trouble, try to alter your tactics for future encounters.+intuition, you will soon figure out which monsters make the best meals.+Likewise, ranged or magic attackers will prove a different kind of+threat from melee fighters. Learn from past deaths and remember which+monsters pose the most problems. If particular monsters are giving you+trouble, try to alter your tactics for future encounters. ------------------------------------------------------------------------@@ -593,7 +593,7 @@ You can use the adjust command (the '=' key) to change the letters to which your possessions are assigned. This command can be used to change -spell letters, too.+spell or ability letters, too. Some items can be sticky-cursed, in which case they weld themselves to your body when you use them. Such items usually carry some kind of@@ -825,11 +825,11 @@ Spell staves (called "rods" in the game) are a totally different kind of item. They hold spells which you can cast without having to memorise-them first, and without consuming food. You must wield a rod like a-weapon in order to gain from its power. Rods can be invoked with the 'E'-command while you are wielding them. They have a pool of magical energy-which regenerates rather quickly when you are wielding it (drawing from-your own Magic), or at a much slower rate when it just sits in your+them first, and consume less food. You must wield a rod like a weapon in+order to gain from its power. Rods can be invoked with the 'v' command+while you are wielding them. They have a pool of magical energy which+regenerates rather quickly when you are wielding it (drawing from your+own Magic), or at a much slower rate when it just sits in your backpack. Unlike other staves, rods are unsuited for physical combat. +: Books@@ -888,12 +888,13 @@ "golden sword" or "shimmering scale mail". Also, artefacts cannot be modified in any way, including enchantments. Apart from that, otherwise mundane items can get one special property.-These are called 'ego items', and examples are: boots of running, a weapon-of flaming, a helmet of see invisible, and so on. Note that such items -can be modified, and thus are subject to corrosion and enchanting scrolls. -All ego items are noted with special adjectives but not all items noted in -this way need have a special property (they often have some enchantment, -though):+These are called 'ego items', and examples are: boots of running, a+weapon of flaming, a helmet of see invisible, and so on. Note that such+items can be modified, and thus are subject to corrosion and enchanting+scrolls. +All ego items are noted with special adjectives but not all items noted+in this way need have a special property (they often have some+enchantment, though): - weapons: glowing, runed; - metal armours: shiny; - leather armours, animal skins: dyed;@@ -970,9 +971,9 @@ well as you, if not better, and often use it intelligently. ---------------------------------------------------------------------------------+------------------------------------------------------------------------ I. TARGETING---------------------------------------------------------------------------------+------------------------------------------------------------------------ When throwing something, or zapping certain wands, or casting spells, you are asked for a direction. There are several ways to tell Crawl @@ -987,10 +988,10 @@ the previous target. - Pressing '+' or '=' moves the cursor to the next monster, going from nearer to further away. Similarly, '-' cycles backwards.- - Any direction key moves the cursor by one square. Occasionally, it can- be useful to target non-inhabited squares.+ - Any direction key moves the cursor by one square. Occasionally, it+ can be useful to target non-inhabited squares. - When you are content with your choice of target, press one of '.' - (period) or Del or Enter or Space to fire at the target. If you press + (period), Del, Enter, or Space to fire at the target. If you press '!', you also fire, but the spell/missile will stop at the target's square if it misses. This can be useful to keep friendlies out of the fire, and is also the only way to attack submerged creatures. You can@@ -999,7 +1000,7 @@ There are some shortcuts while targeting: - Typing Shift-direction on your keypad fires straight away in that direction.- - Pressing 'p', 't' or 'f' fires at the previous target (if it is still+ - Pressing 'p' or 'f' fires at the previous target (if it is still alive and in sight). Due to this, most hunters can go a long way by pressing 'ff' to fire their ammunition at a monster and then keep firing at it with further @@ -1007,38 +1008,39 @@ '+' or '-' commands, though. It is possible to target yourself: obviously beneficial effects like -hasting or healing will actually target the cursor on you, leaving to you-only the pressing of '.', Enter, etc. - except if you want to heal or -haste someone else. If you target yourself while firing something harmful-(which can be sensible at times), you will be asked for confirmation.+hasting or healing will actually target the cursor on you, leaving to+you only the pressing of '.', Enter, etc. - except if you want to heal+or haste someone else. If you target yourself while firing something+harmful (which can be sensible at times), you will be asked for+confirmation. Finally, there are some more targeting related commands: - Ctrl-F changes which monsters are cycled when using '+', '=' or '-': hostiles, friends, or all monsters. - ( and ) allow to change the ammunition. This is useful when you have - several types of appropriate ammunition, say poisoned needles and curare- needles. Your last usage will be remembered. Note that you can use ( for- changing the quiver ammunition even outside of targeting.+ several types of appropriate ammunition, say poisoned needles and+ curare needles. Your last usage will be remembered. Note that you can+ use ( for changing the quiver ammunition even outside of targeting. - The ':' key allows you to display the path of your spell/wand/missile. ---------------------------------------------------------------------------------+------------------------------------------------------------------------ J. RELIGION---------------------------------------------------------------------------------+------------------------------------------------------------------------ There are a number of Gods, Demons, and other assorted Powers who will accept your character's worship, and sometimes give out favours in exchange. You can use the '^' command to check the requirements of whoever it is that you worship, and if you find religion to be an inconvenience you can always renounce your faith (use the 'a' command - -but some Gods resent being scorned!).+but most Gods resent being scorned!). The 'p' command lets you pray to your God. Most gods take note of your actions throughout, but by praying you ask for attention. This is how -you dedicate corpse-sacrifices to your God, for example: press 'pD' to -pray first, and then dissect. Note that not all gods like this. Praying -also gives you a sense of what your God thinks of you, and can be used -to sacrifice things at altars.+you dedicate corpse-sacrifices to your God, for example: press 'pc' to +pray first, and then chop up a corpse. Note that not all gods like this.+Praying also gives you a sense of what your God thinks of you, and can+be used to sacrifice things at altars. To use any powers which your God deems you fit for, access the abilities menu via the 'a' command; God-given abilities are listed as invocations.@@ -1079,17 +1081,17 @@ particularly Haste (not the kind you get from being berserk) and Invisibility, as your system absorbs too much magical energy - but you would have to spend almost all of your time hasted or invisible to be -affected. However, some powerful items radiate dangerous levels of +affected. However, some powerful items also radiate dangerous levels of magical energy. More often than not, the mutations caused by magical radiations express harmfully. Furthermore, certain corpses are mutagenic, and there are traps with -mutation effects. There are some spells that cause mutations.+mutation effects. There are also some spells that cause mutations. -It is much more difficult to get rid of bad mutations. A lucky mutation -attempt can actually remove mutations. However, the only sure-fire way -is to quaff a potion of cure mutation, which will attempt to remove -three random mutations.+It is much more difficult to get rid of bad mutations that to get one. A+lucky mutation attempt can actually remove mutations. However, the only+sure-fire way is to quaff a potion of cure mutation, which will attempt+to remove three random mutations. A special case are Demonspawn. Characters of this species get certain special powers during their career; these are listed in red. They are @@ -1097,7 +1099,7 @@ been augmented by a mutation, it is displayed in a lighter red colour. Many a race starts with some special intrinsic feats, like the greater-speed of Centaurs or Spriggans and the eating habits of Trolls, Ogres, +speed of Centaurs or Spriggans, or the eating habits of Trolls, Ogres, and others. These are often, but not always, like a preset mutation. In case such an innate feature gets amplified by an ordinary mutation, it is displayed in a light blue colour.@@ -1108,7 +1110,8 @@ ------------------------------------------------------------------------ Licence: Read Licence.txt for information about the Crawl licence - (which is nearly identical to the Nethack public license).+ (which is nearly identical to the Nethack public+ license). Disclaimer: This software is provided as is, with absolutely no warranty express or implied. Use of it is at the sole @@ -1171,10 +1174,10 @@ wielding, etc.), so is not recommended. Macroing 'a' to some other key will only change the command key 'a'. -You can set up key maps and macros in-game with the ~ key (Ctrl-D will-also work); this also allows for saving all current key bindings and -macros. Alternatively, you can directly edit the macros.txt file. For -more information on both and for examples, see macros_guide.txt.+You can set up key maps and macros in-game with the '~' key ('Ctrl-D'+will also work); this also allows for saving all current key bindings+and macros. Alternatively, you can directly edit the macros.txt file.+For more information on both and for examples, see macros_guide.txt. Crawl supports a large number of options that allow for great flexibility in the interface. They are fully documented in the file@@ -1234,7 +1237,7 @@ most deaths are not of this type: by this stage, almost all casualties can be traced back to actual mistakes; if not tactical ones, then of a strategical type, like wrong skilling (too broad or too narrow), unwise-use of resources (too conservative or too liberal) , or wrong decisions +use of resources (too conservative or too liberal), or wrong decisions about branch/god/gear. The possibility of unavoidable deaths is a larger topic in computer@@ -1268,8 +1271,8 @@ lost opportunity for fun. Examples for this are the resistances: there are very few permanent sources, most involve a choice (like rings or specific armour) or are only semi-permanent (like mutations). Another-example is the absence of clear-cut best items, which comes from the fact-that most artefacts are randomly generated. Furthermore, even fixed+example is the absence of clear-cut best items, which comes from the+fact that most artefacts are randomly generated. Furthermore, even fixed artefacts cannot be wished for, as scrolls of acquirement produce random items in general. Likewise, there are no sure-fire means of life saving (the closest equivalents are controlled blinks, and good religious@@ -1583,9 +1586,10 @@ Ogre societies: the resulting offspring is often ill-fated, and in very rare cases, even two-headed ogres result. -Ogres are huge, chunky creatures who usually live to do nothing more than -smash, smash, smash, and destroy. They have great physical strength, but -are bad at almost everything except fighting and mature quite slowly. +Ogres are huge, chunky creatures who usually live to do nothing more+than smash, smash, smash, and destroy. They have great physical+strength, but are bad at almost everything except fighting and mature+quite slowly. Because of their large size they can only wear loose robes, cloaks and animal skins. Although ogres can eat almost anything, their size also means that they need to do so more frequently than smaller folk.@@ -1594,8 +1598,8 @@ counterparts and grow a bit slower. They are unique among the beefier species in their ability to use magic, especially enchantments. Still, they also perform well in all types of melee combat, with a slight -disadvantage at short blades. While they perform better than Ogres in all -more civilised aspects of life, Ogre-Mages have lost the ability to +disadvantage at short blades. While they perform better than Ogres in+all more civilised aspects of life, Ogre-Mages have lost the ability to digest raw meat when not hungry. Most often, small bands of Common Ogres raid the countryside or@@ -1606,8 +1610,8 @@ Trolls ------ Trolls are like Ogres, but even nastier. They have thick, knobbly skins-of any colour from putrid green to mucky brown, and their mouths are -full of ichor-dripping fangs.+of any colour from putrid green to mucky brown, which are covered in+patches of thick fur, and their mouths are full of ichor-dripping fangs. They can rip creatures apart with their claws, and regenerate very quickly from even the most terrible wounds. They learn very slowly@@ -1728,7 +1732,8 @@ warmth left to be affected by cold; and are not susceptible to mutations. -There are two types of undead available to players: Mummies and Ghouls.+There are three types of undead available to players: Mummies, Ghouls,+and Vampires. Mummies These are undead creatures who travel into the depths in search of @@ -1754,11 +1759,24 @@ fighters and, due to their contact with the grave, can use ice, earth and death magic without too many difficulties. -Note: Some species have special abilities which can be accessed by the - 'a' abilities menu. Some also have physical characteristics which - allow them to make extra attacks using the Unarmed Combat skill.+Vampires+ Vampires are another form of undead, but with a peculiarity: by + consuming fresh blood, they may become alive. A bloodless Vampire has+ all the traits of an undead, yet possesses no innate healing power at+ all -- in particular, magical items or spell which increase the rate+ of regeneration will not work. On the other hand, a Vampire full with+ blood will regenerate very quickly, but lose all undead powers.+ Vampires can never starve. Upon growing, they learn to transform into+ quick bats, and later how to draw potions of blood from fresh corpses. +Note: Use 'A' to check for which particular pecularities a species might+ have. Also, some species have special abilities which can be+ accessed by the 'a' abilities menu. Some also have physical+ characteristics which allow them to make extra attacks using the+ Unarmed Combat skill.++ ------------------------------------------------------------------------ 2. LIST OF CHARACTER CLASSES ------------------------------------------------------------------------@@ -1785,19 +1803,6 @@ heavy things. They start with a nasty weapon, a small shield, leather armour, and some nets. -Berserkers:-------------Berserkers are hardy warriors who worship Trog the Wrathful, from whom-they get the power to go berserk (as well as a number of other powers -should they prove worthy) but who forbids the use of spell magic. They-enter the dungeon with an axe, some spears, and a set of leather armour.--Hunters:----------The Hunter is a type of fighter who specialises in missile weapons. A -Hunter starts with a ranged weapon and some ammunition, as well as a-hunting knife and a set of leathers.- Monks: ------ The Monk is a member of an ascetic order dedicated to the perfection@@ -1805,49 +1810,13 @@ Monks start with very little equipment, but can survive without the weighty weapons and spellbooks needed by other classes. -Thieves:----------The Thief is one of the trickiest classes to play. Thieves start out -with a large variety of useful skills, and need to use all of them to -survive. Thieves start with a short sword, some throwing darts, and -light armour.+Berserkers:+-----------+Berserkers are hardy warriors who worship Trog the Wrathful, from whom+they get the power to go berserk (as well as a number of other powers +should they prove worthy) but who forbids the use of spell magic. They+enter the dungeon with an axe, some spears, and a set of leather armour. -Assassin:-----------An Assassin is a thief who is especially good at killing. Assassins are-like thieves in most respects, but are more dangerous in combat.--Stalkers:-----------The stalker is an assassin who has trained in the use of poison magic.--Crusaders:------------The Crusader is a decent fighter who can use the magical art of-enchantment to become more dangerous in battle. Crusaders start out-lightly armed and armoured, but equipped with a book of martial spells.--Reavers:----------Reavers are warriors who learn the magics of destruction in order to -complement their deadliness in hand combat.--Death Knights:----------------The Death Knight is a fighter who aligns him or herself with the powers-of death. There are two types of Death Knights: those who worship and -draw their abilities from the Demon-God Yredelemnul, and those who study-the fearsome arts of necromancy.--Chaos Knights:----------------The Chaos Knight is a fighter who chooses to serve one of the Gods of -Chaos. There are two choices: Xom or Makhleb. Xom is a very -unpredictable (and possibly psychotic) entity who rewards or punishes-according to whim. Makhleb the Destroyer is a more purposeful God, who-appreciates destruction and offers a variety of very violent powers to-the faithful.- Paladins: --------- The Paladin is a servant of the Shining One, and has many of the@@ -1864,11 +1833,39 @@ has been lost in the mists of time; Priests are not in any way restricted in their choice of weapon skills. +Chaos Knights:+--------------+The Chaos Knight is a fighter who chooses to serve one of the Gods of +Chaos. There are two choices: Xom or Makhleb. Xom is a very +unpredictable (and possibly psychotic) entity who rewards or punishes+according to whim. Makhleb the Destroyer is a more purposeful God, who+appreciates destruction and offers a variety of very violent powers to+the faithful.++Death Knights:+--------------+The Death Knight is a fighter who aligns him or herself with the powers+of death. There are two types of Death Knights: those who worship and +draw their abilities from the Demon-God Yredelemnul, and those who study+the fearsome arts of necromancy.+ Healers: -------- The Healer is a priest of Elyvilon. Healers begin with minor healing powers, but can gain far greater abilities in the long run. +Crusaders:+----------+The Crusader is a decent fighter who can use the magical art of+enchantment to become more dangerous in battle. Crusaders start out+lightly armed and armoured, but equipped with a book of martial spells.++Reavers:+--------+Reavers are warriors who learn the magics of destruction in order to +complement their deadliness in hand combat.++ Magicians: These are not a class, but a type of class, including Wizards, Conjurers, Enchanters, Summoners, Necromancers, various Elementalists, Venom Mages, Transmuters and Warpers. Magicians are @@ -1911,6 +1908,16 @@ of magic. Necromantic spells are a varied bunch, but many involve some degree of risk or harm to the caster. +Warpers:+--------+Warpers specialise in translocations, and are experts in travelling long+distances and positioning themselves precisely.++Transmuters:+------------+Transmuters specialise in transmigrations, and can cause strange changes+in themselves and others.+ Elementalists: -------------- Elementalists are magicians who specialise in one of the four types@@ -1934,16 +1941,28 @@ it. Poison is especially effective when used against insects, damaging their tracheae quite effectively. -Transmuters:--------------Transmuters specialise in transmigrations, and can cause strange changes-in themselves and others.+Stalkers:+---------+The Stalker is an Assassin who has trained in the use of poison magic. -Warpers:+Thieves: ---------Warpers specialise in translocations, and are experts in travelling long-distances and positioning themselves precisely.+The Thief is one of the trickiest classes to play. Thieves start out +with a large variety of useful skills, and need to use all of them to +survive. Thieves start with a short sword, some throwing darts, and +light armour. +Assassin:+---------+An Assassin is a Thief who is especially good at killing. Assassins are+like Thieves in most respects, but are more dangerous in combat.++Hunters:+--------+The Hunter is a type of fighter who specialises in missile weapons. A +Hunter starts with a ranged weapon and some ammunition, as well as a+hunting knife and a set of leathers.+ Wanderers: ---------- Wanderers are people who have not learned a specific trade. Instead,@@ -1964,7 +1983,8 @@ Here is a description of the skills you may have. You can check your current skills with the 'm' command, and therein toggle between progress display and aptitude display using '!'. You can also read the table of-aptitudes from the help menu using '?%'.+aptitudes from the help menu using '?%', and during character choice+with '%'. Fighting skills: ----------------@@ -1987,7 +2007,7 @@ * Polearms If you are already good at a weapon, say a long sword, and you practise-for a while with similar weapon such as a short sword, your practise +for a while with a similar weapon such as a short sword, your practise will be sped up (and will require less experience) until both skills are equal; this is called crosstraining. Similar types of weapons are: @@ -2170,8 +2190,8 @@ the numpad cursor keys (try both Numlock on and off) or one of the Rogue vi keys (hjklyubn). Shift-direction This moves straight until something interesting- or / direction is found (like a monster). If the first square is- a trap, movement starts nonetheless.+ or / direction is found (like a monster). If the first square+ is a trap, movement starts nonetheless. Ctrl-G Interlevel travel (to arbitrary dungeon levels or waypoints). Remembers old destinations if interrupted. This command has its own set of@@ -2207,10 +2227,12 @@ < Use staircase to go higher, also enters shops. > Use staircase to go deeper, or enters branch. ; Examine occupied tile, also causes auto-pickup.- x Examine surroundings mode, see below. Has ? help.- X Examine level map, see below. Has help on ?.+ x Examine surroundings mode, see below. Has '?'+ help.+ X Examine level map, see below. Has help on '?'. Ctrl-O Show dungeon overview (branches, shops, etc.).- ! Annotate current level: you can enter any string.+ ! Annotate current level: you can enter any + string. This annotation is then listed in the dungeon overview (Ctrl-O) and also shown whenever you enter that level again. If you use this command @@ -2218,7 +2240,8 @@ annotate the level that staircase leads to. Should your annotation contain an exclamation mark (!), you will be prompted before entering- the level. An empty string clears any annotation.+ the level. An empty string clears any+ annotation. Character information: 'display' below means usage of the message area,@@ -2277,17 +2300,19 @@ Within the drop list, you can select slots based on a regular expression by pressing Ctrl-F, followed by the regex.- #d Drop exact number of items, where # is any number.+ #d Drop exact number of items, where # is any+ number. g or , Pick up items; press twice for pick up menu. Use a prefix to pick up smaller quantities. As with dropping, Ctrl-F allows you to pick up items matching a regular expression.- c Chop up a corpse. This will switch to an uncursed- edged weapon (unless you have claws or wield such- a weapon already), cut up a single corpse on the- ground and switch back to your primary weapon. In- case there are several corpses on the ground, you - are prompted one by one. There, you can answer+ c Chop up a corpse. This will switch to an+ uncursed edged weapon (unless you have claws or+ wield such a weapon already), cut up a single+ corpse on the ground and switch back to your+ primary weapon. In case there are several+ corpses on the ground, you are prompted one by+ one. There, you can answer y, c: yes (chop up this corpse) n, Space: no (skip this corpse) a: yes to all (chop up all corpses)@@ -2344,11 +2369,12 @@ tracking if using 'stash_tracking = explicit'). Tiles:- - Edit player doll. This makes it possible to change- the appearance of the player and to override the- defaults, which are to mimic the current player's- equipment and any species defaults. These options- are saved into the dolls.txt file.+ - Edit player doll. This makes it possible to+ change the appearance of the player and to+ override the defaults, which are to mimic the+ current player's equipment and any species+ defaults. These options are saved into the+ dolls.txt file. Ctrl-Q Modify screen size preferences. These changes are saved into the wininit.txt file. @@ -2429,12 +2455,12 @@ avoid damaging pets, or to attack submerged water creatures. p Fire at previous target (if still in sight).- f or t Smart-firing: fire at previous target, if it is+ f Smart-firing: fire at previous target, if it is still in sight; and else fire at the cursor - position. Together with the default_target (which- is on by default) this allows to start shooting- at an opponent with 'ff' and then keep firing - with 'ff'.+ position. Together with the default_target + option (which is on by default) this allows to+ start shooting at an opponent with 'ff' and then+ keep firing with 'ff'. : Toggle display of the beam path. Ctrl-F Toggle target modes (between enemies, all, friends; see also option target_zero_exp).@@ -2473,7 +2499,8 @@ , Global select (subject to drop_filter option). - Global deselect (subject to drop_filter option). * Invert selection. This will allow you to select- all items even if you use the drop_filter option.+ all items even if you use the drop_filter+ option. . Selects next item. (If you have pressed the key of an item in the list, '.' will toggle the next item. This can be repeated, quickly selecting@@ -2507,25 +2534,27 @@ are several levels of poisoning. Cure with potions of healing or by waiting it out. Pray You are praying. Any action taken under prayer is done - in the name of your god. For example, dissecting a + in the name of your god. For example, chopping up a corpse offers it. Depending on the scope of your religion, this may or may not be a good idea. Encumbered Your load is heavy enough to slow you down. You also - need more food then walking around encumbered. Try to - avoid this!+ need more food than when walking around encumbered. Try+ to avoid this! Overloaded You carry too much to do anything sensible. Drop stuff! Conf You are confused. Actions may not work properly. Fast All of your actions are twice as fast (this can cause magic contamination). Swift You move at a somewhat higher speed. This only means movement speed.-Slow All actions are slowed. Note: ending berserking will slow.+Slow All actions are slowed. + Note: ending berserking will slow you. Special enchantments: --------------------- BWpn Some characters have a breath weapon (like Nagas or - experienced Draconians), which will show "BWpn" when used. - Further breaths have to wait until this disappears.+ experienced Draconians), which will show "BWpn" when+ used. Further breaths have to wait until this+ disappears. Invis You are invisible. This can cause glowing, if used too much. Holy You repel undead.@@ -2539,8 +2568,8 @@ Kenku, lucky Draconians, characters using Dragon form, or those levitating while wearing an amulet of controlled flight.-Held You are held in a net: you cannot move freely and instead - only try to fight your way out of the net.+Held You are held in a net: you cannot move freely and+ will instead only try to fight your way out of the net. Bhld You are beheld: you cannot move away from the monster(s) beholding you. Fire You are plagued with sticky fire. It will time out.@@ -2559,6 +2588,10 @@ itself if the maximal health is back to its initial value, and it also expires after a while. Ins You are insulated, i.e. immune to electric shocks.+Touch Your hands are glowing, and any monster you touch might+ become confused.+Blade You are bonded with your blade, so it strikes more+ accurately. There are several more enchantment messages for various spells. The description of the spell causing the enchantment will explain these.@@ -2576,7 +2609,7 @@ ---------------------- These are done by the game to help you to identify items. For example, rings or scrolls which did not do anything obvious upon trying will be-automatically inscribed with "tried".+automatically inscribed with "{tried}". Inscriptions as shortcuts -------------------------Modified: trunk/crawl-ref/readme.txt===================================================================--- trunk/crawl-ref/readme.txt2008-03-31 13:45:05 UTC (rev 3980)+++ trunk/crawl-ref/readme.txt2008-03-31 14:13:33 UTC (rev 3981)@@ -21,14 +21,14 @@ 1. Getting started ------------------ If you'd like to dive in immediately, your best bets are to-* start up a game and choose a tutorial (press T when asked for race), or+* start up a game and choose a tutorial (press 'T' when asked for race), or * read quickstart.txt (in the /docs directory), or * for studious readers, browse the manual (see below for all doc files). Additionally, you may want to print out the file keys.pdf from the /docs folder. Besides a full list of command keys (don't bother with it), it contains two pages of help for new players.-Note that you can read quickstart.txt and the manual when playing; pressing ? +Note that you can read quickstart.txt and the manual when playing; pressing '?' brings up a menu for that. @@ -46,11 +46,11 @@ * macro.txt Playing Crawl can be made even more convenient by redefining keys and assigning macros. Ignore early on. -The docs/ folder contains the following helpful texts (all of which can be +The /docs folder contains the following helpful texts (all of which can be read in-game by bringing up the help menu with '?'): -* crawl_manual.txt The complete manual; describing all aspects in the- detail. Contains appendices on species, classes, etc.+* crawl_manual.txt The complete manual; describing all aspects in detail.+ Contains appendices on species, classes, etc. * options_guide.txt Describes all options in detail. The structure of init.txt follows this text. * macros_guide.txt A how-to on using macros and keymappings, with examples.@@ -70,7 +70,7 @@ The official webpage is http://crawl-ref.sourceforge.net/ and there you can find both trackers to add bug reports, feature requests, or -upload patches as well as sources and binaries. This is the best way to report +upload patches, as well as sources and binaries. This is the best way to report bugs or mention new ideas. There is a Usenet newsgroup dealing with roguelikes, including Crawl:@@ -92,11 +92,11 @@ 4. License and history information -----------------------------------What you have downloaded is a descendant to Linley's Dungeon Crawl. Development+What you have downloaded is a descendant of Linley's Dungeon Crawl. Development of the main branch stalled at version 4.0.0b26, with a final alpha of 4.1 being released by Brent Ross in 2005. Since 2006, the Dungeon Crawl Stone Soup team -continues the development. See the CREDITS in the mail folder for myriad of -contributors, past and present; license.txt contains the legal blurb.+has been continuing the development. See the CREDITS in the mail folder for a+myriad of contributors, past and present; license.txt contains the legal blurb. Dungeon Crawl Stone Soup is an open source, freeware roguelike. It is supported on Linux, Windows, OS/X and, to a lesser extent, on DOS. The source should @@ -107,7 +107,7 @@ * The Lua script language, see /docs/lualicense.txt. * The PCRE library for regular expressions, see /docs/pcre_license.txt. * The Mersenne Twister for random number generation, /docs/mt19937.txt.-* The SQLite library as database enging; it is properly public domain.+* The SQLite library as database engine; it is properly public domain. * The ReST light markup language for the documentation. 5. How you can help@@ -124,8 +124,8 @@ * Vault making. Crawl uses many hand-drawn (but often randomised) maps. Making them is fun and easy. It's best to start with simple entry vaults (glance through -dat/entry.des for a first impression). Later, you may want to read -docs/level_design.txt for the full power. If you're ambitious, new maps for +/dat/entry.des for a first impression). Later, you may want to read +/docs/level_design.txt for the full power. If you're ambitious, new maps for branch ends are possible, as well. If you've made some maps, you can test them on your system (no compiling needed) and then just mail them to the mailing list.@@ -133,17 +133,19 @@ * Speech. Monster talking provides a lot of flavour. Just like vaults, speech depends upon a large set of entries. Since most of the speech has been outsourced, you -can add new prose. The syntax is a slightly strange, so you may want to read -docs/monster_speech.txt.+can add new prose. The syntax is effective, but slightly strange, so you may+want to read /docs/monster_speech.txt. Again, changing or adding speech is possible on your local game. If you have added something, send the files to the list. * Monster descriptions.-You can look up that current descriptions in-game with ?/ or just read them in -dat/descript/monsters.txt. The following conventions should be more or less -obeyed: descriptions ought to contain flavour text, ideally pointing out major -weaknesses/strenghts. No numbers, please. Citations are okay, but try to stay -away from the most generic ones.+You can look up the current monster descriptions in-game with '?/' or just read+them in /dat/descript/monsters.txt. The following conventions should be more or+less obeyed: descriptions ought to contain flavour text, ideally pointing out+major weaknesses/strenghts. No numbers, please. Citations are okay, but try to+stay away from the most generic ones.+If you like, you can similarly modify the descriptions for features, items or+branches. * Tiles. Since version 0.4, tiles are integrated within Crawl. Having variants of @@ -152,5 +154,9 @@ * Patches. If you like to, you can download the source code and apply patches. Both -patches for bug fixes as well as implementation of new features is welcome. -Please be sure to read docs/coding_conventions.txt first.+patches for bug fixes as well as implementation of new features are very much+welcome. +Please be sure to read /docs/coding_conventions.txt first.++Thank you, and have fun crawling!+Modified: trunk/crawl-ref/source/direct.cc===================================================================--- trunk/crawl-ref/source/direct.cc2008-03-31 13:45:05 UTC (rev 3980)+++ trunk/crawl-ref/source/direct.cc2008-03-31 14:13:33 UTC (rev 3981)@@ -2290,7 +2290,8 @@ case CONTROL('F'): return CMD_TARGET_CYCLE_TARGET_MODE; case 'p': return CMD_TARGET_PREV_TARGET; case 'f': return CMD_TARGET_MAYBE_PREV_TARGET;- + case 't': return CMD_TARGET_MAYBE_PREV_TARGET; // f. users of the 0.3.4 keys+ case '-': return CMD_TARGET_CYCLE_BACK; case '+': case '=': return CMD_TARGET_CYCLE_FORWARD; case ';': case '/': return CMD_TARGET_OBJ_CYCLE_BACK;Modified: trunk/crawl-ref/source/enum.h===================================================================--- trunk/crawl-ref/source/enum.h2008-03-31 13:45:05 UTC (rev 3980)+++ trunk/crawl-ref/source/enum.h2008-03-31 14:13:33 UTC (rev 3981)@@ -2138,22 +2138,22 @@ enum operation_types {- OPER_WIELD = 'w',- OPER_QUAFF = 'q',- OPER_DROP = 'd',- OPER_EAT = 'e',- OPER_TAKEOFF = 'T',- OPER_WEAR = 'W',- OPER_PUTON = 'P',- OPER_REMOVE = 'R',- OPER_READ = 'r',+ OPER_WIELD = 'w',+ OPER_QUAFF = 'q',+ OPER_DROP = 'd',+ OPER_EAT = 'e',+ OPER_TAKEOFF = 'T',+ OPER_WEAR = 'W',+ OPER_PUTON = 'P',+ OPER_REMOVE = 'R',+ OPER_READ = 'r', OPER_MEMORISE = 'M',- OPER_ZAP = 'z',- OPER_EXAMINE = 'v',- OPER_FIRE = 'f',- OPER_PRAY = 'p',- OPER_EVOKE = 'E',- OPER_ANY = 0+ OPER_ZAP = 'Z',+ OPER_EXAMINE = 'v',+ OPER_FIRE = 'f',+ OPER_PRAY = 'p',+ OPER_EVOKE = 'E',+ OPER_ANY = 0 }; enum orb_typeModified: trunk/crawl-ref/source/invent.cc===================================================================--- trunk/crawl-ref/source/invent.cc2008-03-31 13:45:05 UTC (rev 3980)+++ trunk/crawl-ref/source/invent.cc2008-03-31 14:13:33 UTC (rev 3981)@@ -1046,11 +1046,19 @@ operation_types oper) { const char iletter = static_cast<char>(oper);- + const std::string& r(item.inscription); for ( unsigned int i = 0; i + 1 < r.size(); ++i )- if (r[i] == '!' && (r[i+1] == iletter || r[i+1] == '*'))- return true;+ {+ if (r[i] == '!')+ {+ if (r[i+1] == iletter || r[i+1] == '*')+ return true;+ else if (oper == OPER_ZAP && r[i+1] == 'z') // for the 0.3.4. keys+ return true;+ }+ }+ return false; } Modified: trunk/crawl-ref/source/item_use.cc===================================================================--- trunk/crawl-ref/source/item_use.cc2008-03-31 13:45:05 UTC (rev 3980)+++ trunk/crawl-ref/source/item_use.cc2008-03-31 14:13:33 UTC (rev 3981)@@ -4672,6 +4672,7 @@ for (int i = EQ_CLOAK; i <= EQ_AMULET; ++i) if ( inv_slot == you.equip[i] ) return true;+ return false; } Modified: trunk/crawl-ref/source/spells4.cc===================================================================--- trunk/crawl-ref/source/spells4.cc2008-03-31 13:45:05 UTC (rev 3980)+++ trunk/crawl-ref/source/spells4.cc2008-03-31 14:13:33 UTC (rev 3981)@@ -1654,6 +1654,11 @@ beem.flavour = BEAM_POTION_STEAM; break; + case POT_BLOOD:+ case POT_BLOOD_COAGULATED:+ if (one_chance_in(3))+ break; // stinking cloud+ // deliberate fall through case POT_BERSERK_RAGE: beem.flavour = (coinflip() ? BEAM_POTION_FIRE : BEAM_POTION_STEAM); break;This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [4173] trunk/crawl-ref

From: <dol...@us...> - 2008-04-10 13:33:35

Revision: 4173 Author: dolorousDate: 2008-04-10 06:33:28 -0700 (Thu, 10 Apr 2008)Log Message:-----------Improve priests' starting weapons. Halflings and kobolds get +1/+1 knives, elves and merfolk get quarterstaves, and everyone else gets maces as before. Update the manual to account for this, as well.Modified Paths:-------------- trunk/crawl-ref/docs/crawl_manual.txt trunk/crawl-ref/source/newgame.ccModified: trunk/crawl-ref/docs/crawl_manual.txt===================================================================--- trunk/crawl-ref/docs/crawl_manual.txt2008-04-10 08:36:20 UTC (rev 4172)+++ trunk/crawl-ref/docs/crawl_manual.txt2008-04-10 13:33:28 UTC (rev 4173)@@ -1853,11 +1853,8 @@ -------- Priests serve either Zin, the ancient and revered God of Law, or the rather less pleasant Death-God Yredelemnul. Hill Orcs may choose to -follow the Orc god Beogh instead. Although priests enter the dungeon -with a mace (as well as a priestly robe and a few healing potions), -this is purely the result of an archaic tradition, the reason for which -has been lost in the mists of time; Priests are not in any way -restricted in their choice of weapon skills.+follow the Orc god Beogh instead. Priests enter the dungeon with a +traditional weapon, a priestly robe and a few healing potions. Chaos Knights: --------------Modified: trunk/crawl-ref/source/newgame.cc===================================================================--- trunk/crawl-ref/source/newgame.cc2008-04-10 08:36:20 UTC (rev 4172)+++ trunk/crawl-ref/source/newgame.cc2008-04-10 13:33:28 UTC (rev 4173)@@ -3758,9 +3758,14 @@ case JOB_PRIEST: you.piety = 45; - _newgame_make_item(0, EQ_WEAPON, OBJ_WEAPONS, WPN_MACE); if (you.species == SP_KOBOLD || you.species == SP_HALFLING)- you.inv[0].sub_type = WPN_KNIFE;+ _newgame_make_item(0, EQ_WEAPON, OBJ_WEAPONS, WPN_KNIFE, 1, 1, 1);+ else+ {+ _newgame_make_item(0, EQ_WEAPON, OBJ_WEAPONS,+ (player_genus(GENPC_ELVEN) || you.species == SP_MERFOLK) ?+ WPN_QUARTERSTAFF : WPN_MACE);+ } _newgame_make_item(1, EQ_BODY_ARMOUR, OBJ_ARMOUR, ARM_ROBE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [4188] trunk/crawl-ref

From: <pau...@us...> - 2008-04-11 09:05:58

Revision: 4188 Author: paulduboisDate: 2008-04-11 02:05:54 -0700 (Fri, 11 Apr 2008)Log Message:-----------put club in default fire_orderModified Paths:-------------- trunk/crawl-ref/init.txt trunk/crawl-ref/source/initfile.ccModified: trunk/crawl-ref/init.txt===================================================================--- trunk/crawl-ref/init.txt2008-04-11 05:16:15 UTC (rev 4187)+++ trunk/crawl-ref/init.txt2008-04-11 09:05:54 UTC (rev 4188)@@ -254,7 +254,7 @@ # # fire_items_start = a # fire_order = launcher, return-# fire_order += javelin / dart / stone / rock / spear / net / handaxe / dagger+# fire_order += javelin / dart / stone / rock / spear / net / handaxe / dagger / club # fire_order += inscribed # fire_quiver_best = true Modified: trunk/crawl-ref/source/initfile.cc===================================================================--- trunk/crawl-ref/source/initfile.cc2008-04-11 05:16:15 UTC (rev 4187)+++ trunk/crawl-ref/source/initfile.cc2008-04-11 09:05:54 UTC (rev 4188)@@ -773,7 +773,7 @@ // Clear fire_order and set up the defaults. set_fire_order("launcher, return, " "javelin / dart / stone / rock /"- " spear / net / handaxe / dagger, inscribed",+ " spear / net / handaxe / dagger / club, inscribed", false); item_stack_summary_minimum = 5;This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [4550] trunk/crawl-ref

From: <dp...@us...> - 2008-04-23 17:20:55

Revision: 4550 Author: dploogDate: 2008-04-23 10:18:40 -0700 (Wed, 23 Apr 2008)Log Message:-----------Moved travel_stop_message options into a separate file (which isdocs/travel_stoppers.txt for now). Files supposed to be included in the init.txt need their own folder at some stage. Adding to the list of travel_stoppers is welcome.Modified Paths:-------------- trunk/crawl-ref/init.txtAdded Paths:----------- trunk/crawl-ref/docs/travel_stoppers.txtAdded: trunk/crawl-ref/docs/travel_stoppers.txt===================================================================--- trunk/crawl-ref/docs/travel_stoppers.txt (rev 0)+++ trunk/crawl-ref/docs/travel_stoppers.txt2008-04-23 17:18:40 UTC (rev 4550)@@ -0,0 +1,25 @@+stop := travel_stop_message++# God channel+#+# By default, all god messages stop autotravel.+# You can use a different scheme by commenting in/out.+stop = god:.*+# stop = Something appears+# stop = god:wrath finds you++# Expiring spells+#+stop = Your icy armour evaporates+stop = You feel less protected from missiles+stop = falls from the air++# Traps+#+stop = found a trap+stop = You have blundered into a Zot trap+stop = Wait a moment++# Ailments+#+stop = flesh startModified: trunk/crawl-ref/init.txt===================================================================--- trunk/crawl-ref/init.txt2008-04-23 16:53:23 UTC (rev 4549)+++ trunk/crawl-ref/init.txt2008-04-23 17:18:40 UTC (rev 4550)@@ -166,8 +166,6 @@ # The following options are not default. #-travel_stop_message = Something appears-travel_stop_message = god:wrath finds you runrest_ignore_message = prayer ends runrest_ignore_message = You feel.*sick runrest_ignore_message = disappears in a puff of smoke@@ -178,8 +176,13 @@ runrest_ignore_monster = fish:2 runrest_ignore_monster = butterfly:1 # runrest_ignore_monster = swamp worm:3+ trapwalk_safe_hp = dart:20,needle:15,arrow:35,bolt:45,spear:40,axe:45,blade:95 +# You can use the travel_stop_message for making autotravel better behaved.+# The following file contains a list of such options, with explanations.+: crawl.read_options('docs/travel_stoppers.txt')+ ##### 4-hStashes ############################### # # stash_tracking = (all | explicit | dropped)This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [5257] trunk/crawl-ref

From: <j-...@us...> - 2008-05-26 15:55:55

Revision: 5257 Author: j-p-e-gDate: 2008-05-26 08:55:52 -0700 (Mon, 26 May 2008)Log Message:-----------Clean up the change log a bit, and modify the monster speech documentation.Modified Paths:-------------- trunk/crawl-ref/docs/changes.stone_soup trunk/crawl-ref/docs/monster_speech.txt trunk/crawl-ref/docs/options_guide.txt trunk/crawl-ref/init.txt trunk/crawl-ref/source/command.ccModified: trunk/crawl-ref/docs/changes.stone_soup===================================================================--- trunk/crawl-ref/docs/changes.stone_soup2008-05-26 15:30:07 UTC (rev 5256)+++ trunk/crawl-ref/docs/changes.stone_soup2008-05-26 15:55:52 UTC (rev 5257)@@ -9,11 +9,12 @@ --------- * Overhauled key settings of a number of commands. (See /docs/034_commands.txt.) * Added monster list for monsters in LOS (for big consoles, ASCII only).-* Overhauled (f)iring interface, abolish (t)hrowing, output quiver in status.+* Overhauled (f)iring interface: abolish (t)hrowing, output quiver in status. * Allow selection of equipment slots from '%' overview screen. * Improved butchering interface. * Allow searching item/monster/spell descriptions ('?\' command). * Allow swapping (' command) to non-weapons that need to be wielded for spells.+* Fixed weapon swap ignoring {!w}. * Added Ctrl-D as a synonym for '~' (defining macros). * Added commands for repeating commands ('`' and '0'). * Added command to annotate level ('!' command).@@ -21,13 +22,9 @@ * Ask for confirmation before stepping into dangerous clouds, or traps. * Allow autotravel through clouds your character is immune to. * Prompt when firing through allies, or doing a ranged attack TSO would punish.+* Make butchering respect distortion weapons. * (W)ear and (P)ut on menus allow removal of equipped items.-* easy_butcher won't switch away from distortion weapons.-* Distortion effect now cancels butchering.-* Fixed weapon swap ignoring {!w}.-* Added inscriptions =p, !p for preventing autosaccing. * Arriving via stairs calls autopickup and lists items on square.-* Output item slots for rotting meat message. * Refuse to eat rotten meat for non-saprovorous characters. * Evaporate can now be cancelled during potion/direction choice. * greedy_explore now defaults to true.@@ -51,17 +48,17 @@ * Added +1 damage bonus for orcs and dwarves throwing racial gear. * Fixed undead being unable to smite. * Necromutation now gives torment resistance again.-* When transforming only remove armour you can't wear when transformed.+* When transforming only remove armour you can't wear while transformed. * Improve Priests' starting weapons. Items ----- * Removed weapons of disruption, improved holy wrath. * New weapon brand: dragon slaying, limited to Polearms.-* Disable random generation of weapons of orc slaying (allowed in randarts).-* Allow random generation of throwing nets.+* Forbid (un)equipping of items with known potentially fatal stat drain. * Make distortion only take effect on unwielding. * Improved autotargeting for weapons of reaching.+* Disable random generation of weapons of orc slaying (allowed in randarts). * Fixed cap acquirement misbehaviour. * New scrolls: Holy Word, Fog. * Removed scrolls of forgetfulness.@@ -73,7 +70,6 @@ * Manuals are now visibly different from spell books. * Improved artefact autoinscriptions. * Several new pre-defined (un)randarts.-* Warn before putting on items of potentially fatal stat drain. * Added message for returning weapons NOT returning. * Equipped randarts can now actually cause berserk. * Thrown potions of poison won't poison monsters anymore.@@ -84,20 +80,21 @@ Monsters -------- * New glyphs and colours for many monsters. (See /docs/034_monster_glyphs.txt.)-* Ghosts get freezing cloud. * Draconian ghosts of xl >= 7 get the shadow dragon breath attack.+* Ghosts get freezing cloud.+* Mummy curses now only decay a random amount of a stack of potions. * Angels and Daevas may appear randomly in the Abyss. * Holy monsters may turn neutral if the player follows a good god.-* Unknown mimics are now consistently treated like items. * Beefed up demon lords.-* Mummy curses now only decay a random amount of a stack of potions.-* Began changing monster resists to have several levels, like the player's.+* Unknown mimics are now consistently treated like items.+* Changed monster resists to have several levels, like the player's. * Removed electricity resistance from several monsters. * Daevas now resist negative energy. * Fixed Oklob plants being confuseable. * Lee's Rapid Deconstruction now works against skeletal dragons. * Changed evil/holiness/intelligence flags for a number of monsters. * Improved trap handling for intelligent monsters.+* Improved control over friendly monsters. * Smarter pickup handling. * Fixed friendlies accidentally shooting the player. * Fixed monsters firing/reaching through walls.@@ -127,24 +124,21 @@ * Removed amnesia traps. * Introduced shafts. * Added blood spattering.-* Allow for fountains of blood in vault generation. Tiles ------* Merged Tiles into Crawl code. +* Merged Tiles into Crawl code. * Save files between tile and non-tile games are compatible. * Added lots of new tiles, and corrected misdisplayed ones. * wininit.txt is now autocreated, if missing. * Tutorial improvement for tiles. * Improved mouse-click inventory/dungeon interaction. * Show travel exclusion in tile map and mini-map.-* Added MP colour bar. * Fixed ghosts changing icons between saves.-* Fixed Detect creatures revealing exact monster type. +* Fixed Detect creatures revealing exact monster type. * Mimics posing as autopickable items now get marked as such. * Clicking on items now respects warning inscriptions. * Added item brand for plants.-* Added '0' significator for empty wands. * General improvement. Miscellaneous@@ -154,6 +148,7 @@ * Train Traps & Doors by setting off traps. * Increase cost for self-banishment, and nerf Banishment spell. * Better feedback on Detect Traps.+* Added MP colour bar. * Identify post-mortem inventory in morgue.txt. * Dump command also dumps level map. * init.txt/crawlrc allow loading of external options/macro files.Modified: trunk/crawl-ref/docs/monster_speech.txt===================================================================--- trunk/crawl-ref/docs/monster_speech.txt2008-05-26 15:30:07 UTC (rev 5256)+++ trunk/crawl-ref/docs/monster_speech.txt2008-05-26 15:55:52 UTC (rev 5257)@@ -2,15 +2,15 @@ ======== As of Dungeon Crawl Stone Soup 0.3 the previously hard-coded monster-speech has been outsourced by Matthew Cline. This makes changing -existing messages, or adding new ones really easy. This file will-hopefully help you in this endeavour.+speech has been outsourced. This makes changing existing messages,+or adding new ones really easy. This file will hopefully help you in+this endeavour. The outsourced messages are used to create two databases out of which-Crawl randomly draws the necessary speech text. +Crawl randomly draws the necessary speech text. -* shout.db (handling speech when monsters first notice you), and -* speak.db (for all other cases). +* shout.db (handling speech when monsters first notice you), and+* speak.db (for all other cases). Because of the amount of definitions necessary, they have been divided over a number of different files.@@ -18,25 +18,25 @@ The shout database is constructed from the following two files: * shout.txt handles message output for monsters noticing you-* insult.txt handles insults thrown at you by imps and demons +* insult.txt handles insults thrown at you by imps and demons The speak database contains messages defined in these files: * monspeak.txt handles messages for monsters communicating with you * wpnnoise.txt handles randart weapons with the noises property-* godspeak.txt handles randomized speech by the gods, as well as +* godspeak.txt handles randomized speech by the gods, as well as speech used for some divine abilities * insult.txt Same file as above. -The messages defined in insult.txt form a part of both databases. -Apart from that, keywords and statements defined for one database -cannot be automatically accessed from the other. Rather, they have to +The messages defined in insult.txt form a part of both databases.+Apart from that, keywords and statements defined for one database+cannot be automatically accessed from the other. Rather, they have to be defined a second time. Whenever Dungeon Crawl is started, the game checks whether any of the databases needs to be updated. If one of the underlying files has been-changed since the last check, the database is automatically rerolled. -That means that if you'd like to change one of the descriptions or add +changed since the last check, the database is automatically rerolled.+That means that if you'd like to change one of the descriptions or add some new monster speech all you have to do is modify the file, save, and restart the game to test your changes. @@ -54,12 +54,12 @@ A. Monster speech probabilities ================================ -Not all monsters are equally likely to speak. Rather there are +Not all monsters are equally likely to speak. Rather there are different chances involved, depending on several attributes, and most of the time the database lookup stage isn't even reached. -First, the player will only ever hear monsters speak if they are in -line of sight, and monsters will only ever speak if they are not +First, the player will only ever hear monsters speak if they are in+line of sight, and monsters will only ever speak if they are not asleep, not submerged in water, air or lava, and not wandering around aimlessly (unless neutral). @@ -78,10 +78,10 @@ Chances are again doubled if this non-humanoid monster is fleeing, and doubled again if confused. -Neutral monsters only speak half as often, and for charmed monsters -the probability is divided by 3. The same applies to silenced -monsters, i.e. monsters that are not naturally silent will only get to -even attempt to speak in one out of three tries where the above +Neutral monsters only speak half as often, and for charmed monsters+the probability is divided by 3. The same applies to silenced+monsters, i.e. monsters that are not naturally silent will only get to+even attempt to speak in one out of three tries where the above chances hold. Note that the definition of which monsters are capable of speech is@@ -129,8 +129,8 @@ friendly '5' The first non-comment, non-blank line is interpreted as the key of an-entry. Many keys are hardcoded, but there's place for user defined -ones as well. More on that later, though. +entry. Many keys are hardcoded, but there's place for user defined+ones as well. More on that later, though. In this case, the key is "friendly '5'". '5' refers to the monster glyph, so the speech will not be entirely@@ -183,7 +183,7 @@ speech from "hostile" or "neutral". All prefixes are optional and tested in the following order: - default <attitude> fleeing silenced confused [related] <player god> + default <attitude> fleeing silenced confused [related] <player god> where <attitude> can be any of friendly, neutral or hostile. Note that the game generally treats neutral monsters like hostiles since they@@ -191,7 +191,7 @@ The prefix "related" is added if the player and the monster share the same genus, e.g. if you're playing a Sludge Elf, and the monster in-question is a deep elf blademaster, you both are Elves and the monster+question is a deep elf blademaster, you both are elves and the monster speech may reflect that. It's currently only used for friendly humanoids who will now sometimes mention that you're family, if you are. Stupid monsters, i.e. animals, will judge your relatedness status@@ -206,9 +206,9 @@ added to the list, though not for charmed orcs who will simply use the generic friendly statements instead of the orcish followers' cheers. If you worship one of the good gods instead (Zin, The Shining One, or-Elyvilon) the prefix "good god" is used. Conversely, worshippers of +Elyvilon) the prefix "good god" is used. Conversely, worshippers of one of the evil gods (Yredelemnul, Makhleb, Kikubaaqudgha, Lugonu, or-Beogh) will use the prefix "evil god". +Beogh) will use the prefix "evil god". This allows fine-grained handling of monsters depending on your character's religion status, e.g. orcs will use special speech for@@ -217,7 +217,7 @@ demons will attempt to slander the good gods. Once the entire set of prefixes has been determined, we only need-to add the monster name and start the database search. +to add the monster name and start the database search. First we search for the complete prefix string in combination with the monster name. Then we try omitting some very specific prefixes that@@ -236,16 +236,16 @@ In practice this means that database keys starting with "default" are the fallback solution if the exact look-up has failed. As such, the-messages should be generic enough to allow for all the possibly -skipped prefixes, or else those cases should be caught earlier, e.g. -if you have "default friendly humanoid", you should also define -"default friendly fleeing humanoid" and "default friendly confused -humanoid" (and possibly both combined) even if only with "__NONE" -(stay silent), as the general friendly messages may look odd for a +messages should be generic enough to allow for all the possibly+skipped prefixes, or else those cases should be caught earlier, e.g.+if you have "default friendly humanoid", you should also define+"default friendly fleeing humanoid" and "default friendly confused+humanoid" (and possibly both combined) even if only with "__NONE"+(stay silent), as the general friendly messages may look odd for a monster such afflicted. Only keys that match a search string perfectly (ignoring case) will-be used. Once all prefixes have been exhausted and still no match has +be used. Once all prefixes have been exhausted and still no match has been found, the database lookup will try for a more general monster description. There are several possible ways this is attempted, in the following order:@@ -263,19 +263,19 @@ latter is entirely hardcoded, though. Examples: "default winged insect", "default confused humanoid" -If you are playing with tiles, you may not know the monster glyphs, -but internally the monsters are still treated the same, and even under -tiles, the glyph keys used for step 3 are entirely valid. In case you -need to know the monster glyphs for your speech definitions you'll -find a list of monster glyphs at the end of this file. Also, for many -monsters you can find out their glyph in-game by searching the -database ('?/') and entering a vague enough monster name. For example, +If you are playing with tiles, you may not know the monster glyphs,+but internally the monsters are still treated the same, and even under+tiles, the glyph keys used for step 3 are entirely valid. In case you+need to know the monster glyphs for your speech definitions you'll+find a list of monster glyphs at the end of this file. Also, for many+monsters you can find out their glyph in-game by searching the+database ('?/') and entering a vague enough monster name. For example, entering "drac" will tell you that all draconians use the symbol 'd'. Note that changing monster glyphs using the mon_glyph option may also affect speech of this kind. -For the last round (shape comparison, e.g. winged humanoid)+For the last round (shape comparison, e.g. "winged humanoid") occasionally an additional intelligence estimate ("stupid", "smart") is prefixed to the search string, depending on the monster type, e.g. a "stupid humanoid" may still be smarter than a "smart arachnid".@@ -299,7 +299,7 @@ Example 1: The monster we want to make "speak" is a "confused killer bee". - However, such an entry cannot be found in the database, so the game + However, such an entry cannot be found in the database, so the game tries first for "default confused killer bee", then "default killer bee", neither of which yields any results. The monster genus is also plain "killer bee", so that doesn't help@@ -318,11 +318,11 @@ wizard". This obviously made up example also has no direct equivalent in the- database, so first we try to remove the less important prefixes, in + database, so first we try to remove the less important prefixes, in this case "related" and "beogh". Unfortunately, none of "friendly fleeing related orc wizard", "friendly fleeing beogh orc wizard", or "friendly fleeing orc wizard" has any corresponding entry in the- database, so that we now check for "default" in combination with, + database, so that we now check for "default" in combination with, one after another, all combinations of three or less prefixes. Three prefixes: "default friendly fleeing related orc wizard",@@ -338,24 +338,24 @@ One prefix: "default friendly orc wizard", "default fleeing orc wizard", "default related orc wizard", "default beogh orc wizard". - No prefix: "default orc wizard". + No prefix: "default orc wizard". Sadly, none of these is successful. The genus of orc wizards is- "orc", so we retry the above using "orc" instead of "orc wizard". + "orc", so we retry the above using "orc" instead of "orc wizard". The same is repeated for "friendly fleeing beogh 'o'", and we still haven't found anything. This is starting to get ridiculous, so it's time for desperate- measures: + measures: - With the help of some rather complicated functions the game works + With the help of some rather complicated functions the game works out that orcs can be described as humanoids of average intelligence. Thus, in a final attempt of making this orc wizard speak, we search- the database for "friendly fleeing related beogh humanoid", - something that, not surprisingly (since Beogh and humanoid don't go - well together), doesn't exist. Annoyingly enough, neither do the - variants "friendly fleeing related humanoid", "friendly fleeing - beogh humanoid" or even "friendly fleeing humanoid". + the database for "friendly fleeing related beogh humanoid",+ something that, not surprisingly (since Beogh and humanoid don't go+ well together), doesn't exist. Annoyingly enough, neither do the+ variants "friendly fleeing related humanoid", "friendly fleeing+ beogh humanoid" or even "friendly fleeing humanoid". Still, we haven't yet tried the prefix combinations: "default friendly fleeing related humanoid" is still unsuccessful, as@@ -381,15 +381,22 @@ Weapon speech -------------- For obvious reasons, weapon noises get by without any such prefixes, and the only hardcoded keywords are "noisy weapon" for weapons with the noises property, and "singing sword" for (who'd have guessed?) the Singing Sword. +Special monster speech+----------------------+Rarely, monster speech will also rely on hard-coded keys, such as+Boris' "return_speech". If such a hard-coded key is changed or removed,+the speech in question will simply not be printed. This may look odd in+the game, but will have no other effect. Sometimes, default messages+will be output instead.+ God speech -----------The keys used to search for god speech are entirely hard-coded, though +The keys used to search for god speech are entirely hard-coded, though some local synonyms have been defined as well. Hopefully, the comments will explain what the different speech messages are used for. @@ -421,8 +428,8 @@ surrounded by @@. These variables may be defined by entries in shout.txt for the shouting database, or monspeak.txt or one of the other files for the speech database, in which case they are replaced-with a random value from the entry; or they may have hardcoded-expansions defined by the game.+with a random value from the entry in question; or they may have+hardcoded expansions defined by the game. Note that variable replacement is recursive, so be careful to avoid infinite loops. Though the game will abort after a number of@@ -442,16 +449,16 @@ @a_something@ : similar @the_something@ : similar @player_name@ : Player name.-@player_species@: Player base species, with Draconian rather than the +@player_species@: Player base species, with Draconian rather than the actual subtype. @player_genus@ : Player genus, i.e. "Elf" rather than the exact type, or "Ogre" instead of "Ogre-Mage". @player_genus_plural@ : pluralised genus form. @player_god@ : Player's god name, or "you" if non-religious. @Player_god@ : Player's god name, or "You" if non-religious.-@god_is@ : replaced with "<god name> is" or "you are", if +@god_is@ : replaced with "<god name> is" or "you are", if non-religious.-@God_is@ : replaced with "<god name> is" or "You are", if +@God_is@ : replaced with "<god name> is" or "You are", if non-religious. @surface@ : Whatever the monster is standing on. @feature@ : The monster's square's feature description.@@ -485,10 +492,10 @@ @the_weapon@, @Your_weapon@, @your_weapon@ and @weapon@ which will get replaced by "The (weapon name)", "the (weapon name)", "Your (weapon name)", "your (weapon name)", and the plain weapon name,-respectively. +respectively. -Note that the Singing Sword, being unique, cannot be referred to by -the possessive variants, so they will be replaced with the appropriate +Note that the Singing Sword, being unique, cannot be referred to by+the possessive variants, so they will be replaced with the appropriate definite article ones. Examples of pre-defined variables in the database include@@ -544,16 +551,16 @@ VISUAL SPELL : MSGCH_MONSTER_SPELL VISUAL WARN : MSGCH_WARN -Note, though, that these only will take effect if a VISUAL message -just happens to be chosen. As stated above, the database search -doesn't really care whether a monster is supposed to be silent, so it -may pick any noisy monster speech, but the message output will care -and refuse to print such nonsense, so that in this case the monster -will actually stay silent after all. +Note, though, that these only will take effect if a VISUAL message+just happens to be chosen. As stated above, the database search+doesn't really care whether a monster is supposed to be silent, so it+may pick any noisy monster speech, but the message output will care+and refuse to print such nonsense, so that in this case the monster+will actually stay silent after all. -All in all, chances of silent "speech" are lower (as is intended) but-only VISUAL messages even have a chance to be printed under these -circ*mstances.+To summarize, chances of silent "speech" are overall lower (as is+intended) but only VISUAL messages even have a chance to be printed+under these circ*mstances. As explained earlier, "silenced" is one of the prefixes that are regarded as "less important" and can be ignored in the exact string@@ -578,7 +585,7 @@ ... - none of which, if chosen, would actually be printed, but luckily the + none of which, if chosen, would actually be printed, but luckily the "Killer Klown" entry also contains VISUAL statements like the following: @@ -593,7 +600,7 @@ If one of these is chosen, we get a non-verbal "speech" statement of this silenced monster. - However, what happens if the other 50% take effect and we will *not* + However, what happens if the other 50% take effect and we will *not* ignore the "silenced" prefix? In this case, we'll simply continue like in the earlier examples above, get no results for either of "default silenced Killer Klown" or "default Killer Klown", and try@@ -621,11 +628,15 @@ For shouts the default channel is also MSGCH_TALK, which is automatically changed to MSGCH_TALK_VISUAL for monsters that can't-speak (animals, usually), and manually set to MSGCH_SOUND for all +speak (animals, usually), and manually set to MSGCH_SOUND for all those variants of "You hear a shout!" +Monster spells and enchantments will only interrupt resting/running+if done by a non-friendly creature, and, as stated above, messages+passed through the TALK or SOUND channels never will.+ For weapon noises only a subset of the above is relevant, as anything-including VISUAL and the channel keys SPELL and ENCHANT are considered+including VISUAL and the channel keys SPELL and ENCHANT is considered invalid and will trigger a default message instead. Again, the default channel is MSGCH_TALK. @@ -653,10 +664,10 @@ ======================== Get a version of Stone Soup that contains WIZARD mode. You can check-whether this is the case by pressing '&' during the game. If you are-told that this is an "unknown command" (likely, since WIZARD builds-are generally not distributed), you will have to compile the game for-yourself.+whether this is the case by reading the in-game version information+('?v'). If Wizard mode is not listed among the included features+(likely, since WIZARD builds are generally not distributed), you will+have to compile the game for yourself. To build Crawl yourself, download the source code from the Crawl homepage [1] and read the "INSTALL" file in the main directory for@@ -664,11 +675,11 @@ documentation and checking the archives of the Crawl newsgroup [2], ask away! -If you have WIZARD mode compiled in, you can simply answer "yes" to-the safety question resulting from pressing '&', and then test to your-heart's content. Pressing '&' followed by a number of other keys will-execute wizard mode commands that are all listed in the wizard help-menu (press '&?').+If you have WIZARD mode compiled in, you can access special wizard+commands by pressing '&'. First answer "yes" to the safety question+and then you can test to your heart's content. Pressing '&' followed+by a number of other keys will execute wizard mode commands that are+all listed in the wizard help menu (press '&?'). In particular, you can create a monster with '&M', and enforce behaviour on a monster by examining it (with 'x', as usual). In wizard@@ -676,8 +687,8 @@ (make monster friendly/neutral/hostile) and 's' (make monster shout). These last two are of particular interest to monster speech designers. -Also, the Singing Sword and all other hardcoded artefacts can be -created with '&|'. The Elemental Staff and the spear of Voo-Doo are +Also, the Singing Sword and all other hardcoded artefacts can be+created with '&|'. The Elemental Staff and the spear of Voo-Doo are examples of noisy weapons. You can also temporarily increase the likelihood of a given message by@@ -685,19 +696,19 @@ temporarily push it into another channel (e.g. MSGCH_WARN) to make it more noticeable. -If you successfully got Crawl compiled, you can easily enable more -detailed debug information. All you need to do is add +If you successfully got Crawl compiled, you can easily enable more+detailed debug information. All you need to do is add #define DEBUG_MONSPEAK somewhere in AppHdr.h, for example at the beginning of the section entitled "Debugging Defines", and then compile the game anew, first-using "make clean", then "make wizard". -If you play with DEBUG_MONSPEAK compiled in, whenever the game is -searching the monspeak database you'll get extensive information on -all keys and prefixes tried. Once you're done testing don't forget to +using "make clean", then "make wizard".+If you play with DEBUG_MONSPEAK compiled in, whenever the game is+searching the monspeak database you'll get extensive information on+all keys and prefixes tried. Once you're done testing don't forget to remove (or comment out) the DEBUG_MONSPEAK setting as trying to-actually play that way would sure be annoying. +actually play that way would sure be annoying. F. Publishing your changes@@ -713,9 +724,9 @@ http://sourceforge.net/projects/crawl-ref .. [2] rec.games.roguelike.misc- Since this newsgroup is being shared with a number of other - roguelike games, it is generally considered polite to flag - subjects of posts pertaining only to Crawl with "-crawl-" or + Since this newsgroup is being shared with a number of other+ roguelike games, it is generally considered polite to flag+ subjects of posts pertaining only to Crawl with "-crawl-" or a similar marker. @@ -735,14 +746,14 @@ and hogs (hog, hell-hog) j snails: elephant slug, giant slug, giant snail k winged insects: killer bee, bumblebee-l lizards (giant newt/gecko/iguana/lizard, gila monster, komodo - dragon), and drakes (swamp drake, firedrake, death drake, - lindwurm)+l lizards (giant newt/gecko/iguana/lizard, gila monster, komodo+ dragon),+ and drakes (swamp drake, firedrake, death drake, lindwurm) n ghouls: necrophage, ghoul, rotting hulk o all orcs p all ghosts, phantom, and insubstantial wisp r all rodents (rats of all colours, and quokka)-s arachnides (giant mite, giant centipede, scorpion, wolf spider, +s arachnides (giant mite, giant centipede, scorpion, wolf spider, redback) t minotaur u (very) ugly thing@@ -764,7 +775,7 @@ G all eyes, giant spore, and giant orange brain H hippogriff, manticore, griffon, and sphinx I ice beast-J all jellies, oozes, and slime creature, pulsating lump, +J all jellies, oozes, and slime creature, pulsating lump, giant amoeba, jellyfish, and acid blob K all kobolds L all liches@@ -787,10 +798,10 @@ -------- 1 all Fiends, Executioner, Blue/Green Death, Balrug, Cacodemon 2 sun demon, reaper, soul eater, ice devil, and Lorocyproca-3 hellion, tormentor, blue/iron devil, neqoxec, orange/shadow demon, +3 hellion, tormentor, blue/iron devil, neqoxec, orange/shadow demon, hellwing, ynoxinul, and demonic crawler 4 red/rotting/hairy devil, beast, and smoke demon-5 all imps, and other minor demons (quasit, lemure, ufetubus, manes, +5 all imps, and other minor demons (quasit, lemure, ufetubus, manes, midge) 8 all golems, and living statues 9 all gargoylesModified: trunk/crawl-ref/docs/options_guide.txt===================================================================--- trunk/crawl-ref/docs/options_guide.txt2008-05-26 15:30:07 UTC (rev 5256)+++ trunk/crawl-ref/docs/options_guide.txt2008-05-26 15:55:52 UTC (rev 5257)@@ -433,7 +433,7 @@ (This is the old friendly pick up behaviour.) friend = They will pick up anything they or another ally dropped, e.g. if another ally dies.- (This is the default value.)+ (This is the default setting.) all = They will pick up anything they want to have. (This is how it works for hostile monsters.) @@ -441,11 +441,11 @@ when you start a new game, or when you enter a level for the first time. - Note that this only works for permanent allies (such as you can- get when worshipping Beogh or the Shining One), and that monsters- have their own reasonings for which items they may need, and when- they feel safe enough to pick them up. Except for "none", these - options won't let you override these restrictions.+ Note that this only works for intelligent permanent allies (such+ as you can get when worshipping Beogh or the Shining One), and+ that monsters have their own reasonings for which items they may+ need, and when they feel safe enough to pick them up. Except for+ "none", these options won't let you override these requirements. Also, friendly jellies won't ever eat any items, regardless of this option. Modified: trunk/crawl-ref/init.txt===================================================================--- trunk/crawl-ref/init.txt2008-05-26 15:30:07 UTC (rev 5256)+++ trunk/crawl-ref/init.txt2008-05-26 15:55:52 UTC (rev 5257)@@ -6,6 +6,7 @@ # monster colours, command keys, order on the character selection screen, # item colours, appearance of the stat section, butchering interface, # targeting interface. +# The options for monster glyphs and item colours don't matter for Tiles. # (New players should just ignore these lines.) # # include docs/034_monster_glyphs.txtModified: trunk/crawl-ref/source/command.cc===================================================================--- trunk/crawl-ref/source/command.cc2008-05-26 15:30:07 UTC (rev 5256)+++ trunk/crawl-ref/source/command.cc2008-05-26 15:55:52 UTC (rev 5257)@@ -654,10 +654,10 @@ #ifdef WIZARD " \n" "<h>Wizard targeting comands:</h>\n"- "<w>F</w>: toggle target friendly/good neutral/neutral/hostile\n"- "<w>P</w>: apply divine blessing to target\n"- "<w>s</w>: force target to shout or speak\n" "<w>g</w>: give item to monster\n"+ "<w>s</w>: force monster to shout or speak\n"+ "<w>F</w>: cycle monster friendly/good neutral/neutral/hostile\n"+ "<w>P</w>: apply divine blessing to monster\n" #endif ; @@ -1681,7 +1681,7 @@ "<w>X</w> : eXamine level map\n" "<w>Ctrl-O</w> : show dungeon Overview\n" "<w>Ctrl-A</w> : toggle auto-pickup\n"- "<w>Ctrl-T</w> : toggle ally pickup behaviour\n",+ "<w>Ctrl-T</w> : change ally pickup behaviour\n", true, true, _cmdhelp_textfilter); cols.add_formatted(This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [5259] trunk/crawl-ref

From: <dp...@us...> - 2008-05-26 17:23:44

Revision: 5259 Author: dploogDate: 2008-05-26 10:23:37 -0700 (Mon, 26 May 2008)Log Message:-----------Moved travel_stoppers.txt to settings folder.Added Paths:----------- trunk/crawl-ref/settings/travel_stoppers.txtRemoved Paths:------------- trunk/crawl-ref/docs/travel_stoppers.txtDeleted: trunk/crawl-ref/docs/travel_stoppers.txt===================================================================--- trunk/crawl-ref/docs/travel_stoppers.txt2008-05-26 16:36:43 UTC (rev 5258)+++ trunk/crawl-ref/docs/travel_stoppers.txt2008-05-26 17:23:37 UTC (rev 5259)@@ -1,26 +0,0 @@-stop := travel_stop_message--# God channel-#-# By default, all god messages stop autotravel.-# You can use a different scheme by commenting in/out.-stop = god:.*-# stop = Something appears-# stop = god:wrath finds you--# Expiring spells-#-stop = Your icy armour evaporates-stop = You feel less protected from missiles-stop = falls from the air--# Traps-#-stop = found a trap-stop = You have blundered into a Zot trap-stop = Wait a moment-stop = You fall through a shaft--# Ailments-#-stop = flesh startCopied: trunk/crawl-ref/settings/travel_stoppers.txt (from rev 5258, trunk/crawl-ref/docs/travel_stoppers.txt)===================================================================--- trunk/crawl-ref/settings/travel_stoppers.txt (rev 0)+++ trunk/crawl-ref/settings/travel_stoppers.txt2008-05-26 17:23:37 UTC (rev 5259)@@ -0,0 +1,26 @@+stop := travel_stop_message++# God channel+#+# By default, all god messages stop autotravel.+# You can use a different scheme by commenting in/out.+stop = god:.*+# stop = Something appears+# stop = god:wrath finds you++# Expiring spells+#+stop = Your icy armour evaporates+stop = You feel less protected from missiles+stop = falls from the air++# Traps+#+stop = found a trap+stop = You have blundered into a Zot trap+stop = Wait a moment+stop = You fall through a shaft++# Ailments+#+stop = flesh startThis was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [5302] trunk/crawl-ref

From: <dol...@us...> - 2008-05-28 00:58:37

Revision: 5302 Author: dolorousDate: 2008-05-27 17:58:34 -0700 (Tue, 27 May 2008)Log Message:-----------Add minor cosmetic fixes.Modified Paths:-------------- trunk/crawl-ref/docs/crawl_manual.txt trunk/crawl-ref/source/dat/descript/branches.txtModified: trunk/crawl-ref/docs/crawl_manual.txt===================================================================--- trunk/crawl-ref/docs/crawl_manual.txt2008-05-27 23:55:37 UTC (rev 5301)+++ trunk/crawl-ref/docs/crawl_manual.txt2008-05-28 00:58:34 UTC (rev 5302)@@ -329,6 +329,7 @@ command. They can be closed with the 'C' command. Pressing Ctrl plus a direction, or '*', followed by a direction, will open/close doors, too.+ If there is no door in the indicated space, both Ctrl-direction and * direction will attempt to attack any monster which may be standing there (this is the only way to attack a friendly creature hand-to-hand). If Modified: trunk/crawl-ref/source/dat/descript/branches.txt===================================================================--- trunk/crawl-ref/source/dat/descript/branches.txt2008-05-27 23:55:37 UTC (rev 5301)+++ trunk/crawl-ref/source/dat/descript/branches.txt2008-05-28 00:58:34 UTC (rev 5302)@@ -65,7 +65,7 @@ Once upon a time, all the daggers and axes and polearms would gather at the time of night and dance the waltz, dreaming of battlefields void of man and-beast. That time is no more yet the weapons are still there.+beast. That time is no more, yet the weapons are still there. %%%% Crypt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [5374] trunk/crawl-ref

From: <j-...@us...> - 2008-05-31 17:59:04

Revision: 5374 Author: j-p-e-gDate: 2008-05-31 10:59:01 -0700 (Sat, 31 May 2008)Log Message:-----------Remove commented out code, and document my changes.Also change merfolk fighter -> merfolk in the database.Modified Paths:-------------- trunk/crawl-ref/docs/options_guide.txt trunk/crawl-ref/source/dat/descript/monsters.txt trunk/crawl-ref/source/invent.ccModified: trunk/crawl-ref/docs/options_guide.txt===================================================================--- trunk/crawl-ref/docs/options_guide.txt2008-05-31 17:44:23 UTC (rev 5373)+++ trunk/crawl-ref/docs/options_guide.txt2008-05-31 17:59:01 UTC (rev 5374)@@ -713,7 +713,7 @@ greedy_items: stop when items that are eligible for autopickup come into view.- + greedy_pickup: stop when you arrive at a square which contains an item eligble for autopickup. @@ -1150,13 +1150,26 @@ spell (the Z and I screens) stash (the results from Ctrl-F) + Crawl has a couple of prefixes defined to make inventory colouring+ easier. These are:+ inedible (you cannot eat this or get no nutrition from it)+ poisonous (chunks/corpses that are poisonous)+ mutagenic (chunks/corpses that are mutagenic)+ contaminated (chunks/corpses that may cause sickness, but+ ignored for Kobolds, Ogres, Trolls, and Ghouls)+ rot-inducing (chunks/corpses that cause rotting)+ equipped (equipped items)+ artefact (item is an artefact, whether identified or not)+ To colour worn stuff and highlight cursed items, take- menu_colour = inventory:lightred: cursed.*(worn|neck|hand|weapon)- menu_colour = inventory:green:(worn|neck|hand|weapon)+ menu_colour = inventory:lightred:equipped.* cursed+ menu_colour = inventory:green:equipped menu_colour = inventory:red: cursed To colour identified artefacts, try menu_colour = inventory:white:( [-+] the)+ or, if menu_colour_prefix_id is true,+ menu_colour = inventory:white:identified.*artefact If you frequently die because you forget to use emergency items, tryModified: trunk/crawl-ref/source/dat/descript/monsters.txt===================================================================--- trunk/crawl-ref/source/dat/descript/monsters.txt2008-05-31 17:44:23 UTC (rev 5373)+++ trunk/crawl-ref/source/dat/descript/monsters.txt2008-05-31 17:59:01 UTC (rev 5374)@@ -1265,7 +1265,7 @@ "Ctesias writeth, that in Aethiopia likewise there is a beast which he calleth Mantichora, having three rankes of teeth, which when they meet togither are let in one within another like the teeth of combes: with the face and eares of a man, with red eyes; of colour sanguine, bodied like a lyon, and having a taile armed with a sting like a scorpion: his voice resembleth the noise of a flute and trumpet sounded together: very swift he is, and mans flesh of all others hee most desireth." -Pliny the Elder, _Natural History_, Book 8, Chapter XXI %%%%-merfolk fighter+merfolk Half fish, half man, the merfolk are citizens of both water and land, and they'll fiercely protect their chosen territory. %%%%Modified: trunk/crawl-ref/source/invent.cc===================================================================--- trunk/crawl-ref/source/invent.cc2008-05-31 17:44:23 UTC (rev 5373)+++ trunk/crawl-ref/source/invent.cc2008-05-31 17:59:01 UTC (rev 5374)@@ -67,43 +67,7 @@ return titlefn? titlefn( m, MenuEntry::get_text() ) : MenuEntry::get_text(); }-/*-static std::string _get_item_prefix(const item_def &item)-{- std::vector<std::string> prefixes;- switch (item.base_type)- {- case OBJ_FOOD:- if (!can_ingest(item.base_type, item.sub_type, true, true, false))- prefixes.push_back("inedible"); - // intentional fall-through- case OBJ_CORPSES:- if (is_poisonous(item) && !player_res_poison())- prefixes.push_back("poisonous");-- if (is_mutagenic(item))- prefixes.push_back("mutagenic");-- if (is_snack(item))- prefixes.push_back("snack");- break;-- case OBJ_WEAPONS:- case OBJ_ARMOUR:- case OBJ_JEWELLERY:- if (item_is_equipped(item))- prefixes.push_back("equipped");- if (is_artefact(item))- prefixes.push_back("artefact");- default:- break;- }-- return comma_separated_line(prefixes.begin(), prefixes.end(),- ",", ",");-}-*/ InvEntry::InvEntry( const item_def &i ) : MenuEntry( "", MEL_ITEM ), item( &i ) { data = const_cast<item_def *>( item );@@ -118,9 +82,6 @@ else text = i.name(DESC_NOCAP_A, false); -// prefix = _get_item_prefix(i);-// mpr(prefix.c_str());- if (i.base_type != OBJ_GOLD && in_inventory(i)) add_hotkey(index_to_letter( i.link )); elseThis was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [5472] trunk/crawl-ref

From: <j-...@us...> - 2008-06-04 07:23:43

Revision: 5472 Author: j-p-e-gDate: 2008-06-04 00:23:40 -0700 (Wed, 04 Jun 2008)Log Message:-----------Fix zombies of wrong habitat on land. It turns out that all thosecareful checks for habitat were ignored (default is HT_LAND) because thebase type for undead wasn't chosen until after the position. I now addedanother habitat check during the base type selection loop and noweverything works. :)Add a warning inscription !D that ignores such items during actions likesacrificing items, destroying weapons (Ely), burning books (Trog) orcasting sticks to snakes. The failure messages are very clumsy now, butthey do get the point across, I hope.Modified Paths:-------------- trunk/crawl-ref/docs/034_changes.txt trunk/crawl-ref/docs/crawl_manual.txt trunk/crawl-ref/docs/options_guide.txt trunk/crawl-ref/source/enum.h trunk/crawl-ref/source/invent.cc trunk/crawl-ref/source/mon-util.cc trunk/crawl-ref/source/monplace.cc trunk/crawl-ref/source/religion.cc trunk/crawl-ref/source/spells4.cc trunk/crawl-ref/source/view.ccModified: trunk/crawl-ref/docs/034_changes.txt===================================================================--- trunk/crawl-ref/docs/034_changes.txt2008-06-04 07:18:06 UTC (rev 5471)+++ trunk/crawl-ref/docs/034_changes.txt2008-06-04 07:23:40 UTC (rev 5472)@@ -40,8 +40,8 @@ We are content that all of these changes are genuine improvements. Should your brain be hardwired to the old settings, you can effectively enforce the 0.3.4 state by using the following options:- : crawl.read_options('docs/034_monster_glyphs.txt')- additional_macro_file = docs/034_command_keys.txt+ include = 034_monster_glyphs.txt+ additional_macro_file = 034_command_keys.txt always_confirm_butcher = true Note that the header of init.txt contains these lines. (It contains some @@ -52,5 +52,5 @@ butcher interface. If you choose to go with the new keyset or the new butcher interface and-you intend to use your old macros, you need to look through your macro.txt-file.+you intend to use your old macros, you'll need to look through your +macro.txt file.Modified: trunk/crawl-ref/docs/crawl_manual.txt===================================================================--- trunk/crawl-ref/docs/crawl_manual.txt2008-06-04 07:18:06 UTC (rev 5471)+++ trunk/crawl-ref/docs/crawl_manual.txt2008-06-04 07:23:40 UTC (rev 5472)@@ -2680,6 +2680,13 @@ cause a stash to automatically be marked. =f item is excluded when cycling ammunition +f item is included when cycling ammunition+ !D prompt before performing an action that might destroy this item+ If you're attempting to destroy an item thus inscribed by+ sacrificing it, destroying a weapon, or burning a book in the + name of various deities, the game won't even ask you for + confirmation but silently ignore this item. It also protects+ against accidentally casting Sticks to Snakes on your favourite+ weapon. Won't protect against lava accidents or hungry jellies. You can use the autoinscribe option to have some items automatically inscribed. See options_guide.txt for details. Some examples areModified: trunk/crawl-ref/docs/options_guide.txt===================================================================--- trunk/crawl-ref/docs/options_guide.txt2008-06-04 07:18:06 UTC (rev 5471)+++ trunk/crawl-ref/docs/options_guide.txt2008-06-04 07:23:40 UTC (rev 5472)@@ -931,7 +931,7 @@ swap_when_safe = true If both this and easy_butcher are true, then if an auto-switch- butchery is interupted, the auto-switch will be reversed as+ butchery is interrupted, the auto-switch will be reversed as soon as you are safe again. easy_quit_item_prompts = trueModified: trunk/crawl-ref/source/enum.h===================================================================--- trunk/crawl-ref/source/enum.h2008-06-04 07:18:06 UTC (rev 5471)+++ trunk/crawl-ref/source/enum.h2008-06-04 07:23:40 UTC (rev 5472)@@ -2180,6 +2180,7 @@ OPER_FIRE = 'f', OPER_PRAY = 'p', OPER_EVOKE = 'E',+ OPER_DESTROY = 'D', OPER_ANY = 0 }; Modified: trunk/crawl-ref/source/invent.cc===================================================================--- trunk/crawl-ref/source/invent.cc2008-06-04 07:18:06 UTC (rev 5471)+++ trunk/crawl-ref/source/invent.cc2008-06-04 07:23:40 UTC (rev 5472)@@ -1066,7 +1066,7 @@ if (is_valid_item(you.inv[i])) { const std::string& r(you.inv[i].inscription);- /* note that r.size() is unsigned */+ // Note that r.size() is unsigned. for ( unsigned int j = 0; j + 2 < r.size(); ++j ) { if ( r[j] == '@'@@ -1092,13 +1092,13 @@ if (r[i] == '!') { if (r[i+1] == iletter || r[i+1] == '*')- return true;+ return (true); else if (oper == OPER_ZAP && r[i+1] == 'z') // for the 0.3.4. keys- return true;+ return (true); } } - return false;+ return (false); } // checks if current item (to be removed) has a warning inscription@@ -1183,24 +1183,31 @@ case OPER_FIRE: return "fire"; case OPER_PRAY: return "sacrifice"; case OPER_EVOKE: return "evoke";+ case OPER_DESTROY: return "destroy"; case OPER_ANY: default: return "choose"; } } -/* return true if user OK'd it (or no warning), false otherwise */+// Return true if user OK'd it (or no warning), false otherwise. bool check_warning_inscriptions( const item_def& item, operation_types oper ) { if (is_valid_item( item ) && has_warning_inscription(item, oper) ) {+ // When it's about destroying an item, don't even ask.+ // If the player really wants to do that, they'll have+ // to remove the inscription.+ if (oper == OPER_DESTROY)+ return (false);+ if (oper == OPER_WEAR) { if (item.base_type != OBJ_ARMOUR) return (true); - // don't ask if item already worn+ // Don't ask if item already worn. int equip = you.equip[get_armour_slot(item)]; if (equip != -1 && item.link == equip) return (_check_old_item_warning(item, oper));@@ -1210,7 +1217,7 @@ if (item.base_type != OBJ_JEWELLERY) return (true); - // don't ask if item already worn+ // Don't ask if item already worn. int equip = -1; if (jewellery_is_amulet(item)) equip = you.equip[EQ_AMULET];Modified: trunk/crawl-ref/source/mon-util.cc===================================================================--- trunk/crawl-ref/source/mon-util.cc2008-06-04 07:18:06 UTC (rev 5471)+++ trunk/crawl-ref/source/mon-util.cc2008-06-04 07:23:40 UTC (rev 5472)@@ -1209,7 +1209,9 @@ return (mon->ghost->fly); } - const int type = mons_is_zombified(mon)? mons_zombie_base(mon) : mon->type;+ const int type = mons_is_zombified(mon) ? mons_zombie_base(mon)+ : mon->type;+ const flight_type ret = mons_class_flies( type ); return (ret ? ret : (_scan_mon_inv_randarts(mon, RAP_LEVITATE) > 0) ? FL_LEVITATEModified: trunk/crawl-ref/source/monplace.cc===================================================================--- trunk/crawl-ref/source/monplace.cc2008-06-04 07:18:06 UTC (rev 5471)+++ trunk/crawl-ref/source/monplace.cc2008-06-04 07:23:40 UTC (rev 5472)@@ -45,9 +45,9 @@ #define BIG_BAND 20 static void _define_zombie( int mid, monster_type ztype,- monster_type cs, int power );+ monster_type cs, int power, coord_def pos ); static monster_type _band_member(band_type band, int power);-static band_type choose_band(int mon_type, int power, int &band_size );+static band_type _choose_band(int mon_type, int power, int &band_size ); // static int _place_monster_aux(int mon_type, beh_type behaviour, int target, // int px, int py, int power, int extra, // bool first_band_member, int dur = 0);@@ -76,10 +76,12 @@ && actual_grid <= DNGN_CLEAR_PERMAROCK_WALL); } + // Restricted fountains during generation, so we don't monsters+ // "trapped" in fountains for easy killing. return (grid_wanted == actual_grid || (grid_wanted == DNGN_DEEP_WATER && (actual_grid == DNGN_SHALLOW_WATER- || actual_grid == DNGN_FOUNTAIN_BLUE)));+ || !generation && actual_grid == DNGN_FOUNTAIN_BLUE))); } // Can this monster survive on actual_grid?@@ -90,13 +92,14 @@ dungeon_feature_type actual_grid) { // Zombified monsters enjoy the same habitat as their original.- const int type = mons_is_zombified(m) ? mons_zombie_base(m) : m->type;+ const int type = mons_is_zombified(m) ? mons_zombie_base(m)+ : m->type; return (monster_habitable_grid(type, actual_grid, mons_flies(m), m->paralysed())); } -inline static bool mons_airborne(int mcls, int flies, bool paralysed)+inline static bool _mons_airborne(int mcls, int flies, bool paralysed) { if (flies == -1) flies = mons_class_flies(mcls);@@ -124,7 +127,7 @@ // [dshaligram] Flying creatures are all DNGN_FLOOR, so we // only have to check for the additional valid grids of deep // water and lava.- if (mons_airborne(monster_class, flies, paralysed)+ if (_mons_airborne(monster_class, flies, paralysed) && (actual_grid == DNGN_LAVA || actual_grid == DNGN_DEEP_WATER)) { return (true);@@ -151,9 +154,10 @@ return (false); } -// Returns true if the monster can submerge in the given grid+// Returns true if the monster can submerge in the given grid. bool monster_can_submerge(const monsters *mons, dungeon_feature_type grid) {+ // Zombies of watery critters can not submerge. switch (mons_habitat(mons)) { case HT_WATER:@@ -164,7 +168,7 @@ return (grid == DNGN_LAVA); default:- return false;+ return (false); } } @@ -189,7 +193,7 @@ return (level); } -static void hell_spawn_random_monsters()+static void _hell_spawn_random_monsters() { // Monster generation in the Vestibule drops off quickly. const int taper_off_turn = 500;@@ -214,7 +218,7 @@ { if (player_in_branch(BRANCH_VESTIBULE_OF_HELL)) {- hell_spawn_random_monsters();+ _hell_spawn_random_monsters(); return; } @@ -354,7 +358,7 @@ return (mon_type); } -static bool can_place_on_trap(int mon_type, trap_type trap)+static bool _can_place_on_trap(int mon_type, trap_type trap) { if (trap == TRAP_TELEPORT) return (false);@@ -377,13 +381,13 @@ return (drac == MONS_DRACONIAN_SCORCHER && colour == MONS_WHITE_DRACONIAN); } -static monster_type resolve_monster_type(monster_type mon_type,- proximity_type proximity,- monster_type base_type,- coord_def &pos,- unsigned mmask,- dungeon_char_type *stair_type,- int *lev_mons)+static monster_type _resolve_monster_type(monster_type mon_type,+ proximity_type proximity,+ monster_type base_type,+ coord_def &pos,+ unsigned mmask,+ dungeon_char_type *stair_type,+ int *lev_mons) { if (mon_type == RANDOM_DRACONIAN) {@@ -437,7 +441,7 @@ int trap = trap_at_xy(pos.x, pos.y); if (trap >= 0) {- if (!can_place_on_trap(mon_type, env.trap[trap].type))+ if (!_can_place_on_trap(mon_type, env.trap[trap].type)) continue; } @@ -531,9 +535,9 @@ if (mg.use_position() && mgrd(mg.pos) != NON_MONSTER) return (false); - mg.cls = resolve_monster_type(mg.cls, mg.proximity, mg.base_type,- mg.pos, mg.map_mask,- &stair_type, &mg.power);+ mg.cls = _resolve_monster_type(mg.cls, mg.proximity, mg.base_type,+ mg.pos, mg.map_mask,+ &stair_type, &mg.power); if (mg.cls == MONS_PROGRAM_BUG) return (false);@@ -544,7 +548,7 @@ if (mg.permit_bands()) {- const band_type band = choose_band(mg.cls, mg.power, band_size);+ const band_type band = _choose_band(mg.cls, mg.power, band_size); band_size ++; for (int i = 1; i < band_size; i++) band_monsters[i] = _band_member( band, mg.power );@@ -579,8 +583,11 @@ // a) not occupied // b) compatible // c) in the 'correct' proximity to the player++ const int htype = (mons_class_is_zombified(mg.cls) ? mg.base_type+ : mg.cls); dungeon_feature_type grid_wanted =- habitat2grid( mons_habitat_by_type(mg.cls) );+ habitat2grid( mons_habitat_by_type(htype) ); while (true) {@@ -589,11 +596,12 @@ return (false); // Placement already decided for PROX_NEAR_STAIRS.+ // Else choose a random point on the map. if (mg.proximity != PROX_NEAR_STAIRS) mg.pos = random_in_bounds(); - // Let's recheck these even for PROX_NEAR_STAIRS, just in case- // occupied?+ // Let's recheck these even for PROX_NEAR_STAIRS, just in case.+ // Occupied? if (mgrd(mg.pos) != NON_MONSTER || mg.pos == you.pos()) continue; @@ -610,7 +618,7 @@ int trap = trap_at_xy(mg.pos.x, mg.pos.y); if (trap >= 0) {- if (!can_place_on_trap(mg.cls, env.trap[trap].type))+ if (!_can_place_on_trap(mg.cls, env.trap[trap].type)) continue; } @@ -629,9 +637,8 @@ case PROX_CLOSE_TO_PLAYER: case PROX_AWAY_FROM_PLAYER:- close_to_player =- (distance(you.x_pos, you.y_pos,- mg.pos.x, mg.pos.y) < 64);+ close_to_player = (distance(you.x_pos, you.y_pos,+ mg.pos.x, mg.pos.y) < 64); if (mg.proximity == PROX_CLOSE_TO_PLAYER && !close_to_player || mg.proximity == PROX_AWAY_FROM_PLAYER && close_to_player)@@ -659,7 +666,7 @@ } shoved = true; coord_def mpos = mg.pos;- mg.pos = you.pos();+ mg.pos = you.pos(); you.moveto(mpos); } proxOK = (pval > 0);@@ -669,9 +676,9 @@ if (!proxOK) continue; - // cool.. passes all tests+ // Cool.. passes all tests. break;- } // end while.. place first monster+ } // end while... place first monster } id = _place_monster_aux(mg, true, force_pos);@@ -680,7 +687,7 @@ if (id == -1) return (id); - // Message to player from stairwell/gate appearance?+ // Message to player from stairwell/gate appearance. if (see_grid(mg.pos) && mg.proximity == PROX_NEAR_STAIRS) { std::string msg;@@ -748,11 +755,12 @@ dungeon_feature_type grid_wanted = DNGN_UNSEEN; coord_def fpos; - // gotta be able to pick an ID+ // Gotta be able to pick an ID. for (id = 0; id < MAX_MONSTERS; id++) if (menv[id].type == -1) break; + // Too many monsters on level? if (id == MAX_MONSTERS) return (-1); @@ -793,14 +801,14 @@ // Don't generate monsters on top of teleport traps. // (How do they get there?) int trap = trap_at_xy(fpos.x, fpos.y);- if (trap >= 0 && !can_place_on_trap(mg.cls, env.trap[trap].type))+ if (trap >= 0 && !_can_place_on_trap(mg.cls, env.trap[trap].type)) continue; - // cool.. passes all tests+ // Cool.. passes all tests. break; } - // did we really try 1000 times?+ // Did we really try 1000 times? if (i == 1000) return (-1); }@@ -808,7 +816,7 @@ // Now, actually create the monster. (Wheeee!) menv[id].type = mg.cls; menv[id].base_monster = mg.base_type;- menv[id].number = mg.number;+ menv[id].number = mg.number; menv[id].x = fpos.x; menv[id].y = fpos.y;@@ -818,7 +826,7 @@ // Generate a brand shiny new monster, or zombie. if (mons_class_is_zombified(mg.cls))- _define_zombie( id, mg.base_type, mg.cls, mg.power );+ _define_zombie( id, mg.base_type, mg.cls, mg.power, fpos ); else define_monster(id); @@ -877,11 +885,11 @@ menv[id].wield_melee_weapon(false); } - // give manticores 8 to 16 spike volleys.+ // Give manticores 8 to 16 spike volleys. if (mg.cls == MONS_MANTICORE) menv[id].number = 8 + random2(9); - // set attitude, behaviour and target+ // Set attitude, behaviour and target. menv[id].attitude = ATT_HOSTILE; menv[id].behaviour = mg.behaviour; @@ -890,9 +898,8 @@ menv[id].foe_memory = 0; - // setting attitude will always make the- // monster wander.. if you want sleeping- // hostiles, use BEH_SLEEP since the default+ // Setting attitude will always make the monster wander...+ // If you want sleeping hostiles, use BEH_SLEEP since the default // attitude is hostile. if (mg.behaviour > NUM_BEHAVIOURS) {@@ -949,12 +956,12 @@ } static void _define_zombie( int mid, monster_type ztype,- monster_type cs, int power )+ monster_type cs, int power, coord_def pos ) {+ monster_type cls = MONS_PROGRAM_BUG; monster_type mons_sec2 = MONS_PROGRAM_BUG;- int zombie_size = 0;+ int zombie_size = 0; bool ignore_rarity = false;- monster_type cls = MONS_PROGRAM_BUG; if (power > 27) power = 27;@@ -998,6 +1005,11 @@ { cls = _pick_random_zombie(); + // Actually pick a monster that is happy where we want to put it.+ // Fish zombies on land are helpless and uncool.+ if (!monster_habitable_grid(cls, grd(pos)))+ continue;+ // On certain branches, zombie creation will fail if we use // the mons_rarity() functions, because (for example) there // are NO zombifiable "native" abyss creatures. Other branches@@ -1032,7 +1044,7 @@ // Size must match, but you can make a spectral thing out // of anything.- if (mons_zombie_size(cls) != zombie_size && zombie_size != -1)+ if (zombie_size != -1 && mons_zombie_size(cls) != zombie_size) continue; // Skeletal or icy draconians shouldn't be coloured.@@ -1052,8 +1064,8 @@ // Check for rarity.. and OOD - identical to mons_place() int level, diff, chance; - level = mons_level( cls ) - 4;- diff = level - power;+ level = mons_level( cls ) - 4;+ diff = level - power; chance = (ignore_rarity) ? 100 : mons_rarity(cls) - (diff * diff) / 2;@@ -1071,21 +1083,22 @@ relax++; } - // set type and secondary appropriately+ // Set type and secondary appropriately. menv[mid].base_monster = cls; mons_sec2 = cls; } else { menv[mid].base_monster = mons_species(ztype);- mons_sec2 = menv[mid].base_monster;+ mons_sec2 = menv[mid].base_monster; } + // Set type to the base type to calculate appropriate stats. menv[mid].type = menv[mid].base_monster; define_monster(mid); - menv[mid].hit_points = hit_points( menv[mid].hit_dice, 6, 5 );+ menv[mid].hit_points = hit_points( menv[mid].hit_dice, 6, 5 ); menv[mid].max_hit_points = menv[mid].hit_points; menv[mid].ac -= 2;@@ -1105,6 +1118,7 @@ menv[mid].speed_increment = 70; + // Now override type with the required type. if (cs == MONS_ZOMBIE_SMALL || cs == MONS_ZOMBIE_LARGE) { menv[mid].type = ((mons_zombie_size(menv[mid].base_monster) == Z_BIG)@@ -1112,7 +1126,7 @@ } else if (cs == MONS_SKELETON_SMALL || cs == MONS_SKELETON_LARGE) {- menv[mid].hit_points = hit_points( menv[mid].hit_dice, 5, 4 );+ menv[mid].hit_points = hit_points( menv[mid].hit_dice, 5, 4 ); menv[mid].max_hit_points = menv[mid].hit_points; menv[mid].ac -= 4;@@ -1131,24 +1145,24 @@ else if (cs == MONS_SIMULACRUM_SMALL || cs == MONS_SIMULACRUM_LARGE) { // Simulacrum aren't tough, but you can create piles of them. -- bwr- menv[mid].hit_points = hit_points( menv[mid].hit_dice, 1, 4 );+ menv[mid].hit_points = hit_points( menv[mid].hit_dice, 1, 4 ); menv[mid].max_hit_points = menv[mid].hit_points; menv[mid].type = ((mons_zombie_size( menv[mid].base_monster ) == Z_BIG) ? MONS_SIMULACRUM_LARGE : MONS_SIMULACRUM_SMALL); } else if (cs == MONS_SPECTRAL_THING) {- menv[mid].hit_points = hit_points( menv[mid].hit_dice, 4, 4 );+ menv[mid].hit_points = hit_points( menv[mid].hit_dice, 4, 4 ); menv[mid].max_hit_points = menv[mid].hit_points;- menv[mid].ac += 4;- menv[mid].type = MONS_SPECTRAL_THING;+ menv[mid].ac += 4;+ menv[mid].type = MONS_SPECTRAL_THING; } menv[mid].base_monster = mons_sec2;- menv[mid].colour = mons_class_colour(cs);+ menv[mid].colour = mons_class_colour(cs); } -static band_type choose_band( int mon_type, int power, int &band_size )+static band_type _choose_band( int mon_type, int power, int &band_size ) { // init band_size = 0;@@ -1723,7 +1737,7 @@ return (mon_type); } -static int ood_limit()+static int _ood_limit() { return Options.ood_interesting; }@@ -1753,7 +1767,7 @@ } else if (you.where_are_you == BRANCH_MAIN_DUNGEON && you.level_type == LEVEL_DUNGEON- && mons_level(monster->type) >= you.your_level + ood_limit()+ && mons_level(monster->type) >= you.your_level + _ood_limit() && mons_level(monster->type) < 99 && !(monster->type >= MONS_EARTH_ELEMENTAL && monster->type <= MONS_AIR_ELEMENTAL)@@ -1768,7 +1782,7 @@ // PUBLIC FUNCTION -- mons_place(). -static monster_type pick_zot_exit_defender()+static monster_type _pick_zot_exit_defender() { if (one_chance_in(11)) return (MONS_PANDEMONIUM_DEMON);@@ -1813,7 +1827,7 @@ if (you.char_direction == GDT_ASCENDING && mg.cls == RANDOM_MONSTER && you.level_type == LEVEL_DUNGEON && !mg.summoned()) {- mg.cls = pick_zot_exit_defender();+ mg.cls = _pick_zot_exit_defender(); mg.flags |= MG_PERMIT_BANDS; } @@ -2080,8 +2094,7 @@ if (mgrd[tx][ty] != NON_MONSTER) continue; - // players won't summon out of LOS, or past transparent- // walls.+ // Players won't summon out of LOS, or past transparent walls. if (!see_grid_no_trans(tx, ty) && playerSummon) continue; Modified: trunk/crawl-ref/source/religion.cc===================================================================--- trunk/crawl-ref/source/religion.cc2008-06-04 07:18:06 UTC (rev 5471)+++ trunk/crawl-ref/source/religion.cc2008-06-04 07:23:40 UTC (rev 5472)@@ -2756,6 +2756,13 @@ continue; } + if (!check_warning_inscriptions(mitm[i], OPER_DESTROY))+ {+ mpr("Won't destroy {!D} inscribed item.");+ i = next;+ continue;+ }+ const int value = item_value( mitm[i], true ); #ifdef DEBUG_DIAGNOSTICS mprf(MSGCH_DIAGNOSTICS, "Destroyed weapon value: %d", value);@@ -2775,6 +2782,7 @@ _print_sacrifice_message(GOD_ELYVILON, mitm[i], pgain); if (is_evil_weapon) {+ // Print this is addition to the above! simple_god_message(" welcomes the destruction of this evil weapon.", GOD_ELYVILON); }@@ -2817,41 +2825,48 @@ for (int xpos = you.x_pos - 8; xpos < you.x_pos + 8; xpos++) for (int ypos = you.y_pos - 8; ypos < you.y_pos + 8; ypos++) {- // checked above- if (xpos == you.x_pos && ypos == you.y_pos)- continue;+ // Checked above.+ if (xpos == you.x_pos && ypos == you.y_pos)+ continue; - // burn only squares in sight- if (!see_grid(xpos, ypos))- continue;+ // Burn only squares in sight.+ if (!see_grid(xpos, ypos))+ continue; - // if a grid is blocked, books lying there will be ignored- // allow bombing of monsters- const int cloud = env.cgrid[xpos][ypos];- if (grid_is_solid(grd[ xpos ][ ypos ]) ||-// mgrd[ xpos ][ ypos ] != NON_MONSTER ||- (cloud != EMPTY_CLOUD && env.cloud[cloud].type != CLOUD_FIRE))- {- continue;- }+ // If a grid is blocked, books lying there will be ignored.+ // Allow bombing of monsters.+ const int cloud = env.cgrid[xpos][ypos];+ if (grid_is_solid(grd[ xpos ][ ypos ])+ || cloud != EMPTY_CLOUD && env.cloud[cloud].type != CLOUD_FIRE)+ {+ continue;+ } - int count = 0;- int rarity = 0;- i = igrd[xpos][ypos];- while (i != NON_ITEM)- {- const int next = mitm[i].link; // in case we can't get it later.+ int count = 0;+ int rarity = 0;+ i = igrd[xpos][ypos];+ while (i != NON_ITEM)+ {+ const int next = mitm[i].link; // in case we can't get it later - if (mitm[i].base_type != OBJ_BOOKS- || mitm[i].sub_type == BOOK_MANUAL- || mitm[i].sub_type == BOOK_DESTRUCTION)- {- i = next;- continue;- }+ if (mitm[i].base_type != OBJ_BOOKS+ || mitm[i].sub_type == BOOK_MANUAL+ || mitm[i].sub_type == BOOK_DESTRUCTION)+ {+ i = next;+ continue;+ } + // Ignore {!D} inscribed books.+ if (!check_warning_inscriptions(mitm[i], OPER_DESTROY))+ {+ mpr("Won't ignite {!D} inscribed book.");+ i = next;+ continue;+ }+ rarity += book_rarity(mitm[i].sub_type);- // piety increases by 2 for books never picked up, else by 1+ // Piety increases by 2 for books never picked up, else by 1. if (mitm[i].flags & ISFLAG_DROPPED || mitm[i].flags & ISFLAG_THROWN) {@@ -4854,9 +4869,17 @@ continue; } - if ( _is_risky_sacrifice(item)- || item.inscription.find("=p") != std::string::npos)+ // Ignore {!D} inscribed items.+ if (!check_warning_inscriptions(item, OPER_DESTROY)) {+ mpr("Won't sacrifice {!D} inscribed item.");+ i = next;+ continue;+ }++ if (_is_risky_sacrifice(item)+ || item.inscription.find("=p") != std::string::npos)+ { const std::string msg = "Really sacrifice " + item.name(DESC_NOCAP_A) + "?"; @@ -4884,8 +4907,8 @@ you.attribute[ATTR_CARD_COUNTDOWN]); #endif }- if ((item.base_type == OBJ_CORPSES &&- one_chance_in(2+you.piety/50))+ if (item.base_type == OBJ_CORPSES+ && one_chance_in(2+you.piety/50) // Nemelex piety gain is fairly fast...at least // when you have low piety. || value/2 >= random2(30 + you.piety/2))Modified: trunk/crawl-ref/source/spells4.cc===================================================================--- trunk/crawl-ref/source/spells4.cc2008-06-04 07:18:06 UTC (rev 5471)+++ trunk/crawl-ref/source/spells4.cc2008-06-04 07:23:40 UTC (rev 5472)@@ -482,6 +482,15 @@ return; } + // Don't enchant sticks marked with {!D}.+ if (!check_warning_inscriptions(you.inv[ weapon ], OPER_DESTROY))+ {+ mprf("%s feel%s slithery for a moment!",+ you.inv[weapon].name(DESC_CAP_YOUR).c_str(),+ you.inv[weapon].quantity > 1 ? "s" : "");+ return;+ }+ const beh_type beha = item_cursed(you.inv[ weapon ]) ? BEH_HOSTILE : BEH_FRIENDLY; const unsigned short hitting = (beha == BEH_HOSTILE) ? MHITYOUModified: trunk/crawl-ref/source/view.cc===================================================================--- trunk/crawl-ref/source/view.cc2008-06-04 07:18:06 UTC (rev 5471)+++ trunk/crawl-ref/source/view.cc2008-06-04 07:23:40 UTC (rev 5472)@@ -1023,7 +1023,7 @@ { ; // No "visual shout" defined for silent monster, do nothing. }- else if (msg == "") // S_SILENT handled above+ else if (msg == "") // Still nothing found? { msg::streams(MSGCH_DIAGNOSTICS) << "No shout entry for default shout type '"This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [5485] trunk/crawl-ref

From: <zel...@us...> - 2008-06-05 08:43:14

Revision: 5485 Author: zelgadisDate: 2008-06-05 01:43:08 -0700 (Thu, 05 Jun 2008)Log Message:-----------Added two new stash options, stash_track_decay and stash_remove_decay. Ifstash_track_decay is true then the stash tracker will remember how longit's been since you've seen a rottable object (corpses, skeletons andmeat chunks) and tell you its condition by appending "rotten by now","skeletalised by now" or "gone by now" to its name in the stash menu.If stash_remove_decay is also true then any item that would have beenmarked "gone by now" is instead removed from the stash tracker.Doesn't yet track decay of potions of blood.Breaks stash save data compatibility.Modified Paths:-------------- trunk/crawl-ref/docs/options_guide.txt trunk/crawl-ref/settings/init.txt trunk/crawl-ref/source/acr.cc trunk/crawl-ref/source/externs.h trunk/crawl-ref/source/initfile.cc trunk/crawl-ref/source/stash.cc trunk/crawl-ref/source/stash.hModified: trunk/crawl-ref/docs/options_guide.txt===================================================================--- trunk/crawl-ref/docs/options_guide.txt2008-06-05 06:07:00 UTC (rev 5484)+++ trunk/crawl-ref/docs/options_guide.txt2008-06-05 08:43:08 UTC (rev 5485)@@ -51,7 +51,8 @@ trap_prompt, rest_wait_both 4-h Stashes. stash_tracking, stash_filter, annotate_item_class,- annoate_item_dropped+ annoate_item_dropped, stash_track_decay,+ stash_remove_decay 4-i Command Enhancements. auto_list, easy_open, easy_unequip, easy_confirm, easy_butcher, always_confirm_butcher, chunks_autopickup,@@ -882,6 +883,17 @@ init.txt. Annotates dropped items with {dropped} for stash searching. +stash_track_decay = false+ If set to true then the stash tracker will remember how long its+ been since you've seen chunks of meat or a corpse or skeleton and+ tell you what state its in by adding "rotten by now",+ "skeletalised by now" or "gone by now" to its name.++stash_remove_decay = false+ If both this and stash_track_decay are set to true, anything that+ would have been reported as "gone by now" will instead be+ removed from the stash tracker's memory.+ 4-i Command Enhancements. ----------------------------- Modified: trunk/crawl-ref/settings/init.txt===================================================================--- trunk/crawl-ref/settings/init.txt2008-06-05 06:07:00 UTC (rev 5484)+++ trunk/crawl-ref/settings/init.txt2008-06-05 08:43:08 UTC (rev 5485)@@ -197,6 +197,8 @@ # stash_filter = 14, 4:21 # annotate_item_class = true # annotate_item_dropped = true+# stash_track_decay = true+# stash_remove_decay = true ##### 4-iCommand Enhancements ################## #Modified: trunk/crawl-ref/source/acr.cc===================================================================--- trunk/crawl-ref/source/acr.cc2008-06-05 06:07:00 UTC (rev 5484)+++ trunk/crawl-ref/source/acr.cc2008-06-05 08:43:08 UTC (rev 5485)@@ -1441,6 +1441,12 @@ _world_reacts(); return; }+ else+ {+ // Don't do this while delayed, so as to not slow down resting+ // and travel by iterating over all stahses once per player turn.+ StashTrack.update_corpses();+ } if ( you.turn_is_over ) {Modified: trunk/crawl-ref/source/externs.h===================================================================--- trunk/crawl-ref/source/externs.h2008-06-05 06:07:00 UTC (rev 5484)+++ trunk/crawl-ref/source/externs.h2008-06-05 08:43:08 UTC (rev 5485)@@ -1714,6 +1714,10 @@ int stash_tracking; // How stashes are tracked + bool stash_track_decay; // Keep track of how decayed corpses are+ bool stash_remove_decay; // Remove corpses that have most probably+ // completely rotted away+ int tc_reachable; // Colour for squares that are reachable int tc_excluded; // Colour for excluded squares. int tc_exclude_circle; // Colour for squares in the exclusion radiusModified: trunk/crawl-ref/source/initfile.cc===================================================================--- trunk/crawl-ref/source/initfile.cc2008-06-05 06:07:00 UTC (rev 5484)+++ trunk/crawl-ref/source/initfile.cc2008-06-05 08:43:08 UTC (rev 5485)@@ -738,6 +738,9 @@ stash_tracking = STM_ALL; + stash_track_decay = false;+ stash_remove_decay = false;+ explore_stop = ES_ITEM | ES_STAIR | ES_PORTAL | ES_SHOP | ES_ALTAR | ES_GREEDY_PICKUP; @@ -2573,6 +2576,8 @@ field == "all" ? STM_ALL : STM_EXPLICIT; }+ else BOOL_OPTION(stash_track_decay);+ else BOOL_OPTION(stash_remove_decay); else if (key == "stash_filter") { std::vector<std::string> seg = split_string(",", field);Modified: trunk/crawl-ref/source/stash.cc===================================================================--- trunk/crawl-ref/source/stash.cc2008-06-05 06:07:00 UTC (rev 5484)+++ trunk/crawl-ref/source/stash.cc2008-06-05 08:43:08 UTC (rev 5485)@@ -25,6 +25,7 @@ #include "menu.h" #include "message.h" #include "misc.h"+#include "mon-util.h" #include "notes.h" #include "overmap.h" #include "place.h"@@ -49,7 +50,7 @@ StashTracker StashTrack; #define ST_MAJOR_VER ((unsigned char) 4)-#define ST_MINOR_VER ((unsigned char) 7)+#define ST_MINOR_VER ((unsigned char) 8) void stash_init_new_level() {@@ -279,7 +280,7 @@ while (objl != NON_ITEM) { if (!is_filtered(mitm[objl]))- items.push_back(mitm[objl]);+ add_item(mitm[objl]); objl = mitm[objl].link; } @@ -310,7 +311,7 @@ if (items.size() == 0) { if (!is_filtered(item))- items.push_back(item);+ add_item(item); verified = (item.link == NON_ITEM); return ; }@@ -354,17 +355,61 @@ // Items are different. We'll put this item in the front of our // vector, and mark this as unverified- items.insert(items.begin(), item);+ add_item(item, true); verified = false; } } } +static bool _is_rottable(const item_def &item)+{+ return (item.base_type == OBJ_CORPSES+ || (item.base_type == OBJ_FOOD && item.sub_type == FOOD_CHUNK));+}++static short _min_rot(const item_def &item)+{+ if (item.base_type == OBJ_FOOD)+ return 0;++ if (item.base_type == OBJ_CORPSES && item.sub_type == CORPSE_SKELETON)+ return 0;++ if (!mons_skeleton(item.plus))+ return 0;+ else+ return -200;+}+ // Returns the item name for a given item, with any appropriate // stash-tracking pre/suffixes. std::string Stash::stash_item_name(const item_def &item) {- return item.name(DESC_NOCAP_A);+ std::string name = item.name(DESC_NOCAP_A);++ if (!Options.stash_track_decay || !_is_rottable(item))+ return name;++ if (item.plus2 <= _min_rot(item))+ {+ name += " (gone by now)";+ return name;+ }++ // Skeletons show no signs of rotting before they're gone+ if (item.base_type == OBJ_CORPSES && item.sub_type == CORPSE_SKELETON)+ return name;++ // Item was already seen to be rotten+ if (item.special < 100)+ return name;++ if (item.plus2 <= 0)+ name += " (skeletalised by now)";+ else if (item.plus2 < 100)+ name += " (rotten by now)";++ return name; } class StashMenu : public InvMenu@@ -544,6 +589,54 @@ return !!res.matches; } +void Stash::_update_corpses(long rot_time)+{+ for (int i = items.size() - 1; i >= 0; i--)+ {+ item_def &item = items[i];++ if (!_is_rottable(item))+ continue;++ long new_rot = static_cast<long>(item.plus2) - rot_time;++ if (new_rot <= _min_rot(item))+ {+ if (Options.stash_remove_decay)+ {+ items.erase(items.begin() + i);+ continue;+ }+ new_rot = _min_rot(item);+ }+ item.plus2 = static_cast<short>(new_rot);+ }+}++void Stash::add_item(const item_def &item, bool add_to_front)+{+ if (add_to_front)+ items.insert(items.begin(), item);+ else+ items.push_back(item);++ if (!_is_rottable(item))+ return;++ // item.special remains unchanged in the stash, to show how fresh it+ // was when last seen. It's plus2 that's decayed over time.+ if (add_to_front)+ {+ item_def &it = items.front();+ it.plus2 = it.special;+ }+ else+ {+ item_def &it = items.back();+ it.plus2 = it.special;+ }+}+ void Stash::write(std::ostream &os, int refx, int refy, std::string place, bool identify) const@@ -1128,6 +1221,15 @@ } } +void LevelStashes::_update_corpses(long rot_time)+{+ for (stashes_t::iterator iter = m_stashes.begin();+ iter != m_stashes.end(); iter++)+ {+ iter->second._update_corpses(rot_time);+ }+}+ void LevelStashes::write(std::ostream &os, bool identify) const { if (visible_stash_count() == 0)@@ -1299,6 +1401,9 @@ marshallByte(outf, ST_MAJOR_VER); marshallByte(outf, ST_MINOR_VER); + // Time of last corpse update.+ marshallFloat(outf, (float) last_corpse_update);+ // How many levels have we? marshallShort(outf, (short) levels.size()); @@ -1316,6 +1421,9 @@ minor = unmarshallByte(inf); if (major != ST_MAJOR_VER || minor != ST_MINOR_VER) return ; + // Time of last corpse update.+ last_corpse_update = (double) unmarshallFloat(inf);+ int count = unmarshallShort(inf); levels.clear();@@ -1742,3 +1850,23 @@ } return false; }++void StashTracker::update_corpses()+{+ if (!Options.stash_track_decay)+ return;++ if (you.elapsed_time - last_corpse_update < 20.0)+ return;++ const long rot_time = static_cast<long>((you.elapsed_time -+ last_corpse_update) / 20.0);++ last_corpse_update = you.elapsed_time;++ for (stash_levels_t::iterator iter = levels.begin();+ iter != levels.end(); iter++)+ {+ iter->second._update_corpses(rot_time);+ }+}Modified: trunk/crawl-ref/source/stash.h===================================================================--- trunk/crawl-ref/source/stash.h2008-06-05 06:07:00 UTC (rev 5484)+++ trunk/crawl-ref/source/stash.h2008-06-05 08:43:08 UTC (rev 5485)@@ -90,6 +90,10 @@ // also never removed from the level's map of // stashes. private:+ void _update_corpses(long rot_time);+ void add_item(const item_def &item, bool add_to_front = false);++private: bool verified; // Is this correct to the best of our knowledge? unsigned char x, y; int abspos;@@ -109,6 +113,8 @@ static bool are_items_same(const item_def &, const item_def &); static bool is_filtered(const item_def &item);++ friend class LevelStashes; }; class ShopInfo@@ -247,6 +253,7 @@ private: int _num_enabled_stashes() const;+ void _update_corpses(long rot_time); private: typedef std::map<int, Stash> stashes_t;@@ -256,6 +263,8 @@ level_id m_place; stashes_t m_stashes; shops_t m_shops;++ friend class StashTracker; }; extern std::ostream &operator << (std::ostream &, const LevelStashes &);@@ -269,7 +278,7 @@ || you.level_type == LEVEL_ABYSS; } - StashTracker() : levels()+ StashTracker() : levels(), last_corpse_update(0.0) { } @@ -294,6 +303,8 @@ // previously marked as stashes. }; + void update_corpses();+ void update_visible_stashes(StashTracker::stash_update_mode = ST_PASSIVE); // Update stash at (x,y) on current level, defaulting to player's current@@ -326,6 +337,8 @@ private: typedef std::map<level_id, LevelStashes> stash_levels_t; stash_levels_t levels;++ double last_corpse_update; }; extern StashTracker StashTrack;This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [5501] trunk/crawl-ref

From: <j-...@us...> - 2008-06-06 19:10:06

Revision: 5501 Author: j-p-e-gDate: 2008-06-06 12:09:12 -0700 (Fri, 06 Jun 2008)Log Message:-----------Add a line on good gods disapproving of certain items to theirdescription (evil_item). Same for evil_eating.In another step on the way to monster pathfinding, take theshortest path and extract a vector of waypoints out of it.When experimenting with ways to do this I noticed that grid_see_grid is not symmetrical (A may see B but not vice versa); I'm not sure what effects that could have. It won't directly affect the player as the checks for monster sees player and player sees monster both use the player LoS, but it could have an effect on friendly monsters fighting enemy ones, I guess.Also, I don't think num_feats_between needs the shortest beamavailable (called with false now). In fact, that seemed to hurtvisibility a bit, probably because of attempting to take visionobstructing shortcuts. If this reasoning is wrong, please speak upand/or correct it. (I sure hope not because the shortest beam calculation has some more overhead that can be avoided this way.)Modified Paths:-------------- trunk/crawl-ref/settings/food_colouring.txt trunk/crawl-ref/source/debug.cc trunk/crawl-ref/source/describe.cc trunk/crawl-ref/source/directn.cc trunk/crawl-ref/source/enum.h trunk/crawl-ref/source/mon-util.cc trunk/crawl-ref/source/monplace.cc trunk/crawl-ref/source/monplace.h trunk/crawl-ref/source/view.ccModified: trunk/crawl-ref/settings/food_colouring.txt===================================================================--- trunk/crawl-ref/settings/food_colouring.txt2008-06-06 14:43:57 UTC (rev 5500)+++ trunk/crawl-ref/settings/food_colouring.txt2008-06-06 19:09:12 UTC (rev 5501)@@ -8,8 +8,8 @@ msg = $inedible:.*inedible.* inv = $inedible:.*inedible.* +inv = $evil:.*evil_eating.* inv = $evil:.*evil_item.*-inv = $evil:.*evil_eating.* msg = $preferred:.*preferred.* inv = $preferred:.*preferred.*Modified: trunk/crawl-ref/source/debug.cc===================================================================--- trunk/crawl-ref/source/debug.cc2008-06-06 14:43:57 UTC (rev 5500)+++ trunk/crawl-ref/source/debug.cc2008-06-06 19:09:12 UTC (rev 5501)@@ -4101,8 +4101,21 @@ snprintf(info, INFO_SIZE, "(%d, %d) ", path[i].x, path[i].y); path_str += info; }+ mpr(path_str.c_str());+ mprf("-> path length: %d", path.size()); + mpr(EOL);+ path = mp.calc_waypoints();+ path_str = "";+ mpr(EOL);+ mpr("And here are the needed waypoints: ");+ for (unsigned int i = 0; i < path.size(); i++)+ {+ snprintf(info, INFO_SIZE, "(%d, %d) ", path[i].x, path[i].y);+ path_str += info;+ } mpr(path_str.c_str());+ mprf("-> #waypoints: %d", path.size()); } } #endifModified: trunk/crawl-ref/source/describe.cc===================================================================--- trunk/crawl-ref/source/describe.cc2008-06-06 14:43:57 UTC (rev 5500)+++ trunk/crawl-ref/source/describe.cc2008-06-06 19:09:12 UTC (rev 5501)@@ -1636,6 +1636,10 @@ description << "$"; break; + case OBJ_CORPSES:+ if (item.sub_type == CORPSE_SKELETON)+ break;+ // intentional fall-through case OBJ_FOOD: if (item.sub_type == FOOD_CHUNK) {@@ -1685,6 +1689,13 @@ default: break; }+ if (is_good_god(you.religion) && is_player_same_species(item.plus)+ || you.religion == GOD_ZIN+ && mons_intel(item.plus) >= I_NORMAL)+ {+ description << "$$" << god_name(you.religion) << " disapproves "+ "of eating such meat.";+ } description << "$"; }@@ -1747,7 +1758,6 @@ case OBJ_SCROLLS: case OBJ_ORBS:- case OBJ_CORPSES: case OBJ_GOLD: // No extra processing needed for these item types. break;@@ -1788,6 +1798,13 @@ } } + if (is_good_god(you.religion) && is_evil_item(item)+ && item_type_known(item))+ {+ description << "$$" << god_name(you.religion) << " disapproves of the "+ << "use of such an item.";+ }+ return description.str(); } // end get_item_description() @@ -1823,7 +1840,7 @@ getch(); } -// Return true if spells can be shown to player+// Returns true if spells can be shown to player. static bool show_item_description(const item_def &item) { clrscr();Modified: trunk/crawl-ref/source/directn.cc===================================================================--- trunk/crawl-ref/source/directn.cc2008-06-06 14:43:57 UTC (rev 5500)+++ trunk/crawl-ref/source/directn.cc2008-06-06 19:09:12 UTC (rev 5501)@@ -1015,10 +1015,10 @@ } #ifdef USE_TILE- // tiles always need a beam redraw if show_beam is true (and if valid...)- if ( need_beam_redraw- || show_beam && find_ray(you.x_pos, you.y_pos, moves.tx, moves.ty,- true, ray, 0, true) )+ // Tiles always need a beam redraw if show_beam is true (and valid...)+ if (need_beam_redraw+ || show_beam && find_ray(you.x_pos, you.y_pos, moves.tx, moves.ty,+ true, ray, 0, true) ) { #else if ( need_beam_redraw )Modified: trunk/crawl-ref/source/enum.h===================================================================--- trunk/crawl-ref/source/enum.h2008-06-06 14:43:57 UTC (rev 5500)+++ trunk/crawl-ref/source/enum.h2008-06-06 19:09:12 UTC (rev 5501)@@ -863,21 +863,21 @@ DNGN_CLEAR_STONE_WALL, // 10 - Transparent DNGN_CLEAR_PERMAROCK_WALL, // 11 - Transparent - // lowest/highest grid value which is a wall+ // Lowest/highest grid value which is a wall. DNGN_MINWALL = DNGN_WAX_WALL, DNGN_MAXWALL = DNGN_CLEAR_PERMAROCK_WALL, - // Random wall types for big rooms+ // Random wall types for big rooms. DNGN_RNDWALL_MIN = DNGN_METAL_WALL, DNGN_RNDWALL_MAX = DNGN_STONE_WALL, - // highest grid value which is opaque+ // Highest grid value which is opaque. DNGN_MAXOPAQUE = DNGN_PERMAROCK_WALL, - // lowest grid value which can be seen through+ // Lowest grid value which can be seen through. DNGN_MINSEE = DNGN_CLEAR_ROCK_WALL, - // highest grid value which can't be reached through+ // Highest grid value which can't be reached through. DNGN_MAX_NONREACH = DNGN_CLEAR_PERMAROCK_WALL, // Can be seen through and reached past.@@ -885,7 +885,7 @@ DNGN_GRANITE_STATUE = 21, // 21 DNGN_STATUE_RESERVED, - // lowest grid value which can be passed by walking etc.+ // Lowest grid value which can be passed by walking etc. DNGN_MINMOVE = 31, DNGN_LAVA = 61, // 61Modified: trunk/crawl-ref/source/mon-util.cc===================================================================--- trunk/crawl-ref/source/mon-util.cc2008-06-06 14:43:57 UTC (rev 5500)+++ trunk/crawl-ref/source/mon-util.cc2008-06-06 19:09:12 UTC (rev 5501)@@ -1269,7 +1269,7 @@ return mons_class_flag(mc, M_AMPHIBIOUS); } -// this nice routine we keep in exactly the way it was+// This nice routine we keep in exactly the way it was- int hit_points(int hit_dice, int min_hp, int rand_hp) { int hrolled = 0;@@ -1281,11 +1281,11 @@ } return (hrolled);-} // end hit_points()+} // This function returns the standard number of hit dice for a type // of monster, not a pacticular monsters current hit dice. -- bwr-// XXX: rename to mons_class_* to be like the rest+// XXX: Rename to mons_class_* to be like the rest. int mons_type_hit_dice( int type ) { struct monsterentry *mon_class = get_monster_data( type );@@ -6079,8 +6079,8 @@ } } - const bool needs_message =- spawned && mons_near(this) && player_monster_visible(this);+ const bool needs_message = spawned && mons_near(this)+ && player_monster_visible(this); if (needs_message) {@@ -6089,6 +6089,7 @@ spawned >= 5 ? " alarmingly" : spawned >= 3 ? " violently" : spawned > 1 ? " vigorously" : "");+ if (spawned == 1) mprf("%s spits out another jelly.", monnam.c_str()); elseModified: trunk/crawl-ref/source/monplace.cc===================================================================--- trunk/crawl-ref/source/monplace.cc2008-06-06 14:43:57 UTC (rev 5500)+++ trunk/crawl-ref/source/monplace.cc2008-06-06 19:09:12 UTC (rev 5501)@@ -2329,8 +2329,8 @@ total = distance + estimated_cost(npos); if (old_dist == INFINITE_DISTANCE) {- mprf("Adding (%d,%d) to hash (total dist = %d)",- npos.x, npos.y, total);+// mprf("Adding (%d,%d) to hash (total dist = %d)",+// npos.x, npos.y, total); add_new_pos(npos, total); if (total > max_length)@@ -2338,8 +2338,8 @@ } else {- mprf("Improving (%d,%d) to total dist %d",- npos.x, npos.y, total);+// mprf("Improving (%d,%d) to total dist %d",+// npos.x, npos.y, total); update_pos(npos, total); }@@ -2368,7 +2368,6 @@ bool monster_pathfind::get_best_position() {-// mprf("minlength: %d, maxlength: %d", min_length, max_length); for (int i = min_length; i <= max_length; i++) { if (!hash[i].empty())@@ -2378,8 +2377,8 @@ std::vector<coord_def> &vec = hash[i]; pos = vec[vec.size()-1]; vec.pop_back();- mprf("Returning (%d, %d) as best pos with total dist %d.",- pos.x, pos.y, min_length);+// mprf("Returning (%d, %d) as best pos with total dist %d.",+// pos.x, pos.y, min_length); return (true); }@@ -2406,8 +2405,8 @@ dir = prev[pos.x][pos.y]; pos = pos + Compass[dir]; ASSERT(in_bounds(pos));- mprf("prev: (%d, %d), pos: (%d, %d)", Compass[dir].x, Compass[dir].y,- pos.x, pos.y);+// mprf("prev: (%d, %d), pos: (%d, %d)", Compass[dir].x, Compass[dir].y,+// pos.x, pos.y); path.push_back(pos); if (pos.x == 0 && pos.y == 0)@@ -2419,6 +2418,41 @@ return path; } +// Reduces the path coordinates to only a couple of key waypoints needed+// to reach the target.+std::vector<coord_def> monster_pathfind::calc_waypoints()+{+ std::vector<coord_def> path = backtrack();+ // If no path found, nothing to be done.+ if (path.empty())+ return path;++ dungeon_feature_type can_move;+ if (mons_amphibious(mons_is_zombified(mons) ? mons->base_monster+ : mons->type))+ {+ can_move = DNGN_DEEP_WATER;+ }+ else+ can_move = DNGN_SHALLOW_WATER;++ std::vector<coord_def> waypoints;+ pos = path[0];++ for (unsigned int i = 1; i < path.size(); i++)+ {+ if (grid_see_grid(pos.x, pos.y, path[i].x, path[i].y, can_move))+ continue;+ else+ {+ pos = path[i-1];+ waypoints.push_back(pos);+ }+ }++ return waypoints;+}+ bool monster_pathfind::traversable(coord_def p) { const int montype = mons_is_zombified(mons) ? mons_zombie_base(mons)Modified: trunk/crawl-ref/source/monplace.h===================================================================--- trunk/crawl-ref/source/monplace.h2008-06-06 14:43:57 UTC (rev 5500)+++ trunk/crawl-ref/source/monplace.h2008-06-06 19:09:12 UTC (rev 5501)@@ -303,6 +303,7 @@ // public methods bool start_pathfind(monsters *mon, coord_def dest, bool msg = false); std::vector<coord_def> backtrack(void);+ std::vector<coord_def> calc_waypoints(void); protected: // protected methodsModified: trunk/crawl-ref/source/view.cc===================================================================--- trunk/crawl-ref/source/view.cc2008-06-06 14:43:57 UTC (rev 5500)+++ trunk/crawl-ref/source/view.cc2008-06-06 19:09:12 UTC (rev 5501)@@ -1100,17 +1100,17 @@ && env.cgrid(monster->pos()) == EMPTY_CLOUD) { _set_show_backup(ex, ey);- env.show[ex][ey] = DNGN_INVIS_EXPOSED;+ env.show[ex][ey] = DNGN_INVIS_EXPOSED; env.show_col[ex][ey] = BLUE; } return (false); } - // mimics are always left on map+ // Mimics are always left on map. if (!mons_is_mimic( monster->type )) _set_show_backup(ex, ey); - env.show[ex][ey] = monster->type + DNGN_START_OF_MONSTERS;+ env.show[ex][ey] = monster->type + DNGN_START_OF_MONSTERS; env.show_col[ex][ey] = get_mons_colour( monster ); return (true);@@ -1456,7 +1456,7 @@ } _set_show_backup(ex, ey);- env.show[ex][ey] = DNGN_CLOUD;+ env.show[ex][ey] = DNGN_CLOUD; env.show_col[ex][ey] = which_colour; #ifdef USE_TILE@@ -2330,15 +2330,15 @@ { const int fullray = _cyclic_offset( fray, cycle_dir, ray.fullray_idx, fullrays.size() );- // yeah, yeah, this is O(n^2). I know.+ // Yeah, yeah, this is O(n^2). I know. cur_offset = 0;- for ( int i = 0; i < fullray; ++i )+ for (int i = 0; i < fullray; ++i) cur_offset += raylengths[i]; - for ( cellray = 0; cellray < raylengths[fullray]; ++cellray )+ for (cellray = 0; cellray < raylengths[fullray]; ++cellray) {- if ( ray_coord_x[cellray + cur_offset] == absx &&- ray_coord_y[cellray + cur_offset] == absy )+ if (ray_coord_x[cellray + cur_offset] == absx+ && ray_coord_y[cellray + cur_offset] == absy) { if (find_shortest) {@@ -2346,11 +2346,11 @@ unaliased_ray.push_back(coord_def(0, 0)); } - // check if we're blocked so far+ // Check if we're blocked so far. bool blocked = false; coord_def c1, c3; int real_length = 0;- for ( inray = 0; inray <= cellray; ++inray )+ for (inray = 0; inray <= cellray; ++inray) { const int xi = signx * ray_coord_x[inray + cur_offset]; const int yi = signy * ray_coord_y[inray + cur_offset];@@ -2419,13 +2419,13 @@ const double ray_slope_diff = find_shortest ? fabs(_slope_factor(fullrays[fullray]) - want_slope) : 0.0; - if ( !blocked- && (!find_shortest- || _superior_ray(shortest, imbalance,- real_length, cimbalance,- slope_diff, ray_slope_diff)))+ if (!blocked+ && (!find_shortest+ || _superior_ray(shortest, imbalance,+ real_length, cimbalance,+ slope_diff, ray_slope_diff))) {- // success!+ // Success! ray = fullrays[fullray]; ray.fullray_idx = fullray; @@ -2437,11 +2437,13 @@ ray.accx = 1.0 - ray.accx; if ( sourcey > targety ) ray.accy = 1.0 - ray.accy;+ ray.accx += sourcex; ray.accy += sourcey;+ _set_ray_quadrant(ray, sourcex, sourcey, targetx, targety); if (!find_shortest)- return true;+ return (true); } } }@@ -2450,24 +2452,24 @@ if (find_shortest && shortest != INFINITE_DISTANCE) return (true); - if ( allow_fallback )+ if (allow_fallback) { ray.accx = sourcex + 0.5; ray.accy = sourcey + 0.5;- if ( targetx == sourcex )+ if (targetx == sourcex) ray.slope = VERTICAL_SLOPE; else {- ray.slope = targety - sourcey;+ ray.slope = targety - sourcey; ray.slope /= targetx - sourcex;- if ( ray.slope < 0 )+ if (ray.slope < 0) ray.slope = -ray.slope; } _set_ray_quadrant(ray, sourcex, sourcey, targetx, targety); ray.fullray_idx = -1;- return true;+ return (true); }- return false;+ return (false); } // Count the number of matching features between two points along@@ -2485,8 +2487,10 @@ int max_dist = grid_distance(sourcex, sourcey, targetx, targety); ray.fullray_idx = -1; // to quiet valgrind- find_ray( sourcex, sourcey, targetx, targety, true, ray, 0, true, true ); + // We don't need to find the shortest beam, any beam will suffice.+ find_ray( sourcex, sourcey, targetx, targety, true, ray, 0, false, true );+ if (exclude_endpoints && ray.x() == sourcex && ray.y() == sourcey) { ray.advance(true);@@ -3497,7 +3501,7 @@ } // end show_map() -// Returns true if succeeded+// Returns true if succeeded. bool magic_mapping(int map_radius, int proportion, bool suppress_msg, bool force) {@@ -3610,11 +3614,11 @@ return true; } // end magic_mapping() -// realize that this is simply a repackaged version of+// Realize that this is simply a repackaged version of // stuff::see_grid() -- make certain they correlate {dlb}: bool mons_near(const monsters *monster, unsigned short foe) {- // early out -- no foe!+ // Early out -- no foe! if (foe == MHITNOT) return (false); @@ -3629,7 +3633,7 @@ return (false); } - // must be a monster+ // Must be a monster. const monsters *myFoe = &menv[foe]; if (myFoe->type >= 0) {@@ -3641,7 +3645,7 @@ } return (false);-} // end mons_near()+} bool mon_enemies_around(const monsters *monster) {@@ -3679,7 +3683,7 @@ return (false); } -// answers the question: "Is a grid within character's line of sight?"+// Answers the question: "Is a grid within character's line of sight?" bool see_grid( const coord_def &p ) { return see_grid(env.show, you.pos(), p);@@ -3702,6 +3706,8 @@ // Depending on the viewer's habitat, 'allowed' can be set to DNGN_FLOOR, // DNGN_SHALLOW_WATER or DNGN_DEEP_WATER. // Yes, this ignores lava-loving monsters.+// XXX: It turns out the beams are not symmetrical, i.e. switching+// pos1 and pos2 may result in small variations. bool grid_see_grid(int posx_1, int posy_1, int posx_2, int posy_2, dungeon_feature_type allowed) {This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

[crawl-ref-commits] SF.net SVN: crawl-ref: [5658] trunk/crawl-ref

From: <j-...@us...> - 2008-06-09 16:17:53

Revision: 5658 Author: j-p-e-gDate: 2008-06-09 09:17:48 -0700 (Mon, 09 Jun 2008)Log Message:-----------Yikes, so many files! And all I did was add more item evaluationfunctions for menu colouring and pickup...Added: emergency_item, good_item, dangerous_item, bad_item, and useless_item, all taking into account player species and mutations, so e.g. =see invisible is useless for Naga, and !poison is always bad but only useless if you don't know Evaporate.Never autopickup useless, dangerous (e.g. ?immolation) or inedible items, and simplify the item colour/pickup options accordingly. I'll have tosee if pickup.lua is still even needed after this.Removed the menu_colour_prefix_id option as I can't see any reason toturn it off.Oh, and fixed a bug where Kenku were unable to stop levitating if theygained level 15 while levitating.Modified Paths:-------------- trunk/crawl-ref/docs/options_guide.txt trunk/crawl-ref/settings/autopickup_exceptions.txt trunk/crawl-ref/settings/menu_colours.txt trunk/crawl-ref/source/acr.cc trunk/crawl-ref/source/clua.cc trunk/crawl-ref/source/debug.cc trunk/crawl-ref/source/describe.cc trunk/crawl-ref/source/effects.cc trunk/crawl-ref/source/externs.h trunk/crawl-ref/source/food.cc trunk/crawl-ref/source/food.h trunk/crawl-ref/source/initfile.cc trunk/crawl-ref/source/item_use.cc trunk/crawl-ref/source/itemname.cc trunk/crawl-ref/source/itemname.h trunk/crawl-ref/source/items.cc trunk/crawl-ref/source/output.cc trunk/crawl-ref/source/player.cc trunk/crawl-ref/source/quiver.cc trunk/crawl-ref/source/religion.cc trunk/crawl-ref/source/religion.h trunk/crawl-ref/source/spells1.cc trunk/crawl-ref/source/travel.ccModified: trunk/crawl-ref/docs/options_guide.txt===================================================================--- trunk/crawl-ref/docs/options_guide.txt2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/docs/options_guide.txt2008-06-09 16:17:48 UTC (rev 5658)@@ -1221,18 +1221,39 @@ stash (the results from Ctrl-F) Crawl has a couple of prefixes defined to make inventory colouring- easier. These are:- inedible (you cannot eat this or get no nutrition from it)- poisonous (chunks/corpses that are poisonous)- mutagenic (chunks/corpses that are mutagenic)- contaminated (chunks/corpses that may cause sickness, but- ignored for Kobolds, Ogres, Trolls, and Ghouls)- rot-inducing (chunks/corpses that cause rotting)- equipped (equipped items)- artefact (item is an artefact, whether identified or not)- evil_item (item is hated by the good gods)- evil_eating (eating this item is punished by the good gods)+ easier. These are, in order of definition:+ identified (The item is fully identified.)+ known (You recognize the item's subtype.)+ unidentified (You don't recognize the item's subtype.) + The following only apply to items whose subtype is known.+ evil_item (Your god would hate it if you used this item.)++ emergency_item (This item is invaluable in emergencies.)+ good_item (This item is generally a good item.)+ dangerous_item (Using this item can be dangerous.)+ bad_item (This item is generally a bad item.)+ useless_item (This item is of no use to you.)++ evil_eating (Eating this item is punished by the good gods.)+ inedible (You cannot eat this or get no nutrition from it.)+ poisonous (Chunks/corpses that are poisonous)+ mutagenic (Chunks/corpses that are mutagenic)+ contaminated (Chunks/corpses that may cause sickness, but+ ignored for Kobolds, Ogres, Trolls, and Ghouls.)+ rot-inducing (Chunks/corpses that cause rotting.)++ equipped (Equipped items.)+ artefact (For artefacts, whether identified or not.)++ When looking for menu_colour matches, these prefixes are prepended to + the actual item name, e.g. in the form of+ identified, evil_item wand of draining (4)+ unidentified, equipped, artefact sparkling ring++ If you want to colour all items that contain a certain prefix, use+ menu_colour = lightgreen:.*poisonous.*+ To colour worn stuff and highlight cursed items, take menu_colour = inventory:lightred:equipped.* cursed menu_colour = inventory:green:equippedModified: trunk/crawl-ref/settings/autopickup_exceptions.txt===================================================================--- trunk/crawl-ref/settings/autopickup_exceptions.txt2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/settings/autopickup_exceptions.txt2008-06-09 16:17:48 UTC (rev 5658)@@ -16,14 +16,8 @@ end end > -# universally bad options and scrolls-ae = potions? of (confusion|degeneration|poison|strong poison)-ae = potions? of (slowing|paralysis|decay|water)-ae = scrolls? of (paper|torment|immolation|curse weapon)-ae = scrolls? of (curse armour|random uselessness|noise)- # Excluding amulets as you only need one of each. Also for some rings.-# There is some (intended) overlap with pickup.lua, which also exludes+# There is some (intended) overlap with pickup.lua, which also excludes # the ring of hunger, for example. ae = amulet of (inaccuracy|gourmand|controlled flight|warding) ae = amulet of (resist mutation|resist slow|clarity|rage)@@ -31,61 +25,8 @@ ae = ring of (fire|ice|sustenance|invisibility) ae = ring of (magical power|regeneration) -: if you.race() == "Mummy" or you.race() == "Ghoul" then-ae = ring of life protection-: end--: if you.race() == "Mummy" then-ae = potion-ae = food-: end--: if you.race() ~= "Vampire" then-ae = potion.*blood-: end--: if you.race() == "Kenku" then-ae = potions? of levitation-: end- : if you.god() == "Trog" then ae = wizardry ae = staff : end -### armour exclusions ###--: if you.race() == "Centaur" then-ae = boots-: else-ae = centaur barding-: end--: if you.race() == "Naga" then-ae = boots-: else-ae = naga barding-: end--: if you.race() == "Ogre" or you.race() == "Ogre-Mage"-: or you.race() == "Troll" or you.race() == "Spriggan"-: or you.race() == "Draconian"-: then-ae = boots-ae = gloves-ae = helmet-ae = armour .* (mail|leather)-: end--: if you.race() == "Spriggan" then-ae = shield-: end--: if you.race() == "Ghoul" then-ae = gloves-: end--: if you.race() == "Kenku" then-ae = boots-ae = helmet-: endModified: trunk/crawl-ref/settings/menu_colours.txt===================================================================--- trunk/crawl-ref/settings/menu_colours.txt2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/settings/menu_colours.txt2008-06-09 16:17:48 UTC (rev 5658)@@ -9,16 +9,15 @@ menu = lightmagenta:.*orb.*Zot # Artefacts+# menu = white:.*artefact.* -# If Options.menu_colour_prefix_id is set to true, you can -# differentiate further. #menu = white:.*identified.*artefact.*-#menu = magenta:.*unidentified.*artefact.*+#menu = lightblue:.*unidentified.*artefact.* # Ego items #-: if options.menu_colour_prefix_class and options.menu_colour_prefix_id then+: if options.menu_colour_prefix_class then menu = lightblue:(^identified armour .* pair of .* of ) menu = lightgrey:(^identified armour .* pair of ) menu = lightblue:(^identified (weapon|armour) .* of )@@ -33,88 +32,30 @@ menu = lightblue:.*armour.*(runed|glowing|embroidered|shiny|dyed) :end -# Mummies' potions-#-: if you.race() == "Mummy" then-menu_colour = darkgrey:.*potion.*-: end+# Emergency items+menu = yellow:.*emergency_item.* -# Emergency items -#-menu = cyan:.*scroll.*(blinking|teleport|fear)-menu = cyan:.*wand.*(teleport|healing|hasting)-menu = cyan:.*potion.*(heal|berserk|speed|resistance)+# Good items+menu = cyan:.*good_item.* menu = cyan:.*misc.*[lL]antern -# Good items-#-menu = magenta:.*scroll.*(acquirement)-menu = magenta:.*potion.*(gain (strength|dexterity|intelligence))-menu = magenta:.*potion.*(experience|magic)-: if not you_real_undead() then-menu = magenta:.*potion.*(of mutation)-: else-menu = lightred:.*potion.*(of mutation)-: end+# Bad items+menu = lightred:.*bad_item.* -# Dangerous items-#-menu = lightred:.*scroll.*(forgetfulness|torment|curse armour)-menu = lightred:.*scroll.*(immolation|curse weapon)-menu = lightred:.*potion.*(slowing|degeneration|poison|confusion)-menu = lightred:.*potion.*(paralysis|decay)-menu = lightred:.*jewellery.*(inaccuracy|hunger)+# Dangerous (but still useful) items+menu = magenta:.*dangerous_item.* # Useless items-#-menu = darkgrey:.*scroll.*(random uselessness|paper|noise)-menu = darkgrey:.*potion.*water+menu = darkgrey:.*useless_item.* -: if you.race() == "Mummy" then-menu = darkgrey:.*jewellery.*(sustenance)-: end--: if you_real_undead() then-menu = darkgrey:.*jewellery.*(regeneration|rage)-: end--: if string.find(you.race(), "Draconian", 0, true) then-menu = darkgrey:.*jewellery.*(controlled flight)-ae = >amulet.*(controlled flight)-: end--: if you.race() == "Green Draconian" or you.race() == "Naga" then-menu = darkgrey:.*jewellery.*(poison resistance)-ae = >ring.*(poison resistance)-: end--< if you.race() == "Naga" or- you.race() == "Spriggan" or- you.race() == "Vampire" then >-menu = darkgrey:.*jewellery.*(see invis)-ae = >ring.*(see invis)-:end- : if you.race() == "Spriggan" then menu = darkgrey:.*jewellery.*(sustenance) ae = >ring.*(sustenance) :end -# need to save and restore after temple if you get trog later-: if you.god() == "Trog" then-menu = darkgrey:.*jewellery.*(rage|wizardry)-ae = >amulet.*(rage)-ae = >ring.*(wizardry)-: end--# Exceptions-#-menu = yellow:.*potion.*(porridge|gluggy white)- # Defaults for normal items #-menu = lightred:.* equipped.* cursed+menu = lightred:.*equipped.* cursed menu = green:.*equipped.* menu = green:uncursed menu = red:cursed-menu = lightgrey:^(scroll|potion|ring|amulet)Modified: trunk/crawl-ref/source/acr.cc===================================================================--- trunk/crawl-ref/source/acr.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/acr.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -2831,7 +2831,7 @@ } - if (!you.permanent_levitation())+ if (!you.permanent_levitation() && !you.permanent_flight()) { if ( _decrement_a_duration(DUR_LEVITATION, "You float gracefully downwards.",@@ -2841,7 +2841,7 @@ burden_change(); // Landing kills controlled flight. you.duration[DUR_CONTROLLED_FLIGHT] = 0;- // re-enter the terrain:+ // Re-enter the terrain. move_player_to_grid( you.x_pos, you.y_pos, false, true, true ); } }Modified: trunk/crawl-ref/source/clua.cc===================================================================--- trunk/crawl-ref/source/clua.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/clua.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -735,7 +735,7 @@ LUARET1(you_exp_points, number, you.experience) LUARET1(you_skill, number, lua_isstring(ls, 1) ? you.skills[str_to_skill(lua_tostring(ls, 1))]- : 0)+ : 0) LUARET1(you_res_poison, number, player_res_poison(false)) LUARET1(you_res_fire, number, player_res_fire(false)) LUARET1(you_res_cold, number, player_res_cold(false))@@ -752,6 +752,7 @@ LUARET1(you_where, string, level_id::current().describe().c_str()) LUARET1(you_branch, string, level_id::current().describe(false, false).c_str()) LUARET1(you_subdepth, number, level_id::current().depth)+// Increase by 1 because check happens on old level. LUARET1(you_absdepth, number, you.your_level + 1) LUAWRAP(you_stop_activity, interrupt_activity(AI_FORCE_INTERRUPT)) LUARET1(you_turns, number, you.num_turns)@@ -761,7 +762,6 @@ see_grid_no_trans(luaL_checkint(ls, 1), luaL_checkint(ls, 2))) LUARET1(you_can_smell, boolean, player_can_smell()) -// increase by 1 because check happens on old level void lua_push_floor_items(lua_State *ls); static int you_floor_items(lua_State *ls)@@ -1181,7 +1181,7 @@ "protection from magic", "fire", "ice",- "teleport control",+ "teleport control" }; static const char *amulet_types[] =@@ -1250,6 +1250,11 @@ return (2); } +// Used to divide a given potion into one of four categories:+// 0 : unknown potion+// 1 : always beneficial+// 2 : always bad+// 3 : depends on species etc. static int l_item_potion_type(lua_State *ls) { LUA_ITEM(item, 1);@@ -1291,7 +1296,7 @@ val = 2; break; - // need more refined handling:+ // Need more refined handling: // for eating habits case POT_BLOOD: case POT_BLOOD_COAGULATED:@@ -1316,7 +1321,7 @@ { LUA_ITEM(item, 1); bool cursed = item && item_ident(*item, ISFLAG_KNOW_CURSE)- && item_cursed(*item);+ && item_cursed(*item); lua_pushboolean(ls, cursed); return (1); }@@ -2192,8 +2197,6 @@ option_hboolean }, { "menu_colour_prefix_class", &Options.menu_colour_prefix_class, option_hboolean },- { "menu_colour_prefix_id", &Options.menu_colour_prefix_id,- option_hboolean }, }; static const option_handler *get_handler(const char *optname)Modified: trunk/crawl-ref/source/debug.cc===================================================================--- trunk/crawl-ref/source/debug.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/debug.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -1220,7 +1220,7 @@ ptr = strstr( strlwr(obj_name), specs ); if (ptr != NULL) {- // earliest match is the winner+ // Earliest match is the winner. if (ptr - obj_name < best_index) { mpr( obj_name );@@ -1238,7 +1238,7 @@ if (type_wanted == -1) {- // ds -- if specs is a valid int, try using that.+ // ds -- If specs is a valid int, try using that. // Since zero is atoi's copout, the wizard // must enter (subtype + 1). if (!(type_wanted = atoi(specs)))Modified: trunk/crawl-ref/source/describe.cc===================================================================--- trunk/crawl-ref/source/describe.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/describe.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -1798,8 +1798,7 @@ } } - if (is_good_god(you.religion) && is_evil_item(item)- && item_type_known(item))+ if (god_dislikes_item_handling(item)) { description << "$$" << god_name(you.religion) << " disapproves of the " << "use of such an item.";Modified: trunk/crawl-ref/source/effects.cc===================================================================--- trunk/crawl-ref/source/effects.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/effects.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -1693,28 +1693,24 @@ case WPN_GREAT_SWORD: case WPN_TRIPLE_SWORD:- thing.sub_type =- (coinflip() ? WPN_FALCHION : WPN_LONG_SWORD);+ thing.sub_type = (coinflip() ? WPN_FALCHION : WPN_LONG_SWORD); break; case WPN_GREAT_MACE: case WPN_DIRE_FLAIL:- thing.sub_type =- (coinflip() ? WPN_MACE : WPN_FLAIL);+ thing.sub_type = (coinflip() ? WPN_MACE : WPN_FLAIL); break; case WPN_BATTLEAXE: case WPN_EXECUTIONERS_AXE:- thing.sub_type =- (coinflip() ? WPN_HAND_AXE : WPN_WAR_AXE);+ thing.sub_type = (coinflip() ? WPN_HAND_AXE : WPN_WAR_AXE); break; case WPN_HALBERD: case WPN_GLAIVE: case WPN_SCYTHE: case WPN_BARDICHE:- thing.sub_type =- (coinflip() ? WPN_SPEAR : WPN_TRIDENT);+ thing.sub_type = (coinflip() ? WPN_SPEAR : WPN_TRIDENT); break; } break;@@ -2537,13 +2533,13 @@ mpr("Your body shudders with the violent release " "of wild energies!", MSGCH_WARN); - // for particularly violent releases, make a little boom+ // For particularly violent releases, make a little boom. if (you.magic_contamination >= 10 && coinflip()) { struct bolt boom;- boom.type = dchar_glyph(DCHAR_FIRED_BURST);- boom.colour = BLACK;- boom.flavour = BEAM_RANDOM;+ boom.type = dchar_glyph(DCHAR_FIRED_BURST);+ boom.colour = BLACK;+ boom.flavour = BEAM_RANDOM; boom.target_x = you.x_pos; boom.target_y = you.y_pos; // Undead enjoy extra contamination explosion damage because@@ -2554,11 +2550,11 @@ you.magic_contamination * (you.is_undead? 4 : 2) / 4 );- boom.thrower = KILL_MISC;- boom.aux_source = "a magical explosion";- boom.beam_source = NON_MONSTER;- boom.is_beam = false;- boom.is_tracer = false;+ boom.thrower = KILL_MISC;+ boom.aux_source = "a magical explosion";+ boom.beam_source = NON_MONSTER;+ boom.is_beam = false;+ boom.is_tracer = false; boom.is_explosion = true; boom.name = "magical storm"; Modified: trunk/crawl-ref/source/externs.h===================================================================--- trunk/crawl-ref/source/externs.h2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/externs.h2008-06-09 16:17:48 UTC (rev 5658)@@ -1769,7 +1769,6 @@ std::vector<message_colour_mapping> message_colour_mappings; bool menu_colour_prefix_class; // Prefix item class to string- bool menu_colour_prefix_id; // Prefix id-status to string std::vector<menu_sort_condition> sort_menus; Modified: trunk/crawl-ref/source/food.cc===================================================================--- trunk/crawl-ref/source/food.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/food.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -1914,6 +1914,29 @@ return 0; } +// Returns true if an item of basetype FOOD or CORPSES cannot currently+// be eaten (respecting species and mutations set).+bool is_inedible(const item_def &item)+{+ if (food_is_rotten(item)+ && !player_mutation_level(MUT_SAPROVOROUS))+ {+ return (true);+ }++ if (item.base_type == OBJ_FOOD+ && !can_ingest(item.base_type, item.sub_type, true, true, false))+ {+ return (true);+ }+ if (item.base_type == OBJ_CORPSES+ && (item.sub_type == CORPSE_SKELETON+ || you.species == SP_VAMPIRE && !mons_has_blood(item.plus)))+ {+ return (true);+ }+ return (false);+} // As we want to avoid autocolouring the entire food selection, this should // be restricted to the absolute highlights, even though other stuff may // still be edible or even delicious.Modified: trunk/crawl-ref/source/food.h===================================================================--- trunk/crawl-ref/source/food.h2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/food.h2008-06-09 16:17:48 UTC (rev 5658)@@ -87,6 +87,7 @@ bool is_mutagenic(const item_def &food); bool is_contaminated(const item_def &food); bool causes_rot(const item_def &food);+bool is_inedible(const item_def &item); bool is_preferred_food(const item_def &food); bool can_ingest(int what_isit, int kindof_thing, bool suppress_msg,Modified: trunk/crawl-ref/source/initfile.cc===================================================================--- trunk/crawl-ref/source/initfile.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/initfile.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -880,7 +880,6 @@ sound_mappings.clear(); menu_colour_mappings.clear(); menu_colour_prefix_class = false;- menu_colour_prefix_id = false; message_colour_mappings.clear(); drop_filter.clear(); map_file_name.clear();@@ -2637,8 +2636,6 @@ } else BOOL_OPTION(menu_colour_prefix_class); else BOOL_OPTION_NAMED("menu_color_prefix_class", menu_colour_prefix_class);- else BOOL_OPTION(menu_colour_prefix_id);- else BOOL_OPTION_NAMED("menu_color_prefix_id", menu_colour_prefix_id); else if (key == "message_colour" || key == "message_color") { add_message_colour_mappings(field);Modified: trunk/crawl-ref/source/item_use.cc===================================================================--- trunk/crawl-ref/source/item_use.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/item_use.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -870,6 +870,7 @@ { if (verbose) mpr("You can't wear that!");+ return (false); } @@ -932,7 +933,7 @@ } else if (slot == EQ_HELMET) {- // soft helmets (caps and wizard hats) always fit+ // Soft helmets (caps and wizard hats) always fit. if (!is_hard_helmet( item )) return (true); @@ -1535,7 +1536,6 @@ int get_ammo_to_shoot(int item, dist &target, bool teleport) {- mpr("in get_ammo_to_shoot()"); if (_fire_warn_if_impossible()) { flush_input_buffer( FLUSH_ON_FAILURE );@@ -1559,10 +1559,8 @@ // If item passed, it will be put into the quiver. void fire_thing(int item) {- mpr("in fire_thing()"); dist target; item = get_ammo_to_shoot(item, target);- mpr("back in fire_thing()"); if (item == -1) return; Modified: trunk/crawl-ref/source/itemname.cc===================================================================--- trunk/crawl-ref/source/itemname.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/itemname.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -24,6 +24,7 @@ #ifdef DOS #include <conio.h> #endif+#include "clua.h" #include "externs.h" @@ -32,6 +33,7 @@ #include "initfile.h" #include "invent.h" #include "it_use2.h"+#include "item_use.h" #include "itemprop.h" #include "macro.h" #include "makeitem.h"@@ -2151,55 +2153,336 @@ return (false); } -const std::string menu_colour_item_prefix(const item_def &item)+// Returns true if an item is a potential life saver in an emergency situation.+bool is_emergency_item(const item_def &item) {- std::vector<std::string> prefixes;+ if (!item_type_known(item))+ return (false); - if (Options.menu_colour_prefix_id)+ switch (item.base_type) {- if (item_ident(item, ISFLAG_KNOW_TYPE)- || item.base_type == OBJ_FOOD- || item.base_type == OBJ_CORPSES)+ case OBJ_WANDS:+ switch (item.sub_type) {- prefixes.push_back("identified");+ case WAND_HASTING:+ case WAND_HEALING:+ case WAND_TELEPORTATION:+ return (true);+ default:+ return (false); }- else+ case OBJ_SCROLLS:+ switch (item.sub_type) {- if (get_ident_type(item.base_type,- item.sub_type) == ID_KNOWN_TYPE)+ case SCR_TELEPORTATION:+ case SCR_BLINKING:+ case SCR_FEAR:+ return (true);+ default:+ return (false);+ }+ case OBJ_POTIONS:+ if (you.species == SP_MUMMY)+ return (false);++ switch (item.sub_type)+ {+ case POT_SPEED:+ case POT_HEALING:+ case POT_HEAL_WOUNDS:+ case POT_RESISTANCE:+ return (true);+ default:+ return (false);+ }+ default:+ return (false);+ }+}++// Returns true if an item can be considered particularly good.+bool is_good_item(const item_def &item)+{+ if (!item_type_known(item))+ return (false);++ if (is_emergency_item(item))+ return (true);++ if (is_useless_item(item) || is_dangerous_item(item))+ return (false);++ switch (item.base_type)+ {+ case OBJ_SCROLLS:+ return (item.sub_type == SCR_ACQUIREMENT);+ case OBJ_POTIONS:+ switch (item.sub_type)+ {+ case POT_CURE_MUTATION:+ case POT_GAIN_STRENGTH:+ case POT_GAIN_INTELLIGENCE:+ case POT_GAIN_DEXTERITY:+ case POT_EXPERIENCE:+ case POT_MAGIC:+ case POT_BERSERK_RAGE:+ case POT_MIGHT:+ case POT_RESTORE_ABILITIES:+ return (true);+ default:+ return (false);+ }+ default:+ return (false);+ }+}++// Returns true if using an item only has harmful effects.+bool is_bad_item(const item_def &item)+{+ if (!item_type_known(item))+ return (false);++ switch (item.base_type)+ {+ case OBJ_SCROLLS:+ switch (item.sub_type)+ {+ case SCR_CURSE_ARMOUR:+ case SCR_CURSE_WEAPON:+ return (true);+ default:+ return (false);+ }+ case OBJ_POTIONS:+ switch (item.sub_type)+ {+ case POT_CONFUSION:+ case POT_SLOWING:+ case POT_DEGENERATION:+ case POT_DECAY:+ case POT_POISON:+ case POT_STRONG_POISON:+ case POT_PARALYSIS:+ return (true);+ case POT_MUTATION:+ return (you.is_undead+ && (you.species != SP_VAMPIRE+ || you.hunger_state < HS_SATIATED));+ default:+ return (false);+ }+ case OBJ_JEWELLERY:+ switch (item.sub_type)+ {+ case AMU_INACCURACY:+ return (true);+ case RING_HUNGER:+ // Even Vampires can use this ring.+ return (!you.is_undead);+ default:+ return (false);+ }+ case OBJ_MISCELLANY:+ return (item.sub_type == MISC_CRYSTAL_BALL_OF_FIXATION);++ default:+ return (false);+ }+}++// Returns true if using an item is risky but may occasionally be worthwhile.+bool is_dangerous_item(const item_def &item)+{+ if (!item_type_known(item))+ {+ // Use-IDing these is extremely dangerous!+ if (item.base_type == OBJ_MISCELLANY+ && (item.sub_type == MISC_CRYSTAL_BALL_OF_SEEING+ || item.sub_type == MISC_CRYSTAL_BALL_OF_ENERGY+ || item.sub_type == MISC_CRYSTAL_BALL_OF_FIXATION))+ {+ return (true);+ }+ return (false);+ }++ switch (item.base_type)+ {+ case OBJ_SCROLLS:+ switch (item.sub_type)+ {+ case SCR_IMMOLATION:+ case SCR_TORMENT:+ return (true);+ default:+ return (false);+ }+ case OBJ_POTIONS:+ switch (item.sub_type)+ {+ case POT_MUTATION:+ // Only living characters can mutate.+ return (!you.is_undead+ || you.species == SP_VAMPIRE+ && you.hunger_state >= HS_SATIATED);+ default:+ return (false);+ }+ default:+ return (false);+ }+}++bool is_useless_item(const item_def &item)+{+ if (!item_type_known(item))+ return (false);++ switch (item.base_type)+ {+ case OBJ_ARMOUR:+ return (!can_wear_armour(item, false, true));++ case OBJ_SCROLLS:+ if (is_bad_item(item))+ return (true);++ switch (item.sub_type)+ {+ case SCR_PAPER:+ case SCR_RANDOM_USELESSNESS:+ case SCR_NOISE:+ return (true);+ default:+ return (false);+ }+ case OBJ_WANDS:+ return (item.plus2 == ZAPCOUNT_EMPTY);++ case OBJ_POTIONS:+ {+ // Certainly not useless if it can be used for attacking.+ if (is_bad_item(item))+ return (!player_knows_spell(SPELL_EVAPORATE));++ if (you.species == SP_MUMMY)+ return (true);++ if (you.species == SP_GHOUL+ || you.species == SP_VAMPIRE && you.hunger_state >= HS_SATIATED)+ {+ switch (item.sub_type) {- // Wands are only fully identified if we know the- // number of charges.- if (item.base_type == OBJ_WANDS)- prefixes.push_back("known");+ case POT_BERSERK_RAGE:+ case POT_CURE_MUTATION:+ case POT_GAIN_STRENGTH:+ case POT_GAIN_INTELLIGENCE:+ case POT_GAIN_DEXTERITY:+ return (true);+ }+ }+ switch (item.sub_type)+ {+ case POT_LEVITATION:+ return (you.permanent_levitation() || you.permanent_flight());+ case POT_PORRIDGE:+ case POT_BLOOD:+ case POT_BLOOD_COAGULATED:+ return (!can_ingest(item.base_type, item.sub_type, true, true,+ false));+ } - // Rings are fully identified simply by knowing their- // type, unless the ring has plusses, like a ring of- // dexterity.- else if (item.base_type == OBJ_JEWELLERY- && !jewellery_is_amulet(item))- {- if (item.plus == 0 && item.plus2 == 0)- prefixes.push_back("identified");- else- prefixes.push_back("known");- }- // All other types of magical items are fully identified- // simply by knowing the type+ return (false);+ }+ case OBJ_JEWELLERY:+ if (is_bad_item(item))+ return (true);++ if (you.species == SP_MUMMY || you.species == SP_GHOUL)+ {+ switch (item.sub_type)+ {+ case AMU_RAGE:+ case RING_REGENERATION:+ case RING_SUSTENANCE:+ case RING_HUNGER:+ case RING_LIFE_PROTECTION:+ return (true);+ }+ }++ if (item.sub_type == RING_SEE_INVISIBLE)+ return (player_mutation_level(MUT_ACUTE_VISION));++ if (item.sub_type == RING_POISON_RESISTANCE)+ {+ return (you.species != SP_VAMPIRE+ && player_mutation_level(MUT_POISON_RESISTANCE));+ }++ if (item.sub_type == AMU_CONTROLLED_FLIGHT)+ return (player_genus(GENPC_DRACONIAN) || you.permanent_flight());++ if (you.religion == GOD_TROG)+ {+ return (item.sub_type == RING_WIZARDRY+ || item.sub_type == AMU_RAGE);+ }+ default:+ return (false);+ }+}++const std::string menu_colour_item_prefix(const item_def &item)+{+ std::vector<std::string> prefixes;++ if (item_ident(item, ISFLAG_KNOW_TYPE))+ prefixes.push_back("identified");+ else+ {+ if (get_ident_type(item.base_type, item.sub_type) == ID_KNOWN_TYPE)+ {+ // Wands are only fully identified if we know the+ // number of charges.+ if (item.base_type == OBJ_WANDS)+ prefixes.push_back("known");++ // Rings are fully identified simply by knowing their+ // type, unless the ring has plusses, like a ring of+ // dexterity.+ else if (item.base_type == OBJ_JEWELLERY+ && !jewellery_is_amulet(item))+ {+ if (item.plus == 0 && item.plus2 == 0)+ prefixes.push_back("identified"); else- prefixes.push_back("identified");+ prefixes.push_back("known"); }+ // All other types of magical items are fully identified+ // simply by knowing the type else- prefixes.push_back("unidentified");+ prefixes.push_back("identified"); }+ else+ prefixes.push_back("unidentified"); } - if (is_good_god(you.religion) && is_evil_item(item)- && item_type_known(item))- {+ if (god_dislikes_item_handling(item)) prefixes.push_back("evil_item");- } + if (is_emergency_item(item))+ prefixes.push_back("emergency_item");+ if (is_good_item(item))+ prefixes.push_back("good_item");+ if (is_dangerous_item(item))+ prefixes.push_back("dangerous_item");+ if (is_bad_item(item))+ prefixes.push_back("bad_item");+ if (is_useless_item(item))+ prefixes.push_back("useless_item");+ switch (item.base_type) { case OBJ_CORPSES:@@ -2219,14 +2502,8 @@ prefixes.push_back("evil_eating"); } - if (item.base_type != OBJ_CORPSES- && !can_ingest(item.base_type, item.sub_type, true, true, false)- || you.species == SP_VAMPIRE && !mons_has_blood(item.plus)- || food_is_rotten(item)- && !player_mutation_level(MUT_SAPROVOROUS))- {+ if (is_inedible(item)) prefixes.push_back("inedible");- } else if (is_preferred_food(item)) prefixes.push_back("preferred"); Modified: trunk/crawl-ref/source/itemname.h===================================================================--- trunk/crawl-ref/source/itemname.h2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/itemname.h2008-06-09 16:17:48 UTC (rev 5658)@@ -109,6 +109,11 @@ bool item_type_tried( const item_def &item ); bool is_interesting_item( const item_def& item );+bool is_emergency_item( const item_def& item );+bool is_good_item(const item_def &item);+bool is_bad_item(const item_def &item);+bool is_dangerous_item( const item_def& item );+bool is_useless_item(const item_def &item); std::string make_name( unsigned long seed, bool all_caps ); Modified: trunk/crawl-ref/source/items.cc===================================================================--- trunk/crawl-ref/source/items.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/items.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -1684,7 +1684,7 @@ // Look for similar item to stack: for (int i = igrd[x][y]; i != NON_ITEM; i = mitm[i].link) {- // check if item already linked here -- don't want to unlink it+ // Check if item already linked here -- don't want to unlink it. if (*obj == i) return (false); @@ -1939,7 +1939,7 @@ if (is_blood_potion(you.inv[item_dropped]) && you.inv[item_dropped].quantity != quant_drop) {- // oldest potions have been dropped+ // Oldest potions have been dropped. for (int i = 0; i < quant_drop; i++) remove_oldest_blood_potion(you.inv[item_dropped]); }@@ -2202,7 +2202,7 @@ if (Options.never_pickup[i].matches(iname)) return (true); - return false;+ return (false); } static bool _is_forced_autopickup(const item_def &item, std::string &iname)@@ -2213,7 +2213,8 @@ for (unsigned i = 0, size = Options.always_pickup.size(); i < size; ++i) if (Options.always_pickup[i].matches(iname)) return (true);- return false;++ return (false); } bool item_needs_autopickup(const item_def &item)@@ -2228,11 +2229,13 @@ return (true); std::string itemname;- return (((Options.autopickups & (1L << item.base_type))+ return ((Options.autopickups & (1L << item.base_type)+ && !is_useless_item(item) && !is_inedible(item)+ && !is_dangerous_item(item) #ifdef CLUA_BINDINGS- && clua.callbooleanfn(true, "ch_autopickup", "u", &item)+ && clua.callbooleanfn(true, "ch_autopickup", "u", &item) #endif- || _is_forced_autopickup(item, itemname))+ || _is_forced_autopickup(item, itemname)) && (Options.pickup_dropped || !(item.flags & ISFLAG_DROPPED)) && !_is_denied_autopickup(item, itemname)); }Modified: trunk/crawl-ref/source/output.cc===================================================================--- trunk/crawl-ref/source/output.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/output.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -650,12 +650,14 @@ if (wearing_amulet( AMU_CONTROLLED_FLIGHT )) { int color = _dur_colour( you.light_flight()? BLUE : MAGENTA,- (you.duration[DUR_LEVITATION] <= 10 && !perm) );+ (you.duration[DUR_LEVITATION] <= 10+ && !perm) ); out.push_back(status_light(color, "Fly")); } else {- int color = _dur_colour(BLUE, (you.duration[DUR_LEVITATION] <= 10 && !perm));+ int color = _dur_colour(BLUE, (you.duration[DUR_LEVITATION] <= 10+ && !perm)); out.push_back(status_light(color, "Lev")); } }@@ -1457,7 +1459,7 @@ for (unsigned int i=1; i < mons.size(); i++) if (! monster_pane_info::less_than(mons[i-1], mons[i])) -- lines_needed;- } + } #if BOTTOM_JUSTIFY_MONSTER_LIST const int skip_lines = std::max<int>(0, crawl_view.mlistsz.y-lines_needed);Modified: trunk/crawl-ref/source/player.cc===================================================================--- trunk/crawl-ref/source/player.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/player.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -580,51 +580,51 @@ } } -// checks whether the player's current species can-// use (usually wear) a given piece of equipment+// Checks whether the player's current species can+// use (usually wear) a given piece of equipment. // Note that EQ_BODY_ARMOUR and EQ_HELMET only check-// the ill-fitting variant (i.e. not caps and robes)+// the ill-fitting variant (i.e. not caps and robes). // If special_armour is set to true, special cases // such as bardings, light armour and caps are // considered. Otherwise these simply return false. // ------------------------------------------------- bool you_can_wear(int eq, bool special_armour) {- // these can be used by all- if (eq == EQ_LEFT_RING || eq == EQ_RIGHT_RING || eq == EQ_AMULET- || eq == EQ_WEAPON || eq == EQ_CLOAK)- {- return true;- }+ // These can be used by all.+ if (eq == EQ_LEFT_RING || eq == EQ_RIGHT_RING || eq == EQ_AMULET+ || eq == EQ_WEAPON || eq == EQ_CLOAK)+ {+ return (true);+ } - // anyone can wear caps/hats and robes and at least one of buckler/shield- if (special_armour- && (eq == EQ_HELMET || eq == EQ_BODY_ARMOUR || eq == EQ_SHIELD))- {- return true;- }+ // Anyone can wear caps/hats and robes and at least one of buckler/shield.+ if (special_armour+ && (eq == EQ_HELMET || eq == EQ_BODY_ARMOUR || eq == EQ_SHIELD))+ {+ return (true);+ } - if (eq == EQ_BOOTS && (you.species == SP_NAGA || you.species == SP_CENTAUR))- return (special_armour);+ if (eq == EQ_BOOTS && (you.species == SP_NAGA || you.species == SP_CENTAUR))+ return (special_armour); - // of the remaining items, these races can't wear anything- if (you.species == SP_TROLL || you.species == SP_SPRIGGAN- || player_genus(GENPC_OGRE) || player_genus(GENPC_DRACONIAN))- {- return false;- }+ // Of the remaining items, these races can't wear anything.+ if (you.species == SP_TROLL || you.species == SP_SPRIGGAN+ || player_genus(GENPC_OGRE) || player_genus(GENPC_DRACONIAN))+ {+ return (false);+ } - if (you.species == SP_KENKU && (eq == EQ_HELMET || eq == EQ_BOOTS))- return false;+ if (you.species == SP_KENKU && (eq == EQ_HELMET || eq == EQ_BOOTS))+ return (false); - if (player_mutation_level(MUT_HORNS) && eq == EQ_HELMET)- return (special_armour);+ if (player_mutation_level(MUT_HORNS) && eq == EQ_HELMET)+ return (special_armour); - if (you.species == SP_GHOUL && eq == EQ_GLOVES)- return false;+ if (you.species == SP_GHOUL && eq == EQ_GLOVES)+ return (false); - // else no problems- return true;+ // Else, no problems.+ return (true); } bool player_has_feet()@@ -826,7 +826,7 @@ break; case EQ_ALL_ARMOUR:- // doesn't make much sense here... be specific. -- bwr+ // Doesn't make much sense here... be specific. -- bwr break; default:@@ -1003,7 +1003,7 @@ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT) return 1; - // jmf: hunger isn't fair while you can't eat+ // jmf: Hunger isn't fair while you can't eat. // Actually, it is since you can detransform any time you like -- bwr if (you.attribute[ATTR_TRANSFORMATION] == TRAN_AIR) return 0;@@ -1167,22 +1167,22 @@ break; } - /* randarts */+ // randarts rm += scan_randarts(RAP_MAGIC); - /* armour */+ // armour rm += 30 * player_equip_ego_type( EQ_ALL_ARMOUR, SPARM_MAGIC_RESISTANCE ); - /* rings of magic resistance */+ // rings of magic resistance rm += 40 * player_equip( EQ_RINGS, RING_PROTECTION_FROM_MAGIC ); - /* Enchantment skill */+ // Enchantment skill rm += 2 * you.skills[SK_ENCHANTMENTS]; - /* Mutations */+ // Mutations rm += 30 * player_mutation_level(MUT_MAGIC_RESISTANCE); - /* transformations */+ // transformations if (you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH) rm += 50; @@ -1289,14 +1289,14 @@ rc++; } - /* rings of fire resistance/fire */+ // rings of fire resistance/fire rc += player_equip( EQ_RINGS, RING_PROTECTION_FROM_COLD, calc_unid ); rc += player_equip( EQ_RINGS, RING_ICE, calc_unid ); - /* rings of ice */+ // rings of ice rc -= player_equip( EQ_RINGS, RING_FIRE, calc_unid ); - /* Staves */+ // Staves rc += player_equip( EQ_STAFF, STAFF_COLD, calc_unid ); // body armour:@@ -2760,8 +2760,8 @@ if (is_flying_light != was_flying_light) {- mpr(is_flying_light? "You feel quicker in the air."- : "You feel heavier in the air.");+ mpr(is_flying_light ? "You feel quicker in the air."+ : "You feel heavier in the air."); } return you.burden;@@ -6257,15 +6257,13 @@ // all times. This is so that you can evoke stop-levitation // in order to actually cancel levitation (by setting // DUR_LEVITATION to 1.) Note that antimagic() won't do this.- return (airborne()- && (permanent_flight()- || player_equip_ego_type( EQ_BOOTS, SPARM_LEVITATION )- && you.duration[DUR_LEVITATION] > 1));+ return (airborne() && player_equip_ego_type(EQ_BOOTS, SPARM_LEVITATION)+ && you.duration[DUR_LEVITATION] > 1); } bool player::permanent_flight() const {- return (airborne()+ return (airborne() && wearing_amulet( AMU_CONTROLLED_FLIGHT ) && you.species == SP_KENKU && you.experience_level >= 15); } Modified: trunk/crawl-ref/source/quiver.cc===================================================================--- trunk/crawl-ref/source/quiver.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/quiver.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -20,9 +20,6 @@ #include <algorithm> -// checks base_type for OBJ_UNASSIGNED, and quantity-// bool is_valid_item( const item_def &item )- static int _get_pack_slot(const item_def&); static ammo_t _get_weapon_ammo_type(const item_def*); static bool _item_matches(const item_def &item, fire_type types, const item_def* launcher);@@ -55,14 +52,18 @@ if (slot == -1) { // Not in inv, but caller can at least get the type of the item.- if (item_out) *item_out = &m_last_used_of_type[m_last_used_type];+ if (item_out)+ *item_out = &m_last_used_of_type[m_last_used_type]; } else { // Return the item in inv, since it will have an accurate count- if (item_out) *item_out = &you.inv[slot];+ if (item_out)+ *item_out = &you.inv[slot]; }- if (slot_out) *slot_out = slot;++ if (slot_out)+ *slot_out = slot; } // Return inv slot of item that should be fired by default.@@ -76,7 +77,7 @@ get_desired_item(&desired_item, &slot); - // If not in inv, try the head of the fire order+ // If not in inv, try the head of the fire order. if (slot == -1) { std::vector<int> order;@@ -85,7 +86,7 @@ slot = order[0]; } - // If we can't find anything, tell caller why+ // If we can't find anything, tell caller why. if (slot == -1) { std::vector<int> full_fire_order;@@ -119,7 +120,7 @@ return slot; } -// Notification that ltem was fired with 'f'+// Notification that item was fired with 'f'. void player_quiver::on_item_fired(const item_def& item) { // If item matches the launcher, put it in that launcher's last-used item.@@ -144,10 +145,10 @@ you.redraw_quiver = true; } -// Notification that ltem was fired with 'f' 'i'+// Notification that item was fired with 'f' 'i' void player_quiver::on_item_fired_fi(const item_def& item) {- // currently no difference+ // Currently no difference. on_item_fired(item); } @@ -246,7 +247,7 @@ { const int inv_start = (ignore_inscription_etc ? 0 : Options.fire_items_start); - // If in a net, cannot throw anything, and can only launch from blowgun+ // If in a net, cannot throw anything, and can only launch from blowgun. if (you.attribute[ATTR_HELD]) { if (launcher && launcher->sub_type == WPN_BLOWGUN)@@ -264,7 +265,7 @@ if (you.equip[EQ_WEAPON] == i_inv) continue; - // =f prevents item from being in fire order+ // =f prevents item from being in fire order. if (!ignore_inscription_etc && strstr(item.inscription.c_str(), "=f")) {@@ -358,9 +359,10 @@ // Helpers // ---------------------------------------------------------------------- -// Helper for _get_fire_order-// types may actually contain more than one fire_type-static bool _item_matches(const item_def &item, fire_type types, const item_def* launcher)+// Helper for _get_fire_order.+// Types may actually contain more than one fire_type.+static bool _item_matches(const item_def &item, fire_type types,+ const item_def* launcher) { ASSERT(is_valid_item(item)); @@ -390,9 +392,9 @@ else if (item.base_type == OBJ_WEAPONS && is_throwable(item, you.body_size())) {- if ( (types & FIRE_RETURNING)- && item.special == SPWPN_RETURNING- && item_ident(item, ISFLAG_KNOW_TYPE))+ if ((types & FIRE_RETURNING)+ && item.special == SPWPN_RETURNING+ && item_ident(item, ISFLAG_KNOW_TYPE)) { return (true); }@@ -408,7 +410,7 @@ return (false); } -// Return inv slot that contains an item that looks like item,+// Returns inv slot that contains an item that looks like item, // or -1 if not in inv. static int _get_pack_slot(const item_def& item) {@@ -426,7 +428,7 @@ } -// Return the type of ammo used by the player's equipped weapon,+// Returns the type of ammo used by the player's equipped weapon, // or AMMO_THROW if it's not a launcher. static ammo_t _get_weapon_ammo_type(const item_def* weapon) {@@ -455,6 +457,6 @@ static bool _items_similar(const item_def& a, const item_def& b) {- // this is a reasonable implementation for now+ // This is a reasonable implementation for now. return items_stack(a, b, true); }Modified: trunk/crawl-ref/source/religion.cc===================================================================--- trunk/crawl-ref/source/religion.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/religion.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -2712,6 +2712,15 @@ return retval; } +bool god_dislikes_item_handling(const item_def &item)+{+ return (item_type_known(item)+ && (is_good_god(you.religion) && is_evil_item(item)+ || you.religion == GOD_TROG && item.base_type == OBJ_BOOKS+ && item.sub_type != BOOK_MANUAL+ && item.sub_type != BOOK_DESTRUCTION));+}+ // Is the destroyed weapon valuable enough to gain piety by doing so? // Evil weapons are handled specially. static bool _destroyed_valuable_weapon(int value, int type)Modified: trunk/crawl-ref/source/religion.h===================================================================--- trunk/crawl-ref/source/religion.h2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/religion.h2008-06-09 16:17:48 UTC (rev 5658)@@ -97,6 +97,7 @@ void beogh_convert_orc(monsters *orc, bool emergency, bool converted_by_follower = false); bool is_evil_item(const item_def& item);+bool god_dislikes_item_handling(const item_def &item); bool ely_destroy_weapons(); bool trog_burn_books(); bool tso_unchivalric_attack_safe_monster(const actor *act);Modified: trunk/crawl-ref/source/spells1.cc===================================================================--- trunk/crawl-ref/source/spells1.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/spells1.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -1267,8 +1267,11 @@ DUR_SLAYING, DUR_STEALTH, DUR_MAGIC_SHIELD, DUR_SAGE }; - if (!you.permanent_levitation() && you.duration[DUR_LEVITATION] > 2)+ if (!you.permanent_levitation() && !you.permanent_flight()+ && you.duration[DUR_LEVITATION] > 2)+ { you.duration[DUR_LEVITATION] = 2;+ } if (!you.permanent_flight() && you.duration[DUR_CONTROLLED_FLIGHT] > 1) you.duration[DUR_CONTROLLED_FLIGHT] = 1;Modified: trunk/crawl-ref/source/travel.cc===================================================================--- trunk/crawl-ref/source/travel.cc2008-06-09 16:17:21 UTC (rev 5657)+++ trunk/crawl-ref/source/travel.cc2008-06-09 16:17:48 UTC (rev 5658)@@ -520,8 +520,9 @@ _set_pass_feature(DNGN_DEEP_WATER, water); // Permanently levitating players can cross most hostile terrain.- const signed char trav = (you.permanent_levitation() ? TRAVERSABLE- : IMPASSABLE);+ const signed char trav = (you.permanent_levitation()+ || you.permanent_flight() ? TRAVERSABLE+ : IMPASSABLE); if (water != TRAVERSABLE) _set_pass_feature(DNGN_DEEP_WATER, trav);This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

<< < 1 2 3 4 .. 13 > >> (Page 2 of 13)

Thread: [crawl-ref-commits] SF.net SVN: crawl-ref: [3084] trunk/crawl-ref (Page 2) (2024)

References

Top Articles
Latest Posts
Article information

Author: Terrell Hackett

Last Updated:

Views: 6734

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Terrell Hackett

Birthday: 1992-03-17

Address: Suite 453 459 Gibson Squares, East Adriane, AK 71925-5692

Phone: +21811810803470

Job: Chief Representative

Hobby: Board games, Rock climbing, Ghost hunting, Origami, Kabaddi, Mushroom hunting, Gaming

Introduction: My name is Terrell Hackett, I am a gleaming, brainy, courageous, helpful, healthy, cooperative, graceful person who loves writing and wants to share my knowledge and understanding with you.