From 31d23a40fe1ac90e0e319ce9bab1fa3bb0a08bf3 Mon Sep 17 00:00:00 2001 From: haranp Date: Mon, 23 Apr 2007 10:19:28 +0000 Subject: Cleaned up a lot of code which was using info[] to use mprf() directly instead. Fixed a bug with affix_weapon_enchantment messaging (mea culpa.) Fixed shatter() messages getting surpressed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1347 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/ouch.cc | 50 +++++++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 30 deletions(-) (limited to 'crawl-ref/source/ouch.cc') diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 41fd58617b..c1a772b2a8 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -84,8 +84,7 @@ int check_your_resists(int hurted, int flavour) int resist; #if DEBUG_DIAGNOSTICS - snprintf( info, INFO_SIZE, "checking resistance: flavour=%d", flavour ); - mpr( info, MSGCH_DIAGNOSTICS ); + mprf(MSGCH_DIAGNOSTICS, "checking resistance: flavour=%d", flavour ); #endif if (flavour == BEAM_FIRE || flavour == BEAM_LAVA @@ -308,9 +307,7 @@ void weapon_acid( char acid_strength ) if (hand_thing == -1) { - snprintf( info, INFO_SIZE, "Your %s burn!", your_hand(true) ); - mpr( info ); - + mprf("Your %s burn!", your_hand(true) ); ouch( roll_dice( 1, acid_strength ), 0, KILLED_BY_ACID ); } else if (random2(20) <= acid_strength) @@ -518,30 +515,28 @@ static void expose_invent_to_element( beam_type flavour, int strength ) switch (target_class) { case OBJ_SCROLLS: - snprintf( info, INFO_SIZE, "%s you are carrying %s fire!", - (num_dest > 1) ? "Some of the scrolls" : "A scroll", - (num_dest > 1) ? "catch" : "catches" ); + mprf("%s you are carrying %s fire!", + (num_dest > 1) ? "Some of the scrolls" : "A scroll", + (num_dest > 1) ? "catch" : "catches" ); break; case OBJ_POTIONS: - snprintf( info, INFO_SIZE, "%s you are carrying %s and %s!", - (num_dest > 1) ? "Some of the potions" : "A potion", - (num_dest > 1) ? "freeze" : "freezes", - (num_dest > 1) ? "shatter" : "shatters" ); + mprf("%s you are carrying %s and %s!", + (num_dest > 1) ? "Some of the potions" : "A potion", + (num_dest > 1) ? "freeze" : "freezes", + (num_dest > 1) ? "shatter" : "shatters" ); break; case OBJ_FOOD: - snprintf( info, INFO_SIZE, "Some of your food is covered with spores!" ); + mprf("Some of your food is covered with spores!"); break; default: - snprintf( info, INFO_SIZE, "%s you are carrying %s destroyed!", - (num_dest > 1) ? "Some items" : "An item", - (num_dest > 1) ? "were" : "was" ); + mprf("%s you are carrying %s destroyed!", + (num_dest > 1) ? "Some items" : "An item", + (num_dest > 1) ? "were" : "was" ); break; } - - mpr( info ); // XXX: should this be in a channel? } } @@ -586,9 +581,8 @@ void lose_level(void) you.experience = exp_needed( you.experience_level + 1 ) - 1; you.experience_level--; - snprintf( info, INFO_SIZE, "You are now a level %d %s!", - you.experience_level, you.class_name ); - mpr( info, MSGCH_WARN ); + mprf(MSGCH_WARN, + "You are now a level %d %s!", you.experience_level, you.class_name); // Constant value to avoid grape jelly trick... see level_change() for // where these HPs and MPs are given back. -- bwr @@ -658,9 +652,7 @@ void drain_exp(void) you.exp_available = 0; #if DEBUG_DIAGNOSTICS - snprintf( info, INFO_SIZE, "You lose %ld experience points.", - exp_drained ); - mpr( info, MSGCH_DIAGNOSTICS ); + mprf(MSGCH_DIAGNOSTICS, "You lose %ld experience points.",exp_drained); #endif you.redraw_experience = 1; @@ -685,9 +677,8 @@ void ouch( int dam, int death_source, char death_type, const char *aux ) // assumed bug for high damage amounts if (dam > 300) { - snprintf( info, INFO_SIZE, - "Potential bug: Unexpectedly high damage = %d", dam ); - mpr( info, MSGCH_DANGER ); + mprf(MSGCH_DANGER, + "Potential bug: Unexpectedly high damage = %d", dam ); return; } @@ -755,9 +746,8 @@ void ouch( int dam, int death_source, char death_type, const char *aux ) #ifdef USE_OPTIONAL_WIZARD_DEATH #if DEBUG_DIAGNOSTICS - snprintf( info, INFO_SIZE, "Damage: %d; Hit points: %d", dam, you.hp ); - mpr( info, MSGCH_DIAGNOSTICS ); -#endif // DEBUG_DIAGNOSTICS + mprf(MSGCH_DIAGNOSTICS, "Damage: %d; Hit points: %d", dam, you.hp); +#endif if (!yesno("Die?", false, 'n')) { -- cgit v1.2.3-54-g00ecf