diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-04 21:24:33 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-04 21:24:33 +0000 |
commit | b69f4b3d80b1ec5b40c27aea393a072dde9551f3 (patch) | |
tree | 03728b16e3a91d13a6d292c59bcbc1e3c6b691e8 | |
parent | 5a4349f58cc28bbcae6cc6967a854d1f7041bbcf (diff) | |
download | crawl-ref-b69f4b3d80b1ec5b40c27aea393a072dde9551f3.tar.gz crawl-ref-b69f4b3d80b1ec5b40c27aea393a072dde9551f3.zip |
[1608520] No more special treatment for rods of striking.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@567 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/describe.cc | 9 | ||||
-rw-r--r-- | crawl-ref/source/dungeon.cc | 18 | ||||
-rw-r--r-- | crawl-ref/source/dungeon.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/itemname.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/newgame.cc | 29 | ||||
-rw-r--r-- | crawl-ref/source/spl-book.cc | 20 |
6 files changed, 39 insertions, 42 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 70001528ec..8f3aca98fc 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -2963,11 +2963,10 @@ static std::string describe_staff( const item_def &item ) if (item_is_rod( item )) { - if (item.sub_type != STAFF_STRIKING) - description += - "$$It uses its own mana reservoir for casting spells, and " - "recharges automatically by channeling mana from its " - "wielder."; + description += + "$$It uses its own mana reservoir for casting spells, and " + "recharges automatically by channeling mana from its " + "wielder."; } else { diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 2a44f2996b..35ebd5084c 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -478,6 +478,19 @@ void builder(int level_number, char level_type) prepare_water( level_number ); } // end builder() +void init_rod_mp(item_def &item) +{ + if (!item_is_rod(item)) + return; + + 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; +} + // Returns item slot or NON_ITEM if it fails int items( int allow_uniques, // not just true-false, // because of BCR acquirement hack @@ -2434,10 +2447,7 @@ int items( int allow_uniques, // not just true-false, mitm[p].special = random2(NUM_STAVE_ADJ); if (item_is_rod( mitm[p] )) - { - mitm[p].plus2 = random_range(9, 14) * ROD_CHARGE_MULT; - mitm[p].plus = mitm[p].plus2; - } + init_rod_mp( mitm[p] ); quant = 1; break; diff --git a/crawl-ref/source/dungeon.h b/crawl-ref/source/dungeon.h index 7db4d30569..4252b8f6cc 100644 --- a/crawl-ref/source/dungeon.h +++ b/crawl-ref/source/dungeon.h @@ -49,6 +49,7 @@ int items( int allow_uniques, int force_class, int force_type, * *********************************************************************** */ void give_item(int mid, int level_number); +void init_rod_mp(item_def &item); // last updated 13mar2001 {gdl} /* *********************************************************************** diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 38d1ba862c..919339d835 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -1738,8 +1738,8 @@ static const char *item_name_2( : "bugginess", ITEMNAME_SIZE ); } - if (item_is_rod( item ) && item.sub_type != STAFF_STRIKING - && item_ident( item, ISFLAG_KNOW_TYPE )) + if (item_is_rod( item ) + && item_ident( item, ISFLAG_KNOW_TYPE )) { strncat( buff, " (", ITEMNAME_SIZE ); itoa( item.plus / ROD_CHARGE_MULT, tmp_quant, 10 ); diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index 5a1c97671c..7901f32611 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -2362,6 +2362,17 @@ static bool give_wanderer_weapon( int slot, int wpn_skill ) return (ret); } +static void make_rod(item_def &item, int rod_type) +{ + item.base_type = OBJ_STAVES; + item.sub_type = rod_type; + item.quantity = 1; + item.special = 0; + item.colour = BROWN; + + init_rod_mp(item); +} + // // The idea behind wanderers is a class that has various different // random skills that's a challenge to play... not a class that can @@ -4143,11 +4154,7 @@ void give_items_skills() you.inv[3].colour = LIGHTCYAN; if (you.species == SP_SPRIGGAN) - { - you.inv[0].base_type = OBJ_STAVES; - you.inv[0].sub_type = STAFF_STRIKING; - you.inv[0].colour = BROWN; - } + make_rod(you.inv[0], STAFF_STRIKING); break; case JOB_FIRE_ELEMENTALIST: @@ -4336,13 +4343,7 @@ void give_items_skills() if (you.species == SP_SPRIGGAN) { - you.inv[0].base_type = OBJ_STAVES; - you.inv[0].sub_type = STAFF_STRIKING; - you.inv[0].quantity = 1; - you.inv[0].plus = 0; - you.inv[0].plus2 = 0; - you.inv[0].special = 0; - you.inv[0].colour = BROWN; + make_rod(you.inv[0], STAFF_STRIKING); you.skills[SK_EVOCATIONS] = 2; you.skills[SK_FIGHTING] = 0; @@ -4360,9 +4361,7 @@ void give_items_skills() if (you.species == SP_SPRIGGAN) { - you.inv[0].base_type = OBJ_STAVES; - you.inv[0].sub_type = STAFF_STRIKING; - you.inv[0].colour = BROWN; + make_rod(you.inv[0], STAFF_STRIKING); you.skills[SK_EVOCATIONS] = 3; } diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc index 4f6e040563..421a6f6bd5 100644 --- a/crawl-ref/source/spl-book.cc +++ b/crawl-ref/source/spl-book.cc @@ -1525,13 +1525,8 @@ int staff_spell( int staff ) return (-1); } - if (staff_type == STAFF_STRIKING) - mana /= ROD_CHARGE_MULT; - - if ((staff_type == STAFF_STRIKING? - you.magic_points < mana - : you.inv[staff].plus < mana) - || you.experience_level < diff) + if (you.inv[staff].plus < mana + || you.experience_level < diff) { #ifdef DEBUG_DIAGNOSTICS mprf(MSGCH_DIAGNOSTICS, @@ -1541,8 +1536,7 @@ int staff_spell( int staff ) if (you.experience_level < diff) mprf("You need to be at least level %d to use that.", diff); else - mprf("%s have enough magic points.", - staff_type == STAFF_STRIKING? "You don't" : "The rod doesn't"); + mpr("The rod doesn't have enough magic points."); // Don't lose a turn for trying to evoke without enough MP - that's // needlessly cruel for an honest error. @@ -1552,13 +1546,7 @@ int staff_spell( int staff ) if (your_spells(specspell, powc, false) == -1) return (-1); - // dec_mp(spell_mana(specspell)); - if (staff_type != STAFF_STRIKING) - you.inv[staff].plus -= mana; - else { - you.magic_points -= mana; - you.redraw_magic_points = true; - } + you.inv[staff].plus -= mana; energy = player_energy(); if (energy <= 0 && you.is_undead != US_UNDEAD) |