Feature - Implemented Provide an easy way to fetch the currently owned zap wand

Irrat

Member
Currently if a script wishes to know if a zap wand is available or not, they must loop over every zap wand item and see if there's one available.

My thoughts on this are to store a preference containing the wand ID/name. With 0 or an empty string when wand has exploded or is not available.
Of course, could just not reset that preference, and rely on the script doing a "is available" check.

Additionally, it might be a bug that "lastZapperWand" is not set on wand acquisition but instead on a valid zap attempt.

That preference looks to be used in some funny looking code where it uses a dead mimic if no wands have been acquired this ascension, and there are no wands in inventory. The wands in inventory part would set the preference. Not sure if that preference is handy for scripts though, so many be best to ignore.
 

Ryo_Sangnoir

Developer
Staff member
KoLCharacter.findWand() seems to do what you want: return either the wand you have or null.

This could be exposed as an ASH function.
 

Irrat

Member
get_zap_wand()? If you're happy to expose it as an ash function, I can whip up a PR for that.

It feels like the best option if so.
 
Top