Unique Primitive 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 unique Primitives= ==CHOOSE:SPELLS== (syntax remains unchanged) ==CHOOSE:ARMORPROFICIENCY== SUBTOKEN: ARMORPRO...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 the global qualifiers:

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

PC: This means any ArmorProf which has been granted to the PC by AUTO:ARMORPROF. If the AUTO:ARMORPROF token has an ARMORTYPE= argument, then that *will* be resolved to include ArmorProf objects of that type. In other words if AND ONLY IF the PC has AUTO:ARMORPROF|ARMORTYPE=Foo ... then CHOOSE:ARMORPROFICIENCY|PC[ALL] is equivalent to CHOOSE:ARMORPROFICIENCY|EQUIPMENT[TYPE=Foo]

!PC: This means any ArmorProf which has NOT been granted to the PC by AUTO:ARMORPROF. If the AUTO:ARMORPROF token has an ARMORTYPE= argument, then that *will* be resolved to include ArmorProf objects of that type.

QUALIFIED: This means any ArmorProf for which the PC qualifies. (Generally since our ArmorProf objects don't have PRExxx associated with them, this is a useless qualifier)

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

CHOOSE:ARMORPROF|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:ARMORPROF|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:ARMORPROF|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 the global qualifiers:

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

PC: This means any ShieldProf which has been granted to the PC by AUTO:SHIELDPROF. If the AUTO:SHIELDPROF token has an SHIELDTYPE= argument, then that *will* be resolved to include ShieldProf objects of that type. In other words if AND ONLY IF the PC has AUTO:SHIELDPROF|SHIELDTYPE=Foo ... then CHOOSE:SHIELDPROFICIENCY|PC[ALL] is equivalent to CHOOSE:SHIELDPROFICIENCY|EQUIPMENT[TYPE=Foo]

!PC: This means any ShieldProf which has NOT been granted to the PC by AUTO:SHIELDPROF. If the AUTO:SHIELDPROF token has an SHIELDTYPE= argument, then that *will* be resolved to include ShieldProf objects of that type.

QUALIFIED: This means any ShieldProf for which the PC qualifies. (Generally since our ShieldProf objects don't have PRExxx associated with them, this is a useless qualifier)

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

CHOOSE:SHIELDPROF|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:SHIELDPROF|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:SHIELDPROF|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 the global qualifiers:

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

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

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

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

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

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


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 the global QUALIFIERS:

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

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

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

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

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

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


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 the global qualifiers:

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

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

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

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

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

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


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 the global QUALIFIERS:

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

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

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

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

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

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


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