From 5b47fc35bc8a689402339fae49f78993cf96a596 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 27 Oct 2007 12:54:20 +0000 Subject: Trunk->0.3 merge (2620-2625): Vestibule, god gift, gift timeout, control demons and Xom fixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2627 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/abl-show.cc | 3 ++- crawl-ref/source/beam.cc | 12 +++++++++--- crawl-ref/source/effects.cc | 5 ++++- crawl-ref/source/monplace.cc | 25 +++++++------------------ crawl-ref/source/religion.cc | 9 ++++----- crawl-ref/source/xom.cc | 6 ++++-- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index c3e11e6703..d9f27b19dc 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -259,7 +259,8 @@ static const ability_def Ability_List[] = // Okawaru { ABIL_OKAWARU_MIGHT, "Might", 2, 0, 50, 1, ABFLAG_NONE }, - { ABIL_OKAWARU_HASTE, "Haste", 5, 0, 100, 5, ABFLAG_NONE }, + { ABIL_OKAWARU_HASTE, "Haste", + 5, 0, 100, generic_cost::fixed(5), ABFLAG_NONE }, // Makhleb { ABIL_MAKHLEB_MINOR_DESTRUCTION, "Minor Destruction", 1, 0, 20, 0, ABFLAG_NONE }, diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 883c96f58a..dec5d4758a 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3962,21 +3962,27 @@ static int affect_monster_enchantment(bolt &beam, monsters *mon) "HD: %d; pow: %d", mon->hit_dice, beam.ench_power ); #endif - if (mon->hit_dice * 7 >= random2(beam.ench_power) + if (mon->hit_dice * 11 / 2 >= random2(beam.ench_power) || mons_is_unique(mon->type)) { return (MON_RESIST); } // already friendly - if (mon->attitude == ATT_FRIENDLY) + if (mons_friendly(mon)) return (MON_UNAFFECTED); simple_monster_message(mon, " is enslaved."); beam.obvious_effect = true; // wow, permanent enslaving - mon->attitude = ATT_FRIENDLY; + if (one_chance_in(2 + mon->hit_dice / 4)) + mon->attitude = ATT_FRIENDLY; + else + mon->add_ench(ENCH_CHARM); + + // break fleeing and suchlike + mon->behaviour = BEH_SEEK; return (MON_AFFECTED); } diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index a5da81159f..c209ae1c2c 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -1341,14 +1341,17 @@ bool acquirement(object_class_type class_wanted, int agent) { thing.plus -= plusmod; thing.plus2 += plusmod; + if (!is_random_artefact(thing)) + thing.plus = std::max(static_cast(thing.plus), 0); } // more accuracy, less damage else if (agent == GOD_OKAWARU) { thing.plus += plusmod; thing.plus2 -= plusmod; + if (!is_random_artefact(thing)) + thing.plus2 = std::max(static_cast(thing.plus2), 0); } - } else if (thing.base_type == OBJ_ARMOUR && !is_fixed_artefact( thing ) diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index c09ee32ef6..a95b212310 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -158,30 +158,19 @@ static int fuzz_mons_level(int level) static void hell_spawn_random_monsters() { - const int speedup_turn = 3000; - - // Monster generation in the Vestibule starts ratcheting up quickly - // after speedup_turn turns spent in the Vestibule. - int genodds = (you.char_direction == GDT_DESCENDING) ? 240 : 8; - if (env.turns_on_level > speedup_turn) + // Monster generation in the Vestibule drops off quickly. + const int taper_off_turn = 500; + int genodds = 240; + if (env.turns_on_level > taper_off_turn) { - genodds -= (env.turns_on_level - speedup_turn) / 14; - if (genodds < 3) - genodds = 3; + genodds += (env.turns_on_level - taper_off_turn); + genodds = (genodds < 0? 20000 : std::min(genodds, 20000)); } if (one_chance_in(genodds)) { - int distance_odds = 10; - if (env.turns_on_level > speedup_turn) - distance_odds -= (env.turns_on_level - speedup_turn) / 100; - - if (distance_odds < 2) - distance_odds = 2; - proximity_type prox = - (one_chance_in(distance_odds) ? PROX_NEAR_STAIRS - : PROX_AWAY_FROM_PLAYER); + (one_chance_in(10) ? PROX_NEAR_STAIRS : PROX_AWAY_FROM_PLAYER); mons_place( WANDERING_MONSTER, BEH_HOSTILE, MHITNOT, false, 50, 50, LEVEL_DUNGEON, prox ); viewwindow(true, false); diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index cbe613feec..fa26873f59 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -597,6 +597,8 @@ static void do_god_gift(bool prayed_for) else { success = acquirement(OBJ_ARMOUR, you.religion); + // Okawaru charges extra for armour acquirements. + inc_gift_timeout(20 + random2avg(15, 2)); } if (success) @@ -1512,7 +1514,7 @@ void gain_piety(int pgn) // Slow down piety gain to account for the fact that gifts // no longer have a piety cost for getting them - if (!one_chance_in(8)) + if (!one_chance_in(4)) return; } @@ -3272,10 +3274,7 @@ void handle_god_time(void) if (one_chance_in(20)) { - // If you.gift_timeout was == 0, then Xom was BORED. - // He HATES that. - xom_acts(you.gift_timeout > 0 && you.piety > 100, - abs(you.piety - 100)); + xom_acts(abs(you.piety - 100)); } break; } diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index ec81db920a..eadf039a69 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -106,7 +106,9 @@ const char *describe_xom_favour() bool xom_is_nice() { - return (you.gift_timeout > 0 && you.piety > 100); + // If you.gift_timeout was == 0, then Xom was BORED. + // He HATES that. + return (you.gift_timeout > 0 && you.piety > 100) || coinflip(); } void xom_is_stimulated(int maxinterestingness) @@ -794,7 +796,7 @@ void xom_acts(bool niceness, int sever) if (sever < 1) sever = 1; - if (niceness) + if (niceness && !one_chance_in(5)) { // Good stuff. while (!xom_is_good(sever)) -- cgit v1.2.3-54-g00ecf