| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
I hadn't thought to check if it was actually *defined* in
random.cc, so of course it was not. For five years, declared in
random.h and defined in stuff.cc.
|
|
|
|
|
| |
Implement bernoulli in terms of decimal_chance, and change one trivial
bernoulli call (ntrials = 1.0) into a direct decimal_chance call.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not sure why do we need both these and "comes into view".
This includes simplification of:
* shoving the player out of stairs
* "wandering" monsters spawning on the stairs
* fancy messages for in-LOS abyss spawns
For the last part, they had really obscure probabilities, this commit makes
them easier to read. Also, it avoid mallocs and RNG calls, but that's a
rather negligible optimization.
This commit eliminates a mysterious call to viewwindow() as well. A comment
claimed that "Special case: must update the view for monsters created in
player LOS." yet this was not done for band members. It appears removing
that call has no ill effects, but I might have missed something.
|
|
|
|
| |
Blame SamB for the name! It's all his fault.
|
|
|
|
|
|
| |
Works same as random2().
Also, stops valgrind from kvetching about unfreed asg state.
|
|
|
|
|
| |
random.cc wrapped rng.cc, rng.cc wrapped asg.cc. The middle level did
nothing but pass calls as-is.
|
|
|
|
|
|
|
| |
It was generally agreed that weapon randarts are a bit weaker than non-weapon
randarts on average. This commit buffs them by increasing their accuracy and
damage enchantment by about 3 each on average (while maintaining the same
[-6,+12] range of possibilities).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
random_real_inc
Returns a value [0..1]. random_real() was not inclusive of 1.0.
random_real_avg
Returns a real value taking the average of a given number of rolls.
random_range_real
Returns a real value in a given range (with optional number of rolls).
|
|
|
|
|
| |
I left a few cases where it helps disambiguate between global and object
functions by the same name (formatted_string::cprintf(), etc).
|
|
|
|
| |
For way too paranoid and underinclusive values of "simple".
|
| |
|
|
|
|
| |
definitions.
|
| |
|
|
|
|
|
|
|
| |
Almost all uses have been converted, the only major one is unarmed base damage.
For users of raw you.skills[], hp and mp calculations have been changed as well.
you.skill() doesn't actually return partial values yet.
|
|
|
|
| |
It's a nightmare to have some operate x >= 0, some x > 0, some x < M, some x <= M.
|
| |
|
|
|
|
| |
This can improve readability somewhat, and can speed up debug builds.
|
|\ |
|
| | |
|
|/
|
|
|
|
| |
I went the lazy way and just stuck stdint.h at the beginning, we include it
from a number of basic and/or platform-dependent headers so was pulled by
AppHdr.h anyway.
|
| |
|
|
|
|
| |
unnecessary.
|
|
|
|
|
|
| |
The Mac OS X SDKs define this already.
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
|
|
|
|
| |
Fixes issue #1014.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The first iteration of AC/EV changes as described on
http://crawl.develz.org/wiki/doku.php?id=dcss:brainstorm:misc:ac
Although the distinction between heavy and light armour has been
removed for the actual AC and EV calculations, the heavy/light armour
distinction is still in place for skill training. Skill training is
not modified in any way by this change.
Change details follow, with Armour = armour skill, Dodge = Dodging skill:
New total AC
= base_AC * (23 + effective_armour_skill) / 23
+ enchantments
+ modifiers
Where
- effective_armour_skill = armour skill + racial armour skill bonus.
- enchantments = armour enchantments
- modifiers = transforms, mutations, etc. affecting AC.
New guaranteed damage reduction:
= body_base_AC*(13+Armour)/17 * max_dam/100
New total EV:
= 10 + size + (7 * Dodge * Dex) / (20 * AEVP - size) - AEVP - ASP + bonuses
Where size = 2 * (medium - body_size)
having: body_size be one of:
tiny = 0
little = 1
small = 2
medium = 3
large = 4
big = 5
giant = 6
huge = 7
For ref: halfling = small, human = medium, ogre = large,
dragon = huge
AEVP (adjusted evasion penalty for armour):
= body_AEVP + piece_EVP
Where body_AEVP is for the body armour, calculated as:
= (EVP + MAX(0, 3*EVP - Str)) * (45 - Armour) /45
where EVP = base evasion penalty of the armour
piece_EVP is the sum of the base evasion penalties of
the non-body armour worn, excluding shields. Currently
this is only applicable to bardings (EVP of 2).
ASP (adjusted shield evasion penalty):
= SP - (1 + Shields) / (2 * (5 + size))
where SP = 1 for buckler, 3 for shield, 5 for large shield
New spellcasting penalty:
= 25 * (body_AEVP + ASP) - 20 - race_mod
where race_mod = 25 for elven, -15 for dwarven,
15 for races in their native armour.
New combat penalties:
- to-hit penalty = 1d(body_AEVP) + 1d(ASP)
- to-hit penalty for 1.5 hand weapons = 1d(body_AEVP) + 2d(ASP)
- to-dam penalty for 1.5 hand = 1d(ASP)
- base_delay is unchanged if body_AEVP is 0, otherwise:
- base_delay = max(base_delay, 1d10 + 1d(body_AEVP))
- base_delay for unarmed = max(base_delay, 1d10 + 2d(body_AEVP))
- final_delay += min(1d(body_AEVP), 1d(body_AEVP))
- final_delay for 1.5 hand += min(1d(body_AEVP) + 1dASP,
1d(body_AEVP) + 1dASP)
1.5-hand weapons now receive penalties when wearing shields, whereas
before they had bonuses handed out when *not* wearing shields. To
compensate for this, more or less, I've changed existing
hand-and-halfer stats as follows (dam/hit/attack delay):
- katana 13/2/13 -> 14/3/12
- blessed katana 14/1/13 -> 15/2/12
- double sword 15/-2/16 -> 16/-1/15
- blessed dbl swd 15/-2/15 -> 16/-1/14
- broad axe 14/-2/17 -> 14/-2/16 (axes don't need help :P)
- spear 6/3/12 -> 7/4/11
- trident 9/2/14 -> 10/3/13
- demon trident 13/0/14 -> 14/1/13
These changes do not match the old 1.5 hander behaviour - they make
hand and halfers stronger, because the boost is to base damage,
whereas the old behaviour was to boost damage after weapon skill was
applied. The 1.5 hander changes will probably need to be discussed and
revisited.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
15k turns on level, monster level fuzz and super OOD rates increase with time spent beyond 3k turns on level.
The four hells, Zot, and all non-LEVEL_DUNGEON areas (Pan, Abyss and friends) are not affected by these changes.
Monster level fuzz can now be up to +7 levels (was +4); this also applies to monsters placed during level-generation (14% chance per monster as before).
Super OODs can now be up to +26 (random2avg(27, 2); was +11). Super OOD gen only begins after over 1k turns spent on level and is still quite rare initially (1 in 500, was 1 in 5000 in 0.5).
Monster fuzz chances (chance of +0-7 to monster level) increase after 3k turns from 14% to 100% after 7.8k turns.
Super OOD chances increase after 3k turns from 1 in 500 (0.2%) to 100% after 12k turns.
|
| |
|
| |
|
|
|
|
|
| |
Worst case for the old version was random2(65535) == 65534, which had a
1 in 2^30 chance of being true.
|
| |
|
|
|
|
|
|
| |
A defer_rand object stores random numbers in a resolution-independant
fashion, providing interesting monotonicity guarantees. See the next
patch for a good use.
|
|
New: colour.cc, coord.cc, coordit.cc, random.cc, rng.cc.
|