PCGen / pcgen

Main code and data development for pcgen program release
http://pcgen.org
GNU Lesser General Public License v2.1
431 stars 341 forks source link

Skill Listfile Documentation does not explain PREVARLT #5343

Closed AramZS closed 5 years ago

AramZS commented 5 years ago

Most skill lst files seem to use PREVARLT in their code, but I can't seem to find a clear explanation of what that does. It would seem the skill file documentation at https://github.com/PCGen/pcgen/docs/listfilepages/datafilestagpages/datafilesskills.html would be a good place to put it, including into that set of documentation what that tag does and how it works.

LegacyKing commented 5 years ago

It's under PREVAR, LT, GT, GTEQ, etc. are all operators...

PREVAR
Requires that a VAR variable has a certain value or range of values.

Status
Syntax
PREVARoperator:varname,value

operator is a comparison operator from the list EQ , LT , LTEQ , GT , GTEQ , or NEQ . The comparison operator is written as part of the tag name, i.e. PREVARLTEQ . See comparison operators for more details.

varname is the name of a variable - as used in a DEFINE: or BONUS:VAR statement.

value is the value the variable is to be compared to.

Examples
PREVARGT:Rage,4

Character must have a variable 'Rage' with a value greater than four.

PREVARGT:SneakAttack,5

Character must have a variable 'Sneak Attack' with a value greater than five.

PREVARGT:SneakAttack,5,Rage,4

Character must have a variable 'SneakAttack' with a value greater than five and a variable 'Rage' with a value greater than four.
LegacyKing commented 5 years ago

If you're familiar with truth statements in discrete math, the PREVAR is basically a truth statement. VAR is a word that holds a numerical value. A PRE is basically a fancy 'IF' statement. IF x = true, then allowed (Standalone or appended to a BONUS or ABILITY tag).