Difference between revisions of "Complex CDOMObject Proposals"

From PCGen Wiki
Jump to: navigation, search
Line 37: Line 37:
 
y is a QUALIFIER
 
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:
+
A QUALIFIER is a special keyword that identifies a subset of objects that should be returned.  Valid qualifiers for Skill objects include any of 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]<br>
 
is equivalent to <br>
 
CHOOSE:SKILL|PC
 
  
 
There are also many Skill specific QUALIFIERS:
 
There are also many Skill specific QUALIFIERS:
Line 160: Line 146:
 
y is a QUALIFIER
 
y is a QUALIFIER
  
A QUALIFIER is a special keyword that identifies a subset of objects that should be returned.  Valid qualifiers for WeaponProf objects are the global QUALIFIERS:
+
A QUALIFIER is a special keyword that identifies a subset of objects that should be returned.  Valid qualifiers for WeaponProf objects include any of the [[Global Qualifiers]].
  
ANY: This means any item in the brackets should be returned (this is implied, so that CHOOSE:WEAPONPROFICIENCY|Foo,TYPE=Bar is equivalent to CHOOSE:WEAPONPROFICIENCY|ANY[Foo,TYPE=Bar]
+
The following WeaponProf specific QUALIFIER is also available:
 
 
PC: This means any WeaponProf which has already been taken by the PlayerCharacter.
 
 
 
!PC: This means any WeaponProf which has NOT already been taken by the PlayerCharacter.
 
 
 
QUALIFIED: This means any WeaponProf for which the PC qualifies (meets the PRExxx on the WeaponProf or has QUALIFY:WEAPONPROFICIENCY|x for that WeaponProf)
 
 
 
The following WeaponProf specific qualifiers are also available:
 
  
 
SIZE=z  : limits the items in the brackets to appearing only if the PlayerChracter is the size given by z
 
SIZE=z  : limits the items in the brackets to appearing only if the PlayerChracter is the size given by z
 
Note that for a QUALIFIER, ALL is the implied PRIMITIVE, so:
 
 
CHOOSE:WEAPONPROFICIENCY|PC[ALL]<br>
 
is equivalent to <br>
 
CHOOSE:WEAPONPROFICIENCY|PC
 
  
  

Revision as of 00:10, 29 March 2009

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 include any of the Global Qualifiers.

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

CHOOSE:WEAPONPROFICIENCY

SUBTOKEN: PROFICIENCY (deprecated) SUBTOKEN: WEAPONPROF (deprecated) SUBTOKEN: WEAPONPROFS (deprecated) SUBTOKEN: WEAPONPROFICIENCY (new)


Syntax

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

x is a WeaponProf PRIMITIVE

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

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

There are also WeaponProf specific PRIMITIVES:

DEITYWEAPON (gets the weapon listed in the deities list file, for the Deity selected by the PlayerCharacter)

FEAT=w (Feat name) (Feat name must be any feat that uses CHOOSE:WEAPONPROF)

WIELD=w (Wield category) (Wield Category can be "Light", "OneHanded" or "TwoHanded", as set by the WIELD token in the Equipment 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 WeaponProf objects include any of the Global Qualifiers.

The following WeaponProf specific QUALIFIER is also available:

SIZE=z  : limits the items in the brackets to appearing only if the PlayerChracter is the size given by z


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:WEAPONPROFICIENCY|Longsword,Flail

will result in NO choices because no WeaponProf is both Longsword and Flail.

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

This could also be written (probably more clearly):
CHOOSE:WEAPONPROFICIENCY|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:WEAPONPROFICIENCY|Longsword|Flail

will result in a choice between Weapon Proficiencies Longsword and Flail.

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

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

Special Cases

CHOOSE:PROFICIENCY|WEAPON uses UNIQUE which is now properly composed as: !PC

CHOOSE:WEAPONPROFS has an argument LIST that is equivalent to the PC qualifier in CHOOSE:WEAPONPROFICIENCY

CHOOSE:WEAPONPROFS has a magical argument TYPE.Light which can mean EITHER TYPE=Light or "This weapon is Light for the PC". This will require special conversion

CHOOSE:WEAPONPROFS has special Syntax SIZE.Z<name> where Z is a Size abbreviation and <name> is a weapon proficiency. It is conditionally added if the PC is the given size.

CHOOSE:WEAPONPROFS WSIZE.z.w.w.w does some strange processing. Z is a wield category and w are equipment types. However, this violates determinism in that if an equipment doesn't match a WeaponProf name, then the first equipment to match is used - thus creating different results in different cases. We should review the rules that caused the creation of this (if we can find them) to see if and how this is handled.

CHOOSE:WEAPONPROF has the ability to restrict (remove) types and this impacts backwards in the token.

Thus, something like: CHOOSE:WEAPONPROF|!TYPE=Foo|TYPE=Bar means the !TYPE has no effect, while CHOOSE:WEAPONPROF|TYPE=Foo|!TYPE=Bar is equivalent to our new syntax: CHOOSE:WEAPONPROFICIENCY|TYPE=Foo,!TYPE=Bar (since the !TYPE previously was treated as an AND)

This means more complicated cases can also be resolved: CHOOSE:WEAPONPROF|TYPE=Foo|!TYPE=Bar|Type=Goo is equivalent to our new syntax: CHOOSE:WEAPONPROFICIENCY|TYPE=Foo,!TYPE=Bar|TYPE=Goo (note how TYPE=Goo appears after the !TYPE=Bar in WEAPONPROF, thus not ANDed with !TYPE=Bar in WEAPONPROFICIENCY

Conversion

CHOOSE:PROFICIENCY|WEAPON|UNIQUE|TYPE=Exotic
becomes
CHOOSE:WEAPONPROFICIENCY|!PC[TYPE=Exotic]

CHOOSE:WEAPONPROF|1|Dagger|Club
becomes
CHOOSE:WEAPONPROFICIENCY|Dagger|Club

CHOOSE:WEAPONPROF|3|DEITYWEAPON
becomes
CHOOSE:WEAPONPROFICIENCY|DEITYWEAPON
SELECT:3

CHOOSE:WEAPONPROF|1|WIELD.OneHanded|WIELD.Light
becomes
CHOOSE:WEAPONPROFICIENCY|WIELD=OneHanded|WIELD=Light

CHOOSE:WEAPONPROF|1|WIELD.OneHanded|!TYPE.Exotic
becomes
CHOOSE:WEAPONPROFICIENCY|WIELD=OneHanded,!TYPE=Exotic

CHOOSE:WEAPONPROFS|LIST
becomes
CHOOSE:WEAPONPROFICIENCY|PC

CHOOSE:WEAPONPROFS|Size.LGreatsword|Size.LClub|Size.SSling|Size.SDagger
becomes
CHOOSE:WEAPONPROFICIENCY|SIZE=L[Greatsword|Club]|SIZE=S[Sling|Dagger]

      • TODO This last example is an interesting test cases - pipes inside the brackets as OR - is this okay?? How is this done so that Qualifiers can use OR and AND inside the brackets, since that was intended in the design?

CHOOSE:WEAPONPROFS|Spellcaster.Longsword|Spellcaster.Longbow Displays a list of Longsword and Longbow if the character is a spellcaster.

      • TODO is SPELLCASTER still valid and necessary?

CHOOSE:WEAPONPROFS|WSize.Light.Wood Displays a list of all the character's weapon profs for light weapons if there is a wood weapon of that type.

      • TODO Per above this is an interesting challenge - what is meant here, as this description of the function is not accurate to the code