Unique Primitive CDOMObject Proposals

From PCGen Wiki
Jump to: navigation, search

CHOOSE Proposals for CDOMObjects with unique Primitives

CHOOSE:SPELLS

(syntax remains unchanged)

CHOOSE:ARMORPROFICIENCY

SUBTOKEN: ARMORPROFICIENCY (new)
SUBTOKEN: ARMORPROF (deprecated by this proposal)

Reason for deprecation: The Challenge with the existing CHOOSE:ARMORPROF is that it is based on equipment. Meaning, CHOOSE:ARMORPROF|TYPE=Foo means to allow a choice of any ArmorProf that is used in a PROFICIENCY:ARMOR|x token on a piece of Equipment of TYPE=Foo. This is counter to the long-term plan for CHOOSE tokens, and I would like to get away from this.

Syntax

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

x is an ArmorProf PRIMITIVE

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

x = an ArmorProf (specified by key)
x = TYPE=w (w is a TYPE identifier for an ArmorProf ) - note that none of our ArmorProfs actually use TYPE: but this works anyway :)
x = !TYPE=w (w is a TYPE identifier for an ArmorProf that would be prohibited)
x = ALL (allow the choice of any ArmorProf)

y is a QUALIFIER

A QUALIFIER is a special keyword that identifies a subset of objects that should be returned. Valid qualifiers for ArmorProf objects are any of the Global Qualifiers.

in case of a global QUALIFIER, z is an ArmorProf PRIMITIVE (see above)

An additional "local" QUALIFIER specific to ArmorProf objects is also available:

EQUIPMENT: If this is used then the parameters in z are evaluated. Once the equipment identified by the z parameters is summarized, the equipment is queried to determine the ArmorProf objects as identified by their PROFICIENCY:ARMOR tokens. These ArmorProf objects are then added to the items that can be selected.

In this case, z is an Equipment PRIMITIVE

A PRIMITIVE is an identifier of objects, and may include any number of specifications. In the case of Equipment objects, there only valid PRIMITIVES are the three global primitives:

z = a piece of Equipment (specified by key)
z = TYPE=w (w is a TYPE identifier for a piece of Equipment)
z = !TYPE=w (w is a TYPE identifier for a piece of Equipment that would be prohibited)
z = ALL (use any Equipment)

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

CHOOSE:ARMORPROFICIENCY|EQUIPMENT[ALL]
is equivalent to
CHOOSE:ARMORPROFICIENCY|EQUIPMENT


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:ARMORPROFICIENCY|Chainmail,Field Plate
will result in NO choices because no ArmorProf is both Chainmail and Field Plate.

CHOOSE:ARMORPROFICIENCY|TYPE=Foo,EQUIPMENT[TYPE=Bar]
would test for any ArmorProf that has the Foo type (as defined in the ArmorProf LST file) which is ALSO the proficiency for an Equipment that has the TYPE Bar (as defined in the Equipment LST file)

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:ARMORPROFICIENCY|Chainmail|Field Plate
will result in a choice between ArmorProf Chainmail and ArmorProf Field Plate

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

CHOOSE:ARMORPROFICIENCY|Chainmail|TYPE=Foo,EQUIPMENT[TYPE=Bar]
would include Chainmail unconditionally, in addition to any ArmorProf that has the Foo type (as defined in the ArmorProf LST file) which is ALSO the proficiency for an Equipment that has the TYPE Bar (as defined in the Equipment LST file)

Conversion

CHOOSE:ARMORPROF|Chainmail
becomes
CHOOSE:ARMORPROFICIENCY|EQUIPMENT[Chainmail]

CHOOSE:ARMORPROF|ALL
becomes
CHOOSE:ARMORPROFICIENCY|EQUIPMENT[ALL]

CHOOSE:SHIELDPROFICIENCY

SUBTOKEN: SHIELDPROFICIENCY (new)
SUBTOKEN: SHIELDPROF (deprecated by this proposal)

Reason for deprecation: The Challenge with the existing CHOOSE:SHIELDPROF is that it is based on equipment. Meaning, CHOOSE:SHIELDPROF|TYPE=Foo means to allow a choice of any ShieldProf that is used in a PROFICIENCY:SHIELD|x token on a piece of Equipment of TYPE=Foo. This is counter to the long-term plan for CHOOSE tokens, and I would like to get away from this.

Syntax

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

x is an ShieldProf PRIMITIVE

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

x = a ShieldProf (specified by key)
x = TYPE=w (w is a TYPE identifier for a ShieldProf ) - note that none of our ShieldProfs actually use TYPE: but this works anyway :)
x = !TYPE=w (w is a TYPE identifier for a ShieldProf that would be prohibited)
x = ALL (allow the choice of any ShieldProf)

y is a QUALIFIER

A QUALIFIER is a special keyword that identifies a subset of objects that should be returned. Valid qualifiers for ShieldProf objects are any of the Global Qualifiers.

In the case of a global QUALIFIER, z is an ShieldProf PRIMITIVE (see above)

An additional "local" QUALIFIER specific to ShieldProf objects is also available:

EQUIPMENT: If this is used then the parameters in z are evaluated. Once the equipment identified by the z parameters is summarized, the equipment is queried to determine the ShieldProf objects as identified by their PROFICIENCY:SHIELD tokens. These ShieldProf objects are then added to the items that can be selected.

In this case, z is an Equipment PRIMITIVE

A PRIMITIVE is an identifier of objects, and may include any number of specifications. In the case of Equipment objects, there only valid PRIMITIVES are the three global primitives:

z = a piece of Equipment (specified by key)
z = TYPE=w (w is a TYPE identifier for a piece of Equipment)
z = !TYPE=w (w is a TYPE identifier for a piece of Equipment that would be prohibited)
z = ALL (use any Equipment)

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

CHOOSE:SHIELDPROFICIENCY|EQUIPMENT[ALL]
is equivalent to
CHOOSE:SHIELDPROFICIENCY|EQUIPMENT


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:SHIELDPROFICIENCY|Buckler,Tower Shield
will result in NO choices because no ShieldProf is both Buckler and Tower Shield.

CHOOSE:SHIELDPROFICIENCY|TYPE=Foo,EQUIPMENT[TYPE=Bar]
would test for any ShieldProf that has the Foo type (as defined in the ShieldProf LST file) which is ALSO the proficiency for an Equipment that has the TYPE Bar (as defined in the Equipment LST file)

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:SHIELDPROFICIENCY|Buckler|Tower Shield
will result in a choice between ShieldProf Buckler and ShieldProf Tower Shield

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

CHOOSE:SHIELDPROFICIENCY|Buckler|TYPE=Foo,EQUIPMENT[TYPE=Bar]
would include Bucklerunconditionally, in addition to any ShieldProf that has the Foo type (as defined in the ShieldProf LST file) which is ALSO the proficiency for an Equipment that has the TYPE Bar (as defined in the Equipment LST file)


Conversion

CHOOSE:SHIELDPROF|Buckler
becomes
CHOOSE:SHIELDPROFICIENCY|EQUIPMENT[Buckler]

CHOOSE:SHIELDPROF|ALL
becomes
CHOOSE:SHIELDPROFICIENCY|EQUIPMENT[ALL]

CHOOSE:DOMAIN

SUBTOKEN: DOMAIN (unchanged)

Syntax

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

x is an Domain PRIMITIVE

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

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

There is also one Domain specific PRIMITIVE:

DEITY = Domains allowed by the Deity

y is a QUALIFIER

A QUALIFIER is a special keyword that identifies a subset of objects that should be returned. Valid qualifiers for Domain objects are any of the Global Qualifiers.


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:DOMAIN|Fire,War

will result in NO choices because no Domain is both Fire and War.

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

This could also be written (probably more clearly):
CHOOSE:DOMAIN|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:DOMAIN|Fire|War
will result in a choice between Domain Fire and Domain War

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

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

Specific Case

ARGUMENT: QUALIFY

This is the only situation where the existing syntax of CHOOSE:DOMAIN will change. QUALIFY currently is a compound behavior, which is performing two tests: - Is the PC qualified for the Domain (equivalent of the QUALIFIER QUALIFIED) - Has the PC taken this Domain (equivalent of the QUALIFIER !PC)

QUALIFY is therefore named in a way that may not be completely clear, and can easily be replaced by two qualifiers joined with a comma (AND):

QUALIFIED,!PC

Conversion

CHOOSE:DOMAIN|War|Fire
remains unchanged

CHOOSE:DOMAIN|QUALIFY (this currently provides any Domain which the PC is qualified for and hasn't yet taken)
becomes
CHOOSE:DOMAIN|QUALIFIED,!PC

CHOOSE:DEITY

SUBTOKEN: DEITY (new)

Syntax

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


x is a Deity PRIMITIVE

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

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

There are also two Deity specific PRIMITIVES:

ALIGN=w selects deities with Deity Alignment as specified in the w argument (w must be an alignment abbreviation, e.g. "LG") PANTHEON=w selects deities with Deity Pantheon as specified in the w argument

y is a QUALIFIER

A QUALIFIER is a special keyword that identifies a subset of objects that should be returned. Valid qualifiers for Deity objects are any of the Global Qualifiers.

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:DEITY|Ra,Set

will result in NO choices because no Deity is both Ra and Set.

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

This could also be written (probably more clearly):
CHOOSE:DEITY|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:DEITY|Ra|Set

will result in a choice between Deities Ra and Set.

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

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

Conversion

None, DEITY is a new Subtoken for CHOOSE

CHOOSE:CLASS

SUBTOKEN: CLASS (unchanged) SUBTOKEN: SPELLCASTER (deprecated)

Syntax

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

x is an PCClass PRIMITIVE

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

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


Note that a KEY for a PCClass whcih contains SubClasses can be a (just the key, indicating the parent class and all subclasses), a.a (indicating just the parent class if ALLOWBASECLASS is YES or indicates just the subclass a if ALLOWBASECLASS if NO), and a.b (indicating just the specific SubClass b

There are also PCClass specific PRIMITIVES:

SPELLCASTER = PCClasses that can cast spells (as defined by the use of the SPELLSTAT: token in the PCClass)

y is a QUALIFIER

A QUALIFIER is a special keyword that identifies a subset of objects that should be returned. Valid qualifiers for PCClass objects are any of the Global Qualifiers.


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:CLASS|Wizard,Fighter

will result in NO choices because no PCClass is both Wizard and Fighter.

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

This could also be written (probably more clearly):
CHOOSE:CLASS|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:CLASS|Wizard|Fighter
will result in a choice between PCClass Wizard and PCClass Fighter

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

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

Conversion

CHOOSE:SPELLCLASSES becomes CHOOSE:CLASS|SPELLCASTER

CHOOSE:CLASS|Fighter|Wizard
remains unchanged

CHOOSE:RACE

SUBTOKEN: RACE (new)

Syntax

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


x is a Race PRIMITIVE

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

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


There is also Race specific PRIMITIVES:

RACETYPE=w (w must be a Race Type as defined by the RACE's RACETYPE token in the LST file) RACESUBTYPE=w (w must be a Race SubType as defined by the RACE's RACESUBTYPE token in the LST file)


y is a QUALIFIER

A QUALIFIER is a special keyword that identifies a subset of objects that should be returned. Valid qualifiers for Race objects are are any of the Global Qualifiers.


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:RACE|Dwarf,Elf

will result in NO choices because no Race is both Dwarf and Elf.

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

This could also be written (probably more clearly):
CHOOSE:RACE|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:RACE|Dwarf|Elf

will result in a choice between Race Dwarf and Race Elf.

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

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

Special Case

The RACE subtoken currently allows brackets to group comma separated items in an AND format. This is equivalent to an AND function (good, because that's what the new system also uses for AND), but the old system has no prefix. This is equivalent to the ANY prefix, however, so conversion is easy. (Note as ANY is also assumed, the brackets can be dropped and solely the comma used as AND)

Conversion

CHOOSE:RACE|RACETYPE=Dragon remains unchanged.

CHOOSE:RACE|[RACETYPE=Humanoid,RACESUBTYPE=Aquatic] becomes CHOOSE:RACE|RACETYPE=Humanoid,RACESUBTYPE=Aquatic