diasurgical / devilution

Diablo devolved - magic behind the 1996 computer game
Other
8.79k stars 919 forks source link

objects: add BUGFIX for AddShrine #2272

Closed mewmew closed 2 years ago

galaxyhaxz commented 2 years ago

LGTM. This bug has been documented further here: https://github.com/diasurgical/scalpel/blob/master/BUGS.md#shrines

Due to a design flaw in how the game engine handles the random effects in shrines, Hidden Shrines will tend to reduce the durability of the item in the right slot (left hand) more often. Mysterious Shrines will tend to raise Dexterity more often than other stats. Enchanted shrines will tend to reduce Chain Lightning more often than the other spells. This effect becomes less noticeable the more you play in a single gaming session, i.e. the shrine effects will become more 'random.' Namely, the "random seed" stored with ANY shrine is not initialized properly, and the shrine uses whatever happens to be in that memory location. At startup this memory will mostly be "empty", which is read as zero, which then causes the non-random behavior. After the game is played for a while, the memory is much less likely to be zero, and therefore tends to approach randomness.