Difference between revisions of "Complex CDOMObject Proposals"

From PCGen Wiki
Jump to: navigation, search
(Conversion)
(CHOOSE Proposals for CDOMObjects with complex Primitives or Qualifiers)
 
(3 intermediate revisions by 2 users not shown)
Line 31: Line 31:
 
There are also Skill specific PRIMITIVES:
 
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")<br>
 
PANTHEON=w selects deities with Skill Pantheon as specified in the w argument<br>
 
 
x% = a pattern match for a Skill (specified for skill keys)
 
x% = a pattern match for a Skill (specified for skill keys)
  
Line 139: Line 137:
  
 
FEAT=w  (Feat name)  (Feat name must be any feat that uses CHOOSE:WEAPONPROF)
 
FEAT=w  (Feat name)  (Feat name must be any feat that uses CHOOSE:WEAPONPROF)
 +
 +
ABILITY=w (Ability name)    (Ability name must be any ability that uses CHOOSE:WEAPONPROF)
 +
* NOTE: This should be universally applied to accept any CHOOSE: referenced in the ABILITY. Not just used for Weapon Prof CHOOSE
  
 
WIELD=w  (Wield category)  (Wield Category can be "Light", "OneHanded" or "TwoHanded", as set by the WIELD token in the Equipment LST file)
 
WIELD=w  (Wield category)  (Wield Category can be "Light", "OneHanded" or "TwoHanded", as set by the WIELD token in the Equipment LST file)
Line 237: Line 238:
 
becomes<br>
 
becomes<br>
 
CHOOSE:WEAPONPROFICIENCY|SIZE=L[Greatsword|Club]|SIZE=S[Sling|Dagger]
 
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
 
CHOOSE:WEAPONPROFS|Spellcaster.Longsword|Spellcaster.Longbow
 
Displays a list of Longsword and Longbow if the character is a spellcaster.
 
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
 
CHOOSE:WEAPONPROFS|WSize.Light.Wood
Line 249: Line 246:
  
 
***TODO Per above this is an interesting challenge - what is meant here, as this description of the function is not accurate to the code See [http://tech.groups.yahoo.com/group/pcgen_experimental/message/12594 _exp 12594]
 
***TODO Per above this is an interesting challenge - what is meant here, as this description of the function is not accurate to the code See [http://tech.groups.yahoo.com/group/pcgen_experimental/message/12594 _exp 12594]
 +
 +
 +
 +
 +
 +
 +
==CHOOSE:SPELLLEVEL==
 +
 +
SUBTOKEN: SPELLLEVEL
 +
 +
===Syntax===
 +
 +
CHOOSE:SPELLLEVEL|x|y|z|x|y|z
 +
 +
x is a 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 = an PCClass (specified by key)<br>
 +
x = TYPE=w (w is a TYPE identifier for a PCClass )<br>
 +
x = !TYPE=w (w is a TYPE identifier for a PCClass that would be prohibited)<br>
 +
x = ALL (allow the choice of any PCClass )<br>
 +
 +
There is also (at least) one specific PCClass Primitive:
 +
 +
SPELLTYPE=x
 +
 +
y is an integer (minimum level of the selection)
 +
 +
z is a formula (maximum level of the selection)
 +
 +
Note: Use of the embedded # of choices is deprecated (and how the old and new syntax are distinguished!).  Use SELECT:x
 +
 +
===Conversion===
 +
 +
CHOOSE:SPELLLEVEL|2|TYPE.Arcane|4|MAXLEVEL+30[BONUS:SPELLCAST|CLASS=%;LEVEL=%|1]
 +
becomes:
 +
SELECT:2
 +
CHOOSE:SPELLLEVEL|SPELLTYPE=Arcane|4|MAXLEVEL+30
 +
BONUS:SPELLCAST|%LIST|1
 +
 +
===New Features===
 +
 +
This requires a number of new features:
 +
* SPELLTYPE= primitive for PCClass
 +
* MAXLEVEL term for (spellcasting) Classes
 +
* Conversion of old SPELLLEVEL syntax

Latest revision as of 01:30, 16 June 2010

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:

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)

ABILITY=w (Ability name) (Ability name must be any ability that uses CHOOSE:WEAPONPROF)

  • NOTE: This should be universally applied to accept any CHOOSE: referenced in the ABILITY. Not just used for Weapon Prof CHOOSE

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]

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

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 See _exp 12594




CHOOSE:SPELLLEVEL

SUBTOKEN: SPELLLEVEL

Syntax

CHOOSE:SPELLLEVEL|x|y|z|x|y|z

x is a 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 = an 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 )

There is also (at least) one specific PCClass Primitive:

SPELLTYPE=x

y is an integer (minimum level of the selection)

z is a formula (maximum level of the selection)

Note: Use of the embedded # of choices is deprecated (and how the old and new syntax are distinguished!). Use SELECT:x

Conversion

CHOOSE:SPELLLEVEL|2|TYPE.Arcane|4|MAXLEVEL+30[BONUS:SPELLCAST|CLASS=%;LEVEL=%|1] becomes: SELECT:2 CHOOSE:SPELLLEVEL|SPELLTYPE=Arcane|4|MAXLEVEL+30 BONUS:SPELLCAST|%LIST|1

New Features

This requires a number of new features:

  • SPELLTYPE= primitive for PCClass
  • MAXLEVEL term for (spellcasting) Classes
  • Conversion of old SPELLLEVEL syntax