// ogl/skills.js

// 3EProfiler (tm) source file.
// Copyright (C) 2003 Michael J. Eggertson.

// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

// **

// 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 = [
  '-',
  'Str',
  'Dex',
  'Con',
  'Int',
  'Wis',
  'Cha'
];

// Defines the key abilities for each set of core skills.
var skillKeys = {
  'balance': 2,
  'bluff': 6,
  'climb': 1,
  'computer use': 4,
  'craft': 4,
  'concentration': 5,
  'decipher script': 4,
  'demolitions': 4,
  'diplomacy': 6,
  'disable device': 4,
  'disguise': 6,
  'drive': 2,
  'escape artist': 2,
  'forgery': 4,
  'gamble': 5,
  'gather information': 6,
  'handle animal': 6,
  'hide': 2,
  'intimidate': 6,
  'investigate': 4,
  'jump': 1,
  'knowledge': 4,
  'listen': 5,
  'move silently': 2,
  'navigate': 4,
  'perform': 6,
  'pilot': 2,
  'profession': 5,
  'read write lang': 0,
  'repair': 4,
  'research': 4,
  'ride': 2,
  'search': 4,
  'sense motive': 5,
  'sleight of hand': 2,
  'speak language': 0,
  'spot': 5,
  'survival': 5,
  'swim': 1,
  'treat injury': 5,
  'tumble': 2
};

// Defines which skills are class skills for each core class.
var classSkills = {
                           // Str Fst Tuf Smt Ded Cha
  'Balance':                  [0,  1,  0,  0,  0,  0],
  'Bluff':                    [0,  0,  0,  0,  0,  1],
  'Climb':                    [1,  0,  1,  0,  1,  1],
  'Computer Use':             [0,  0,  0,  1,  0,  0],
  'Concentration':            [0,  0,  1,  0,  0,  0],
  'Craft: 1':                 [0,  0,  0,  0,  0,  0],
  'Craft: 2':                 [0,  0,  0,  0,  0,  0],
  'Craft: 3':                 [0,  0,  0,  0,  0,  0],
  'Decipher Script':          [0,  0,  0,  1,  0,  0],
  'Demolitions':              [0,  0,  0,  1,  0,  0],
  'Diplomacy':                [0,  0,  0,  0,  0,  1],
  'Disable Device':           [0,  0,  0,  1,  0,  0],
  'Disguise':                 [0,  0,  0,  0,  0,  1],
  'Drive':                    [0,  1,  1,  0,  0,  0],
  'Escape Artist':            [0,  1,  0,  0,  0,  1],
  'Forgery':                  [0,  0,  0,  1,  0,  0],    
  'Gamble':                   [0,  0,  0,  0,  1,  0],
  'Gather Information':       [0,  0,  0,  0,  0,  1],
  'Handle Animal':            [1,  0,  0,  0,  0,  1],
  'Hide':                     [0,  1,  0,  0,  0,  0],
  'Intimidate':               [0,  0,  1,  0,  0,  1],
  'Investigate':              [0,  0,  0,  1,  1,  0],
  'Jump':                     [1,  0,  0,  0,  0,  0],
  'Knowledge: 1':             [0,  0,  0,  0,  0,  0],
  'Knowledge: 2':             [0,  0,  0,  0,  0,  0],
  'Knowledge: 3':             [0,  0,  0,  0,  0,  0],  
  'Listen':                   [0,  0,  0,  0,  1,  0],
  'Move Silently':            [0,  1,  0,  0,  0,  0],
  'Navigate':                 [0,  0,  0,  1,  0,  0],  
  'Perform: 1':               [0,  0,  0,  0,  0,  1],
  'Perform: 2':               [0,  0,  0,  0,  0,  1],
  'Perform: 3':               [0,  0,  0,  0,  0,  1],
  'Pilot':				      [0,  1,  0,  0,  0,  0],	
  'Profession':               [1,  1,  1,  1,  1,  1],
  'Read Write Lang: 1':       [1,  1,  1,  1,  1,  1],
  'Read Write Lang: 2':       [1,  1,  1,  1,  1,  1],
  'Read Write Lang: 3':       [1,  1,  1,  1,  1,  1],
  'Repair':                   [1,  0,  0,  1,  0,  0],
  'Research':                 [0,  0,  0,  1,  0,  0],
  'Ride':                     [0,  1,  1,  0,  0,  0],
  'Search':                   [0,  0,  0,  1,  0,  0],
  'Sense Motive':             [0,  0,  0,  0,  1,  0],
  'Sleight of Hand':          [0,  1,  0,  0,  0,  0],
  'Speak Language: 1':        [1,  1,  1,  1,  1,  1],
  'Speak Language: 2':        [1,  1,  1,  1,  1,  1],
  'Speak Language: 3':        [1,  1,  1,  1,  1,  1],
  'Spot':                     [0,  0,  1,  0,  1,  0],
  'Survival':                 [0,  0,  1,  0,  1,  0],
  'Swim':                     [1,  0,  0,  0,  0,  0],
  'Treat Injury':             [0,  0,  0,  0,  1,  0],
  'Tumble':                   [0,  1,  0,  0,  0,  0]
};

// 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;
}

