From be6a0a38de9cba44caca289f155d46df6324d0a5 Mon Sep 17 00:00:00 2001 From: haranp Date: Tue, 13 Nov 2007 17:49:42 +0000 Subject: Bunch of changes: Removed unnecessary static_casts<> from branch.cc, improved messages a bit. Removed incorrect caps from entomb(). Changed ornate/legendary bonuses from percentages to flat power bonuses (+150 and +300 respectively.) Ensured at least one Nemelex gift by the time you get the first power. Changed probability of Nemelex liking a gift, made it dependent on piety. Fix warning in cloud.cc. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2850 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/branch.cc | 30 ++++++++++++++---------------- crawl-ref/source/cloud.cc | 2 -- crawl-ref/source/decks.cc | 4 ++-- crawl-ref/source/religion.cc | 21 ++++++++++++++------- crawl-ref/source/spells3.cc | 5 ----- 5 files changed, 30 insertions(+), 32 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/branch.cc b/crawl-ref/source/branch.cc index 26411173ef..0739562861 100644 --- a/crawl-ref/source/branch.cc +++ b/crawl-ref/source/branch.cc @@ -13,7 +13,7 @@ Branch& your_branch() { - return branches[static_cast(you.where_are_you)]; + return branches[you.where_are_you]; } branch_type str_to_branch(const std::string &branch, branch_type err) @@ -35,8 +35,8 @@ bool set_branch_flags(unsigned long flags, bool silent, bool could_control = allow_control_teleport(true); bool could_map = player_in_mappable_area(); - unsigned long old_flags = branches[static_cast(branch)].branch_flags; - branches[static_cast(branch)].branch_flags |= flags; + unsigned long old_flags = branches[branch].branch_flags; + branches[branch].branch_flags |= flags; bool can_control = allow_control_teleport(true); bool can_map = player_in_mappable_area(); @@ -56,7 +56,7 @@ bool set_branch_flags(unsigned long flags, bool silent, "remembering where you've been.", MSGCH_WARN); } - return (old_flags != branches[static_cast(branch)].branch_flags); + return (old_flags != branches[branch].branch_flags); } bool unset_branch_flags(unsigned long flags, bool silent, @@ -65,14 +65,14 @@ bool unset_branch_flags(unsigned long flags, bool silent, if (branch == NUM_BRANCHES) branch = you.where_are_you; - bool could_control = allow_control_teleport(true); - bool could_map = player_in_mappable_area(); + const bool could_control = allow_control_teleport(true); + const bool could_map = player_in_mappable_area(); - unsigned long old_flags = branches[static_cast(branch)].branch_flags; - branches[static_cast(branch)].branch_flags &= ~flags; + unsigned long old_flags = branches[branch].branch_flags; + branches[branch].branch_flags &= ~flags; - bool can_control = allow_control_teleport(true); - bool can_map = player_in_mappable_area(); + const bool can_control = allow_control_teleport(true); + const bool can_map = player_in_mappable_area(); if (you.level_type == LEVEL_DUNGEON && branch == you.where_are_you && you.skills[SK_TRANSLOCATIONS] > 0 @@ -80,8 +80,7 @@ bool unset_branch_flags(unsigned long flags, bool silent, { // Isn't really a "recovery", but I couldn't think of where // else to send it. - mpr("You sense the disappearence of a powerful magical force " - "which warped space.", MSGCH_RECOVERY); + mpr("Space seems to straighten in your vicinity.", MSGCH_RECOVERY); } if (you.level_type == LEVEL_DUNGEON && branch == you.where_are_you @@ -89,11 +88,10 @@ bool unset_branch_flags(unsigned long flags, bool silent, { // Isn't really a "recovery", but I couldn't think of where // else to send it. - mpr("You sense the disappearence the force that prevented you " - "from remembering where you've been.", MSGCH_RECOVERY); + mpr("An oppressive force seems to lift.", MSGCH_RECOVERY); } - return (old_flags != branches[static_cast(branch)].branch_flags); + return (old_flags != branches[branch].branch_flags); } unsigned long get_branch_flags(branch_type branch) @@ -106,7 +104,7 @@ unsigned long get_branch_flags(branch_type branch) branch = you.where_are_you; } - return branches[static_cast(branch)].branch_flags; + return branches[branch].branch_flags; } Branch branches[] = { diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc index 3d471f41ee..351f1a3773 100644 --- a/crawl-ref/source/cloud.cc +++ b/crawl-ref/source/cloud.cc @@ -448,8 +448,6 @@ fog_machine_data random_fog_for_place(int level_number, const level_id &place) Branch &branch = branches[place.branch]; ASSERT(branch.num_fogs_function != NULL && branch.rand_fog_function != NULL); - fog_machine_data data; - branch.rand_fog_function(level_number, data); return data; } diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index 0db1d95a71..e54e36e33f 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -2120,9 +2120,9 @@ static int card_power(deck_rarity_type rarity) result += you.skills[SK_EVOCATIONS] * 9; if ( rarity == DECK_RARITY_RARE ) - result += random2(result / 2); + result += 150; if ( rarity == DECK_RARITY_LEGENDARY ) - result += random2(result); + result += 300; return result; } diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 93b59a40d3..8f203d69fc 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -596,10 +596,15 @@ static void show_pure_deck_chances() static void give_nemelex_gift() { - if (random2(MAX_PIETY) <= you.piety - && one_chance_in(3) - && !you.attribute[ATTR_CARD_COUNTDOWN] - && !grid_destroys_items(grd[you.x_pos][you.y_pos])) + if ( grid_destroys_items(grd[you.x_pos][you.y_pos]) ) + return; + + // Nemelex will give at least one gift early. + if ((you.num_gifts[GOD_NEMELEX_XOBEH] == 0 + && random2(piety_breakpoint(1)) < you.piety) || + (random2(MAX_PIETY) <= you.piety + && one_chance_in(3) + && !you.attribute[ATTR_CARD_COUNTDOWN])) { misc_item_type gift_type; if ( random2(MAX_PIETY) <= you.piety ) @@ -3245,9 +3250,11 @@ void offer_items() // 60: 50.0% // 70: 58.0% // 80: 63.0% - if ((item.base_type == OBJ_CORPSES && coinflip()) - // Nemelex piety gain is fairly fast. - || random2(value) >= random2(60)) + if ((item.base_type == OBJ_CORPSES && + one_chance_in(2+you.piety/50)) + // Nemelex piety gain is fairly fast...at least + // when you have low piety. + || value/2 >= random2(30 + you.piety/2)) { gain_piety(1); gained_piety = true; diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 78501fe6ed..200c0cfa83 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -687,11 +687,6 @@ bool entomb(int powc) DNGN_FLOOR_SPECIAL }; - if ( powc > 98 ) - powc = 98; - if ( powc < 30 ) - powc = 30; - for (int srx = you.x_pos - 1; srx < you.x_pos + 2; srx++) { for (int sry = you.y_pos - 1; sry < you.y_pos + 2; sry++) -- cgit v1.2.3-54-g00ecf