// ogl/skills.js

/*
  3EProfiler character sheet source file.
  Copyright (C) 2007 Myth-Weavers Games
  **
*/

// **

// Skill information used by 3EProfiler that was released by WotC under
// the Open Gaming License (OGL). This file however, is not released under
// the OGL (see above).

var abilityKeys = [
  , // zero index undefined.
  'Str',
  'Dex',
  'Con',
  'Int',
  'Wis',
  'Cha'
];

/*
// Defines the key abilities for each set of core skills.
var skillKeys = {
  'appraise': [4,0,'N'],
  'astrogate': [4,0,'N'],
  'balance': [2,0,'N'],
  'bluff': [6,0,'N'],
  'climb': [1,0,'N'],
  'computer use': [4,0,'N'],
  'craft': [4,0,'N'],
  'demolitions': [4,0,'N'],
  'diplomacy': [6,0,'N'],
  'disable device': [4,0,'N'],
  'disguise': [6,0,'N'],
  'entertain': [6,0,'N'],
  'escape artist': [2,0,'N'],
  'forgery': [4,0,'N'],
  'gamble': [5,0,'N'],
  'gather information': [6,0,'N'],
  'handle animal': [6,0,'N'],
  'hide': [2,0,'N'],
  'intimidate': [6,0,'N'],
  'jump': [1,0,'N'],
  'knowledge': [4,0,'N'],
  'listen': [5,0,'N'],
  'move silently': [2,0,'N'],
  'pilot': [2,0,'N'],
  'profession': [5,0,'N'],
  'repair': [4,0,'N'],
  'ride': [2,0,'N'],
  'search': [4,0,'N'],
  'sense motive': [5,0,'N'],
  'sleight of hand': [2,0,'N'],
  'spot': [5,0,'N'],
  'survival': [5,0,'N'],
  'swim': [1,0,'N'],
  'treat injury': [5,0,'N'],
  'tumble': [2,0,'N'],
  'affect mind': [6,1,'A'],
  'alchemy': [4,1,'F'],
  'battle influence': [3,0,'C'],
  'battlemind': [3,0,'C'],
  'control mind': [6,1,'A'],
  'drain energy': [3,1,'A'],
  'drain knowledge': [4,1,'S'],
  'empathy': [5,0,'F'],
  'enhance ability': [3,0,'F'],
  'enhance senses': [5,0,'S'],
  'farseeing': [5,0,'S'],
  'fear': [5,1,'S'],
  'force defense': [6,0,'C'],
  'force grip': [4,1,'A'],
  'force light': [4,0,'A'],
  'force lightning': [4,1,'A'],
  'force stealth': [6,0,'C'],
  'force strike': [4,0,'A'],
  'friendship': [6,0,'F'],
  'heal another': [5,0,'A'],
  'heal self': [6,0,'C'],
  'illusion': [6,0,'A'],
  'inspire': [6,0,'A'],
  'malacia': [4,0,'A'],
  'move object': [4,0,'A'],
  'plant surge': [4,0,'A'],
  'see force': [5,0,'S'],
  'sever force': [6,0,'A'],
  'telepathy': [5,0,'S'],
  'transfer essence': [6,0,'F']
};

// Defines which skills are class skills for each core class.
var classSkills = {
			    //fri nob scn sco sol ts  fa  jc  jg 
  'Appraise':                 [0,  1,  1,  1,  0,  0,  0,  0,  0],
  'Astrogate':                [0,  0,  1,  0,  1,  1,  0,  0,  0],
  'Balance':                  [0,  0,  1,  0,  0,  0,  0,  0,  1],
  'Bluff':                    [0,  0,  1,  0,  0,  0,  0,  1,  0],
  'Climb':                    [1,  0,  0,  1,  0,  0,  1,  0,  1],
  'Computer Use':             [0,  1,  1,  1,  1,  1,  0,  1,  1],
  'Craft ( )':                [1,  1,  1,  1,  1,  1,  1,  1,  1],
  'Demolitions':              [0,  0,  1,  1,  1,  1,  0,  0,  0],
  'Diplomacy':                [0,  1,  0,  0,  0,  0,  0,  1,  0],
  'Disable Device':           [0,  0,  1,  0,  0,  1,  0,  0,  0],
  'Disguise':                 [0,  1,  1,  1,  0,  0,  0,  0,  0],
  'Entertain ( )':            [0,  1,  0,  0,  0,  0,  0,  0,  0],
  'Escape Artist':            [0,  0,  1,  0,  0,  0,  0,  0,  0],
  'Forgery':                  [0,  0,  1,  0,  0,  0,  0,  0,  0],
  'Gamble':                   [1,  0,  1,  0,  0,  0,  0,  0,  0],
  'Gather Information':       [0,  0,  1,  0,  0,  0,  0,  1,  0],
  'Handle Animal':            [1,  0,  0,  0,  0,  0,  1,  0,  0],
  'Hide':                     [1,  0,  1,  1,  0,  0,  1,  0,  0],
  'Intimidate':               [0,  0,  0,  0,  1,  0,  0,  1,  1],
  'Jump':                     [1,  0,  0,  1,  0,  1,  1,  0,  1],
  'Knowledge (1)':            [1,  1,  1,  1,  1,  1,  1,  1,  1],
  'Knowledge (2)':            [1,  1,  1,  1,  1,  0,  1,  1,  1],
  'Listen':                   [1,  0,  1,  1,  0,  0,  1,  0,  0],
  'Move Silently':            [0,  0,  1,  1,  0,  0,  0,  0,  0],
  'Pilot':                    [1,  0,  1,  1,  1,  1,  0,  1,  1],
  'Profession ( )':           [1,  1,  1,  1,  1,  1,  1,  1,  1],
  'Repair':                   [0,  0,  1,  1,  1,  1,  0,  0,  0],
  'Ride':                     [1,  1,  0,  1,  1,  0,  0,  0,  0],
  'Search':                   [1,  0,  1,  1,  1,  1,  0,  0,  0],
  'Sense Motive':             [0,  1,  0,  0,  0,  0,  1,  1,  0],
  'Sleight of Hand':          [0,  0,  1,  0,  0,  0,  0,  0,  0],
  'Spot':                     [1,  0,  1,  1,  1,  0,  1,  0,  0],
  'Survival':                 [1,  0,  0,  1,  1,  0,  1,  0,  0],
  'Swim':                     [1,  0,  0,  1,  1,  0,  1,  0,  0],
  'Treat injury':             [0,  0,  0,  0,  0,  1,  1,  1,  0],
  'Tumble':                   [0,  0,  1,  0,  0,  0,  0,  0,  1]
};

var forceSkills = {
			     //fri nob scn sco sol ts  fa  jc  jg 
  'Affect Mind':               [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Alchemy':                   [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Battle influence':          [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Battlemind':                [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Control Mind':              [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Drain Energy':              [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Drain Knowledge':           [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Empathy':                   [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Enhance Ability':           [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Enhance Senses':            [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Farseeing':                 [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Fear':                      [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Force Defense':             [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Force Grip':                [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Force Light':               [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Force Lightning':           [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Force Stealth':             [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Force Strike':              [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Friendship':                [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Heal Another':              [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Heal Self':                 [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Illusion':                  [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Inspire':                   [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Malacia':                   [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Move Object':               [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Plant Surge':               [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'See Force':                 [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Sever Force':               [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Telepathy':                 [0,  0,  0,  0,  0,  0,  0,  0,  0],
  'Transfer Essence':          [0,  0,  0,  0,  0,  0,  0,  0,  0]
};
*/

//SW Saga Edition starts here.

var skillKeys = {
	'acrobatics': [2],
	'climb': [1],
	'deception': [6],
	'endurance': [3],
	'gather information': [6],
	'initiative': [2],
	'jump': [1],
	'knowledge': [4],
	'mechanics': [4],
	'perception': [5],
	'persuasion': [6],
	'pilot': [2],
	'ride': [2],
	'stealth': [2],
	'survival': [5],
	'swim': [1],
	'treat injury': [5],
	'use computer': [4],
	'use the force': [6]
};

// Now transform the classSkill object to contain a bitset rather than an array.
//for (var skill in classSkills)
//{
//  var cc_code = 0;
//  for (var i = 0; i < classSkills[skill].length; i++)
//    cc_code = (cc_code << 1) | classSkills[skill][i];
//  classSkills[skill] = cc_code;
//}
/*
for (var skill in forceSkills)
{
  var cc_code = 0;
  for (var i = 0; i < forceSkills[skill].length; i++)
    cc_code = (cc_code << 1) | forceSkills[skill][i];
  forceSkills[skill] = cc_code;
}
*/