diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-20 21:50:54 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-20 21:50:54 +0000 |
commit | f86f721a09fef1f93958a2abc37da555d87f8971 (patch) | |
tree | 1851c4f80e2848734dc5c2202b3478f890818253 /crawl-ref/source/makeitem.cc | |
parent | 3219115e22de903dd8795fc40e101d6c05ab3291 (diff) | |
download | crawl-ref-f86f721a09fef1f93958a2abc37da555d87f8971.tar.gz crawl-ref-f86f721a09fef1f93958a2abc37da555d87f8971.zip |
* Add ability descriptions to the database search.
* Xom no longer gifts stuff that unquestionably makes for a more boring
adventure (scrolls of Detect/Remove Curse, Magic Mapping, Identify;
potion of cure mutation, amulet of resist mutation, ring of control
teleport).
* Xom's "niceness" is no longer automatically defined by his mood, but
it's now randomly picked according to piety > random2(200), which
translates to nice, else the opposite. A "beloved toy" is extremely
likely to get nice effects, and vice versa for the "beloved plaything".
* In xom_acts, instead of 50% chance for piety flip, there's now a 20%
chance of piety being randomly rerolled.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9523 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/makeitem.cc')
-rw-r--r-- | crawl-ref/source/makeitem.cc | 135 |
1 files changed, 88 insertions, 47 deletions
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index 04809c5c70..b085171650 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -811,6 +811,36 @@ void item_colour(item_def &item) } } +// Does Xom consider an item boring? +static bool _is_boring_item(int type, int sub_type) +{ + switch (type) + { + case OBJ_POTIONS: + return (sub_type == POT_CURE_MUTATION); + case OBJ_SCROLLS: + // The corresponding spells are considered "boring", so Xom + // shouldn't gift these scrolls either. + switch (sub_type) + { + case SCR_DETECT_CURSE: + case SCR_REMOVE_CURSE: + case SCR_IDENTIFY: + case SCR_MAGIC_MAPPING: + return (true); + default: + break; + } + break; + case OBJ_JEWELLERY: + return (sub_type == RING_TELEPORT_CONTROL + || sub_type == AMU_RESIST_MUTATION); + default: + break; + } + return (false); +} + static weapon_type _determine_weapon_subtype(int item_level) { weapon_type rc = WPN_UNKNOWN; @@ -2301,7 +2331,7 @@ static void _generate_food_item(item_def& item, int force_quant, int force_type) } static void _generate_potion_item(item_def& item, int force_type, - int item_level) + int item_level, int agent) { item.quantity = 1; @@ -2345,12 +2375,13 @@ static void _generate_potion_item(item_def& item, int force_type, 10, POT_DECAY, 0); } - while ( stype == POT_POISON && item_level < 1 - || stype == POT_STRONG_POISON && item_level < 11 ); + while (stype == POT_POISON && item_level < 1 + || stype == POT_STRONG_POISON && item_level < 11 + || agent == GOD_XOM && _is_boring_item(OBJ_POTIONS, stype)); - if ( stype == POT_GAIN_STRENGTH || stype == POT_GAIN_DEXTERITY - || stype == POT_GAIN_INTELLIGENCE || stype == POT_EXPERIENCE - || stype == POT_MAGIC || stype == POT_RESTORE_ABILITIES ) + if (stype == POT_GAIN_STRENGTH || stype == POT_GAIN_DEXTERITY + || stype == POT_GAIN_INTELLIGENCE || stype == POT_EXPERIENCE + || stype == POT_MAGIC || stype == POT_RESTORE_ABILITIES) { item.quantity = 1; } @@ -2362,7 +2393,7 @@ static void _generate_potion_item(item_def& item, int force_type, } static void _generate_scroll_item(item_def& item, int force_type, - int item_level) + int item_level, int agent) { // determine sub_type: if (force_type != OBJ_RANDOM) @@ -2371,40 +2402,44 @@ static void _generate_scroll_item(item_def& item, int force_type, { const int depth_mod = random2(1 + item_level); - // total weight: 10000 - item.sub_type = random_choose_weighted( - 1797, SCR_IDENTIFY, - 1305, SCR_REMOVE_CURSE, - 802, SCR_TELEPORTATION, - 642, SCR_DETECT_CURSE, - 321, SCR_FEAR, - 321, SCR_NOISE, - 321, SCR_MAGIC_MAPPING, - 321, SCR_FOG, - 321, SCR_RANDOM_USELESSNESS, - 321, SCR_CURSE_WEAPON, - 321, SCR_CURSE_ARMOUR, - 321, SCR_RECHARGING, - 321, SCR_BLINKING, - 161, SCR_PAPER, - 321, SCR_ENCHANT_ARMOUR, - 321, SCR_ENCHANT_WEAPON_I, - 321, SCR_ENCHANT_WEAPON_II, - - // Don't create ?oImmolation at low levels (encourage read-ID) - 321, (item_level < 4 ? SCR_TELEPORTATION : SCR_IMMOLATION), - - // Medium-level scrolls - 160, (depth_mod < 4 ? SCR_TELEPORTATION : SCR_ACQUIREMENT), - 160, (depth_mod < 4 ? SCR_TELEPORTATION : SCR_ENCHANT_WEAPON_III), - 160, (depth_mod < 4 ? SCR_DETECT_CURSE : SCR_SUMMONING), - 160, (depth_mod < 4 ? SCR_PAPER : SCR_VULNERABILITY), - - // High-level scrolls - 160, (depth_mod < 7 ? SCR_TELEPORTATION : SCR_VORPALISE_WEAPON), - 160, (depth_mod < 7 ? SCR_DETECT_CURSE : SCR_TORMENT), - 160, (depth_mod < 7 ? SCR_DETECT_CURSE : SCR_HOLY_WORD), - 0); + do + { + // total weight: 10000 + item.sub_type = random_choose_weighted( + 1797, SCR_IDENTIFY, + 1305, SCR_REMOVE_CURSE, + 802, SCR_TELEPORTATION, + 642, SCR_DETECT_CURSE, + 321, SCR_FEAR, + 321, SCR_NOISE, + 321, SCR_MAGIC_MAPPING, + 321, SCR_FOG, + 321, SCR_RANDOM_USELESSNESS, + 321, SCR_CURSE_WEAPON, + 321, SCR_CURSE_ARMOUR, + 321, SCR_RECHARGING, + 321, SCR_BLINKING, + 161, SCR_PAPER, + 321, SCR_ENCHANT_ARMOUR, + 321, SCR_ENCHANT_WEAPON_I, + 321, SCR_ENCHANT_WEAPON_II, + + // Don't create ?oImmolation at low levels (encourage read-ID) + 321, (item_level < 4 ? SCR_TELEPORTATION : SCR_IMMOLATION), + + // Medium-level scrolls + 160, (depth_mod < 4 ? SCR_TELEPORTATION : SCR_ACQUIREMENT), + 160, (depth_mod < 4 ? SCR_TELEPORTATION : SCR_ENCHANT_WEAPON_III), + 160, (depth_mod < 4 ? SCR_DETECT_CURSE : SCR_SUMMONING), + 160, (depth_mod < 4 ? SCR_PAPER : SCR_VULNERABILITY), + + // High-level scrolls + 160, (depth_mod < 7 ? SCR_TELEPORTATION : SCR_VORPALISE_WEAPON), + 160, (depth_mod < 7 ? SCR_DETECT_CURSE : SCR_TORMENT), + 160, (depth_mod < 7 ? SCR_DETECT_CURSE : SCR_HOLY_WORD), + 0); + } + while (agent == GOD_XOM && _is_boring_item(OBJ_SCROLLS, item.sub_type)); } // determine quantity @@ -2593,7 +2628,7 @@ static int _determine_ring_plus(int subtype) } static void _generate_jewellery_item(item_def& item, bool allow_uniques, - int force_type, int item_level) + int force_type, int item_level, int agent) { if (allow_uniques && _try_make_jewellery_unrandart(item, force_type, item_level)) @@ -2607,8 +2642,13 @@ static void _generate_jewellery_item(item_def& item, bool allow_uniques, item.sub_type = force_type; else { - item.sub_type = (one_chance_in(4) ? get_random_amulet_type() - : get_random_ring_type()); + do + { + item.sub_type = (one_chance_in(4) ? get_random_amulet_type() + : get_random_ring_type()); + } + while (agent == GOD_XOM + && _is_boring_item(OBJ_JEWELLERY, item.sub_type)); } // Everything begins as uncursed, unenchanted jewellery {dlb}: @@ -2811,15 +2851,16 @@ int items( int allow_uniques, // not just true-false, break; case OBJ_POTIONS: - _generate_potion_item(item, force_type, item_level); + _generate_potion_item(item, force_type, item_level, agent); break; case OBJ_SCROLLS: - _generate_scroll_item(item, force_type, item_level); + _generate_scroll_item(item, force_type, item_level, agent); break; case OBJ_JEWELLERY: - _generate_jewellery_item(item, allow_uniques, force_type, item_level); + _generate_jewellery_item(item, allow_uniques, force_type, item_level, + agent); break; case OBJ_BOOKS: |