diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-17 11:11:48 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-17 11:11:48 +0000 |
commit | b077eb8665d53ff4c307678ad0c6ca07d73b623e (patch) | |
tree | a552e7374e2763f38d79e39828a5e5afa1109f2c | |
parent | c76e3a228cfc6bc3b115c99278b38f21bdc733af (diff) | |
download | crawl-ref-b077eb8665d53ff4c307678ad0c6ca07d73b623e.tar.gz crawl-ref-b077eb8665d53ff4c307678ad0c6ca07d73b623e.zip |
Apply several recent commits to 0.4.1
* r6547 (Matthew's item quote patch)
* r6550 (Haran's mapmark patch, no idea what part it plays in fixing the
bug but it surely won't hurt)
* r6561 (Haran's hell effects patch)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6584 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/docs/changes.stone_soup | 1 | ||||
-rw-r--r-- | crawl-ref/source/describe.cc | 23 | ||||
-rw-r--r-- | crawl-ref/source/describe.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/mapmark.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 26 |
5 files changed, 40 insertions, 18 deletions
diff --git a/crawl-ref/docs/changes.stone_soup b/crawl-ref/docs/changes.stone_soup index 278083d5b0..33bc1e57c6 100644 --- a/crawl-ref/docs/changes.stone_soup +++ b/crawl-ref/docs/changes.stone_soup @@ -9,6 +9,7 @@ Disclaimer: These are merely the highlights, not an exhaustive list of changes. * Fixed crashes when selecting an item with no appropriate items in inventory. * Fixed tiles not working on Windows 2000 and earlier. * Fixed targetting prompts being ignored or having the wrong result. +* Fixed item quotes causing overlong descriptions. * Fixed vampire bat jewellery exploit. * Fixed secondary monster attacks being branded according to their weapon. * Fixed kills by hell effects counting as player kills. diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 18ffe14195..cf4f1e96b8 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -1612,8 +1612,11 @@ bool is_dumpable_artefact( const item_def &item, bool verbose) // //--------------------------------------------------------------- std::string get_item_description( const item_def &item, bool verbose, - bool dump ) + bool dump, bool noquote ) { + if (dump) + noquote = true; + std::ostringstream description; if (!dump) @@ -1674,7 +1677,7 @@ std::string get_item_description( const item_def &item, bool verbose, { std::string db_name = item.name(DESC_DBNAME, true, false, false); std::string db_desc = - getLongDescription(db_name, is_artefact(item)); + getLongDescription(db_name, is_artefact(item) || noquote); if (db_desc.empty()) { @@ -1956,7 +1959,21 @@ void describe_feature_wide(int x, int y) // Returns true if spells can be shown to player. static bool _show_item_description(const item_def &item) { - const std::string description = get_item_description( item, 1 ); + const unsigned int lineWidth = get_number_of_cols() - 1; + const int height = get_number_of_lines(); + + std::string description = get_item_description( item, 1, false, + Options.tutorial_left); + + int num_lines = _count_desc_lines(description, lineWidth) + 1; + + // XXX: hack: Leave room for "Inscribe item?" and the blank line above + // it by removing item quote. This should really be taken care of + // by putting the quotes into a separate DB and treating them as + // a suffix that can be ignored by print_description(). + if (height - num_lines <= 2) + description = get_item_description( item, 1, false, true); + print_description(description); if (Options.tutorial_left) tutorial_describe_item(item); diff --git a/crawl-ref/source/describe.h b/crawl-ref/source/describe.h index 92a4fdfb04..66c0275b46 100644 --- a/crawl-ref/source/describe.h +++ b/crawl-ref/source/describe.h @@ -43,7 +43,7 @@ bool is_dumpable_artefact( const item_def &item, bool verbose ); * called from: chardump - describe * *********************************************************************** */ std::string get_item_description( const item_def &item, bool verbose, - bool dump = false ); + bool dump = false, bool noquote = false ); // last updated 12 Jun 2008 {jpeg} /* *********************************************************************** diff --git a/crawl-ref/source/mapmark.cc b/crawl-ref/source/mapmark.cc index 4994b6dc32..5f0942ef2e 100644 --- a/crawl-ref/source/mapmark.cc +++ b/crawl-ref/source/mapmark.cc @@ -752,7 +752,11 @@ void map_markers::write(writer &outf) const // Write the marker data, prefixed by a size marshallLong(outf, buf.size()); - outf.write(&buf[0], buf.size()); + for ( std::vector<unsigned char>::const_iterator bi = buf.begin(); + bi != buf.end(); ++bi ) + { + outf.writeByte(*bi); + } } } diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 35b27a7a07..ed711ad7a1 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -2268,7 +2268,7 @@ static void _miscast_conjuration(int severity, const char* cause) case 0: msg::stream << "Smoke pours from your " << your_hand(true) << '!' << std::endl; - big_cloud( CLOUD_GREY_SMOKE, KC_YOU, + big_cloud( CLOUD_GREY_SMOKE, (cause ? KC_OTHER : KC_YOU), you.x_pos, you.y_pos, 20, 7 + random2(7) ); break; @@ -3256,7 +3256,7 @@ static void _miscast_fire(int severity, const char* cause) case 0: msg::stream << "Smoke pours from your " << your_hand(true) << "!" << std::endl; - big_cloud( random_smoke_type(), KC_YOU, + big_cloud( random_smoke_type(), (cause ? KC_OTHER : KC_YOU), you.x_pos, you.y_pos, 20, 7 + random2(7) ); break; @@ -3453,8 +3453,8 @@ static void _miscast_ice(int severity, const char* cause) case 1: msg::stream << "Freezing gasses pour from your " << your_hand(true) << "!" << std::endl; - big_cloud(CLOUD_COLD, KC_YOU, you.x_pos, you.y_pos, 20, - 8 + random2(4)); + big_cloud(CLOUD_COLD, (cause ? KC_OTHER : KC_YOU), + you.x_pos, you.y_pos, 20, 8 + random2(4)); break; } break; @@ -3653,8 +3653,8 @@ static void _miscast_air(int severity, const char* cause) case 1: msg::stream << "Noxious gasses pour from your " << your_hand(true) << "!" << std::endl; - big_cloud(CLOUD_STINK, KC_YOU, you.x_pos, you.y_pos, 20, - 9 + random2(4)); + big_cloud(CLOUD_STINK, (cause ? KC_OTHER : KC_YOU), + you.x_pos, you.y_pos, 20, 9 + random2(4)); break; } break; @@ -3684,8 +3684,8 @@ static void _miscast_air(int severity, const char* cause) case 1: msg::stream << "Venomous gasses pour from your " << your_hand(true) << "!" << std::endl; - big_cloud( CLOUD_POISON, KC_YOU, you.x_pos, you.y_pos, 20, - 8 + random2(5) ); + big_cloud( CLOUD_POISON, (cause ? KC_OTHER : KC_YOU), + you.x_pos, you.y_pos, 20, 8 + random2(5) ); break; } } @@ -3754,7 +3754,7 @@ static void _miscast_poison(int severity, const char* cause) msg::stream << "Noxious gasses pour from your " << your_hand(true) << "!" << std::endl; place_cloud(CLOUD_STINK, you.x_pos, you.y_pos, - 2 + random2(4), KC_YOU); + 2 + random2(4), (cause ? KC_OTHER : KC_YOU) ); break; } break; @@ -3774,8 +3774,8 @@ static void _miscast_poison(int severity, const char* cause) case 1: mpr("Noxious gasses pour from your hands!"); - big_cloud(CLOUD_STINK, KC_YOU, you.x_pos, you.y_pos, 20, - 8 + random2(5)); + big_cloud(CLOUD_STINK, (cause ? KC_OTHER : KC_YOU), + you.x_pos, you.y_pos, 20, 8 + random2(5)); break; case 2: @@ -3802,8 +3802,8 @@ static void _miscast_poison(int severity, const char* cause) case 1: msg::stream << "Venomous gasses pour from your " << your_hand(true) << "!" << std::endl; - big_cloud(CLOUD_POISON, KC_YOU, you.x_pos, you.y_pos, 20, - 7 + random2(7)); + big_cloud(CLOUD_POISON, (cause ? KC_OTHER : KC_YOU), + you.x_pos, you.y_pos, 20, 7 + random2(7)); break; case 2: if (player_res_poison()) |