Complex CDOMObject Proposals

From PCGen Wiki
Revision as of 22:00, 24 March 2009 by Tom Parker (talk | contribs) (New page: {| align="right" | __TOC__ |} =CHOOSE Proposals for CDOMObjects with complex Primitives or Qualifiers= ==CHOOSE:SKILL== SUBTOKEN: CSKILLS (deprecated)<br> SUBTOKEN: NONCLASSSKILLLIS...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

CHOOSE Proposals for CDOMObjects with complex Primitives or Qualifiers

CHOOSE:SKILL

SUBTOKEN: CSKILLS (deprecated)
SUBTOKEN: NONCLASSSKILLLIST (deprecated)
SUBTOKEN: SKILLSNAMED (deprecated)
SUBTOKEN: SKILLSNAMEDTOCSKILL (deprecated)
SUBTOKEN: SKILLSNAMEDTOCCSKILL (deprecated)
SUBTOKEN: SKILLS (deprecated)
SUBTOKEN: SKILL (new)

Syntax

CHOOSE:SKILL|x|y|y[z]|y[z,z]|x,y,y[z],y[z,z]


x is a Skill PRIMITIVE

A PRIMITIVE is an identifier of objects, and may include any number of specifications. In the case of Skill objects, there are are the four global PRIMITIVES:

x = an Skill (specified by key)
x = TYPE=w (w is a TYPE identifier for a Skill )
x = !TYPE=w (w is a TYPE identifier for a Skill that would be prohibited)
x = ALL (allow the choice of any Skill)

There are also Skill specific PRIMITIVES:

ALIGN=w selects deities with Skill Alignment as specified in the w argument (w must be an alignment abbreviation, e.g. "LG")
PANTHEON=w selects deities with Skill Pantheon as specified in the w argument
x% = a pattern match for a Skill (specified for skill keys)

y is a QUALIFIER

A QUALIFIER is a special keyword that identifies a subset of objects that should be returned. Valid qualifiers for Skill objects are the global QUALIFIERS:

ANY: This means any item in the brackets should be returned (this is implied, so that CHOOSE:SKILL|Foo,TYPE=Bar is equivalent to CHOOSE:SKILL|ANY[Foo,TYPE=Bar]

PC: This means any Skill which has already been taken by the PlayerCharacter.

!PC: This means any Skill which has NOT already been taken by the PlayerCharacter.

QUALIFIED: This means any Skill for which the PC qualifies (meets the PRExxx on the Skill or has QUALIFY:SKILL|x for that Skill)

Note that for a QUALIFIER, ALL is the implied PRIMITIVE, so:

CHOOSE:SKILL|PC[ALL]
is equivalent to
CHOOSE:SKILL|PC

There are also many Skill specific QUALIFIERS:

CLASS Displays all class skills for the PC
!CLASS Displays all skills that are NOT class skills for the PC
CROSSCLASS Displays all crossclass skills for the PC
!CROSSCLASS Displays all skills that are NOT crossclass skills for the PC
EXCLUSIVE Displays all exclusive skills for the PC
!EXCLUSIVE Displays all skills that are not exclusive skills for the PC
NORANK Displays all skills in which the PC has no rank
RANK=n Displays all skills in which the PC has n or more ranks


A comma represents "AND", meaning multiple items are evaluated independently and then any item that appears in ALL of the items is added to the list.

CHOOSE:SKILL|Search,Spot

will result in NO choices because no Skill is both Search and Spot.

CHOOSE:SKILL|TYPE=Foo,PC
would test for any Skill that has the Foo type (as defined in the Skill LST file) which is ALSO already selected by the PlayerCharacter

This could also be written (probably more clearly):
CHOOSE:SKILL|PC[TYPE=Foo]


A pipe represents "OR", meaning multiple items are evaluated independently and then any item that appears in any of the items is added to the list:

CHOOSE:SKILL|Search|Spot

will result in a choice between Deities Search and Spot.

All commas (ANDs) are evaluated before pipes (ORs), so something like:

CHOOSE:SKILL|Search|TYPE=Foo,PC
would include Search unconditionally, in addition to any Skill that has the Foo type (as defined in the Skill LST file) which is ALSO already selected by the PlayerCharacter

Special Case

CHOOSE:NONCLASSSKILLLIST had an argument LIST which queried for CROSSCLASS skills on the PC, thus LIST is equivalent to CROSSCLASS in the new syntax

Note that the SKILLSNAMED, SKILLSNAMEDTOCSKILL, and SKILLSNAMEDTOCCSKILL subtokens have syntax that does not change (even relative to the complex behavior available in those tokens)

Conversion

CHOOSE:CSKILLS becomes CHOOSE:SKILL|CLASS

CHOOSE:SKILLS becomes CHOOSE:SKILL|PC

CHOOSE:SKILLSNAMED|... becomes CHOOSE:SKILL|...

CHOOSE:SKILLSNAMEDTOCSKILL|... becomes CHOOSE:SKILL|... CSKILL:LIST

CHOOSE:SKILLSNAMEDTOCCSKILL|... becomes CHOOSE:SKILL|... CCSKILL:LIST

CHOOSE:NONCLASSSKILLLIST|LIST becomes CHOOSE:SKILL|CROSSCLASS

CHOOSE:NONCLASSSKILLLIST|LIST|Spot,Search becomes CHOOSE:SKILL|CROSSCLASS|Spot|Search