afritz1 / OpenTESArena

Open-source re-implementation of The Elder Scrolls: Arena.
MIT License
915 stars 68 forks source link

Hit Chance Calculation. Clarification/Verification requested for wiki #231

Closed gmjack closed 2 years ago

gmjack commented 2 years ago

https://github.com/afritz1/OpenTESArena/wiki/Combat#armor-class

Hit Chance given as

if attacker.race in (REDGUARD, DARKELF, WOODELF) then
   racial <- attacker.level*256/100
else
   racial <- 0
endif

chance1 <- 128+((attacker.level-defender.level)*5)*256/100+(attacker.luckBonus-defender.luckBonus)+racial+(attacker.hitBonus-defender.defenceBonus)-defender.AC[slot]
chance2 <- player.level*256/100+51

return (rnd(256)<max(chance1,chance2))

According to this code, "chance2" is affected solely by the PLAYER's level. This seems to imply that player's will be hit MORE often by an enemy as the player level ups. Is this correct? Should this not be chance2 <- attacker.level*256/100 +51??

Thanks, gmjack

Carmina16 commented 2 years ago

The code is correct. I think it was intended as a balancing measure.