From e676769f64300c5da6daf5afbb1b27347060a5bb Mon Sep 17 00:00:00 2001 From: haranp Date: Mon, 23 Apr 2007 18:20:57 +0000 Subject: Made trap ammo dependent on T&D. Old: 11 + G(1/3), bounded at 20 (G is the geometric distribution.) New: 10 + random2(T&D skill). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1353 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/message.cc | 8 ++++++++ crawl-ref/source/message.h | 1 + crawl-ref/source/misc.cc | 8 +++----- crawl-ref/source/view.cc | 6 ++---- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc index 6a1421e701..0438fb3c0f 100644 --- a/crawl-ref/source/message.cc +++ b/crawl-ref/source/message.cc @@ -250,6 +250,14 @@ static void do_message_print( int channel, int param, mpr(buff, channel, param); } +void mprf( int channel, int param, const char *format, ... ) +{ + va_list argp; + va_start( argp, format ); + do_message_print( channel, param, format, argp ); + va_end( argp ); +} + void mprf( int channel, const char *format, ... ) { va_list argp; diff --git a/crawl-ref/source/message.h b/crawl-ref/source/message.h index 0d82a195d3..3fcf7d881e 100644 --- a/crawl-ref/source/message.h +++ b/crawl-ref/source/message.h @@ -64,6 +64,7 @@ void formatted_message_history(const std::string st, int channel = MSGCH_PLAIN, int param = 0); // 4.1-style mpr, currently named mprf for minimal disruption. +void mprf( int channel, int param, const char *format, ... ); void mprf( int channel, const char *format, ... ); void mprf( const char *format, ... ); diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index e1fed13fb5..ff43c96cfd 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1439,13 +1439,11 @@ void disarm_trap( struct dist &disa ) if (env.trap[i].type != TRAP_BLADE && trap_category(env.trap[i].type) == DNGN_TRAP_MECHANICAL) { - for (j = 0; j < 20; j++) - { + const int num_to_make = 10 + random2(you.skills[SK_TRAPS_DOORS]); + for (j = 0; j < num_to_make; j++) + { // places items (eg darts), which will automatically stack itrap(beam, i); - - if (j > 10 && one_chance_in(3)) - break; } } diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 1ecead7205..006fcf4d18 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -582,10 +582,8 @@ void monster_grid(bool do_updates) } else { - int the_shout = mons_shouts(monster->type); - strcpy(info, "You hear "); - switch (the_shout) + switch (mons_shouts(monster->type)) { case S_SILENT: default: @@ -639,7 +637,7 @@ void monster_grid(bool do_updates) break; } - mpr(info); + mpr(info, MSGCH_SOUND); } } -- cgit v1.2.3-54-g00ecf