View Single Post
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old August 19th, 2008, 09:29 AM
At 01:24 AM 8/14/2008, you wrote:
Quote:
Here's an example PreReq from Pathfinder 8 - the class in question requires proficiency in any type of crossbow:

Code:

if (hero.tagis[WepProf.wCrsHand] + hero.tagis[WepProf.wCrsHeavy] + hero.tagis[WepProf.wCrsLight] + hero.tagis[WepProf.wCrsRpHvy] + hero.tagis[WepProf.wCrsRpLgt] + #hasfeat[fWepSimple] <> 0) then
@valid = 1
endif
Don't forget that you can use wildcards on the tag templates. If all crossbow proficiencies are of the form "wCrsXXXXX", then you can use "WepProf.wCrs?" to reference all of them. So the above code could be simplified to:

if (hero.tagis[WepProf.wCrs>] + #hasfeat[fWepSimple] <> 0) then
* @valid = 1
* endif

In addition to being simpler, if someone adds a new crossbow proficiency, the code works without needing any changes.
rob is offline   #4 Reply With Quote