summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-07 10:44:55 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-07 10:44:55 +0000
commite73443245850c17be63996e97549416d6cba1759 (patch)
treeca57253e1c3b350117bd63e320d714c7a3204a60 /crawl-ref/source
parent1219201e4079858b2963b4c943488e1c0b93d26c (diff)
downloadcrawl-ref-e73443245850c17be63996e97549416d6cba1759.tar.gz
crawl-ref-e73443245850c17be63996e97549416d6cba1759.zip
Tiles: Save per-character equipment setting and use it in the character
selection menu. TODO: Use this instead of dolls.txt for initialising dolls, falling back on dolls.txt if name.tdl cannot be found and for new characters. I've tried displaying floor type but found it resulted in an information overload, and also distracts from the main information (species, equipment), esp. since it's mostly floor and most of the tile is covered anyway. I left it in (though commented out), so it's in the repository, but will remove it afterwards. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10122 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/defines.h14
-rw-r--r--crawl-ref/source/externs.h30
-rw-r--r--crawl-ref/source/files.cc100
-rw-r--r--crawl-ref/source/itemname.cc156
-rw-r--r--crawl-ref/source/itemname.h3
-rw-r--r--crawl-ref/source/menu.cc7
-rw-r--r--crawl-ref/source/newgame.cc24
-rw-r--r--crawl-ref/source/player.cc5
-rw-r--r--crawl-ref/source/player.h34
-rw-r--r--crawl-ref/source/rltiles/dc-corpse.txt370
-rw-r--r--crawl-ref/source/rltiles/dc-mon.txt4
-rw-r--r--crawl-ref/source/tilepick.cc123
-rw-r--r--crawl-ref/source/tilereg.cc35
-rw-r--r--crawl-ref/source/tilereg.h1
-rw-r--r--crawl-ref/source/tiles.h3
-rw-r--r--crawl-ref/source/tiletex.cc2
16 files changed, 583 insertions, 328 deletions
diff --git a/crawl-ref/source/defines.h b/crawl-ref/source/defines.h
index 0cff5e5a67..42f083ffb6 100644
--- a/crawl-ref/source/defines.h
+++ b/crawl-ref/source/defines.h
@@ -280,13 +280,13 @@ enum GotoRegion
// Mouse modes (for tiles)
enum mouse_mode
{
- MOUSE_MODE_NORMAL,
- MOUSE_MODE_COMMAND,
- MOUSE_MODE_TARGET,
- MOUSE_MODE_TARGET_DIR,
- MOUSE_MODE_TARGET_PATH,
- MOUSE_MODE_MORE,
- MOUSE_MODE_MACRO
+ MOUSE_MODE_NORMAL,
+ MOUSE_MODE_COMMAND,
+ MOUSE_MODE_TARGET,
+ MOUSE_MODE_TARGET_DIR,
+ MOUSE_MODE_TARGET_PATH,
+ MOUSE_MODE_MORE,
+ MOUSE_MODE_MACRO
};
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 2f0aa523a3..c2a0ec73be 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -28,18 +28,6 @@
#include "store.h"
#ifdef USE_TILE
-// This used to be in tiles.h. (jpeg)
-#include "tiledef-main.h"
-#include "tiledef-dngn.h"
-#include "tiledef-player.h"
-
-struct dolls_data
-{
- dolls_data() { memset(parts, 0, sizeof(parts)); }
-
- int parts[TILEP_PART_MAX];
-};
-
struct tile_flavour
{
// The floor tile to use.
@@ -1181,24 +1169,6 @@ protected:
extern player you;
-struct player_save_info
-{
- std::string name;
- unsigned long experience;
- int experience_level;
- bool wizard;
- species_type species;
- std::string class_name;
- god_type religion;
-#ifdef USE_TILE
- dolls_data doll;
-#endif
-
- player_save_info operator=(const player& rhs);
- bool operator<(const player_save_info& rhs) const;
- std::string short_desc() const;
-};
-
class monster_spells : public FixedVector<spell_type, NUM_MONSTER_SPELL_SLOTS>
{
public:
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index 506530b621..47adcea3bb 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -65,6 +65,7 @@ REVISION("$Rev$");
#include "mon-util.h"
#include "mstuff2.h"
#include "mtransit.h"
+#include "newgame.h"
#include "notes.h"
#include "output.h"
#include "overmap.h"
@@ -191,8 +192,8 @@ player_save_info read_character_info(const std::string &savefile)
fromfile = you;
you.copy_from(backup);
}
-
fclose(charf);
+
return fromfile;
}
@@ -602,6 +603,57 @@ std::string get_savedir_path(const std::string &shortpath)
#endif
}
+#ifdef USE_TILE
+static void _fill_player_doll(player_save_info &p, const std::string &dollfile)
+{
+ dolls_data equip_doll;
+ for (unsigned int j = 0; j < TILEP_PART_MAX; ++j)
+ equip_doll.parts[j] = TILEP_SHOW_EQUIP;
+
+ equip_doll.parts[TILEP_PART_BASE]
+ = tilep_species_to_base_tile(p.species, p.experience_level);
+
+ bool success = false;
+
+ FILE *fdoll = fopen(dollfile.c_str(), "r");
+ if (fdoll)
+ {
+ char fbuf[1024];
+ memset(fbuf, 0, sizeof(fbuf));
+ if (fscanf(fdoll, "%s", fbuf) != EOF)
+ {
+ tilep_scan_parts(fbuf, equip_doll.parts);
+ tilep_race_default(p.species,
+ get_gender_from_tile(equip_doll.parts),
+ p.experience_level,
+ equip_doll.parts);
+ success = true;
+
+ while (fscanf(fdoll, "%s", fbuf) != EOF)
+ {
+ if (strcmp(fbuf, "net") == 0)
+ p.held_in_net = true;
+// else if (strncmp(fbuf, "floor=", 6) == 0)
+// sscanf(fbuf, "floor=%d", &p.floor_tile);
+ }
+ }
+ fclose(fdoll);
+ }
+
+ if (!success) // Use default doll instead.
+ {
+ int job = get_class_by_name(p.class_name.c_str());
+ if (job == -1)
+ job = JOB_FIGHTER;
+
+ int gender = coinflip();
+ tilep_job_default(job, gender, equip_doll.parts);
+ }
+ p.doll = equip_doll;
+}
+#endif
+
+
/*
* Returns a list of the names of characters that are already saved for the
* current user.
@@ -646,9 +698,33 @@ std::vector<player_save_info> find_saved_characters()
#endif
if (is_save_file_name(filename))
{
- player_save_info p=read_character_info(get_savedir_path(filename));
+ const std::string path = get_savedir_path(filename);
+ player_save_info p = read_character_info(path);
if (!p.name.empty())
+ {
+#ifdef USE_TILE
+ if (Options.tile_menu_icons)
+ {
+ const std::string dollname = basename + ".tdl";
+ #ifdef LOAD_UNPACKAGE_CMD
+ snprintf( cmd_buff, sizeof(cmd_buff),
+ UNPACK_SPECIFIC_FILE_CMD,
+ zipname.c_str(),
+ dir.c_str(),
+ dollname.c_str() );
+ system(cmd_buff);
+ #endif
+ const std::string dollpath = get_savedir_path(dollname);
+ _fill_player_doll(p, dollpath);
+ #ifdef LOAD_UNPACKAGE_CMD
+ // Throw away doll file.
+ if (file_exists(dollpath.c_str()))
+ unlink( dollpath.c_str() );
+ #endif
+ }
+#endif
chars.push_back(p);
+ }
}
#ifdef LOAD_UNPACKAGE_CMD
@@ -1517,6 +1593,26 @@ void save_game(bool leave_game, const char *farewellmsg)
DO_CHMOD_PRIVATE(msgFile.c_str());
}
+ /* tile dolls (empty for ASCII)*/
+ std::string dollFile = get_savedir_filename(you.your_name, "", "tdl");
+#ifdef USE_TILE
+ // Save the current equipment into a file.
+ FILE *dollf = fopen(dollFile.c_str(), "w+");
+ if (dollf)
+ {
+ save_doll_file(dollf);
+ fclose(dollf);
+ DO_CHMOD_PRIVATE(dollFile.c_str());
+ }
+#else
+ // Don't overwrite old tile dolls.
+ if (!file_exists(dollFile))
+ {
+ FILE *dollf = fopen(dollFile.c_str(), "wb");
+ fclose(dollf);
+ }
+#endif
+
std::string charFile = get_savedir_filename(you.your_name, "", "sav");
FILE *charf = fopen(charFile.c_str(), "wb");
if (!charf)
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 9d30e6f374..98ec4bc9ed 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -50,11 +50,11 @@ REVISION("$Rev$");
id_arr type_ids;
-static bool is_random_name_space( char let );
-static bool is_random_name_vowel( char let );
+static bool _is_random_name_space( char let );
+static bool _is_random_name_vowel( char let );
-static char retvow(int sed);
-static char retlet(int sed);
+static char _random_vowel(int seed);
+static char _random_cons(int seed);
bool is_vowel( const char chr )
{
@@ -1946,16 +1946,16 @@ bool check_item_knowledge(bool quiet)
// Used for: Pandemonium demonlords, shopkeepers, scrolls, random artefacts
-std::string make_name( unsigned long seed, bool all_cap )
+std::string make_name(unsigned long seed, bool all_cap, int maxlen, char start)
{
char name[ITEMNAME_SIZE];
- int numb[17];
+ int numb[17]; // contains the random seeds used for the name
int i = 0;
- bool want_vowel = false;
- bool has_space = false;
+ bool want_vowel = false; // Keep track of whether we want a vowel next.
+ bool has_space = false; // Keep track of whether the name contains a space.
- for (i = 0; i < ITEMNAME_SIZE; i++)
+ for (i = 0; i < ITEMNAME_SIZE; ++i)
name[i] = '\0';
const int var1 = (seed & 0xFF);
@@ -1983,14 +1983,20 @@ std::string make_name( unsigned long seed, bool all_cap )
int len = 3 + numb[0] % 5 + ((numb[1] % 5 == 0) ? numb[2] % 6 : 1);
- if (all_cap)
+ if (all_cap) // scrolls have longer names
len += 6;
+ if (maxlen != -1 && len > maxlen)
+ len = maxlen;
+
+ ASSERT(len > 0);
+ ASSERT(len <= ITEMNAME_SIZE);
+
int j = numb[3] % 17;
const int k = numb[4] % 17;
- int count = 0;
- for (i = 0; i < len; i++)
+ int count = 0;
+ for (i = 0; i < len; ++i)
{
j = (j + 1) % 17;
if (j == 0)
@@ -2000,57 +2006,75 @@ std::string make_name( unsigned long seed, bool all_cap )
break;
}
- if (!has_space && i > 5 && i < len - 4
- && (numb[(k + 10 * j) % 17] % 5) != 3)
+ if (i == 0 && start != 0)
+ {
+ // Start the name with a predefined letter.
+ name[i] = start;
+ want_vowel = _is_random_name_vowel(start);
+ }
+ else if (!has_space && i > 5 && i < len - 4
+ && (numb[(k + 10 * j) % 17] % 5) != 3) // 4/5 chance of a space
{
+ // Hand out a space.
want_vowel = true;
name[i] = ' ';
}
else if (i > 0
- && (want_vowel
- || (i > 1
- && is_random_name_vowel( name[i - 1] )
- && !is_random_name_vowel( name[i - 2] )
- && (numb[(k + 4 * j) % 17] % 5) <= 1 )))
+ && (want_vowel
+ || (i > 1
+ && _is_random_name_vowel( name[i - 1] )
+ && !_is_random_name_vowel( name[i - 2] )
+ && (numb[(k + 4 * j) % 17] % 5) <= 1 ))) // 2/5 chance
{
+ // Place a vowel.
want_vowel = true;
- name[i] = retvow( numb[(k + 7 * j) % 17] );
+ name[i] = _random_vowel( numb[(k + 7 * j) % 17] );
- if (is_random_name_space( name[i] ))
+ if (_is_random_name_space( name[i] ))
{
- if (i == 0)
+ if (i == 0) // Shouldn't happen.
{
want_vowel = false;
- name[i] = retlet( numb[(k + 14 * j) % 17] );
+ name[i] = _random_cons( numb[(k + 14 * j) % 17] );
}
else if (len < 7
- || i <= 2 || i >= len - 3
- || is_random_name_space( name[i - 1] )
- || (i > 1 && is_random_name_space( name[i - 2] ))
- || (i > 2
- && !is_random_name_vowel( name[i - 1] )
- && !is_random_name_vowel( name[i - 2] )))
+ || i <= 2 || i >= len - 3
+ || _is_random_name_space( name[i - 1] )
+ || (i > 1 && _is_random_name_space( name[i - 2] ))
+ || i > 2
+ && !_is_random_name_vowel( name[i - 1] )
+ && !_is_random_name_vowel( name[i - 2] ))
{
+ // Replace the space with something else if ...
+ // * the name is really short
+ // * we're close to the begin/end of the name
+ // * we just got a space, or
+ // * the last two letters were consonants
i--;
continue;
}
}
else if (i > 1
- && name[i] == name[i - 1]
- && (name[i] == 'y' || name[i] == 'i'
- || (numb[(k + 12 * j) % 17] % 5) <= 1))
+ && name[i] == name[i - 1]
+ && (name[i] == 'y' || name[i] == 'i'
+ || (numb[(k + 12 * j) % 17] % 5) <= 1))
{
+ // Replace the vowel with something else if the previous
+ // letter was the same, and it's a 'y', 'i' or with 2/5 chance.
i--;
continue;
}
}
- else
+ else // We want a consonant.
{
+ // Use one of number of predefined letter combinations.
if ((len > 3 || i != 0)
- && (numb[(k + 13 * j) % 17] % 7) <= 1
- && (i < len - 2 || (i > 0 && !is_random_name_space(name[i - 1]))))
+ && (numb[(k + 13 * j) % 17] % 7) <= 1 // 2/7 chance
+ && (i < len - 2
+ || i > 0 && !_is_random_name_space(name[i - 1])))
{
- const bool beg = ((i < 1) || is_random_name_space(name[i - 1]));
+ // Are we at start or end of the (sub) name?
+ const bool beg = (i < 1 || _is_random_name_space(name[i - 1]));
const bool end = (i >= len - 2);
const int first = (beg ? 0 : (end ? 14 : 0));
@@ -2060,6 +2084,11 @@ std::string make_name( unsigned long seed, bool all_cap )
i++;
+ // Pick a random combination of consonants from the set below.
+ // begin -> [0,27]
+ // middle -> [0,67]
+ // end -> [14,56]
+
switch (numb[(k + 11 * j) % 17] % num + first)
{
// start, middle
@@ -2138,50 +2167,53 @@ std::string make_name( unsigned long seed, bool all_cap )
break;
}
}
- else
+ else // Place a single letter instead.
{
if (i == 0)
{
+ // Start with any letter.
name[i] = 'a' + (numb[(k + 8 * j) % 17] % 26);
- want_vowel = is_random_name_vowel( name[i] );
+ want_vowel = _is_random_name_vowel( name[i] );
}
else
{
- name[i] = retlet( numb[(k + 3 * j) % 17] );
+ // Pick a random consonant.
+ name[i] = _random_cons( numb[(k + 3 * j) % 17] );
}
}
}
+ // No letter chosen?
if (name[i] == '\0')
{
i--;
continue;
}
- if (want_vowel && !is_random_name_vowel( name[i] )
- || (!want_vowel && is_random_name_vowel( name[i] )))
+ // Picked wrong type?
+ if (want_vowel && !_is_random_name_vowel( name[i] )
+ || !want_vowel && _is_random_name_vowel( name[i] ))
{
i--;
continue;
}
- if (is_random_name_space( name[i] ))
+ if (_is_random_name_space( name[i] ))
has_space = true;
- if (!is_random_name_vowel( name[i] ))
- want_vowel = true;
- else
- want_vowel = false;
+ // If we just got a vowel, we want a consonant next, and vice versa.
+ want_vowel = !_is_random_name_vowel(name[i]);
}
- // catch break and try to give a final letter
+ // Catch break and try to give a final letter.
if (i > 0
- && !is_random_name_space( name[i - 1] )
+ && !_is_random_name_space( name[i - 1] )
&& name[i - 1] != 'y'
- && is_random_name_vowel( name[i - 1] )
+ && _is_random_name_vowel( name[i - 1] )
&& (count > 9 || (i < 8 && numb[16] % 3)))
{
- name[i] = retlet( numb[j] );
+ // 2/3 chance of ending in a consonant
+ name[i] = _random_cons( numb[j] );
}
len = strlen( name );
@@ -2200,6 +2232,7 @@ std::string make_name( unsigned long seed, bool all_cap )
}
}
+ // Fallback if the name was too short.
if (len < 4)
{
strcpy(name, "plog");
@@ -2211,29 +2244,34 @@ std::string make_name( unsigned long seed, bool all_cap )
name[i] = toupper( name[i] );
return name;
-} // end make_name()
+}
-bool is_random_name_space(char let)
+static bool _is_random_name_space(char let)
{
return (let == ' ');
}
-static bool is_random_name_vowel( char let )
+// Returns true for vowels, 'y' or space.
+static bool _is_random_name_vowel( char let )
{
return (let == 'a' || let == 'e' || let == 'i' || let == 'o' || let == 'u'
|| let == 'y' || let == ' ');
-} // end is_random_name_vowel()
+}
-static char retvow( int sed )
+// Returns a random vowel (a, e, i, o, u with equal probability) or space
+// or 'y' with lower chances.
+static char _random_vowel( int seed )
{
static const char vowels[] = "aeiouaeiouaeiouy ";
- return (vowels[ sed % (sizeof(vowels) - 1) ]);
-} // end retvow()
+ return (vowels[ seed % (sizeof(vowels) - 1) ]);
+}
-static char retlet( int sed )
+// Returns a random consonant with not quite equal probability.
+// Does not include 'y'.
+static char _random_cons( int seed )
{
static const char consonants[] = "bcdfghjklmnpqrstvwxzcdfghlmnrstlmnrst";
- return (consonants[ sed % (sizeof(consonants) - 1) ]);
+ return (consonants[ seed % (sizeof(consonants) - 1) ]);
}
bool is_interesting_item( const item_def& item )
diff --git a/crawl-ref/source/itemname.h b/crawl-ref/source/itemname.h
index 0f8012e021..447892639a 100644
--- a/crawl-ref/source/itemname.h
+++ b/crawl-ref/source/itemname.h
@@ -94,7 +94,8 @@ bool is_bad_item(const item_def &item, bool temp = false);
bool is_dangerous_item( const item_def& item, bool temp = false);
bool is_useless_item(const item_def &item, bool temp = false);
-std::string make_name( unsigned long seed, bool all_caps );
+std::string make_name(unsigned long seed, bool all_caps, int maxlen = -1,
+ char start = 0);
const char* weapon_brand_name(const item_def& item, bool terse);
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index 9af8b1681c..f918a079a7 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -849,6 +849,10 @@ bool PlayerMenuEntry::get_tiles(std::vector<tile_def>& tileset) const
const player_save_info &player = *static_cast<player_save_info*>( data );
dolls_data equip_doll = player.doll;
+// int feat = player.floor_tile;
+// if (feat > 0 && feat < TILE_MAIN_MAX)
+// tileset.push_back(tile_def(feat, TEX_DUNGEON));
+
// FIXME: A lot of code duplication from DungeonRegion::pack_doll().
int p_order[TILEP_PART_MAX] =
{
@@ -900,6 +904,9 @@ bool PlayerMenuEntry::get_tiles(std::vector<tile_def>& tileset) const
tileset.push_back(tile_def(idx, TEX_PLAYER, ymax));
}
+ if (player.held_in_net)
+ tileset.push_back(tile_def(TILE_TRAP_NET, TEX_DEFAULT));
+
return (true);
}
#endif
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index 0b73143e9d..36605fd09b 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -3259,22 +3259,6 @@ static void _enter_player_name(bool blankOK)
desc = desc.substr(0, get_number_of_cols() - 1);
#ifdef USE_TILE
- dolls_data equip_doll;
- for (unsigned int j = 0; j < TILEP_PART_MAX; ++j)
- equip_doll.parts[j] = TILEP_SHOW_EQUIP;
-
- const int gender = TILEP_GENDER_MALE;
- tilep_race_default(existing_chars[i].species, gender,
- existing_chars[i].experience_level,
- equip_doll.parts);
-
- int job = get_class_by_name(existing_chars[i].class_name.c_str());
- if (job == -1)
- job = JOB_FIGHTER;
-
- tilep_job_default(job, gender, equip_doll.parts);
- existing_chars[i].doll = equip_doll;
-
MenuEntry *me = new PlayerMenuEntry(desc);
#else
MenuEntry *me = new MenuEntry(desc);
@@ -3295,13 +3279,7 @@ static void _enter_player_name(bool blankOK)
// If the player wants out, we bail out.
if (!_read_player_name(name, kNameLen, existing_chars, char_menu))
end(0);
-#if 0
-#ifdef USE_TILE
- // What's this supposed to achieve? (jpeg)
- clrscr();
- cgotoxy(1, 1);
-#endif
-#endif
+
// Laboriously trim the damn thing.
std::string read_name = name;
trim_string(read_name);
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 492e5219a5..0bbc88ac34 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -6057,6 +6057,11 @@ player_save_info player_save_info::operator=(const player& rhs)
species = rhs.species;
class_name = rhs.class_name;
religion = rhs.religion;
+#ifdef USE_TILE
+// floor_tile = 0;
+ held_in_net = false;
+#endif
+
return (*this);
}
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index 26600a22af..29930a22fd 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -13,6 +13,40 @@
#include "externs.h"
#include "itemprop.h"
+#ifdef USE_TILE
+// This used to be in tiles.h. (jpeg)
+#include "tiledef-main.h"
+#include "tiledef-dngn.h"
+#include "tiledef-player.h"
+
+struct dolls_data
+{
+ dolls_data() { memset(parts, 0, sizeof(parts)); }
+
+ int parts[TILEP_PART_MAX];
+};
+#endif
+
+struct player_save_info
+{
+ std::string name;
+ unsigned long experience;
+ int experience_level;
+ bool wizard;
+ species_type species;
+ std::string class_name;
+ god_type religion;
+#ifdef USE_TILE
+ dolls_data doll;
+// int floor_tile;
+ bool held_in_net;
+#endif
+
+ player_save_info operator=(const player& rhs);
+ bool operator<(const player_save_info& rhs) const;
+ std::string short_desc() const;
+};
+
class monsters;
struct item_def;
diff --git a/crawl-ref/source/rltiles/dc-corpse.txt b/crawl-ref/source/rltiles/dc-corpse.txt
index 4473de88cc..18c51333c6 100644
--- a/crawl-ref/source/rltiles/dc-corpse.txt
+++ b/crawl-ref/source/rltiles/dc-corpse.txt
@@ -1,216 +1,233 @@
-### dungeon crawl monster corpses
+### Dungeon Crawl monster corpses
+### (only lists monsters that actually leave a corpse)
%sdir dc-mon
%corpse 1
-%back dc-misc/blood_red dc-misc/blood_red1 dc-misc/blood_red2 dc-misc/blood_red3 dc-misc/blood_red4
-glowing_shapeshifter CORPSE_GLOWING_SHAPESHIFTER /* @ */
-hell_knight CORPSE_HELL_KNIGHT /* @ */
-human CORPSE_HUMAN /* @ */
-necromancer CORPSE_NECROMANCER /* @ */
-shapeshifter CORPSE_SHAPESHIFTER /* @ */
-wizard CORPSE_WIZARD /* @ */
+### Animals
%sdir dc-mon/animals
+
+## Insects ('a')
%back dc-misc/blood_green
-boring_beetle CORPSE_BORING_BEETLE /* B */
-boulder_beetle CORPSE_BOULDER_BEETLE /* B */
-giant_beetle CORPSE_GIANT_BEETLE /* B */
+giant_cockroach CORPSE_GIANT_COCKROACH
+giant_ant CORPSE_GIANT_ANT
+soldier_ant CORPSE_SOLDIER_ANT
-%sdir dc-mon
+## Batty monsters ('b')
+butterfly CORPSE_BUTTERFLY
%back dc-misc/blood_red dc-misc/blood_red1 dc-misc/blood_red2 dc-misc/blood_red3 dc-misc/blood_red4
-cyclops CORPSE_CYCLOPS /* C */
-fire_giant CORPSE_FIRE_GIANT /* C */
-frost_giant CORPSE_FROST_GIANT /* C */
-hill_giant CORPSE_HILL_GIANT /* C */
-ettin CORPSE_ETTIN
-stone_giant CORPSE_STONE_GIANT /* C */
-titan CORPSE_TITAN /* C */
-
-dragon CORPSE_DRAGON /* D */
-golden_dragon CORPSE_GOLDEN_DRAGON /* D */
-hydra5 CORPSE_HYDRA /* D */
-ice_dragon CORPSE_ICE_DRAGON /* D */
-iron_dragon CORPSE_IRON_DRAGON /* D */
-quicksilver_dragon CORPSE_QUICKSILVER_DRAGON /* D */
-shadow_dragon CORPSE_SHADOW_DRAGON /* D */
-storm_dragon CORPSE_STORM_DRAGON /* D */
-swamp_dragon CORPSE_SWAMP_DRAGON /* D */
-wyvern CORPSE_WYVERN /* D */
+giant_bat CORPSE_GIANT_BAT
-%sdir dc-mon/animals
-blink_frog CORPSE_BLINK_FROG /* F */
-giant_brown_frog CORPSE_GIANT_BROWN_FROG /* F */
-giant_frog CORPSE_GIANT_FROG /* F */
-spiny_frog CORPSE_SPINY_FROG /* F */
-
-%sdir dc-mon
-eye_of_draining CORPSE_EYE_OF_DRAINING /* G */
-giant_eyeball CORPSE_GIANT_EYEBALL /* G */
-giant_orange_brain CORPSE_GIANT_ORANGE_BRAIN /* G */
-great_orb_of_eyes CORPSE_GREAT_ORB_OF_EYES /* G */
-
-griffon CORPSE_GRIFFON /* H */
-hippogriff CORPSE_HIPPOGRIFF /* H */
-
-giant_amoeba CORPSE_GIANT_AMOEBA /* J */
+## Hounds ('h')
+jackal CORPSE_JACKAL
+hound CORPSE_HOUND
+warg CORPSE_WARG
+war_dog CORPSE_WAR_DOG
+wolf CORPSE_WOLF
+hog CORPSE_HOG
+## Bees ('k')
%back dc-misc/blood_green
-kobold CORPSE_KOBOLD /* K */
-big_kobold CORPSE_BIG_KOBOLD
+bumblebee CORPSE_BUMBLEBEE
+killer_bee CORPSE_KILLER_BEE
+## Lizards ('l')
%back dc-misc/blood_red dc-misc/blood_red1 dc-misc/blood_red2 dc-misc/blood_red3 dc-misc/blood_red4
-greater_naga CORPSE_GREATER_NAGA /* N */
-guardian_naga CORPSE_GUARDIAN_NAGA /* N */
-naga CORPSE_NAGA /* N */
-###naga_mage CORPSE_NAGA_MAGE /* N */
-###naga_warrior CORPSE_NAGA_WARRIOR /* N */
+giant_newt CORPSE_GIANT_NEWT
+giant_gecko CORPSE_GIANT_GECKO
+giant_iguana CORPSE_GIANT_IGUANA
+giant_lizard CORPSE_GIANT_LIZARD
+gila_monster CORPSE_GILA_MONSTER
+komodo_dragon CORPSE_KOMODO_DRAGON
+
+## Slugs ('j')
+%back dc-misc/blood_green
+elephant_slug CORPSE_ELEPHANT_SLUG
+giant_slug CORPSE_GIANT_SLUG
+giant_snail CORPSE_GIANT_SNAIL
+
+## Rodents ('r')
+rat CORPSE_RAT
+quokka CORPSE_QUOKKA
+grey_rat CORPSE_GREY_RAT
+green_rat CORPSE_GREEN_RAT
+orange_rat CORPSE_ORANGE_RAT
+
+## Spiders ('s')
+%back dc-misc/blood_green
+giant_centipede CORPSE_GIANT_CENTIPEDE
+giant_mite CORPSE_GIANT_MITE
+scorpion CORPSE_SCORPION
+wolf_spider CORPSE_WOLF_SPIDER
+trapdoor_spider CORPSE_TRAPDOOR_SPIDER
+redback CORPSE_REDBACK
+
+## Worms ('w')
+%sdir dc-mon/animals
+killer_bee_larva CORPSE_ANT_LARVA
+killer_bee_larva CORPSE_KILLER_BEE_LARVA
+worm CORPSE_WORM
+swamp_worm CORPSE_SWAMP_WORM
+spiny_worm CORPSE_SPINY_WORM
+brain_worm CORPSE_BRAIN_WORM
+
+## Wasps ('y')
+giant_blowfly CORPSE_GIANT_BLOWFLY
+giant_mosquito CORPSE_GIANT_MOSQUITO
+yellow_wasp CORPSE_YELLOW_WASP
+red_wasp CORPSE_RED_WASP
+
+## Beetles ('B')
+%back dc-misc/blood_green
+giant_beetle CORPSE_GIANT_BEETLE
+boring_beetle CORPSE_BORING_BEETLE
+boulder_beetle CORPSE_BOULDER_BEETLE
-ogre CORPSE_OGRE /* O */
-two_headed_ogre CORPSE_TWO_HEADED_OGRE /* O */
+## Frogs ('F')
+giant_frog CORPSE_GIANT_FROG
+giant_brown_frog CORPSE_GIANT_BROWN_FROG
+blink_frog CORPSE_BLINK_FROG
+spiny_frog CORPSE_SPINY_FROG
-%sdir dc-mon/animals
+## Queen insects ('Q')
%back dc-misc/blood_green
-queen_ant CORPSE_QUEEN_ANT /* Q */
-queen_bee CORPSE_QUEEN_BEE /* Q */
+queen_ant CORPSE_QUEEN_ANT
+queen_bee CORPSE_QUEEN_BEE
+## Snakes ('S')
%back dc-misc/blood_red dc-misc/blood_red1 dc-misc/blood_red2 dc-misc/blood_red3 dc-misc/blood_red4
-black_mamba CORPSE_BLACK_MAMBA /* S */
-water_moccasin CORPSE_WATER_MOCCASIN /* S */
-grey_snake CORPSE_GREY_SNAKE /* S */
-small_snake CORPSE_SMALL_SNAKE /* S */
-snake CORPSE_SNAKE /* S */
-viper CORPSE_VIPER /* S */
-
+small_snake CORPSE_SMALL_SNAKE
+snake CORPSE_SNAKE
+black_mamba CORPSE_BLACK_MAMBA
+water_moccasin CORPSE_WATER_MOCCASIN
+grey_snake CORPSE_GREY_SNAKE
+viper CORPSE_VIPER
+
+## Bears ('U')
+bear CORPSE_BEAR
+black_bear CORPSE_BLACK_BEAR
+grizzly_bear CORPSE_GRIZZLY_BEAR
+polar_bear CORPSE_POLAR_BEAR
+
+## Cattle ('Y')
+sheep CORPSE_SHEEP
+yak CORPSE_YAK
+death_yak CORPSE_DEATH_YAK
+
+
+### Non-animals
%sdir dc-mon
-deep_troll CORPSE_DEEP_TROLL /* T */
-iron_troll CORPSE_IRON_TROLL /* T */
-rock_troll CORPSE_ROCK_TROLL /* T */
-troll CORPSE_TROLL /* T */
-%sdir dc-mon/animals
-bear CORPSE_BEAR /* U */
-black_bear CORPSE_BLACK_BEAR /* U */
-grizzly_bear CORPSE_GRIZZLY_BEAR /* U */
-polar_bear CORPSE_POLAR_BEAR /* U */
+## Centaurs ('c')
+centaur CORPSE_CENTAUR
+yaktaur CORPSE_YAKTAUR
-death_yak CORPSE_DEATH_YAK /* Y */
-sheep CORPSE_SHEEP /* Y */
-yak CORPSE_YAK /* Y */
+## Elves ('e')
+elf CORPSE_ELF
-%sdir dc-mon/animals
-%back dc-misc/blood_green
-giant_ant CORPSE_GIANT_ANT /* a */
-giant_cockroach CORPSE_GIANT_COCKROACH /* a */
-soldier_ant CORPSE_SOLDIER_ANT /* a */
+## Goblins ('g')
+goblin CORPSE_GOBLIN
+hobgoblin CORPSE_HOBGOBLIN
+gnoll CORPSE_GNOLL
-butterfly CORPSE_BUTTERFLY /* b */
+## Merfolk ('m')
%back dc-misc/blood_red dc-misc/blood_red1 dc-misc/blood_red2 dc-misc/blood_red3 dc-misc/blood_red4
-giant_bat CORPSE_GIANT_BAT /* b */
-
-%sdir dc-mon
-centaur CORPSE_CENTAUR /* c */
-###centaur_warrior CORPSE_CENTAUR_WARRIOR /* c */
-yaktaur CORPSE_YAKTAUR /* c */
-###yaktaur_captain CORPSE_YAKTAUR_CAPTAIN /* c */
-
-firedrake CORPSE_FIREDRAKE /* d */
-lindwurm CORPSE_LINDWURM /* d */
-mottled_dragon CORPSE_MOTTLED_DRAGON /* d */
-steam_dragon CORPSE_STEAM_DRAGON /* d */
-swamp_drake CORPSE_SWAMP_DRAKE /* d */
-death_drake CORPSE_DEATH_DRAKE /* d */
-
-##deep_elf_annihilator CORPSE_DEEP_ELF_ANNIHILATOR /* e */
-##deep_elf_conjurer CORPSE_DEEP_ELF_CONJURER /* e */
-##deep_elf_death_mage CORPSE_DEEP_ELF_DEATH_MAGE /* e */
-##deep_elf_demonologist CORPSE_DEEP_ELF_DEMONOLOGIST /* e */
-##deep_elf_fighter CORPSE_DEEP_ELF_FIGHTER /* e */
-##deep_elf_high_priest CORPSE_DEEP_ELF_HIGH_PRIEST /* e */
-##deep_elf_knight CORPSE_DEEP_ELF_KNIGHT /* e */
-##deep_elf_mage CORPSE_DEEP_ELF_MAGE /* e */
-##deep_elf_priest CORPSE_DEEP_ELF_PRIEST /* e */
-##deep_elf_soldier CORPSE_DEEP_ELF_SOLDIER /* e */
-##deep_elf_sorcerer CORPSE_DEEP_ELF_SORCERER /* e */
-##deep_elf_summoner CORPSE_DEEP_ELF_SUMMONER /* e */
-elf CORPSE_ELF /* e */
-
-gnoll CORPSE_GNOLL /* g */
-goblin CORPSE_GOBLIN /* g */
-hobgoblin CORPSE_HOBGOBLIN /* g */
-
-%sdir dc-mon/animals
-jackal CORPSE_JACKAL /* h */
-hog CORPSE_HOG /* h */
-hound CORPSE_HOUND /* h */
-warg CORPSE_WARG /* h */
-war_dog CORPSE_WAR_DOG /* h */
-wolf CORPSE_WOLF /* h */
+merfolk_fighter_water CORPSE_MERFOLK_FIGHTER
+mermaid_water CORPSE_MERMAID
+siren_water CORPSE_SIREN
+## Rotting monsters ('n')
%back dc-misc/blood_green
-bumblebee CORPSE_BUMBLEBEE /* k */
-killer_bee CORPSE_KILLER_BEE /* k */
+necrophage CORPSE_NECROPHAGE
+ghoul CORPSE_GHOUL
+## Orcs ('o')
%back dc-misc/blood_red dc-misc/blood_red1 dc-misc/blood_red2 dc-misc/blood_red3 dc-misc/blood_red4
-giant_gecko CORPSE_GIANT_GECKO /* l */
-giant_iguana CORPSE_GIANT_IGUANA /* l */
-giant_lizard CORPSE_GIANT_LIZARD /* l */
-giant_newt CORPSE_GIANT_NEWT /* l */
-gila_monster CORPSE_GILA_MONSTER /* l */
-komodo_dragon CORPSE_KOMODO_DRAGON /* l */
+orc CORPSE_ORC
-%back dc-misc/blood_green
-elephant_slug CORPSE_ELEPHANT_SLUG /* m */
-giant_slug CORPSE_GIANT_SLUG /* m */
-giant_snail CORPSE_GIANT_SNAIL /* m */
-%sdir dc-mon
-manticore CORPSE_MANTICORE /* m */
+## Minotaur ('t')
%back dc-misc/blood_red dc-misc/blood_red1 dc-misc/blood_red2 dc-misc/blood_red3 dc-misc/blood_red4
-minotaur CORPSE_MINOTAUR /* m */
+minotaur CORPSE_MINOTAUR
-%back dc-misc/blood_green
-ghoul CORPSE_GHOUL /* n */
-necrophage CORPSE_NECROPHAGE /* n */
+## Ugly things ('u')
+%sdir dc-mon/demons
+ugly_thing CORPSE_UGLY_THING
+very_ugly_thing CORPSE_VERY_UGLY_THING
+## Giants ('C')
+%sdir dc-mon
%back dc-misc/blood_red dc-misc/blood_red1 dc-misc/blood_red2 dc-misc/blood_red3 dc-misc/blood_red4
-orc CORPSE_ORC /* o */
-###orc_high_priest CORPSE_ORC_HIGH_PRIEST /* o */
-###orc_priest CORPSE_ORC_PRIEST /* o */
-###orc_sorcerer CORPSE_ORC_SORCERER /* o */
-###orc_warlord CORPSE_ORC_WARLORD /* o */
+hill_giant CORPSE_HILL_GIANT
+ettin CORPSE_ETTIN
+cyclops CORPSE_CYCLOPS
+fire_giant CORPSE_FIRE_GIANT
+frost_giant CORPSE_FROST_GIANT
+stone_giant CORPSE_STONE_GIANT
+titan CORPSE_TITAN
+
+## Drakes ('l')
+swamp_drake CORPSE_SWAMP_DRAKE
+firedrake CORPSE_FIREDRAKE
+lindwurm CORPSE_LINDWURM
+death_drake CORPSE_DEATH_DRAKE
+
+## Dragons ('D')
+wyvern CORPSE_WYVERN
+dragon CORPSE_DRAGON
+hydra5 CORPSE_HYDRA
+steam_dragon CORPSE_STEAM_DRAGON
+ice_dragon CORPSE_ICE_DRAGON
+swamp_dragon CORPSE_SWAMP_DRAGON
+mottled_dragon CORPSE_MOTTLED_DRAGON
+quicksilver_dragon CORPSE_QUICKSILVER_DRAGON
+iron_dragon CORPSE_IRON_DRAGON
+storm_dragon CORPSE_STORM_DRAGON
+golden_dragon CORPSE_GOLDEN_DRAGON
+shadow_dragon CORPSE_SHADOW_DRAGON
+
+## Eyes ('G')
+giant_eyeball CORPSE_GIANT_EYEBALL
+eye_of_draining CORPSE_EYE_OF_DRAINING
+giant_orange_brain CORPSE_GIANT_ORANGE_BRAIN
+great_orb_of_eyes CORPSE_GREAT_ORB_OF_EYES
+
+## Hybrids ('H')
+hippogriff CORPSE_HIPPOGRIFF
+griffon CORPSE_GRIFFON
+manticore CORPSE_MANTICORE
+harpy CORPSE_HARPY
+
+## Jellies ('J')
+giant_amoeba CORPSE_GIANT_AMOEBA
+
+## Kobolds ('K')
+%back dc-misc/blood_green
+kobold CORPSE_KOBOLD
+big_kobold CORPSE_BIG_KOBOLD
-%sdir dc-mon/animals
-green_rat CORPSE_GREEN_RAT /* r */
-grey_rat CORPSE_GREY_RAT /* r */
-orange_rat CORPSE_ORANGE_RAT /* r */
-quokka CORPSE_QUOKKA /* r */
-rat CORPSE_RAT /* r */
+## Nagas ('N')
+%back dc-misc/blood_red dc-misc/blood_red1 dc-misc/blood_red2 dc-misc/blood_red3 dc-misc/blood_red4
+naga CORPSE_NAGA
+guardian_naga CORPSE_GUARDIAN_NAGA
-%back dc-misc/blood_green
-giant_centipede CORPSE_GIANT_CENTIPEDE /* s */
-giant_mite CORPSE_GIANT_MITE /* s */
-redback CORPSE_REDBACK /* s */
-scorpion CORPSE_SCORPION /* s */
-wolf_spider CORPSE_WOLF_SPIDER /* s */
-trapdoor_spider CORPSE_TRAPDOOR_SPIDER /* s */
+## Ogres ('O')
+ogre CORPSE_OGRE
+two_headed_ogre CORPSE_TWO_HEADED_OGRE
-%sdir dc-mon/demons
-ugly_thing CORPSE_UGLY_THING /* u */
-very_ugly_thing CORPSE_VERY_UGLY_THING /* u */
+## Trolls ('T')
+troll CORPSE_TROLL
+rock_troll CORPSE_ROCK_TROLL
+iron_troll CORPSE_IRON_TROLL
+deep_troll CORPSE_DEEP_TROLL
-%sdir dc-mon/animals
-killer_bee_larva CORPSE_ANT_LARVA /* w */
-brain_worm CORPSE_BRAIN_WORM /* w */
-killer_bee_larva CORPSE_KILLER_BEE_LARVA /* w */
-spiny_worm CORPSE_SPINY_WORM /* w */
-swamp_worm CORPSE_SWAMP_WORM /* w */
-worm CORPSE_WORM /* w */
-
-giant_blowfly CORPSE_GIANT_BLOWFLY /* y */
-giant_mosquito CORPSE_GIANT_MOSQUITO /* y */
-red_wasp CORPSE_RED_WASP /* y */
-yellow_wasp CORPSE_YELLOW_WASP /* y */
+## Human shaped ('@')
+%back dc-misc/blood_red dc-misc/blood_red1 dc-misc/blood_red2 dc-misc/blood_red3 dc-misc/blood_red4
+human CORPSE_HUMAN
+shapeshifter CORPSE_SHAPESHIFTER
+glowing_shapeshifter CORPSE_GLOWING_SHAPESHIFTER
+## Draconians ('d')
%sdir player
%start
%compose drcwing/drcwing_black
@@ -272,9 +289,4 @@ yellow_wasp CORPSE_YELLOW_WASP /* y */
%compose drchead/drchead_yellow
%finish CORPSE_DRACONIAN_YELLOW
-%sdir dc-mon
-%back dc-misc/blood_red dc-misc/blood_red1 dc-misc/blood_red2 dc-misc/blood_red3 dc-misc/blood_red4
-mermaid_water CORPSE_MERMAID
-merfolk_fighter_water CORPSE_MERFOLK_FIGHTER
-
%corpse 0
diff --git a/crawl-ref/source/rltiles/dc-mon.txt b/crawl-ref/source/rltiles/dc-mon.txt
index 3309d17c19..1a2f9e8d7c 100644
--- a/crawl-ref/source/rltiles/dc-mon.txt
+++ b/crawl-ref/source/rltiles/dc-mon.txt
@@ -74,9 +74,9 @@ brain_worm MONS_BRAIN_WORM
rock_worm MONS_ROCK_WORM
## Flying insects ('y')
-yellow_wasp MONS_YELLOW_WASP
giant_blowfly MONS_GIANT_BLOWFLY
giant_mosquito MONS_GIANT_MOSQUITO
+yellow_wasp MONS_YELLOW_WASP
red_wasp MONS_RED_WASP
moth_of_wrath MONS_MOTH_OF_WRATH
@@ -366,8 +366,8 @@ eye_of_devastation MONS_EYE_OF_DEVASTATION
hippogriff MONS_HIPPOGRIFF
manticore MONS_MANTICORE
griffon MONS_GRIFFON
-sphinx MONS_SPHINX
harpy MONS_HARPY
+sphinx MONS_SPHINX
## Ice beast only
ice_beast MONS_ICE_BEAST /*'I'*/
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc
index 798cae7d30..5b151d5403 100644
--- a/crawl-ref/source/tilepick.cc
+++ b/crawl-ref/source/tilepick.cc
@@ -1528,24 +1528,31 @@ static int _tileidx_food(const item_def &item)
// Parameter mon already holds the corpse type (monster species).
static int _tileidx_corpse(int mon)
{
- switch (mon)
- {
+ switch (mon)
+ {
+ // insects ('a')
case MONS_GIANT_COCKROACH:
return TILE_CORPSE_GIANT_COCKROACH;
case MONS_GIANT_ANT:
return TILE_CORPSE_GIANT_ANT;
case MONS_SOLDIER_ANT:
return TILE_CORPSE_SOLDIER_ANT;
+
+ // batty monsters ('b')
case MONS_GIANT_BAT:
return TILE_CORPSE_GIANT_BAT;
case MONS_BUTTERFLY:
return TILE_CORPSE_BUTTERFLY;
+
+ // centaurs ('c')
case MONS_CENTAUR:
case MONS_CENTAUR_WARRIOR:
return TILE_CORPSE_CENTAUR;
case MONS_YAKTAUR:
case MONS_YAKTAUR_CAPTAIN:
return TILE_CORPSE_YAKTAUR;
+
+ // draconians ('d')
case MONS_DRACONIAN:
return TILE_CORPSE_DRACONIAN_BROWN;
case MONS_BLACK_DRACONIAN:
@@ -1572,6 +1579,8 @@ static int _tileidx_corpse(int mon)
case MONS_DRACONIAN_KNIGHT:
case MONS_DRACONIAN_SCORCHER:
return TILE_CORPSE_DRACONIAN_BROWN;
+
+ // elves ('e')
case MONS_ELF:
case MONS_DEEP_ELF_SOLDIER:
case MONS_DEEP_ELF_FIGHTER:
@@ -1588,12 +1597,16 @@ static int _tileidx_corpse(int mon)
case MONS_DEEP_ELF_SORCERER:
case MONS_DEEP_ELF_DEATH_MAGE:
return TILE_CORPSE_ELF;
+
+ // goblins ('g')
case MONS_GOBLIN:
return TILE_CORPSE_GOBLIN;
case MONS_HOBGOBLIN:
return TILE_CORPSE_HOBGOBLIN;
case MONS_GNOLL:
return TILE_CORPSE_GNOLL;
+
+ // hounds ('h')
case MONS_JACKAL:
return TILE_CORPSE_JACKAL;
case MONS_HOUND:
@@ -1606,16 +1619,22 @@ static int _tileidx_corpse(int mon)
return TILE_CORPSE_WAR_DOG;
case MONS_HOG:
return TILE_CORPSE_HOG;
+
+ // slugs ('j')
case MONS_ELEPHANT_SLUG:
return TILE_CORPSE_ELEPHANT_SLUG;
case MONS_GIANT_SLUG:
return TILE_CORPSE_GIANT_SLUG;
case MONS_GIANT_SNAIL:
return TILE_CORPSE_GIANT_SNAIL;
+
+ // bees ('k')
case MONS_KILLER_BEE:
return TILE_CORPSE_KILLER_BEE;
case MONS_BUMBLEBEE:
return TILE_CORPSE_BUMBLEBEE;
+
+ // lizards ('l')
case MONS_GIANT_NEWT:
return TILE_CORPSE_GIANT_NEWT;
case MONS_GIANT_GECKO:
@@ -1628,6 +1647,8 @@ static int _tileidx_corpse(int mon)
return TILE_CORPSE_GILA_MONSTER;
case MONS_KOMODO_DRAGON:
return TILE_CORPSE_KOMODO_DRAGON;
+
+ // drakes (also 'l')
case MONS_SWAMP_DRAKE:
return TILE_CORPSE_SWAMP_DRAKE;
case MONS_FIREDRAKE:
@@ -1636,14 +1657,22 @@ static int _tileidx_corpse(int mon)
return TILE_CORPSE_LINDWURM;
case MONS_DEATH_DRAKE:
return TILE_CORPSE_DEATH_DRAKE;
+
+ // merfolk ('m')
case MONS_MERFOLK:
return TILE_CORPSE_MERFOLK_FIGHTER;
case MONS_MERMAID:
return TILE_CORPSE_MERMAID;
+ case MONS_SIREN:
+ return TILE_CORPSE_SIREN;
+
+ // rotting monsters ('n')
case MONS_NECROPHAGE:
return TILE_CORPSE_NECROPHAGE;
case MONS_GHOUL:
return TILE_CORPSE_GHOUL;
+
+ // orcs ('o')
case MONS_ORC:
case MONS_ORC_WIZARD:
case MONS_ORC_PRIEST:
@@ -1653,6 +1682,8 @@ static int _tileidx_corpse(int mon)
case MONS_ORC_SORCERER:
case MONS_ORC_HIGH_PRIEST:
return TILE_CORPSE_ORC;
+
+ // rodents ('r')
case MONS_RAT:
return TILE_CORPSE_RAT;
case MONS_QUOKKA:
@@ -1663,6 +1694,8 @@ static int _tileidx_corpse(int mon)
return TILE_CORPSE_GREEN_RAT;
case MONS_ORANGE_RAT:
return TILE_CORPSE_ORANGE_RAT;
+
+ // spiders ('s')
case MONS_GIANT_MITE:
return TILE_CORPSE_GIANT_MITE;
case MONS_GIANT_CENTIPEDE:
@@ -1671,42 +1704,54 @@ static int _tileidx_corpse(int mon)
return TILE_CORPSE_SCORPION;
case MONS_WOLF_SPIDER:
return TILE_CORPSE_WOLF_SPIDER;
- case MONS_REDBACK:
- return TILE_CORPSE_REDBACK;
case MONS_TRAPDOOR_SPIDER:
return TILE_CORPSE_TRAPDOOR_SPIDER;
+ case MONS_REDBACK:
+ return TILE_CORPSE_REDBACK;
+
+ // minotaur ('t')
case MONS_MINOTAUR:
return TILE_CORPSE_MINOTAUR;
+
+ // ugly things ('u')
case MONS_UGLY_THING:
return TILE_CORPSE_UGLY_THING;
case MONS_VERY_UGLY_THING:
return TILE_CORPSE_VERY_UGLY_THING;
+
+ // worms ('w')
case MONS_KILLER_BEE_LARVA:
return TILE_CORPSE_KILLER_BEE_LARVA;
- case MONS_WORM:
- return TILE_CORPSE_WORM;
case MONS_ANT_LARVA:
return TILE_CORPSE_ANT_LARVA;
+ case MONS_WORM:
+ return TILE_CORPSE_WORM;
case MONS_BRAIN_WORM:
return TILE_CORPSE_BRAIN_WORM;
- case MONS_SPINY_WORM:
- return TILE_CORPSE_SPINY_WORM;
case MONS_SWAMP_WORM:
return TILE_CORPSE_SWAMP_WORM;
- case MONS_YELLOW_WASP:
- return TILE_CORPSE_YELLOW_WASP;
+ case MONS_SPINY_WORM:
+ return TILE_CORPSE_SPINY_WORM;
+
+ // wasps ('y')
case MONS_GIANT_MOSQUITO:
return TILE_CORPSE_GIANT_MOSQUITO;
case MONS_GIANT_BLOWFLY:
return TILE_CORPSE_GIANT_BLOWFLY;
+ case MONS_YELLOW_WASP:
+ return TILE_CORPSE_YELLOW_WASP;
case MONS_RED_WASP:
return TILE_CORPSE_RED_WASP;
+
+ // beetles ('B')
case MONS_GIANT_BEETLE:
return TILE_CORPSE_GIANT_BEETLE;
case MONS_BOULDER_BEETLE:
return TILE_CORPSE_BOULDER_BEETLE;
case MONS_BORING_BEETLE:
return TILE_CORPSE_BORING_BEETLE;
+
+ // giants ('C')
case MONS_HILL_GIANT:
return TILE_CORPSE_HILL_GIANT;
case MONS_ETTIN:
@@ -1721,6 +1766,8 @@ static int _tileidx_corpse(int mon)
return TILE_CORPSE_STONE_GIANT;
case MONS_TITAN:
return TILE_CORPSE_TITAN;
+
+ // dragons ('D')
case MONS_WYVERN:
return TILE_CORPSE_WYVERN;
case MONS_DRAGON:
@@ -1745,6 +1792,8 @@ static int _tileidx_corpse(int mon)
return TILE_CORPSE_GOLDEN_DRAGON;
case MONS_SHADOW_DRAGON:
return TILE_CORPSE_SHADOW_DRAGON;
+
+ // frogs ('F')
case MONS_GIANT_FROG:
return TILE_CORPSE_GIANT_FROG;
case MONS_GIANT_BROWN_FROG:
@@ -1753,6 +1802,8 @@ static int _tileidx_corpse(int mon)
return TILE_CORPSE_SPINY_FROG;
case MONS_BLINK_FROG:
return TILE_CORPSE_BLINK_FROG;
+
+ // eyes ('G')
case MONS_GIANT_EYEBALL:
return TILE_CORPSE_GIANT_EYEBALL;
case MONS_EYE_OF_DRAINING:
@@ -1761,46 +1812,64 @@ static int _tileidx_corpse(int mon)
return TILE_CORPSE_GIANT_ORANGE_BRAIN;
case MONS_GREAT_ORB_OF_EYES:
return TILE_CORPSE_GREAT_ORB_OF_EYES;
+
+ // hybrids ('H')
case MONS_HIPPOGRIFF:
return TILE_CORPSE_HIPPOGRIFF;
case MONS_MANTICORE:
return TILE_CORPSE_MANTICORE;
case MONS_GRIFFON:
return TILE_CORPSE_GRIFFON;
+ case MONS_HARPY:
+ return TILE_CORPSE_HARPY;
+
+ // jellies ('J')
case MONS_GIANT_AMOEBA:
return TILE_CORPSE_GIANT_AMOEBA;
+
+ // kobolds ('K')
case MONS_KOBOLD:
return TILE_CORPSE_KOBOLD;
case MONS_BIG_KOBOLD:
return TILE_CORPSE_BIG_KOBOLD;
- case MONS_KOBOLD_DEMONOLOGIST:
- return TILE_CORPSE_KOBOLD;
+
+ // nagas ('N')
case MONS_NAGA:
- case MONS_GUARDIAN_NAGA:
case MONS_NAGA_MAGE:
case MONS_NAGA_WARRIOR:
case MONS_GREATER_NAGA:
return TILE_CORPSE_NAGA;
+ case MONS_GUARDIAN_NAGA:
+ return TILE_CORPSE_GUARDIAN_NAGA;
+
+ // ogres ('O')
case MONS_OGRE:
+ case MONS_OGRE_MAGE:
return TILE_CORPSE_OGRE;
case MONS_TWO_HEADED_OGRE:
return TILE_CORPSE_TWO_HEADED_OGRE;
+
+ // queen insects ('Q')
case MONS_QUEEN_BEE:
return TILE_CORPSE_QUEEN_BEE;
case MONS_QUEEN_ANT:
return TILE_CORPSE_QUEEN_ANT;
+
+ // snakes ('S')
case MONS_SMALL_SNAKE:
return TILE_CORPSE_SMALL_SNAKE;
case MONS_SNAKE:
return TILE_CORPSE_SNAKE;
+ case MONS_GREY_SNAKE:
+ return TILE_CORPSE_GREY_SNAKE;
case MONS_WATER_MOCCASIN:
return TILE_CORPSE_WATER_MOCCASIN;
case MONS_BLACK_MAMBA:
return TILE_CORPSE_BLACK_MAMBA;
case MONS_VIPER:
return TILE_CORPSE_VIPER;
- case MONS_GREY_SNAKE:
- return TILE_CORPSE_GREY_SNAKE;
+
+ // trolls ('T')
case MONS_TROLL:
return TILE_CORPSE_TROLL;
case MONS_ROCK_TROLL:
@@ -1809,6 +1878,8 @@ static int _tileidx_corpse(int mon)
return TILE_CORPSE_IRON_TROLL;
case MONS_DEEP_TROLL:
return TILE_CORPSE_DEEP_TROLL;
+
+ // bears ('U')
case MONS_BEAR:
return TILE_CORPSE_BEAR;
case MONS_GRIZZLY_BEAR:
@@ -1817,12 +1888,16 @@ static int _tileidx_corpse(int mon)
return TILE_CORPSE_POLAR_BEAR;
case MONS_BLACK_BEAR:
return TILE_CORPSE_BLACK_BEAR;
+
+ // cattle ('Y')
case MONS_SHEEP:
return TILE_CORPSE_SHEEP;
case MONS_YAK:
return TILE_CORPSE_YAK;
case MONS_DEATH_YAK:
return TILE_CORPSE_DEATH_YAK;
+
+ // humans ('@')
case MONS_HUMAN:
case MONS_HELL_KNIGHT:
case MONS_NECROMANCER:
@@ -1832,13 +1907,10 @@ static int _tileidx_corpse(int mon)
return TILE_CORPSE_SHAPESHIFTER;
case MONS_GLOWING_SHAPESHIFTER:
return TILE_CORPSE_GLOWING_SHAPESHIFTER;
- case MONS_POLYPHEMUS:
- return TILE_CORPSE_CYCLOPS;
+
default:
return TILE_ERROR;
- }
-
- return TILE_ERROR;
+ }
}
static int _tileidx_rune(const item_def &item)
@@ -3204,6 +3276,8 @@ const int parts_saved[] ={
TILEP_PART_HAIR,
TILEP_PART_BEARD,
TILEP_PART_HELM,
+ TILEP_PART_HALO,
+ TILEP_PART_ENCH,
-1
};
@@ -3216,13 +3290,13 @@ void tilep_scan_parts(char *fbuf, int *parts)
int gcount = 0;
int ccount = 0;
- for (int i = 0; parts_saved[i] != -1; i++)
+ for (int i = 0; parts_saved[i] != -1; ++i)
{
ccount = 0;
int p = parts_saved[i];
while (fbuf[gcount] != ':' && fbuf[gcount] != '\n'
- && ccount < 4 && gcount < 48)
+ && ccount < 4 && gcount < (i+1)*4)
{
ibuf[ccount++] = fbuf[gcount++];
}
@@ -3253,11 +3327,14 @@ void tilep_scan_parts(char *fbuf, int *parts)
/*
* format-print parts
*/
-void tilep_print_parts(char *fbuf, int *parts)
+void tilep_print_parts(char *fbuf, int *parts, bool check_halo)
{
char *ptr = fbuf;
for (unsigned i = 0; parts_saved[i] != -1; ++i)
{
+ if (!check_halo && parts_saved[i] == TILEP_PART_HALO)
+ break;
+
int p = parts_saved[i];
if (p == TILEP_PART_BASE) // 0: female 1: male
sprintf(ptr, "%03d", get_gender_from_tile(parts));
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 6ac5035efa..1d99c60697 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -558,6 +558,37 @@ static void _fill_doll_equipment(dolls_data &result)
result.parts[TILEP_PART_DRCHEAD] = 0;
}
+// Writes equipment information into per-character doll file.
+void save_doll_file(FILE *dollf)
+{
+ ASSERT(dollf);
+
+ dolls_data result = player_doll;
+
+ const bool halo = inside_halo(you.pos());
+ result.parts[TILEP_PART_HALO] = halo ? TILEP_HALO_TSO : 0;
+ result.parts[TILEP_PART_ENCH] =
+ (you.duration[DUR_LIQUID_FLAMES] ? TILEP_ENCH_STICKY_FLAME : 0);
+
+ _fill_doll_equipment(result);
+
+ // Write into file.
+ char fbuf[80];
+ tilep_print_parts(fbuf, result.parts, true);
+ fprintf(dollf, "%s\n", fbuf);
+
+// const coord_def c = you.pos();
+// int feat = tileidx_feature(grd(c), c.x, c.y);
+// if (feat == TILE_FLOOR_NORMAL)
+// feat = env.tile_flv(c).floor;
+// else if (feat == TILE_WALL_NORMAL)
+// feat = env.tile_flv(c).wall;
+// fprintf(dollf, "floor=%d\n", feat);
+
+ if (you.attribute[ATTR_HELD] > 0)
+ fprintf(dollf, "net\n");
+}
+
// Allow player to choose between up to 10 premade dolls, or replace them
// with the job default, using current equipment, or a random doll.
// If the player makes any changes while browsing the selections, i.e.
@@ -3330,8 +3361,12 @@ bool ImageManager::load_textures()
if (!m_textures[TEX_PLAYER].load_texture("player.png", mip))
return (false);
+ if (!m_textures[TEX_DEFAULT].load_texture("main.png", mip))
+ return (false);
+
m_textures[TEX_DUNGEON].set_info(TILE_DNGN_MAX, &tile_dngn_info);
m_textures[TEX_PLAYER].set_info(TILEP_PLAYER_MAX, &tile_player_info);
+ m_textures[TEX_DEFAULT].set_info(TILE_MAIN_MAX, &tile_main_info);
return (true);
}
diff --git a/crawl-ref/source/tilereg.h b/crawl-ref/source/tilereg.h
index 15c7d3a886..4efce0130a 100644
--- a/crawl-ref/source/tilereg.h
+++ b/crawl-ref/source/tilereg.h
@@ -11,6 +11,7 @@
#include "AppHdr.h"
#include "format.h"
+#include "player.h"
#include "tilebuf.h"
#include "tiletex.h"
#include "tiles.h"
diff --git a/crawl-ref/source/tiles.h b/crawl-ref/source/tiles.h
index c7ad19a787..49833897b9 100644
--- a/crawl-ref/source/tiles.h
+++ b/crawl-ref/source/tiles.h
@@ -61,7 +61,7 @@ void tilep_part_to_str(int number, char *buf);
int tilep_str_to_part(char *str);
void tilep_scan_parts(char *fbuf, int *parts);
-void tilep_print_parts(char *fbuf, int *parts);
+void tilep_print_parts(char *fbuf, int *parts, bool check_halo = false);
int tilep_equ_weapon(const item_def &item);
int tilep_equ_shield(const item_def &item);
@@ -123,6 +123,7 @@ void TileNewLevel(bool first_time);
// edit player tile
void TilePlayerEdit();
void init_player_doll();
+void save_doll_file(FILE *dollf);
int item_unid_type(const item_def &item);
int tile_known_weapon_brand(const item_def item);
diff --git a/crawl-ref/source/tiletex.cc b/crawl-ref/source/tiletex.cc
index faaf20f5b0..c42d3a168d 100644
--- a/crawl-ref/source/tiletex.cc
+++ b/crawl-ref/source/tiletex.cc
@@ -267,7 +267,7 @@ TilesTexture::TilesTexture() :
void TilesTexture::set_info(int tile_max, tile_info_func *info_func)
{
- m_tile_max = tile_max;
+ m_tile_max = tile_max;
m_info_func = info_func;
}