View Single Post
Old August 30, 2010, 20:00   #2
Timo Pietilš
Join Date: Apr 2007
Location: Climbing up from hole I just dug.
Posts: 4,093
Timo Pietilš is on a distinguished road
Originally Posted by Hajo View Post
I've been trying to make ego lights for Angband 2.9.3. It seems I got most of it right. The flags are set right when I inspect the items with the debug commands, and they work as expected.

But there is a strange side effect in inventory display.

a Wooden Torch of Brightness (-1) (with 2345 turns of light)
I wonder where the -1 comes from and what it means. The torch has SEE_INVIS and my newly introduced EGO_LIGHT flags. I tried to give it +1 to hit (due to the better light) but nothing else.

N:103:of Brightness
I guess the -1 comes from the C line, but why is that (-1) then and not [+1, +0]? I might skip the idea of the attack bonus from ego lights if this causes too much troubles. I have even no idea if the bonus would transfer to the attack mods anyways, since this is a ego light and not a weapon.
That first number is max to-hit. For some reason you get it negative. For to_hit and to_dam values you use parenthesis for AC brackets. 2.9.3 code doesn't show the other value for to_hit and to_dam if it is zero. That is why only one number.

I have no idea why it shows it as negative. Maybe just giving it a value as ego makes it possible to generate negative value too (flip value). That C: -line is max to_hit, not fixed value. Artifacts get fixed values. For egos there is some code for values.
Timo Pietilš is offline   Reply With Quote