The Cathedral of Attnam ()
-   Programming (/forums/13/Programming)
-   -   Blocking (/topics/859/Blocking)

chaostrom

Apr 11, 2010, 6:24 am
Can anyone tell me how blocking works in IVAN? I think this is it, but I can\'t make head or tail of it.


SPOILER ALERT. Click here to see text.

Alveradok

Apr 11, 2010, 11:32 am
(You could post which files to look up in the source, instead of pasting it all here, I think.)

An item\'s block value seems to be calculated by the formula
Code

((10000. / (1000 + GetWeight()) + GetTHVBonus()) * GetBlockModifier() / 10000.)

where:
GetWeight is weight (based on material mostly, it seems),
GetTHVBonus is a bonus probably derived from skill level,
GetBlockModifier is an interesting piece, based on your Size times \"Roundness\" (a shield has 95, a banana has 15). The resulting value is then shifted with \"<<\". I don\'t know, however, how exactly \"<<\" works, but it MAY BE that roundness is multiplied 2^2 for shields, and 2^1 for non-shields.

Char.cpp seems to hold more on using that value, though.

chaostrom

Apr 12, 2010, 1:00 am
Thanks! That helps a lot. By the way, where did you find those roundness values?

Ernomouse

Apr 12, 2010, 2:37 pm
Sheesh, at least put it in the spoiler tag...

Alveradok

Apr 12, 2010, 4:00 pm
It\'s like the only page of Attnam eligible for widescreen.