From cb3497134b22bd2a2d413fdbdb41324e8e7070d7 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 6 May 2008 21:06:34 +0000 Subject: * Fix god gift randarts being named after *other* gods. * Reallow monster placement of bands (at least for Beogh's retribution; it might be similarly buggy for normal generation). * Extend documentation on orc naming, and sometimes name the band leader of a band sent after you for retribution. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4894 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/randart.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/randart.cc') diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc index d3d40eb0cd..02446ad67d 100644 --- a/crawl-ref/source/randart.cc +++ b/crawl-ref/source/randart.cc @@ -27,6 +27,7 @@ #include "database.h" #include "itemname.h" #include "itemprop.h" +#include "items.h" #include "place.h" #include "player.h" #include "religion.h" @@ -185,9 +186,6 @@ static std::string _replace_name_parts(const std::string name_in, name = replace_all(name, "@player_species@", species_name(static_cast(you.species), 1)); - name = replace_all(name, "@race_name@", - species_name(static_cast(random2(SP_ELF)),1)); - if (name.find("@branch_name@", 0) != std::string::npos) { std::string place; @@ -1279,7 +1277,7 @@ static bool _pick_db_name( const item_def &item ) } } -static std::string _randart_name(const item_def &item, bool appearance = false) +std::string randart_name(const item_def &item, bool appearance) { ASSERT(is_artefact(item)); @@ -1407,12 +1405,12 @@ std::string get_randart_name( const item_def &item ) // print artefact's real name if (item.props.exists(RANDART_NAME_KEY)) return item.props[RANDART_NAME_KEY].get_string(); - return _randart_name(item, false); + return randart_name(item, false); } // print artefact appearance if (item.props.exists(RANDART_APPEAR_KEY)) return item.props[RANDART_APPEAR_KEY].get_string(); - return _randart_name(item, false); + return randart_name(item, false); } int find_unrandart_index(const item_def& artefact) @@ -1869,11 +1867,11 @@ bool make_item_randart( item_def &item ) // get true artefact name ASSERT(!item.props.exists( RANDART_NAME_KEY )); - item.props[RANDART_NAME_KEY].get_string() = _randart_name(item, false); + item.props[RANDART_NAME_KEY].get_string() = randart_name(item, false); // get artefact appearance ASSERT(!item.props.exists( RANDART_APPEAR_KEY )); - item.props[RANDART_APPEAR_KEY].get_string() = _randart_name(item, true); + item.props[RANDART_APPEAR_KEY].get_string() = randart_name(item, true); return (true); } -- cgit v1.2.3-54-g00ecf