diff options
author | reaverb <reaverb.Crawl@gmail.com> | 2014-05-10 18:31:54 -0400 |
---|---|---|
committer | reaverb <reaverb.Crawl@gmail.com> | 2014-05-10 18:40:52 -0400 |
commit | b9c215d3f3cf27d717c499f26b707bcb7a9b5031 (patch) | |
tree | b267f3cbd80450567f423a21f7a76b808e60c109 /crawl-ref/source/random.h | |
parent | 2b8d6ef895db6532c4cff4c65f920d33580d527f (diff) | |
download | crawl-ref-b9c215d3f3cf27d717c499f26b707bcb7a9b5031.tar.gz crawl-ref-b9c215d3f3cf27d717c499f26b707bcb7a9b5031.zip |
New function: percent_chance()
Designed to make sure things like no god protecting you from miscasts
won't happen again.
Lua could use it in a couple places, if the function was made accessible from that environment.
Diffstat (limited to 'crawl-ref/source/random.h')
-rw-r--r-- | crawl-ref/source/random.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crawl-ref/source/random.h b/crawl-ref/source/random.h index a0ae035eb5..1e6d4fa453 100644 --- a/crawl-ref/source/random.h +++ b/crawl-ref/source/random.h @@ -30,6 +30,7 @@ int binomial_generator(unsigned n_trials, unsigned trial_prob); bool bernoulli(double n_trials, double trial_prob); int fuzz_value(int val, int lowfuzz, int highfuzz, int naverage = 2); int roll_dice(int num, int size); +bool percent_chance(double percent); int ui_random(int max); |