/* ================================================================================ == NOTES ======================================================================= HOLY SMOKES THIS IS A LOT OF INFORMATION. Most of this section is about setting up the code for evaluating trait prerequisites. If you plan on creating or adding game books, be sure to read the summaries in the "functions" section. The following is passed to every &prerequisite.: 0: sheet dbref 1: instance (if exists) 2: value to raise by This information can then be passed to the functions set up below. They are meant to be powerful shortcuts to the usual things that new World of Darkness/ Chronicles of Darkness wants for prerequisites, usually for merits and sometimes for powers. Use these functions for good, not evil. ================================================================================ == SETUP ======================================================================= */ @create Data Dictionary
@set Data Dictionary
=inherit safe @fo me=&d.dd me=search( name=Data Dictionary
) @fo me=@parent Data Dictionary
=[v( d.codp )] &prefix.functions Data Dictionary
=. &prefix.attributes Data Dictionary
=attribute. &prefix.skills Data Dictionary
=skill. &prefix.merits Data Dictionary
=merit. &prefix.advantages Data Dictionary
=advantage. &prefix.bio Data Dictionary
=bio. &prefix.specials Data Dictionary
=special. &prefix.health Data Dictionary
=health. &prefix.conditions Data Dictionary
=condition. &prefix.specials Data Dictionary
=special. /* -------------------------------------------------------------------------------- -- Data Tags ------------------------------------------------------------------- These are on its own object because the system might flood the poor lookup system. In the future, notes and page references should go here as well. */ @create Data Tags @set Data Tags =inherit safe @fo me=&d.dt me=search( name=Data Tags ) @fo me=&d.dt [v( d.dd )]=search( name=Data Tags ) @fo me=@parent [v( d.dt )]=[v( d.codp )] &prefix.attributes [v( d.dt )]=tags.attribute. &prefix.skills [v( d.dt )]=tags.skill. &prefix.merits [v( d.dt )]=tags.merit. &prefix.advantages [v( d.dt )]=tags.advantage. &prefix.bio [v( d.dt )]=tags.bio. &prefix.specials [v( d.dt )]=tags.special. &prefix.health [v( d.dt )]=tags.health. &prefix.conditions [v( d.dt )]=tags.condition. &prefix.specials [v( d.dt )]=tags.special. /* ================================================================================ == FUNCTIONS =================================================================== Data Dictionary Prerequisite Shortcut Functions -------------------------------------------------------------------------------- -- Summary --------------------------------------------------------------------- "This stat" means "this stat's final value". For almost all of these, the following variables are passed: 0: sheet dbref 1: instance (when exists) 2: value to check against 3: value this stat (with the prereq on it) is being adjusted by Class - Numeric, String, List, or Peppermint. .Class (see above) Value - Current value of a stat,. .Value Numeric. Unadjusted value. .Value_Full Any. Untouched attribute. .Value_Stats Numeric. Summed & current value of a list of statpaths. .Value_Stats_Template Numeric. Will add template alterations. At Least - Numeric. Statpath(s) passed are >= ("at least") value(s) passed. .At_Least This stat is at least value. .At_Least_All Other stats are at least value. .At_Least_One One of other stats is at least value. .At_Least_Stat This stat is at least value of another stat. At Most - Numeric. Opposite of "At Least", Stat <= Value. .At_Most .At_Most_All .At_Most_One .At_Most_Stat Between - Numeric. Both 'at least' and 'at most' .Between Is - Direct comparison of stat's value. .Is Numeric. Stat's value is 'x'. .Is_Full Any. Stat's contents is 'x'. .Is_Not Numeric. Stat's value is not 'x'. .Is_One_Of Numeric. Stat's value matches one of a dot-delim list. .Is_None_Of Numeric. Opposite of "is one of", above. .Is_Stat Any. Statpath's value equals another statpath's value. Has - Checking for existance of stats. .Has Stat exists on sheet. .Has_Not Stat doesn't exist on sheet. .Has_One_Of One of stats listed exists on sheet. .Has_All_Of Stats listed all exist on sheet. .Has_None_Of Stats listed all do not exist on sheet. Min/Max Of - Return a high/low value .Min_Of Lowest value of a list of stats .Max_Of Highest value of a list of stats List Class Checks - Checks specifically about the 'list' stat class .List_Has 'List' stat class includes value passed .List_Has_All Includes all of a dot-delimited list passed .List_Has_Not Includes none of a dot-delimited list passed .List_At_Least Has a level of at least value Core Stat Checks - Check against Supernatural Tollerance (power trait) .Max_Trait How high can they take skills/attributes? .Trait_Check Can they take "this" skill/attribute "that" high? .Sphere Which 'sphere' (game line) do you belong to? Specialty - Get information about specialties .Specialty_For Return the skill that has the passed specialty .Specialty_Has Has the specialty named in a certain or any skill Instanced - Information about Instanced () stats .Instanced_Once Item has one or zero existing instances -------------------------------------------------------------------------------- -- Class ----------------------------------------------------------------------- What is the class of the stat? 0: stat path */ &.Class [v( d.dd )]=u( [u( d.sfp )]/f.get-class, %0 ) /* -------------------------------------------------------------------------------- -- Value ----------------------------------------------------------------------- The "value" directive just pulls the permanent part of a numeric stat (such as Strength) or the first item from a text list. -- value -- Value of a primary stat, or the first item of a list 0: sheet dbref 1: stat.path e.g.: u( .value, %0, attribute.strength ) */ &.Value [v( d.dd )]= case( u( .class, %1 ), numeric, first( u( .value_full, %0, %1 ), . ), u( .value_full, %0, %1 ) ) /* -- value full -- Full text on a stat ("both" for numeric stats) 0: sheet dbref 1: stat.path e.g.: u( .value_full, %0, bio.full_name ) */ &.Value_Full [v( d.dd )]= udefault( [u( d.sfp )]/f.getstat.workhorse.[u( .class, %1 )], u( %0/_%1 ), %0, _%1 ) /* -- value stats -- Total value of a numeric trait 0: sheet dbref 1: list.of stat.paths e.g.: u( .value_stats, %0, attribute.strength skill.brawl ) */ &.Value_Stats [v( d.dd )]= ladd( iter( %1 , u( .value_full, %0, %i0 ), , . ), . ) /* -- value stats template -- Run 'value stats' but also check for '.