summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-13 08:04:42 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-13 08:04:42 +0000
commitcab797009b47f77520b8db9f8b427ba9ea14f63c (patch)
tree3257807bf2686cfb1a5f2f9d9f66040eb2df6ef4 /crawl-ref
parent659553d325a49df4870dcfa18af7f9bece5cbf16 (diff)
downloadcrawl-ref-cab797009b47f77520b8db9f8b427ba9ea14f63c.tar.gz
crawl-ref-cab797009b47f77520b8db9f8b427ba9ea14f63c.zip
* Allow panlords to have the chaos-branded weapons.
* update stash tracker after Xom's teleportation journey. * A few tweaks to Xom debug noting. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9599 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/docs/changes.stone_soup4
-rw-r--r--crawl-ref/source/acr.cc17
-rw-r--r--crawl-ref/source/debug.cc14
-rw-r--r--crawl-ref/source/decks.cc5
-rw-r--r--crawl-ref/source/delay.cc4
-rw-r--r--crawl-ref/source/directn.cc7
-rw-r--r--crawl-ref/source/fight.cc29
-rw-r--r--crawl-ref/source/ghost.cc2
-rw-r--r--crawl-ref/source/item_use.cc4
-rw-r--r--crawl-ref/source/itemprop.h14
-rw-r--r--crawl-ref/source/misc.cc8
-rw-r--r--crawl-ref/source/mstuff2.cc28
-rw-r--r--crawl-ref/source/stash.cc10
-rw-r--r--crawl-ref/source/stash.h1
-rw-r--r--crawl-ref/source/view.cc2
-rw-r--r--crawl-ref/source/xom.cc42
16 files changed, 110 insertions, 81 deletions
diff --git a/crawl-ref/docs/changes.stone_soup b/crawl-ref/docs/changes.stone_soup
index 5f04161fff..746ecc73e9 100644
--- a/crawl-ref/docs/changes.stone_soup
+++ b/crawl-ref/docs/changes.stone_soup
@@ -88,6 +88,7 @@ Interface
* Limit travel exclusions to line of sight.
* 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.
* Shops now use shopping cart behaviour.
* Wizard commands can now be used from the wizard help screen.
* Allow quivering/firing of wielded missiles and wielded weapons of returning.
@@ -108,6 +109,7 @@ Interface
Items
-----
* New scroll: ?vulnerability, applying to all creatures in LoS including you.
+* New weapon brand: chaos, available only via Xom and pandemonium lords.
* Introduce randart spellbooks with random spell selections.
* Book acquirements are now much more random and may yield manuals.
* Missile enchantment decreases chance of destruction on impact.
@@ -117,7 +119,7 @@ Items
* Item descriptions now mention enchantment/charging limits.
* Randarts now get their known properties autoinscribed.
* Randarts are now noted as identified even if the plusses are still unknown.
-* Eliminate RAP_ANGRY and RAP_BERSERK for missile weapons.
+* Eliminate RAP_ANGRY and RAP_BERSERK for launcher weapons.
* Ammo that IDs through throwing now merges in your pack instantaneously.
* ?immolation doesn't burn scrolls anymore.
* ?summoning creates a permanent abomination.
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index c069315785..5219d8e8a9 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -103,6 +103,7 @@ REVISION("$Rev$");
#include "spl-book.h"
#include "spl-cast.h"
#include "spl-util.h"
+#include "stash.h"
#include "state.h"
#include "stuff.h"
#include "tags.h"
@@ -2609,13 +2610,7 @@ void world_reacts()
viewwindow(true, true);
- if (Options.stash_tracking && !crawl_state.arena)
- {
- StashTrack.update_visible_stashes(
- Options.stash_tracking == STM_ALL ? StashTracker::ST_AGGRESSIVE
- : StashTracker::ST_PASSIVE);
- }
-
+ maybe_update_stashes();
handle_monsters();
_check_banished();
@@ -3479,13 +3474,7 @@ static bool _initialise(void)
#endif
set_cursor_enabled(false);
-
- if (Options.stash_tracking && !crawl_state.arena)
- {
- StashTrack.update_visible_stashes(
- Options.stash_tracking == STM_ALL ? StashTracker::ST_AGGRESSIVE
- : StashTracker::ST_PASSIVE);
- }
+ maybe_update_stashes();
// This just puts the view up for the first turn.
viewwindow(true, false);
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index ee85fb6c58..3ff7d97624 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -1325,9 +1325,7 @@ void wizard_create_spec_object()
canned_msg(MSG_SOMETHING_APPEARS);
// Tell the stash tracker.
- StashTrack.update_visible_stashes(
- Options.stash_tracking == STM_ALL ? StashTracker::ST_AGGRESSIVE
- : StashTracker::ST_PASSIVE);
+ maybe_update_stashes();
}
}
@@ -2941,10 +2939,12 @@ void debug_mons_scan()
coord_def pos = m->pos();
if (!in_bounds(pos))
+ {
mprf(MSGCH_ERROR, "Out of bounds monster: %s at (%d, %d), "
"midx = %d",
m->full_name(DESC_PLAIN, true).c_str(),
pos.x, pos.y, i);
+ }
else if (mgrd(pos) != i)
{
floating_mons.push_back(i);
@@ -3089,8 +3089,10 @@ void debug_mons_scan()
if (vaults.size() == 0)
mprf(MSGCH_WARN, "%s not in any vaults.", str.c_str());
else
+ {
mpr_comma_separated_list(str + " in vault(s) ", vaults,
" and ", ", ", MSGCH_WARN);
+ }
}
mpr("");
@@ -3110,8 +3112,10 @@ void debug_mons_scan()
if (vaults.size() == 0)
mprf(MSGCH_WARN, "%s not in any vaults.", str.c_str());
else
+ {
mpr_comma_separated_list(str + " in vault(s) ", vaults,
" and ", ", ", MSGCH_WARN);
+ }
// Don't report on same monster twice.
if (is_floating[idx])
@@ -3123,8 +3127,10 @@ void debug_mons_scan()
if (vaults.size() == 0)
mprf(MSGCH_WARN, "%s not in any vaults.", str.c_str());
else
+ {
mpr_comma_separated_list(str + " in vault(s) ", vaults,
" and ", ", ", MSGCH_WARN);
+ }
}
mpr("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", MSGCH_ERROR);
@@ -3195,7 +3201,7 @@ static void _debug_acquirement_stats(FILE *ostat)
int num_arts = 0;
int subtype_quants[256];
- int ego_quants[SPWPN_RANDART_I];
+ int ego_quants[SPWPN_DEBUG_RANDART];
memset(subtype_quants, 0, sizeof(subtype_quants));
memset(ego_quants, 0, sizeof(ego_quants));
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index c8233f0139..048c2b3d56 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -1670,8 +1670,10 @@ static void _move_stair(coord_def stair_pos, bool away)
viewwindow(true, false);
if (!swap_features(stair_pos, ray.pos(), false, false))
+ {
mprf(MSGCH_ERROR, "_move_stair(): failed to move %s",
stair_str.c_str());
+ }
}
static void _stairs_card(int power, deck_rarity_type rarity)
@@ -1689,8 +1691,7 @@ static void _stairs_card(int power, deck_rarity_type rarity)
std::vector<coord_def> stairs_avail;
- radius_iterator ri(you.pos(), LOS_RADIUS, false, true, true);
- for (; ri; ++ri)
+ for (radius_iterator ri(you.pos(), LOS_RADIUS, false, true, true); ri; ++ri)
{
dungeon_feature_type feat = grd(*ri);
if (grid_stair_direction(feat) != CMD_NO_CMD
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 5a47ce5e96..68b662178b 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -408,7 +408,6 @@ void stop_delay( bool stop_stair_travel )
if (!i_feel_safe())
handle_interrupted_swap(false, true);
}
-
break;
}
case DELAY_MEMORISE:
@@ -560,7 +559,8 @@ void handle_interrupted_swap(bool swap_if_safe, bool force_unsafe,
bool transform)
{
if (!you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED]
- || !you_tran_can_wear(EQ_WEAPON) || you.cannot_act())
+ || !you_tran_can_wear(EQ_WEAPON) || you.cannot_act()
+ || you.duration[DUR_BERSERKER])
{
return;
}
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 91bddc720d..6013f609ff 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -3155,6 +3155,13 @@ std::string get_monster_equipment_desc(const monsters *mon, bool full_desc,
else if (mons_neutral(mon))
str = "neutral";
+ if (mons_is_summoned(mon))
+ {
+ if (!str.empty())
+ str += ", ";
+ str += "summoned";
+ }
+
if (mon->type == MONS_DANCING_WEAPON
|| mon->type == MONS_PANDEMONIUM_DEMON
|| mon->type == MONS_PLAYER_GHOST
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index d92bc31dfe..f673ba2435 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -62,7 +62,11 @@ REVISION("$Rev$");
#include "view.h"
#include "xom.h"
-#ifdef DEBUG_CHAOS
+#ifdef NOTE_DEBUG_CHAOS_BRAND
+ #define NOTE_DEBUG_CHAOS_EFFECTS
+#endif
+
+#ifdef NOTE_DEBUG_CHAOS_EFFECTS
#include "notes.h"
#endif
@@ -1263,8 +1267,8 @@ bool melee_attack::player_aux_unarmed()
else
{
mprf("Your %s misses %s.",
- miss_verb.empty()? unarmed_attack.c_str()
- : miss_verb.c_str(),
+ miss_verb.empty() ? unarmed_attack.c_str()
+ : miss_verb.c_str(),
defender->name(DESC_NOCAP_THE).c_str());
}
@@ -2343,7 +2347,7 @@ void melee_attack::chaos_affects_defender()
beam.flavour = BEAM_NONE;
int choice = choose_random_weighted(probs, probs + NUM_CHAOS_TYPES);
-#ifdef DEBUG_CHAOS
+#ifdef NOTE_DEBUG_CHAOS_EFFECTS
std::string chaos_effect = "CHAOS effect: ";
switch (choice)
{
@@ -2569,7 +2573,7 @@ void melee_attack::chaos_affects_attacker()
// Move stairs out from under the attacker.
if (one_chance_in(100) && _move_stairs(attacker, defender))
{
-#ifdef DEBUG_CHAOS
+#ifdef NOTE_DEBUG_CHAOS_EFFECTS
take_note(Note(NOTE_MESSAGE, 0, 0,
"CHAOS affects attacker: move stairs"), true);
#endif
@@ -2583,7 +2587,7 @@ void melee_attack::chaos_affects_attacker()
&& one_chance_in(1000))
{
(void) attacker->do_shaft();
-#ifdef DEBUG_CHAOS
+#ifdef NOTE_DEBUG_CHAOS_EFFECTS
take_note(Note(NOTE_MESSAGE, 0, 0,
"CHAOS affects attacker: shaft effect"), true);
#endif
@@ -2596,7 +2600,7 @@ void melee_attack::chaos_affects_attacker()
mprf("Smoke pours forth from %s!", wep_name(DESC_NOCAP_YOUR).c_str());
big_cloud(random_smoke_type(), KC_OTHER, attacker->pos(), 20,
4 + random2(8));
-#ifdef DEBUG_CHAOS
+#ifdef NOTE_DEBUG_CHAOS_EFFECTS
take_note(Note(NOTE_MESSAGE, 0, 0,
"CHAOS affects attacker: smoke"), true);
#endif
@@ -2629,7 +2633,7 @@ void melee_attack::chaos_affects_attacker()
{
mpr(msg.c_str(), MSGCH_SOUND);
noisy(15, attacker->pos());
-#ifdef DEBUG_CHAOS
+#ifdef NOTE_DEBUG_CHAOS_EFFECTS
take_note(Note(NOTE_MESSAGE, 0, 0,
"CHAOS affects attacker: noise"), true);
#endif
@@ -2798,7 +2802,7 @@ void melee_attack::chaos_killed_defender(monsters* mon)
&& _make_zombie(mon, corpse_class, corpse_index, fake_corpse,
last_item))
{
-#ifdef DEBUG_CHAOS
+#ifdef NOTE_DEBUG_CHAOS_EFFECTS
take_note(Note(NOTE_MESSAGE, 0, 0,
"CHAOS killed defender: zombified monster"), true);
#endif
@@ -2943,7 +2947,7 @@ int melee_attack::random_chaos_brand()
if (susceptible)
break;
}
-#ifdef DEBUG_CHAOS
+#ifdef NOTE_DEBUG_CHAOS_BRAND
std::string brand_name = "CHAOS brand: ";
switch (brand)
{
@@ -2967,7 +2971,10 @@ int melee_attack::random_chaos_brand()
default: brand_name += "(other)"; break;
}
- take_note(Note(NOTE_MESSAGE, 0, 0, brand_name.c_str()), true);
+ // Pretty much duplicated by the chaos effect note,
+ // which will be much more informative.
+ if (brand != SPWPN_CHAOS)
+ take_note(Note(NOTE_MESSAGE, 0, 0, brand_name.c_str()), true);
#endif
return (brand);
}
diff --git a/crawl-ref/source/ghost.cc b/crawl-ref/source/ghost.cc
index 5d766fda7b..5258e125ac 100644
--- a/crawl-ref/source/ghost.cc
+++ b/crawl-ref/source/ghost.cc
@@ -168,7 +168,7 @@ void ghost_demon::init_random_demon()
resists.cold = -1;
}
- // demons, like ghosts, automatically get poison res. and life prot.
+ // Demons, like ghosts, automatically get poison res. and life prot.
// resist electricity:
resists.elec = one_chance_in(3);
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 619598edc3..0ecc9228cc 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2008,8 +2008,8 @@ void setup_missile_beam(const actor *agent, bolt &beam, item_def &item,
const bool exploding = ammo_brand == SPMSL_EXPLODING;
const bool penetrating = !exploding
- && (bow_brand == SPWPN_PENETRATION
- || ammo_brand == SPMSL_PENETRATION);
+ && (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
diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h
index e1b4755f8f..63a77f7c41 100644
--- a/crawl-ref/source/itemprop.h
+++ b/crawl-ref/source/itemprop.h
@@ -107,18 +107,14 @@ enum brand_type // equivalent to (you.inv[].special or mitm[].special) % 30
SPWPN_DISTORTION,
SPWPN_REACHING,
SPWPN_RETURNING, // 18
+ SPWPN_CHAOS,
- MAX_PAN_LORD_BRANDS = SPWPN_RETURNING,
+ MAX_PAN_LORD_BRANDS = SPWPN_CHAOS,
- SPWPN_CHAOS,
SPWPN_CONFUSE, // 20
- SPWPN_PENETRATION,
- SPWPN_SHADOW,
- SPWPN_RANDART_I = 25, // 25
- SPWPN_RANDART_II,
- SPWPN_RANDART_III,
- SPWPN_RANDART_IV,
- SPWPN_RANDART_V,
+ SPWPN_PENETRATION, // unused
+ SPWPN_SHADOW, // unused
+ SPWPN_DEBUG_RANDART = 25, // 25
NUM_SPECIAL_WEAPONS,
SPWPN_DUMMY_CRUSHING, // ONLY TEMPORARY USAGE -- converts to VORPAL
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 5f19ee1974..589fdfe492 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -2402,13 +2402,7 @@ void down_stairs( int old_level, dungeon_feature_type force_stair,
trackers_init_new_level(true);
viewwindow(true, true);
-
- if (Options.stash_tracking && !crawl_state.arena)
- {
- StashTrack.update_visible_stashes(
- Options.stash_tracking == STM_ALL ? StashTracker::ST_AGGRESSIVE
- : StashTracker::ST_PASSIVE);
- }
+ maybe_update_stashes();
if (collect_travel_data)
{
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index 42f7f05407..dc7b2d9e75 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -585,10 +585,10 @@ void mons_cast_noise(monsters *monster, bolt &pbolt, spell_type spell_cast)
int noise;
if (silent
- || (innate
- && !mons_class_flag(monster->type, M_NOISY_SPELLS)
- && !(flags & SPFLAG_NOISY)
- && mons_genus(monster->type) != MONS_DRAGON))
+ || (innate
+ && !mons_class_flag(monster->type, M_NOISY_SPELLS)
+ && !(flags & SPFLAG_NOISY)
+ && mons_genus(monster->type) != MONS_DRAGON))
{
noise = 0;
}
@@ -635,11 +635,11 @@ void mons_cast_noise(monsters *monster, bolt &pbolt, spell_type spell_cast)
key_list.push_back("demon" + cast_str);
const bool visible_beam = pbolt.type != 0 && pbolt.type != ' '
- && pbolt.name[0] != '0'
- && !pbolt.is_enchantment();
+ && pbolt.name[0] != '0'
+ && !pbolt.is_enchantment();
const bool targeted = (flags & SPFLAG_TARGETING_MASK)
- && (pbolt.target != monster->pos() || visible_beam);
+ && (pbolt.target != monster->pos() || visible_beam);
if (targeted)
{
@@ -725,9 +725,9 @@ void mons_cast_noise(monsters *monster, bolt &pbolt, spell_type spell_cast)
/////////////////////
const bool gestured = msg.find("Gesture") != std::string::npos
- || msg.find(" gesture") != std::string::npos
- || msg.find("Point") != std::string::npos
- || msg.find(" point") != std::string::npos;
+ || msg.find(" gesture") != std::string::npos
+ || msg.find("Point") != std::string::npos
+ || msg.find(" point") != std::string::npos;
bolt tracer = pbolt;
if (targeted)
@@ -761,8 +761,10 @@ void mons_cast_noise(monsters *monster, bolt &pbolt, spell_type spell_cast)
else if (in_bounds(pbolt.target) && see_grid(pbolt.target))
{
if (const monsters* mtarg = monster_at(pbolt.target))
+ {
if (you.can_see(mtarg))
target = mtarg->name(DESC_NOCAP_THE);
+ }
}
// Monster might be aiming past the real target, or maybe some fuzz has
@@ -911,13 +913,11 @@ void mons_cast_noise(monsters *monster, bolt &pbolt, spell_type spell_cast)
const msg_channel_type chan =
(unseen ? MSGCH_SOUND :
- mons_friendly_real(monster) ? MSGCH_FRIEND_SPELL :
- MSGCH_MONSTER_SPELL);
+ mons_friendly_real(monster) ? MSGCH_FRIEND_SPELL
+ : MSGCH_MONSTER_SPELL);
if (silent)
- {
mons_speaks_msg(monster, msg, chan, true);
- }
else if (noisy(noise, monster->pos()) || !unseen)
{
// noisy() returns true if the player heard the noise.
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc
index 0b1002c5e3..691f387289 100644
--- a/crawl-ref/source/stash.cc
+++ b/crawl-ref/source/stash.cc
@@ -102,6 +102,16 @@ std::string stash_annotate_item(const char *s,
return text;
}
+void maybe_update_stashes()
+{
+ if (Options.stash_tracking && !crawl_state.arena)
+ {
+ StashTrack.update_visible_stashes(
+ Options.stash_tracking == STM_ALL ? StashTracker::ST_AGGRESSIVE
+ : StashTracker::ST_PASSIVE);
+ }
+}
+
bool is_stash(int x, int y)
{
LevelStashes *ls = StashTrack.find_current_level();
diff --git a/crawl-ref/source/stash.h b/crawl-ref/source/stash.h
index d14b67173e..3638cd52b1 100644
--- a/crawl-ref/source/stash.h
+++ b/crawl-ref/source/stash.h
@@ -358,6 +358,7 @@ private:
extern StashTracker StashTrack;
+void maybe_update_stashes();
bool is_stash(int x, int y);
inline bool is_stash( const coord_def& p ) { return is_stash(p.x, p.y); }
void describe_stash(int x, int y);
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 6473c1c761..f06fcd797b 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -3932,7 +3932,7 @@ bool mons_near(const monsters *monster, unsigned short foe)
if (crawl_state.arena || crawl_state.arena_suspended)
return (true);
- if ( grid_distance(monster->pos(), you.pos()) <= LOS_RADIUS )
+ if (grid_distance(monster->pos(), you.pos()) <= LOS_RADIUS)
{
const coord_def diff = grid2show(monster->pos());
if (show_bounds(diff) && env.show(diff))
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index d563b30846..52cb556a7a 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -37,6 +37,7 @@ REVISION("$Rev$");
#include "spl-cast.h"
#include "spl-mis.h"
#include "spl-util.h"
+#include "stash.h"
#include "state.h"
#include "stuff.h"
#include "transfor.h"
@@ -478,7 +479,7 @@ static bool _xom_makes_you_cast_random_spell(int sever, int tension)
#endif
#ifdef NOTE_DEBUG_XOM
- static char spell_buf[80];
+ static char spell_buf[100];
snprintf(spell_buf, sizeof(spell_buf), "XOM: cast spell '%s' (tension %d)",
spell_title(spell), tension);
take_note(Note(NOTE_MESSAGE, 0, 0, spell_buf), true);
@@ -550,7 +551,7 @@ static void _xom_make_item(object_class_type base, int subtype, int power)
canned_msg(MSG_SOMETHING_APPEARS);
#ifdef NOTE_DEBUG_XOM
- static char gift_buf[80];
+ static char gift_buf[100];
snprintf(gift_buf, sizeof(gift_buf), "XOM: god gift: %s",
mitm[thing_created].name(DESC_PLAIN).c_str());
take_note(Note(NOTE_MESSAGE, 0, 0, gift_buf), true);
@@ -574,6 +575,13 @@ static void _xom_acquirement(object_class_type force_class)
_try_brand_switch(item_index);
+#ifdef NOTE_DEBUG_XOM
+ static char gift_buf[100];
+ snprintf(gift_buf, sizeof(gift_buf), "XOM: god gift: %s",
+ mitm[item_index].name(DESC_PLAIN).c_str());
+ take_note(Note(NOTE_MESSAGE, 0, 0, gift_buf), true);
+#endif
+
stop_running();
}
@@ -1173,11 +1181,12 @@ static bool _xom_send_allies(int sever)
#ifdef NOTE_DEBUG_XOM
static char summ_buf[80];
- snprintf(summ_buf, sizeof(summ_buf), "XOM: summons %d %s%s",
+ snprintf(summ_buf, sizeof(summ_buf), "XOM: summons %d %s%s%s",
num_actually_summoned,
hostiletype == 0 ? "friendly " :
hostiletype == 3 ? "hostile " : "",
- only_demonic ? "demons" : "monsters");
+ only_demonic ? "demon" : "monster",
+ num_actually_summoned > 1 ? "s" : "");
take_note(Note(NOTE_MESSAGE, 0, 0, summ_buf), true);
#endif
@@ -1257,7 +1266,7 @@ static bool _xom_polymorph_nearby_monster(bool helpful)
powerup ? PPT_MORE : PPT_LESS);
#ifdef NOTE_DEBUG_XOM
- static char poly_buf[80];
+ static char poly_buf[120];
snprintf(poly_buf, sizeof(poly_buf), "XOM: polymorph %s -> %s (%s)",
old_name.c_str(), mon->name(DESC_PLAIN, true).c_str(),
powerup ? "upgrade" : "downgrade");
@@ -1591,7 +1600,7 @@ static bool _xom_is_good(int sever, int tension)
break;
}
while (x_chance_in_y(3, 4) || player_in_a_dangerous_place());
- done = true;
+ maybe_update_stashes();
#ifdef NOTE_DEBUG_XOM
static char tele_buf[80];
@@ -1600,6 +1609,7 @@ static bool _xom_is_good(int sever, int tension)
count, (player_in_a_dangerous_place() ? " (dangerous)" : ""));
take_note(Note(NOTE_MESSAGE, 0, 0, tele_buf), true);
#endif
+ done = true;
}
else if (random2(tension) < 5 && x_chance_in_y(12, sever))
{
@@ -2094,9 +2104,13 @@ static bool _xom_lose_stats()
#ifdef NOTE_DEBUG_XOM
static char stat_buf[80];
- snprintf(stat_buf, sizeof(stat_buf), "XOM: stat loss (-%d %s)",
+ snprintf(stat_buf, sizeof(stat_buf), "XOM: stat loss: -%d %s (%d/%d)",
loss, (stat == STAT_STRENGTH ? " Str" :
- stat == STAT_DEXTERITY ? " Dex" : "Int"));
+ stat == STAT_DEXTERITY ? " Dex" : "Int"),
+ (stat == STAT_STRENGTH ? you.strength :
+ stat == STAT_DEXTERITY ? you.dex : you.intel),
+ (stat == STAT_STRENGTH ? you.max_strength :
+ stat == STAT_DEXTERITY ? you.max_dex : you.max_intel));
take_note(Note(NOTE_MESSAGE, 0, 0, stat_buf), true);
#endif
return (true);
@@ -2201,10 +2215,10 @@ static bool _xom_draining_torment_effect(int sever)
if (random2(sever) > 3 && (nasty || you.experience > 0))
drain_exp();
- rc = true;
#ifdef NOTE_DEBUG_XOM
take_note(Note(NOTE_MESSAGE, 0, 0, "XOM: draining"), true);
#endif
+ rc = true;
}
}
else
@@ -2232,7 +2246,7 @@ static bool _xom_summon_hostiles(int sever)
const std::string speech = _get_xom_speech("hostile monster");
// Nasty, but fun.
- if (one_chance_in(4))
+ if (player_weapon_wielded() && one_chance_in(4))
{
rc = cast_tukimas_dance(100, GOD_XOM, true);
@@ -2268,7 +2282,8 @@ static bool _xom_summon_hostiles(int sever)
#ifdef NOTE_DEBUG_XOM
static char summ_buf[80];
snprintf(summ_buf, sizeof(summ_buf),
- "XOM: summons %d hostile demons", num_summoned);
+ "XOM: summons %d hostile demon%s",
+ num_summoned, num_summoned > 1 ? "s" : "");
take_note(Note(NOTE_MESSAGE, 0, 0, summ_buf), true);
#endif
rc = true;
@@ -2345,7 +2360,7 @@ static bool _xom_is_bad(int sever, int tension)
}
while (x_chance_in_y(3, 4) && !player_in_a_dangerous_place());
badness = player_in_a_dangerous_place() ? 3 : 1;
- done = true;
+ maybe_update_stashes();
#ifdef NOTE_DEBUG_XOM
static char tele_buf[80];
@@ -2354,6 +2369,7 @@ static bool _xom_is_bad(int sever, int tension)
count, (badness == 3 ? " (dangerous)" : ""));
take_note(Note(NOTE_MESSAGE, 0, 0, tele_buf), true);
#endif
+ done = true;
}
else if (x_chance_in_y(8, sever))
{
@@ -2549,7 +2565,7 @@ void xom_acts(bool niceness, int sever, int tension)
{
#if defined(DEBUG_DIAGNOSTICS) || defined(DEBUG_RELIGION) || defined(DEBUG_XOM)
mprf(MSGCH_DIAGNOSTICS, "xom_acts(%u, %d, %d); piety: %u, interest: %u\n",
- niceness, sever, tension, you.piety, you.gift_timeout);
+ niceness, sever, tension, you.piety, you.gift_timeout);
#endif
#ifdef WIZARD