From 5e333ce7bdf88c826dfc0a8a8fa0cbba8b110167 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Wed, 10 Dec 2008 11:59:16 +0000 Subject: Changed weights of the brands a chaos weapon might simulate and the weight of the various chaos effects, to make chaos brand less powerful. Added berserk and miscast effects for chaos effects, plus chaos weapons will occasionally give a message-only miscast effect if it would otherwise have done nothing. Added several effects that have a chance of happening to an attacker every time it uses a chaos brand/AF_CHAOS: dropping through temporary a shaft, having the stairs move out from under them, the weapon making a loud noise. Monsters killed by a chaos weapon/AF_CHAOS have a chance of immediately turning into a zombie (assuming the monster didn't leave a corpse; chaos effects don't (yet) use up corpses). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7804 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/stuff.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/stuff.h') diff --git a/crawl-ref/source/stuff.h b/crawl-ref/source/stuff.h index 996809b4ab..47245e42f2 100644 --- a/crawl-ref/source/stuff.h +++ b/crawl-ref/source/stuff.h @@ -214,15 +214,21 @@ int choose_random_weighted(Iterator beg, const Iterator end) { ASSERT(beg < end); +#if DEBUG + int times_set = 0; +#endif + int totalweight = 0; - int count = 0, result = 0, times_set = 0; + int count = 0, result = 0; while ( beg != end ) { totalweight += *beg; if ( random2(totalweight) < *beg ) { result = count; +#if DEBUG times_set++; +#endif } ++count; ++beg; -- cgit v1.2.3-54-g00ecf