Monday, February 11, 2013

#two-handing artifacts

Slashem, to the joy of many players, allows you to wield two artifact weapons at once.  There's a catch, though.  You only gain "wield" effects from the primary weapon.  This was a simple implementation, since it only requires commenting out a few lines of code:


For the non-programmers out there, the "..." can be used for functions with variable-length argument lists, but in this case, it is instead most likely used as a place holder--a "fill this part in later", if you will (note the TODO).

The rest of the code, that deals with effects gained from wielding artifacts, is not changed.  Since nethack assumes you can only wield an artifact as a primary weapon, it only checks your primary weapon when it handles dealing out wielding effects.  I'd like to fix this to check both weapons when #twoweaponing.  In fact, there are other areas I'd like to have code for this, so I'm considering a CPP macro or an inline function.  Just to be clear, when I say CPP I am, and always will be, referring to the C pre-processor, not C++.  I know C++ in the sense that I can just write regular C code, but otherwise, C++ makes no sense to me (check out the C++ frequently questioned answers to get my gist: http://yosefk.com/c++fqa/).

In other news, for the first time in _ages_, I finally have a decent tourist game going. This one is very much ascendable.  I've only ascended a tourist once, so it'll be nice to double up.  I found an altar very early, dungeon level 2 or so, and sacrificed like a madman until I got Fire Brand, Frost Brand, Mjollnir, and Cleaver.  It was around then that I realized Grayswandir was a lawful, not neutral, weapon.  Fortunately, with all those other artifacts in existence, I managed to get Grayswandir out of a wish from a magic lamp found in the tourist quest.




No comments:

Post a Comment