diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-02 18:35:22 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-02 18:35:22 +0000 |
commit | 52c7e79cd76a5205f72c43da92d9aa1297b1d3d4 (patch) | |
tree | ff906edd7976a830a817e2a15185b267e0bd881a /crawl-ref/source/makeitem.cc | |
parent | da683c2f2f2474d0494eb280deae1fb11d6c8de2 (diff) | |
download | crawl-ref-52c7e79cd76a5205f72c43da92d9aa1297b1d3d4.tar.gz crawl-ref-52c7e79cd76a5205f72c43da92d9aa1297b1d3d4.zip |
Make artificers' rods of striking start with a constant number of
charges, as their wands do.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9312 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/makeitem.cc')
-rw-r--r-- | crawl-ref/source/makeitem.cc | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index 35a3af0bab..f6ca660c82 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -341,7 +341,7 @@ static int _armour_colour(const item_def &item) : _newwave_armour_colour(item)); } -void item_colour( item_def &item ) +void item_colour(item_def &item) { int switchnum = 0; int temp_value; @@ -2559,8 +2559,8 @@ static void _generate_staff_item(item_def& item, int force_type) } } - if (item_is_rod( item )) - init_rod_mp( item ); + if (item_is_rod(item)) + init_rod_mp(item); } static bool _try_make_jewellery_unrandart(item_def& item, int force_type, @@ -2906,19 +2906,24 @@ int items( int allow_uniques, // not just true-false, } // Note that item might be invalidated now, since p could have changed. - ASSERT( is_valid_item(mitm[p]) ); - return p; + ASSERT(is_valid_item(mitm[p])); + return (p); } -void init_rod_mp(item_def &item) +void init_rod_mp(item_def &item, int ncharges) { if (!item_is_rod(item)) return; - if (item.sub_type == STAFF_STRIKING) - item.plus2 = random_range(6, 9) * ROD_CHARGE_MULT; + if (ncharges != -1) + item.plus2 = ncharges * ROD_CHARGE_MULT; else - item.plus2 = random_range(9, 14) * ROD_CHARGE_MULT; + { + if (item.sub_type == STAFF_STRIKING) + item.plus2 = random_range(6, 9) * ROD_CHARGE_MULT; + else + item.plus2 = random_range(9, 14) * ROD_CHARGE_MULT; + } item.plus = item.plus2; } |