diff options
author | reaverb <reaverb.Crawl@gmail.com> | 2014-06-09 20:07:57 -0400 |
---|---|---|
committer | reaverb <reaverb.Crawl@gmail.com> | 2014-06-09 23:41:23 -0400 |
commit | 4b86065cfee426986f01c12fe8d412dcd2369238 (patch) | |
tree | 3cd12b58ca2e86784b6452d82a80e70002e3ed77 /crawl-ref/source/makeitem.cc | |
parent | 5d615acd57e8bbbb43e574b088287dbe6105f9a3 (diff) | |
download | crawl-ref-4b86065cfee426986f01c12fe8d412dcd2369238.tar.gz crawl-ref-4b86065cfee426986f01c12fe8d412dcd2369238.zip |
Inline _got_distortion_roll()
Having a one_chance_in() which is later overridden is completely
nonsensical and meaningless, inlining this would be a prerequisite to
any saner weapon brand schemes.
Diffstat (limited to 'crawl-ref/source/makeitem.cc')
-rw-r--r-- | crawl-ref/source/makeitem.cc | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index 11fa8f696b..4cdf4de9f7 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -65,11 +65,6 @@ bool got_curare_roll(const int item_level) (364 - 7 * item_level) / 25); } -static bool _got_distortion_roll(const int item_level) -{ - return one_chance_in(25); -} - static int _exciting_colour() { switch (random2(3)) @@ -930,7 +925,7 @@ static brand_type _determine_weapon_brand(const item_def& item, int item_level) if (one_chance_in(25)) rc = SPWPN_PAIN; - if (_got_distortion_roll(item_level)) + if (one_chance_in(25)) rc = SPWPN_DISTORTION; if (one_chance_in(3) && (rc == SPWPN_NORMAL || one_chance_in(5))) @@ -959,7 +954,7 @@ static brand_type _determine_weapon_brand(const item_def& item, int item_level) if (one_chance_in(25)) rc = SPWPN_ANTIMAGIC; - if (_got_distortion_roll(item_level)) + if (one_chance_in(25)) rc = SPWPN_DISTORTION; if (one_chance_in(10)) @@ -1005,7 +1000,7 @@ static brand_type _determine_weapon_brand(const item_def& item, int item_level) if (one_chance_in(10)) rc = SPWPN_VAMPIRICISM; - if (_got_distortion_roll(item_level)) + if (one_chance_in(25)) rc = SPWPN_DISTORTION; if (one_chance_in(5)) @@ -1047,7 +1042,7 @@ static brand_type _determine_weapon_brand(const item_def& item, int item_level) if (one_chance_in(10)) rc = SPWPN_VAMPIRICISM; - if (_got_distortion_roll(item_level)) + if (one_chance_in(25)) rc = SPWPN_DISTORTION; if (one_chance_in(3) && (rc == SPWPN_NORMAL || one_chance_in(5))) @@ -1073,7 +1068,7 @@ static brand_type _determine_weapon_brand(const item_def& item, int item_level) if (one_chance_in(10)) rc = SPWPN_PAIN; - if (_got_distortion_roll(item_level)) + if (one_chance_in(25)) rc = SPWPN_DISTORTION; if (one_chance_in(10)) @@ -1113,7 +1108,7 @@ static brand_type _determine_weapon_brand(const item_def& item, int item_level) if (one_chance_in(10)) rc = SPWPN_VAMPIRICISM; - if (_got_distortion_roll(item_level)) + if (one_chance_in(25)) rc = SPWPN_DISTORTION; if (one_chance_in(5) && (rc == SPWPN_NORMAL || one_chance_in(6))) @@ -1166,7 +1161,7 @@ static brand_type _determine_weapon_brand(const item_def& item, int item_level) if (one_chance_in(30)) rc = SPWPN_PAIN; - if (_got_distortion_roll(item_level)) + if (one_chance_in(25)) rc = SPWPN_DISTORTION; if (one_chance_in(10)) @@ -1187,7 +1182,7 @@ static brand_type _determine_weapon_brand(const item_def& item, int item_level) rc = SPWPN_SPEED; else if (one_chance_in(12)) rc = SPWPN_PAIN; - else if (_got_distortion_roll(item_level)) + else if (one_chance_in(25)) rc = SPWPN_DISTORTION; else if (one_chance_in(9)) rc = SPWPN_PROTECTION; |