From 0e672fb6b2424528497812eb1422c6bbad5396dd Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 24 Mar 2009 21:35:54 +0000 Subject: * A few starting choice restriction tweaks. * Increase probability of Xom acts some more, in particularly tension ones. * Greatly lower the chance of Xom doing a bad act despite xom_is_nice() having been rolled. (Now that Xom's mood is no longer predefined, it's not really necessary anymore.) * When making Xom cast a spell, distinguish between spells that require tension and those that don't. * Monsters that are more than 3 waypoints away from their target grid don't count towards tension. (This applies to monsters attracted by noise to a nearby position, or monsters "tracking" you.) * If there are no monsters within line of sight (including invisible ones), tension will always be zero. (This avoids the mysterious berserk effects while a monster is lurking around the corner.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9543 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 2 +- crawl-ref/source/newgame.cc | 10 ++++--- crawl-ref/source/player.cc | 14 ++++----- crawl-ref/source/religion.cc | 18 ++++++++++-- crawl-ref/source/spells2.cc | 5 ++-- crawl-ref/source/xom.cc | 67 ++++++++++++++++++++++++++++---------------- 6 files changed, 76 insertions(+), 40 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 061e5085c2..4092c6198e 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -2678,7 +2678,7 @@ void world_reacts() if (you.cannot_act() && any_messages()) more(); -#if DEBUG_TENSION || DEBUG_RELIGION +#ifdef DEBUG_TENSION | DEBUG_RELIGION if (you.religion != GOD_NO_GOD) mprf(MSGCH_DIAGNOSTICS, "TENSION = %d", get_tension()); #endif diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index 3dca5be4be..826fceb758 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -1400,7 +1400,9 @@ static char_choice_restriction _class_allowed(species_type speci, case SP_SPRIGGAN: case SP_NAGA: case SP_CENTAUR: + case SP_TROLL: case SP_RED_DRACONIAN: + case SP_GHOUL: case SP_MUMMY: return (CC_RESTRICTED); default: @@ -1421,7 +1423,6 @@ static char_choice_restriction _class_allowed(species_type speci, case SP_SPRIGGAN: case SP_NAGA: case SP_OGRE: - case SP_KENKU: case SP_RED_DRACONIAN: case SP_DEMIGOD: case SP_DEMONSPAWN: @@ -1647,6 +1648,7 @@ static char_choice_restriction _class_allowed(species_type speci, case SP_MINOTAUR: case SP_KENKU: case SP_RED_DRACONIAN: + case SP_DEMONSPAWN: case SP_GHOUL: case SP_MUMMY: return (CC_RESTRICTED); @@ -1688,6 +1690,7 @@ static char_choice_restriction _class_allowed(species_type speci, case SP_CENTAUR: case SP_TROLL: case SP_MINOTAUR: + case SP_GHOUL: return (CC_RESTRICTED); default: return (CC_UNRESTRICTED); @@ -1705,7 +1708,6 @@ static char_choice_restriction _class_allowed(species_type speci, case SP_MERFOLK: case SP_HALFLING: case SP_KOBOLD: - case SP_NAGA: case SP_CENTAUR: case SP_OGRE: case SP_TROLL: @@ -1885,9 +1887,7 @@ static char_choice_restriction _class_allowed(species_type speci, switch (speci) { case SP_DEEP_DWARF: - case SP_HALFLING: case SP_KOBOLD: - case SP_SPRIGGAN: case SP_NAGA: case SP_OGRE: case SP_RED_DRACONIAN: @@ -2543,8 +2543,10 @@ static char_choice_restriction _religion_restriction(god_type god) return (CC_BANNED); case SP_SLUDGE_ELF: case SP_MOUNTAIN_DWARF: + case SP_SPRIGGAN: case SP_CENTAUR: case SP_MINOTAUR: + case SP_OGRE: return (CC_UNRESTRICTED); default: return (CC_RESTRICTED); diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index fd2429a949..5d46daf826 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -6327,11 +6327,11 @@ std::string player::pronoun(pronoun_type pro, bool) const switch (pro) { default: - case PRONOUN_CAP: return "You"; - case PRONOUN_NOCAP: return "you"; - case PRONOUN_CAP_POSSESSIVE: return "Your"; - case PRONOUN_NOCAP_POSSESSIVE: return "your"; - case PRONOUN_REFLEXIVE: return "yourself"; + case PRONOUN_CAP: return "You"; + case PRONOUN_NOCAP: return "you"; + case PRONOUN_CAP_POSSESSIVE: return "Your"; + case PRONOUN_NOCAP_POSSESSIVE: return "your"; + case PRONOUN_REFLEXIVE: return "yourself"; } } @@ -6357,7 +6357,7 @@ std::string player::foot_name(bool plural, bool *can_plural) const std::string str; if (you.attribute[ATTR_TRANSFORMATION] == TRAN_SPIDER) - str = "back leg"; + str = "hind leg"; else if (!transform_changed_physiology()) { if (player_mutation_level(MUT_HOOVES)) @@ -6400,7 +6400,7 @@ std::string player::arm_name(bool plural, bool *can_plural) const else if (you.species == SP_KENKU) str = "feathered arm"; else if (you.species == SP_MUMMY) - str = "bandaged wrapped arm"; + str = "bandage wrapped arm"; if (plural) str = pluralise(str); diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index afb5b41e42..17759f78f8 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -7095,7 +7095,7 @@ bool tso_unchivalric_attack_safe_monster(const monsters *mon) const mon_holy_type holiness = mon->holiness(); return (mons_intel(mon) < I_NORMAL || mons_is_evil(mon) - || (holiness != MH_NATURAL && holiness != MH_HOLY)); + || holiness != MH_NATURAL && holiness != MH_HOLY); } int get_tension(god_type god) @@ -7104,6 +7104,7 @@ int get_tension(god_type god) int total = 0; + bool nearby_monster = false; for (int midx = 0; midx < MAX_MONSTERS; ++midx) { const monsters* mons = &menv[midx]; @@ -7112,13 +7113,21 @@ int get_tension(god_type god) continue; if (see_grid(mons->pos())) - ; // Monster is nearby. + { + // Monster is nearby. + if (!nearby_monster && !mons_wont_attack(mons)) + nearby_monster = true; + } else { // Is the monster trying to get somewhere nearby? coord_def target; unsigned int travel_size = mons->travel_path.size(); + // If the monster is too far away, it doesn't count. + if (travel_size > 3) + continue; + if (travel_size > 0) target = mons->travel_path[travel_size - 1]; else @@ -7193,6 +7202,11 @@ int get_tension(god_type god) total += exper; } + + // At least one monster has to be nearby, for tension to count. + if (!nearby_monster) + return (0); + const int scale = 1; int tension = total; diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index b2ef894474..9175fa1d11 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -1589,8 +1589,7 @@ bool summon_holy_warrior(int pow, god_type god, int spell, !force_hostile, quiet); } -bool cast_tukimas_dance(int pow, god_type god, - bool force_hostile) +bool cast_tukimas_dance(int pow, god_type god, bool force_hostile) { bool success = true; @@ -1613,10 +1612,12 @@ bool cast_tukimas_dance(int pow, god_type god, if (i == NON_ITEM) success = false; else if (success) + { // Copy item now so that mitm[i] is occupied and doesn't get picked // by get_item_slot() when giving the dancing weapon its item // during create_monster(). mitm[i] = you.inv[wpn]; + } int monster; diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 99d2434fc4..a382e7faf3 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -55,7 +55,16 @@ REVISION("$Rev$"); // Which spells? First I copied all spells from your_spells(), and then // I filtered some out, especially conjurations. Then I sorted them in // roughly ascending order of power. -static const spell_type _xom_spells[] = +static const spell_type _xom_nontension_spells[] = +{ + SPELL_BLINK, SPELL_MAGIC_MAPPING, SPELL_DETECT_ITEMS, + SPELL_DETECT_CREATURES, SPELL_RING_OF_FLAMES, SPELL_OLGREBS_TOXIC_RADIANCE, + SPELL_EXCRUCIATING_WOUNDS, SPELL_SUMMON_BUTTERFLIES, + SPELL_FLY, SPELL_SPIDER_FORM, SPELL_STATUE_FORM, SPELL_ICE_FORM, + SPELL_DRAGON_FORM, SPELL_ANIMATE_DEAD, SPELL_NECROMUTATION +}; + +static const spell_type _xom_tension_spells[] = { SPELL_BLINK, SPELL_CONFUSING_TOUCH, SPELL_MAGIC_MAPPING, SPELL_DETECT_ITEMS, SPELL_DETECT_CREATURES, SPELL_CAUSE_FEAR, @@ -219,7 +228,7 @@ void xom_tick() if (you.gift_timeout == 1) simple_god_message(" is getting BORED."); - if (one_chance_in(10) && (coinflip() || get_tension(GOD_XOM))) + if (one_chance_in(5) && (one_chance_in(3) || get_tension(GOD_XOM))) xom_acts(abs(you.piety - MAX_PIETY/2)); } @@ -237,16 +246,25 @@ void xom_is_stimulated(int maxinterestingness, const std::string& message, _xom_is_stimulated(maxinterestingness, message_array, force_message); } -static void _xom_makes_you_cast_random_spell(int sever) +static void _xom_makes_you_cast_random_spell(int sever, int tension) { int spellenum = sever; god_acting gdact(GOD_XOM); - const int nxomspells = ARRAYSZ(_xom_spells); - spellenum = std::min(nxomspells, spellenum); - - const spell_type spell = _xom_spells[random2(spellenum)]; + spell_type spell; + if (tension > 0) + { + const int nxomspells = ARRAYSZ(_xom_tension_spells); + spellenum = std::min(nxomspells, spellenum); + spell = _xom_tension_spells[random2(spellenum)]; + } + else + { + const int nxomspells = ARRAYSZ(_xom_nontension_spells); + spellenum = std::min(nxomspells, spellenum); + spell = _xom_nontension_spells[random2(spellenum)]; + } god_speaks(GOD_XOM, _get_xom_speech("spell effect").c_str()); @@ -1136,8 +1154,11 @@ static bool _xom_is_good(int sever, int tension) done = _xom_do_potion(); else if (x_chance_in_y(3, sever)) { - _xom_makes_you_cast_random_spell(sever); - done = true; + if (tension || coinflip()) + { + _xom_makes_you_cast_random_spell(sever, tension); + done = true; + } } else if (x_chance_in_y(4, sever)) done = _xom_confuse_monsters(sever); @@ -1750,18 +1771,15 @@ static bool _xom_summon_hostiles(int sever) // Nasty, but fun. if (one_chance_in(4)) - { - god_speaks(GOD_XOM, speech.c_str()); - cast_tukimas_dance(100, GOD_XOM, true); - // FIXME: We should probably only do this if the spell - // succeeded. - rc = true; - } + rc = cast_tukimas_dance(100, GOD_XOM, true); else { - // XXX: Can we clean up this ugliness, please? - const int numdemons = - std::min(random2(random2(random2(sever+1)+1)+1)+1, 14); + // The number of demons is dependant on severity, though heavily + // randomized. + int numdemons = sever; + for (int i = 0; i < 3; i++) + numdemons = random2(numdemons+1); + numdemons = std::min(numdemons+1,14); for (int i = 0; i < numdemons; ++i) { @@ -1774,10 +1792,11 @@ static bool _xom_summon_hostiles(int sever) rc = true; } } - - if (rc) - god_speaks(GOD_XOM, speech.c_str()); } + + if (rc) + god_speaks(GOD_XOM, speech.c_str()); + return (rc); } @@ -2052,7 +2071,7 @@ void xom_acts(bool niceness, int sever) const FixedVector orig_mutation = you.mutation; - if (niceness && !one_chance_in(5)) + if (niceness && !one_chance_in(20)) { // Good stuff. while (!_xom_is_good(sever, tension)) @@ -2078,7 +2097,7 @@ void xom_acts(bool niceness, int sever) } } - if (you.religion == GOD_XOM && one_chance_in(5)) + if (you.religion == GOD_XOM && one_chance_in(8)) { const std::string old_xom_favour = describe_xom_favour(); you.piety = random2(MAX_PIETY+1); -- cgit v1.2.3-54-g00ecf