From 13abff271666dcc566102311c3b9d237ea04f933 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 22 Apr 2009 15:58:36 +0000 Subject: * Tweak Xom's ideas about what makes a funny or boring death. * Add another option (*sigh*) covering whether W=T and P=R. (Defaults to false.) * Various spacing and comment fixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9675 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/docs/changes.stone_soup | 5 +- crawl-ref/docs/options_guide.txt | 5 ++ crawl-ref/settings/init.txt | 9 ++-- crawl-ref/source/acr.cc | 2 +- crawl-ref/source/clua.cc | 2 +- crawl-ref/source/dat/database/godspeak.txt | 12 +++++ crawl-ref/source/delay.cc | 2 +- crawl-ref/source/effects.cc | 85 +++++++++++++++-------------- crawl-ref/source/enum.h | 4 +- crawl-ref/source/externs.h | 1 + crawl-ref/source/fight.cc | 21 +++----- crawl-ref/source/files.cc | 6 +-- crawl-ref/source/food.cc | 12 ++--- crawl-ref/source/format.cc | 2 +- crawl-ref/source/ghost.cc | 2 +- crawl-ref/source/initfile.cc | 42 +++++++++------ crawl-ref/source/invent.cc | 5 +- crawl-ref/source/item_use.cc | 87 +++++++++++++++--------------- crawl-ref/source/item_use.h | 4 +- crawl-ref/source/itemprop.cc | 26 ++++----- crawl-ref/source/itemprop.h | 6 +-- crawl-ref/source/items.cc | 46 ++++++++-------- crawl-ref/source/misc.cc | 2 +- crawl-ref/source/ouch.cc | 3 ++ crawl-ref/source/religion.cc | 4 +- crawl-ref/source/religion.h | 2 +- crawl-ref/source/spells2.cc | 3 +- crawl-ref/source/xom.cc | 21 +++++++- 28 files changed, 234 insertions(+), 187 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/docs/changes.stone_soup b/crawl-ref/docs/changes.stone_soup index c3ddb9f125..d3b2c274dd 100644 --- a/crawl-ref/docs/changes.stone_soup +++ b/crawl-ref/docs/changes.stone_soup @@ -42,7 +42,7 @@ Characters * Transformations cause worn equipment to be melded rather than removed. * Overhaul nutrition values and duration for Vampires feeding on corpses. * Vampires can no longer heal via potions of blood or non-fresh corpses. -* Vampires recover lost attributes depending on blood level. +* Vampires recover lost stats depending on blood level. * Draining of the experience pool is now reduced by life protection. * Merfolk can swim in heavy armour, albeit with doubled armour penalty. * Player and monster nagas no longer flounder or lose stealth in shallow water. @@ -50,6 +50,7 @@ Characters * Pure spellcasters don't start with a weapon anymore. * Tweak starting choice restrictions. * Going into berserk rage doubles Health, ending it halves Health. +* Added the slow healing mutation, affecting hitpoints and stat regeneration. Monsters -------- @@ -91,6 +92,7 @@ Interface * Change exclusion commands to e, E, Ctrl-E (was Ctrl-X, x, Ctrl-E). * Switch off autopickup and autoswap if you see a monster turn invisible. * Killing an invisible monster reactivates autopickup. +* Added ally pickup mode for items dropped by player and allies. * Shops use shopping cart behaviour. * Wizard commands can be used from the wizard help screen. * Allow quivering/firing of wielded missiles and wielded weapons of returning. @@ -132,6 +134,7 @@ Items * Decks of punishment are no longer randomly generated. * Removing rings of levitation or invisibility no longer cancels the effect. * Identify the Horn of Geryon when wielding it. +* Skeletons rot away in inventory at the same rate as on the floor. Gods ---- diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt index 29fe06c45d..435bca6a57 100644 --- a/crawl-ref/docs/options_guide.txt +++ b/crawl-ref/docs/options_guide.txt @@ -983,6 +983,11 @@ easy_open = true easy_unequip = true Allows auto removal of armour and jewellery when dropping it. +equip_unequip = false + If this is true, 'W'ear will also allow you to 'T'ake off worn + armour, and vice versa, and the same is true for 'P'utting on/ + 'R'emoving jewellery. + easy_confirm = (none | safe) Make confirmation questions easier to answer: none = force capitals on Y/N questions diff --git a/crawl-ref/settings/init.txt b/crawl-ref/settings/init.txt index 9f7470a51c..e130ff0925 100644 --- a/crawl-ref/settings/init.txt +++ b/crawl-ref/settings/init.txt @@ -214,10 +214,11 @@ stash_filter = ring of hunger, amulet of inaccuracy ##### 4-i Command Enhancements ################## # -# auto_list = false -# easy_open = false -# easy_unequip = false -# easy_confirm = (none | safe) +# auto_list = false +# easy_open = false +# easy_unequip = false +# equip_unequip = true +# easy_confirm = (none | safe) # allow_self_target = (yes | no | prompt) # easy_butcher = false # always_confirm_butcher = true diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index d9c1d70bf0..6309cefbb2 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1580,7 +1580,7 @@ void process_command( command_type cmd ) break; case CMD_WEAR_JEWELLERY: - puton_ring(-1, false); + puton_ring(-1); break; case CMD_ADJUST_INVENTORY: diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index de1f5cb040..c9382a596c 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -1057,7 +1057,7 @@ static int l_item_puton(lua_State *ls) if (!item || !in_inventory(*item)) return (0); - lua_pushboolean(ls, puton_ring(item->link, false)); + lua_pushboolean(ls, puton_ring(item->link)); return (1); } diff --git a/crawl-ref/source/dat/database/godspeak.txt b/crawl-ref/source/dat/database/godspeak.txt index b046569748..8719d0700e 100644 --- a/crawl-ref/source/dat/database/godspeak.txt +++ b/crawl-ref/source/dat/database/godspeak.txt @@ -392,6 +392,18 @@ Xom pokes at a nearby @staircase@. Xom alters the dungeon around you. %%%% +Xom boring death + +Xom yawns loudly! + +"Boring in life, boring in death..." + +"What!? That's it?" + +Xom sighs, "I guess I need a new plaything now." + +"Hmm? Did I miss something?" +%%%% # Xom laughing # (Currently only used post-game in response to "You die...") Xom laughter diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index b5bc25dd1f..0b80374a45 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -1074,7 +1074,7 @@ static void _finish_delay(const delay_queue_item &delay) break; case DELAY_JEWELLERY_ON: - puton_ring(delay.parm1, false); + puton_ring(delay.parm1); break; case DELAY_ARMOUR_ON: diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index ef29b00b7b..5e75380c3a 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -874,7 +874,7 @@ typedef FixedVector has_vector; static armour_type _acquirement_armour_subtype() { // Increasing the representation of the non-body armour - // slots here to make up for the fact that there's one + // slots here to make up for the fact that there's only // one type of item for most of them. -- bwr // // NUM_ARMOURS is body armour and handled below @@ -1314,8 +1314,8 @@ static int _find_acquirement_subtype(object_class_type class_wanted, return (type_wanted); } -// The weight of a spell is defined as the average of all disciplines' -// skill levels minus the doubled spell level. +// The weight of a spell takes into account its disciplines' skill levels +// and the spell difficulty. static int _spell_weight(spell_type spell) { ASSERT(spell != SPELL_NO_SPELL); @@ -1330,12 +1330,13 @@ static int _spell_weight(spell_type spell) { int skill = you.skills[spell_type2skill(disc)]; - weight += skill + 1; + weight += skill; count++; } } ASSERT(count > 0); + // Particularly difficult spells _reduce_ the overall weight. int leveldiff = 5 - spell_difficulty(spell); return std::max(0, 2 * weight/count + leveldiff); @@ -1416,14 +1417,14 @@ static bool _do_book_acquirement(item_def &book, int agent) if (i == SK_SPELLCASTING && weight >= 1) weight--; - // Count magic skills double to bias against manuals - // for magic users. if (i >= SK_SPELLCASTING && i <= SK_POISON_MAGIC) magic_weights += weight; else other_weights += weight; } + // Count magic skills double to bias against manuals + // for magic users. if (x_chance_in_y(other_weights, 2*magic_weights + other_weights)) { choice = BOOK_MANUAL; @@ -1510,7 +1511,7 @@ static bool _do_book_acquirement(item_def &book, int agent) int w = (skill < 12) ? skill + 3 : std::max(0, 25 - skill); - // If we don't know any magic skills, make non-magic skills + // If we don't have any magic skills, make non-magic skills // more likely. if (!knows_magic && (i < SK_SPELLCASTING || i > SK_POISON_MAGIC)) w *= 2; @@ -2476,14 +2477,21 @@ static bool _grid_is_flanked_by_walls(const coord_def &p) // are flanked by walls on both sides, and if so, the grids following that // also have to be floor flanked by walls. // -// c.d +// czd // a.b -> if (a, b == walls) then (c, d == walls) or return (false) // #X# // . +// +// Grid z may be floor or wall, either way we have a corridor of at least +// length 2. static bool _deadend_check_wall(const coord_def &p) { + // The grids to the left and right of p are walls. (We already know that + // they are symmetric, so only need to check one side. We also know that + // the other direction, here up/down must then be non-walls.) if (grid_is_wall(grd[p.x-1][p.y])) { + // Run the check twice, once in either direction. for (int i = -1; i <= 1; i++) { if (i == 0) @@ -2503,7 +2511,7 @@ static bool _deadend_check_wall(const coord_def &p) } } } - else + else // The grids above and below p are walls. { for (int i = -1; i <= 1; i++) { @@ -2531,8 +2539,9 @@ static bool _deadend_check_wall(const coord_def &p) // Similar to the above, checks whether turning a wall grid into floor // would create a short "dead-end" of only 1 grid. // -// In the example below, X would create dead-ends at positions a and b, -// but both Y and Z avoid this, and the resulting mini-mazes looks better. +// In the example below, X would create miniature dead-ends at positions +// a and b, but both Y and Z avoid this, and the resulting mini-mazes +// look much better. // // ######## (A) ######## (B) ######## (C) ######## // #.....#. #....a#. #.....#. #.....#. @@ -2640,6 +2649,7 @@ void change_labyrinth(bool msg) if (testbits(env.map(*ri).property, FPROP_VAULT)) continue; + // Make sure we don't accidentally create "ugly" dead-ends. if (_grid_is_flanked_by_walls(*ri) && _deadend_check_floor(*ri)) targets.push_back(*ri); } @@ -2694,7 +2704,7 @@ void change_labyrinth(bool msg) { const coord_def c(targets[count]); // Maybe not valid anymore... - if (!_grid_is_flanked_by_walls(c)) + if (!grid_is_wall(grd(c)) || !_grid_is_flanked_by_walls(c)) continue; // Use the adjacent floor grids as source and destination. @@ -2736,9 +2746,15 @@ void change_labyrinth(bool msg) for (unsigned int i = 0; i < path.size(); i++) { const coord_def p(path[i]); + // The point must be inside the changed area. if (p.x < c1.x || p.x > c2.x || p.y < c1.y || p.y > c2.y) continue; + // Only replace plain floor. + if (grd(p) != DNGN_FLOOR) + continue; + + // Don't change any grids we remember. if (is_terrain_seen(p.x, p.y)) continue; @@ -2771,11 +2787,12 @@ void change_labyrinth(bool msg) (int) old_grid, c.x, c.y, (int) grd(p), p.x, p.y); } #ifdef WIZARD + // Highlight the switched grids. env.map(c).property |= FPROP_HIGHLIGHT; env.map(p).property |= FPROP_HIGHLIGHT; #endif - // Shift blood some most of the time. + // Shift blood some of the time. if (is_bloodcovered(c)) { if (one_chance_in(4)) @@ -2786,18 +2803,17 @@ void change_labyrinth(bool msg) if (grid_is_wall(grd(*ai)) && one_chance_in(++wall_count)) old_adj = *ai; - if (old_adj != c) + if (old_adj != c && !is_bloodcovered(old_adj)) { - if (!is_bloodcovered(old_adj)) - env.map(old_adj).property |= FPROP_BLOODY; + env.map(old_adj).property |= FPROP_BLOODY; env.map(c).property &= (~FPROP_BLOODY); } } } else if (one_chance_in(500)) { - // Sometimes (rarely) add blood randomly, accumulating with time... - env.map(p).property |= FPROP_BLOODY; + // Rarely add blood randomly, accumulating with time... + env.map(c).property |= FPROP_BLOODY; } // Rather than use old_grid directly, replace with an adjacent @@ -2839,10 +2855,9 @@ void change_labyrinth(bool msg) if (_is_floor(grd(*ai)) && one_chance_in(++floor_count)) new_adj = *ai; - if (new_adj != p) + if (new_adj != p && !is_bloodcovered(new_adj)) { - if (!is_bloodcovered(new_adj)) - env.map(new_adj).property |= FPROP_BLOODY; + env.map(new_adj).property |= FPROP_BLOODY; env.map(p).property &= (~FPROP_BLOODY); } } @@ -2861,7 +2876,7 @@ void change_labyrinth(bool msg) dirs.push_back(coord_def( 0,-1)); dirs.push_back(coord_def( 1,-1)); dirs.push_back(coord_def(-1, 0)); -// dirs.push_back(coord_def( 0, 0)); + dirs.push_back(coord_def( 1, 0)); dirs.push_back(coord_def(-1, 1)); dirs.push_back(coord_def( 0, 1)); @@ -2979,13 +2994,13 @@ static void _rot_inventory_food(long time_delta) if (you.inv[i].base_type == OBJ_POTIONS) { - // also handles messaging + // Also handles messaging. if (maybe_coagulate_blood_potions_inv(you.inv[i])) burden_changed_by_rot = true; continue; } - // food item timed out -> make it disappear + // Food item timed out -> make it disappear. if ((time_delta / 20) >= you.inv[i].special) { if (you.inv[i].base_type == OBJ_FOOD) @@ -2998,17 +3013,9 @@ static void _rot_inventory_food(long time_delta) continue; } - if (you.inv[i].sub_type == CORPSE_SKELETON) - { - if (you.equip[EQ_WEAPON] == i) - unwield_item(); - - destroy_item(you.inv[i]); - burden_changed_by_rot = true; - continue; - } - - if (!mons_skeleton(you.inv[i].plus)) + // The item is of type carrion. + if (you.inv[i].sub_type == CORPSE_SKELETON + || !mons_skeleton(you.inv[i].plus)) { if (you.equip[EQ_WEAPON] == i) unwield_item(); @@ -3024,7 +3031,7 @@ static void _rot_inventory_food(long time_delta) continue; } - // if it hasn't disappeared, reduce the rotting timer + // If it hasn't disappeared, reduce the rotting timer. you.inv[i].special -= (time_delta / 20); if (food_is_rotten(you.inv[i]) @@ -3137,10 +3144,10 @@ void handle_time(long time_delta) // Slow heal mutation. Applied last. // Each level reduces your stat recovery by one third. - if (player_mutation_level(MUT_SLOW_HEALING) > 0) + if (player_mutation_level(MUT_SLOW_HEALING) > 0 + && x_chance_in_y(player_mutation_level(MUT_SLOW_HEALING), 3)) { - if (x_chance_in_y(player_mutation_level(MUT_SLOW_HEALING), 3)) - recovery = false; + recovery = false; } if (recovery) diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 93449257b1..2695017c5c 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -856,7 +856,7 @@ enum feature_property_type FPROP_SANCTUARY_2 = (1 << 2), FPROP_BLOODY = (1 << 3), FPROP_VAULT = (1 << 4), - FPROP_HIGHLIGHT = (1 << 5) + FPROP_HIGHLIGHT = (1 << 5) // Highlight grids on the X map for debugging. // NOTE: Bloody floor and sanctuary are exclusive. }; @@ -3054,7 +3054,7 @@ enum montravel_target_type MTRAV_PLAYER, // Travelling to reach the player. MTRAV_PATROL, // Travelling to reach the patrol point. MTRAV_SIREN, // Sirens travelling towards deep water. - MTRAV_WALL, // Earthworms travelling towards a wall. + MTRAV_WALL, // Rock worms travelling towards a wall. MTRAV_UNREACHABLE, // Not travelling because target is unreachable. MTRAV_KNOWN_UNREACHABLE // As above, and the player knows this. }; diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index ed71617376..b2b4b83152 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -1966,6 +1966,7 @@ public: bool show_uncursed; // label known uncursed items as "uncursed" bool easy_open; // open doors with movement bool easy_unequip; // allow auto-removing of armour / jewellery + bool equip_unequip; // Make 'W' = 'T', and 'P' = 'R'. bool easy_butcher; // autoswap to butchering tool bool always_confirm_butcher; // even if only one corpse bool chunks_autopickup; // Autopickup chunks after butchering diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index a6c7a07e14..d25c02c28a 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -1941,7 +1941,7 @@ bool melee_attack::player_monattk_hit_effects(bool mondied) // the hydra some more. // // Also returns true if the hydra's last head was cut off, in which - // case nothing more should be done to the last hydra. + // case nothing more should be done to the hydra. if (decapitate_hydra(damage_done)) return (!defender->alive()); @@ -2274,7 +2274,7 @@ enum chaos_type }; // XXX: We might want to vary the probabilities for the various effects -// based on whether the source is weapon of chaos or a monster with +// based on whether the source is a weapon of chaos or a monster with // AF_CHAOS. void melee_attack::chaos_affects_defender() { @@ -2298,7 +2298,7 @@ void melee_attack::chaos_affects_defender() if (is_shifter) shifter_chance = 0; - // A chaos self-attack increased the chance of certain effects, + // A chaos self-attack increases the chance of certain effects, // due to a short-circuit/feedback/resonance/whatever. if (attacker == defender) { @@ -2695,10 +2695,8 @@ static void _find_remains(monsters* mon, int &corpse_class, int &corpse_index, { // Last item which we're sure belonged to the monster. for (unsigned int i = 0; i < items.size(); i++) - { if (items[i] == si.link()) last_item = si.link(); - } } } } @@ -2922,8 +2920,7 @@ int melee_attack::random_chaos_brand() susceptible = false; break; case SPWPN_VAMPIRICISM: - if (defender->atype() != ACT_PLAYER - && defender_as_monster()->is_summoned()) + if (defender->is_summoned()) { susceptible = false; break; @@ -2969,8 +2966,8 @@ int melee_attack::random_chaos_brand() case SPWPN_VAMPIRICISM: brand_name += "vampiricism"; break; case SPWPN_VORPAL: brand_name += "vorpal"; break; // ranged weapon brands - case SPWPN_FLAME: brand_name += "(flame)"; break; - case SPWPN_FROST: brand_name += "(frost)"; break; + case SPWPN_FLAME: brand_name += "flame"; break; + case SPWPN_FROST: brand_name += "frost"; break; // both ranged and non-ranged case SPWPN_CHAOS: brand_name += "chaos"; break; @@ -4753,10 +4750,6 @@ void melee_attack::mons_apply_attack_flavour(const mon_attack_def &attk) if (defender->atype() != ACT_PLAYER) break; - // Only use this attack sometimes. - if (!one_chance_in(3)) - break; - if (expose_player_to_element(BEAM_STEAL_FOOD, 10) && needs_message) { mprf("%s steals some of your food!", @@ -5283,7 +5276,7 @@ static inline int player_weapon_str_weight() { const item_def* weapon = you.weapon(); - // unarmed, weighted slightly towards dex -- would have been more, + // Unarmed, weighted slightly towards dex -- would have been more, // but then we'd be punishing Trolls and Ghouls who are strong and // get special unarmed bonuses. if (!weapon) diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index 18c9571f3b..55fb5f341c 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -1039,7 +1039,7 @@ static void _do_lost_items(level_area_type old_level_type) continue; // Item is in player intentory, so it's not lost. - if (item.pos.x == -1 && item.pos.y == -1) + if (item.pos == coord_def(-1,-1)) continue; item_was_lost(item); @@ -1633,14 +1633,14 @@ void _load_ghost(void) fclose(gfile); #if DEBUG_DIAGNOSTICS - mpr( "Loaded ghost.", MSGCH_DIAGNOSTICS ); + mpr("Loaded ghost.", MSGCH_DIAGNOSTICS); #endif // Remove bones file - ghosts are hardly permanent. unlink(cha_fil.c_str()); // Translate ghost to monster and place. - for (int imn = 0; imn < MAX_MONSTERS - 10 && !ghosts.empty(); imn++) + for (int imn = 0; imn < MAX_MONSTERS - 10 && !ghosts.empty(); ++imn) { if (menv[imn].type != -1) continue; diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 052cc36863..569208b831 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -689,9 +689,6 @@ bool butchery(int which_corpse) success = true; first_corpse = false; } - -// if (!butcher_all && !bottle_all) -// break; } } @@ -842,9 +839,7 @@ bool eat_food(int slot) return (prompt_eat_inventory_item(slot)); } -/* - * END PUBLIC FUNCTIONS - */ +// END PUBLIC FUNCTIONS static bool _player_has_enough_food() { @@ -1587,11 +1582,12 @@ int prompt_eat_chunks() const bool contam = is_contaminated(*item); const bool bad = _is_bad_food(*item); - // Excempt undead from auto-eating since: + // Exempt undead from auto-eating since: // * Mummies don't eat. // * Vampire feeding takes a lot more time than eating a chunk // and may have unintended consequences. - // * Ghouls may want to wait until chunks become rotten. + // * Ghouls may want to wait until chunks become rotten + // or until they have some hp rot to heal. if (easy_eat && !bad && !contam) { // If this chunk is safe to eat, just do so without prompting. diff --git a/crawl-ref/source/format.cc b/crawl-ref/source/format.cc index 4dd398cb0c..012c64a181 100644 --- a/crawl-ref/source/format.cc +++ b/crawl-ref/source/format.cc @@ -89,7 +89,7 @@ formatted_string formatted_string::parse_string( bool (*process)(const std::string &tag), int main_colour) { - // Safe assumption, that incoming color is LIGHTGREY + // main_colour will usually be LIGHTGREY (default). std::vector colour_stack; colour_stack.push_back(main_colour); diff --git a/crawl-ref/source/ghost.cc b/crawl-ref/source/ghost.cc index 7e04e83ca9..38a3546d49 100644 --- a/crawl-ref/source/ghost.cc +++ b/crawl-ref/source/ghost.cc @@ -258,7 +258,7 @@ void ghost_demon::init_random_demon() if (one_chance_in(25)) spells[0] = SPELL_METAL_SPLINTERS; if (one_chance_in(25)) - spells[0] = SPELL_ENERGY_BOLT; // eye of daevas + spells[0] = SPELL_ENERGY_BOLT; // eye of devastation if (one_chance_in(25)) spells[1] = SPELL_STEAM_BALL; diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 8f09c0597e..1f48e6a6d2 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -726,6 +726,7 @@ void game_options::reset_options() show_uncursed = true; easy_open = true; easy_unequip = true; + equip_unequip = false; easy_butcher = true; always_confirm_butcher = false; chunks_autopickup = true; @@ -916,25 +917,25 @@ void game_options::reset_options() tile_window_col = MAP_YELLOW; // font selection - tile_font_crt_file = "VeraMono.ttf"; - tile_font_crt_size = 0; - tile_font_stat_file = "VeraMono.ttf"; - tile_font_stat_size = 0; - tile_font_msg_file = "VeraMono.ttf"; - tile_font_msg_size = 0; - tile_font_tip_file = "VeraMono.ttf"; - tile_font_tip_size = 0; - tile_font_lbl_file = "Vera.ttf"; - tile_font_lbl_size = 0; + tile_font_crt_file = "VeraMono.ttf"; + tile_font_crt_size = 0; + tile_font_stat_file = "VeraMono.ttf"; + tile_font_stat_size = 0; + tile_font_msg_file = "VeraMono.ttf"; + tile_font_msg_size = 0; + tile_font_tip_file = "VeraMono.ttf"; + tile_font_tip_size = 0; + tile_font_lbl_file = "Vera.ttf"; + tile_font_lbl_size = 0; // window layout - tile_key_repeat = true; - tile_full_screen = SCREENMODE_AUTO; - tile_window_width = 0; - tile_window_height = 0; - tile_map_pixels = 0; - tile_tooltip_ms = 500; - tile_tag_pref = crawl_state.arena ? TAGPREF_NAMED : TAGPREF_ENEMY; + tile_key_repeat = true; + tile_full_screen = SCREENMODE_AUTO; + tile_window_width = 0; + tile_window_height = 0; + tile_map_pixels = 0; + tile_tooltip_ms = 500; + tile_tag_pref = crawl_state.arena ? TAGPREF_NAMED : TAGPREF_ENEMY; #endif // map each colour to itself as default @@ -1510,8 +1511,10 @@ void game_options::read_options(InitLineInput &il, bool runscript, { #ifdef CLUA_BINDINGS if (luacode.run(clua)) + { mprf(MSGCH_ERROR, "Lua error: %s", luacode.orig_error().c_str()); + } luacode.clear(); #endif } @@ -2143,6 +2146,7 @@ void game_options::read_option_line(const std::string &str, bool runscript) else BOOL_OPTION_NAMED("easy_quit_item_lists", easy_quit_item_prompts); else BOOL_OPTION(easy_open); else BOOL_OPTION(easy_unequip); + else BOOL_OPTION(equip_unequip); else BOOL_OPTION_NAMED("easy_armour", easy_unequip); else BOOL_OPTION_NAMED("easy_armor", easy_unequip); else BOOL_OPTION(easy_butcher); @@ -3159,11 +3163,15 @@ void game_options::read_option_line(const std::string &str, bool runscript) else if (key == "constant") { if (variables.find(field) == variables.end()) + { report_error(make_stringf("No variable named '%s' to make " "constant", field.c_str())); + } else if (constants.find(field) != constants.end()) + { report_error(make_stringf("'%s' is already a constant", field.c_str())); + } else constants.insert(field); } diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 6abb296c73..9208943f4b 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -1036,10 +1036,9 @@ static bool _item_class_selected(const item_def &i, int selector) return (true); for (int eq = 0; eq < NUM_EQUIP; eq++) - { if (you.equip[eq] == i.link) return (true); - } + return (false); } default: @@ -1281,7 +1280,7 @@ std::vector prompt_invent_items( ret = letter_to_index( keyin ); if (!is_valid_item( you.inv[ret] )) - mpr( "You do not have any such object." ); + mpr("You do not have any such object."); else break; } diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 19d7fda3af..5a643a6276 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -726,7 +726,7 @@ void wield_effects(int item_wield_2, bool showMsgs) if (!was_known) { - // Xom loves when you ID a distortion weapon this way, + // Xom loves it when you ID a distortion weapon this way, // and even more so if he gifted the weapon himself. god_type god; if (origin_is_god_gift(item, &god) && god == GOD_XOM) @@ -1055,7 +1055,15 @@ bool do_wear_armour(int item, bool quiet) } if (wearing_slot(item)) - return (!takeoff_armour(item)); + { + if (Options.equip_unequip) + return (!takeoff_armour(item)); + else + { + mpr("You're already wearing that object!"); + return (false); + } + } // if you're wielding something, if (you.weapon() @@ -1105,11 +1113,11 @@ bool do_wear_armour(int item, bool quiet) } if ((slot == EQ_CLOAK - || slot == EQ_HELMET - || slot == EQ_GLOVES - || slot == EQ_BOOTS - || slot == EQ_SHIELD - || slot == EQ_BODY_ARMOUR) + || slot == EQ_HELMET + || slot == EQ_GLOVES + || slot == EQ_BOOTS + || slot == EQ_SHIELD + || slot == EQ_BODY_ARMOUR) && you.equip[slot] != -1) { if (!takeoff_armour(you.equip[slot])) @@ -2006,14 +2014,14 @@ void setup_missile_beam(const actor *agent, bolt &beam, item_def &item, poisoned = true; } - const bool exploding = ammo_brand == SPMSL_EXPLODING; - const bool penetrating = !exploding - && (bow_brand == SPWPN_PENETRATION - || ammo_brand == SPMSL_PENETRATION); - const bool silver = ammo_brand == SPMSL_SILVER; - const bool disperses = ammo_brand == SPMSL_DISPERSAL; - const bool shadow = bow_brand == SPWPN_SHADOW - || ammo_brand == SPMSL_SHADOW; + const bool exploding = ammo_brand == SPMSL_EXPLODING; + const bool penetrating = (!exploding + && (bow_brand == SPWPN_PENETRATION + || ammo_brand == SPMSL_PENETRATION)); + const bool silver = (ammo_brand == SPMSL_SILVER); + const bool disperses = (ammo_brand == SPMSL_DISPERSAL); + const bool shadow = (bow_brand == SPWPN_SHADOW + || ammo_brand == SPMSL_SHADOW); ASSERT(!exploding || !is_artefact(item)); @@ -2988,7 +2996,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, bow_brand == SPWPN_CHAOS || ammo_brand_known); } - if (ammo_brand == SPMSL_SHADOW || bow_brand == SPWPN_SHADOW) + if (ammo_brand == SPMSL_SHADOW || bow_brand == SPWPN_SHADOW) { did_god_conduct(DID_NECROMANCY, 2, bow_brand == SPWPN_SHADOW || ammo_brand_known); @@ -3477,7 +3485,7 @@ static bool _swap_rings(int ring_slot) return (true); } -bool puton_item(int item_slot, bool prompt_finger) +bool puton_item(int item_slot) { item_def& item = you.inv[item_slot]; @@ -3486,7 +3494,13 @@ bool puton_item(int item_slot, bool prompt_finger) || item_slot == you.equip[EQ_AMULET]) { // "Putting on" an equipped item means taking it off. - return (!remove_ring(item_slot)); + if (Options.equip_unequip) + return (!remove_ring(item_slot)); + else + { + mpr("You're already wearing that object!"); + return (false); + } } if (item_slot == you.equip[EQ_WEAPON]) @@ -3549,27 +3563,12 @@ bool puton_item(int item_slot, bool prompt_finger) } else { - // First ring goes on left hand if we're choosing automatically. + // First ring always goes on left hand. hand_used = EQ_LEFT_RING; + // ... unless we're already wearing a ring on the left hand. if (lring && !rring) hand_used = EQ_RIGHT_RING; - else if (rring && !lring) - hand_used = EQ_LEFT_RING; - else if (prompt_finger) // both free; both busy has been handled - { - mpr("Put on which hand (l or r)?", MSGCH_PROMPT); - int keyin = get_ch(); - switch (keyin) - { - case 'l': hand_used = EQ_LEFT_RING; break; - case 'r': hand_used = EQ_RIGHT_RING; break; - case ESCAPE: return (false); - default: - mpr("You don't have such a hand!"); - return (false); - } - } } // Actually equip the item. @@ -3585,7 +3584,7 @@ bool puton_item(int item_slot, bool prompt_finger) return (true); } -bool puton_ring(int slot, bool prompt_finger) +bool puton_ring(int slot) { if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT) { @@ -3619,7 +3618,7 @@ bool puton_ring(int slot, bool prompt_finger) if (prompt_failed(item_slot)) return (false); - return puton_item(item_slot, prompt_finger); + return puton_item(item_slot); } void jewellery_remove_effects(item_def &item, bool mesg) @@ -3914,12 +3913,16 @@ void zap_wand(int slot) targ_mode = TARG_ANY; break; - case WAND_HASTING: case WAND_HEALING: + if (you.religion == GOD_ELYVILON) + { + targ_mode = TARG_ANY; + break; + } + // else intentional fall-through + case WAND_HASTING: case WAND_INVISIBILITY: - targ_mode = (wand.sub_type == WAND_HEALING - && you.religion == GOD_ELYVILON) ? - TARG_ANY : TARG_FRIEND; + targ_mode = TARG_FRIEND; break; default: @@ -5506,7 +5509,7 @@ void tile_item_use(int idx) remove_ring(idx); } else if (check_warning_inscriptions(item, OPER_PUTON)) - puton_ring(idx, false); + puton_ring(idx); return; case OBJ_POTIONS: diff --git a/crawl-ref/source/item_use.h b/crawl-ref/source/item_use.h index 1dd4051855..ac7a1c8d80 100644 --- a/crawl-ref/source/item_use.h +++ b/crawl-ref/source/item_use.h @@ -79,7 +79,7 @@ void examine_object(void); /* *********************************************************************** * called from: acr * *********************************************************************** */ -bool puton_ring(int slot = -1, bool prompt_finger = true); +bool puton_ring(int slot = -1); void jewellery_remove_effects(item_def &item, bool mesg = true); // called from: transfor @@ -159,7 +159,7 @@ void wield_effects(int item_wield_2, bool showMsgs); void use_randart( unsigned char item_wield_2 ); void use_randart(item_def &item, bool unmeld = false); -bool puton_item(int slot, bool prompt_finger = true); +bool puton_item(int slot); bool enchant_weapon(enchant_stat_type which_stat, bool quiet, item_def &wpn); bool enchant_armour(int &ac_change, bool quiet, item_def &arm); diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 6827ebca16..163719798b 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -1196,7 +1196,7 @@ bool check_armour_shape( const item_def &item, bool quiet ) if (item.sub_type != ARM_NAGA_BARDING) { if (!quiet) - mpr( "You can't wear that!" ); + mpr("You can't wear that!"); return (false); } @@ -1206,7 +1206,7 @@ bool check_armour_shape( const item_def &item, bool quiet ) if (item.sub_type != ARM_CENTAUR_BARDING) { if (!quiet) - mpr( "You can't wear that!" ); + mpr("You can't wear that!"); return (false); } @@ -1216,7 +1216,7 @@ bool check_armour_shape( const item_def &item, bool quiet ) if (player_in_water() && item.sub_type == ARM_BOOTS) { if (!quiet) - mpr( "You don't currently have feet!" ); + mpr("You don't currently have feet!"); return (false); } @@ -1226,7 +1226,7 @@ bool check_armour_shape( const item_def &item, bool quiet ) || item.sub_type == ARM_CENTAUR_BARDING) { if (!quiet) - mpr( "You can't wear barding!" ); + mpr("You can't wear barding!"); return (false); } @@ -1241,7 +1241,7 @@ bool check_armour_shape( const item_def &item, bool quiet ) if (player_mutation_level(MUT_HORNS)) { if (!quiet) - mpr( "You can't wear that with your horns!" ); + mpr("You can't wear that with your horns!"); return (false); } @@ -1249,7 +1249,7 @@ bool check_armour_shape( const item_def &item, bool quiet ) if (player_mutation_level(MUT_BEAK)) { if (!quiet) - mpr( "You can't wear that with your beak!" ); + mpr("You can't wear that with your beak!"); return (false); } @@ -1259,7 +1259,7 @@ bool check_armour_shape( const item_def &item, bool quiet ) if (you.has_claws(false) >= 3) { if (!quiet) - mpr( "You can't wear gloves with your huge claws!" ); + mpr("You can't wear gloves with your huge claws!"); return (false); } @@ -1272,7 +1272,7 @@ bool check_armour_shape( const item_def &item, bool quiet ) && !check_armour_size( item, SIZE_BIG )) { if (!quiet) - mpr( "That armour doesn't fit your wings." ); + mpr("That armour doesn't fit your wings."); return (false); } @@ -1289,7 +1289,7 @@ bool check_armour_shape( const item_def &item, bool quiet ) || item.sub_type == ARM_CENTAUR_BARDING) { if (!quiet) - mpr( "You can't wear barding in your current form!" ); + mpr("You can't wear barding in your current form!"); return (false); } @@ -1724,9 +1724,9 @@ bool is_blessed_blade(const item_def &item) bool is_blessed_blade_convertible(const item_def &item) { return (!is_artefact(item) - && (item.base_type == OBJ_WEAPONS - && (is_demonic(item) - || weapon_skill(item) == SK_LONG_BLADES))); + && (item.base_type == OBJ_WEAPONS + && (is_demonic(item) + || weapon_skill(item) == SK_LONG_BLADES))); } bool convert2good(item_def &item, bool allow_blessed) @@ -2069,7 +2069,7 @@ bool check_weapon_shape( const item_def &item, bool quiet, bool check_id ) && player_is_unholy()) { if (!quiet) - mpr( "This weapon will not allow you to wield it." ); + mpr("This weapon will not allow you to wield it."); return (false); } diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h index e8c183ab00..7018209135 100644 --- a/crawl-ref/source/itemprop.h +++ b/crawl-ref/source/itemprop.h @@ -598,9 +598,9 @@ enum wand_type enum zap_count_type { - ZAPCOUNT_EMPTY = -1, - ZAPCOUNT_UNKNOWN = -2, - ZAPCOUNT_RECHARGED = -3, + ZAPCOUNT_EMPTY = -1, + ZAPCOUNT_UNKNOWN = -2, + ZAPCOUNT_RECHARGED = -3, ZAPCOUNT_MAX_CHARGED = -4 }; diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index fc6ba2facb..997453a9a5 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -154,7 +154,7 @@ static int _cull_items(void) // XXX: Not the prettiest of messages, but the player // deserves to know whenever this kicks in. -- bwr - mpr( "Too many items on level, removing some.", MSGCH_WARN ); + mpr("Too many items on level, removing some.", MSGCH_WARN); // Rules: // 1. Don't cleanup anything nearby the player @@ -170,12 +170,12 @@ static int _cull_items(void) // 2. Avoid shops by avoiding (0,5..9). // 3. Avoid monster inventory by iterating over the dungeon grid. - for ( rectangle_iterator ri(1); ri; ++ri ) + for (rectangle_iterator ri(1); ri; ++ri) { - if ( grid_distance( you.pos(), *ri ) <= 9 ) + if (grid_distance( you.pos(), *ri ) <= 9) continue; - for ( stack_iterator si(*ri); si; ++si ) + for (stack_iterator si(*ri); si; ++si) { if (_item_ok_to_clean(si->index()) && x_chance_in_y(15, 100)) { @@ -260,7 +260,7 @@ bool dec_inv_item_quantity( int obj, int amount, bool suppress_burden ) you.inv[obj].quantity -= amount; } - if ( !suppress_burden ) + if (!suppress_burden) burden_change(); return (ret); @@ -576,7 +576,7 @@ void item_was_destroyed(const item_def &item, int cause) void lose_item_stack( const coord_def& where ) { - for ( stack_iterator si(where); si; ++si ) + for (stack_iterator si(where); si; ++si) { if (is_valid_item( *si )) // FIXME is this check necessary? { @@ -589,7 +589,7 @@ void lose_item_stack( const coord_def& where ) void destroy_item_stack( int x, int y, int cause ) { - for ( stack_iterator si(coord_def(x,y)); si; ++si ) + for (stack_iterator si(coord_def(x,y)); si; ++si) { if (is_valid_item( *si )) // FIXME is this check necessary? { @@ -609,7 +609,7 @@ static int _count_nonsquelched_items( int obj ) { int result = 0; - for ( stack_iterator si(obj); si; ++si ) + for (stack_iterator si(obj); si; ++si) if (!_invisible_to_player(*si)) ++result; @@ -628,10 +628,10 @@ void item_list_on_square( std::vector& items, || _count_nonsquelched_items(obj)); // Loop through the items. - for ( stack_iterator si(obj); si; ++si ) + for (stack_iterator si(obj); si; ++si) { // Add them to the items list if they qualify. - if ( !have_nonsquelched || !_invisible_to_player(*si) ) + if (!have_nonsquelched || !_invisible_to_player(*si)) items.push_back( & (*si) ); } } @@ -704,7 +704,7 @@ int item_name_specialness(const item_def& item) // You can tell something is an artefact, because it'll have a // description which rules out anything else. // XXX: Fixedarts and unrandarts might upset the apple-cart, though. - if ( is_artefact(item) ) + if (is_artefact(item)) return 2; return 0; @@ -1520,7 +1520,7 @@ int move_item_to_player( int obj, int quant_got, bool quiet, { mpr("You cannot pick up the net that holds you!"); // Fake a successful pickup (return 1), so we can continue to pick up - // anything that might be on this square. + // anything else that might be on this square. return (1); } @@ -2003,7 +2003,7 @@ bool drop_item( int item_dropped, int quant_drop, bool try_offer ) if (grid_destroys_items(my_grid)) { - if ( !silenced(you.pos()) ) + if (!silenced(you.pos())) mprf(MSGCH_SOUND, grid_item_destruction_message(my_grid)); item_was_destroyed(you.inv[item_dropped], NON_MONSTER); @@ -2198,14 +2198,14 @@ void drop() // EVIL HACK: Fix item quantity to match the quantity we will drop, // in order to prevent misleading messages when dropping // 15 of 25 arrows inscribed with {!d}. - if ( si.quantity && si.quantity != item_quant ) + if (si.quantity && si.quantity != item_quant) const_cast(si.item)->quantity = si.quantity; // Check if we can add it to the multidrop list. bool warning_ok = check_warning_inscriptions(*(si.item), OPER_DROP); // Restore the item quantity if we mangled it. - if ( item_quant != si.item->quantity ) + if (item_quant != si.item->quantity) const_cast(si.item)->quantity = item_quant; if (warning_ok) @@ -2234,16 +2234,16 @@ static void _autoinscribe_item( item_def& item ) { // If there's an inscription already, do nothing - except // for automatically generated inscriptions - if ( !item.inscription.empty() && item.inscription != "god gift") + if (!item.inscription.empty() && item.inscription != "god gift") return; const std::string old_inscription = item.inscription; item.inscription.clear(); std::string iname = _autopickup_item_name(item); - for ( unsigned i = 0; i < Options.autoinscriptions.size(); ++i ) + for (unsigned i = 0; i < Options.autoinscriptions.size(); ++i) { - if ( Options.autoinscriptions[i].first.matches(iname) ) + if (Options.autoinscriptions[i].first.matches(iname)) { // Don't autoinscribe dropped items on ground with // "=g". If the item matches a rule which adds "=g", @@ -2259,9 +2259,9 @@ static void _autoinscribe_item( item_def& item ) item.inscription += str; } } - if ( !old_inscription.empty() ) + if (!old_inscription.empty()) { - if ( item.inscription.empty() ) + if (item.inscription.empty()) item.inscription = old_inscription; else item.inscription = old_inscription + ", " + item.inscription; @@ -2270,7 +2270,7 @@ static void _autoinscribe_item( item_def& item ) static void _autoinscribe_floor_items() { - for ( stack_iterator si(you.pos()); si; ++si ) + for (stack_iterator si(you.pos()); si; ++si) _autoinscribe_item( *si ); } @@ -2462,8 +2462,8 @@ item_def *find_floor_item(object_class_type cls, int sub_type) { for (int y = 0; y < GYM; ++y) for (int x = 0; x < GXM; ++x) - for ( stack_iterator si(coord_def(x,y)); si; ++si ) - if (is_valid_item( *si) + for (stack_iterator si(coord_def(x,y)); si; ++si) + if (is_valid_item(*si) && si->base_type == cls && si->sub_type == sub_type) { return (& (*si)); diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index bc8a256604..d7b588d4a9 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -145,7 +145,7 @@ void turn_corpse_into_skeleton(item_def &item) item.plus = MONS_RAT; item.sub_type = CORPSE_SKELETON; - item.special = 200; + item.special = 200; // reset rotting counter item.colour = LIGHTGREY; } diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 86dda18464..0a071ee46c 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -443,12 +443,14 @@ static bool _expose_invent_to_element(beam_type flavour, int strength) || target_class == OBJ_FOOD && you.inv[i].base_type == OBJ_CORPSES) { + // Conservation doesn't help against harpies stealing food. if (flavour != BEAM_STEAL_FOOD && player_item_conserve() && !one_chance_in(10)) { continue; } + // Loop through all items in the stack. for (int j = 0; j < you.inv[i].quantity; ++j) { if (x_chance_in_y(strength, 100)) @@ -470,6 +472,7 @@ static bool _expose_invent_to_element(beam_type flavour, int strength) if (!num_dest) return (false); + // Message handled elsewhere. if (flavour == BEAM_STEAL_FOOD) return (true); diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index ba7fd58626..03b797ac8b 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -7105,7 +7105,7 @@ bool tso_unchivalric_attack_safe_monster(const monsters *mon) || holiness != MH_NATURAL && holiness != MH_HOLY); } -int get_tension(god_type god) +int get_tension(god_type god, bool count_travelling) { ASSERT(god != GOD_NO_GOD); @@ -7125,7 +7125,7 @@ int get_tension(god_type god) if (!nearby_monster && !mons_wont_attack(mons)) nearby_monster = true; } - else + else if (count_travelling) { // Is the monster trying to get somewhere nearby? coord_def target; diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index 5793562246..116fcb8c4a 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -164,5 +164,5 @@ bool god_likes_items(god_type god); void religion_turn_start(); void religion_turn_end(); -int get_tension(god_type god = you.religion); +int get_tension(god_type god = you.religion, bool count_travelling = true); #endif diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 9175fa1d11..bff4189ff6 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -385,10 +385,9 @@ bool restore_stat(unsigned char which_stat, unsigned char stat_gain, if (which_stat == STAT_ALL) { for (unsigned char loopy = STAT_STRENGTH; loopy < NUM_STATS; ++loopy) - { if (restore_stat(loopy, stat_gain, suppress_msg)) stat_restored = true; - } + return (stat_restored); // early return {dlb} } diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 47f5ef2293..067c069513 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -3134,7 +3134,7 @@ static bool _death_is_funny(const kill_method_type killed_by) { switch (killed_by) { - // The less original deaths are boring. + // The less original deaths are considered boring. case KILLED_BY_MONSTER: case KILLED_BY_BEAM: case KILLED_BY_CLOUD: @@ -3142,6 +3142,7 @@ static bool _death_is_funny(const kill_method_type killed_by) case KILLED_BY_BURNING: case KILLED_BY_SELF_AIMED: case KILLED_BY_SOMETHING: + case KILLED_BY_TRAP: return (false); default: // All others are fun (says Xom). @@ -3154,6 +3155,22 @@ void xom_death_message(const kill_method_type killed_by) if (you.religion != GOD_XOM && (!you.worshipped[GOD_XOM] || coinflip())) return; - if (_death_is_funny(killed_by) || you.hp < -1 * random2(10)) + const int death_tension = get_tension(GOD_XOM, false); + + // "Normal" deaths with only down to -2 hp and comparatively low tension + // are considered particularly boring. + if (!_death_is_funny(killed_by) && you.hp >= -1 * random2(3) + && death_tension <= random2(10)) + { + god_speaks(GOD_XOM, _get_xom_speech("boring death").c_str()); + } + // Unusual methods of dying, really low hp, or high tension make + // for funny deaths. + else if (_death_is_funny(killed_by) || you.hp <= -10 + || death_tension >= 20) + { god_speaks(GOD_XOM, _get_xom_speech("laughter").c_str()); + } + + // All others just get ignored by Xom. } -- cgit v1.2.3-54-g00ecf