/*********************************************************
* All sources in Hellbound are Copyright (c) 2008 Konijn *
* I Konijn, release all code and data under the terms of *
* of the GNU General Public License (version 2), as well *
* as under the traditional Angband license. Distribution *
* is allowed both under the terms of the GPL (version 2) *
* or under the terms of the traditional Angband license. *
*********************************************************/

//Global Objects

//Binary choices for character creation
var CH_NONE          = 0x000
var CH_MIRACLES      = 0x001
var CH_SORCERY       = 0x002
var CH_NATURE        = 0x004
var CH_CHAOS         = 0x008
var CH_DEATH         = 0x010
var CH_TAROT         = 0x020
var CH_CHARMS        = 0x040
var CH_SOMATIC       = 0x080
var CH_DEMONIC       = 0x100
var CH_ALL           = 0x1FF //<- Update this when adding a new realm

//Integers representing the chosen realm(s)
var REALM_NONE       = 0
var REALM_MIRACLES   = 1
var REALM_SORCERY    = 2
var REALM_NATURE     = 3
var REALM_CHAOS      = 4
var REALM_DEATH      = 5
var REALM_TAROT      = 6
var REALM_CHARMS     = 7
var REALM_SOMATIC    = 8
var REALM_DEMONIC    = 9
var MAX_REALM        = 9 //<-Update this when adding a new realm

//Integers representing item type values for spellbooks
var TV_NO_BOOK       = 0;
var TV_MIRACLES_BOOK = 90;
var TV_SORCERY_BOOK  = 91;
var TV_BOOK_REALM1   = 91;
var TV_NATURE_BOOK   = 92;
var TV_CHAOS_BOOK    = 93;
var TV_DEATH_BOOK    = 94;
var TV_BOOK_REALM2   = 94;
var TV_TAROT_BOOK    = 95;
var TV_CHARMS_BOOK   = 96;
var TV_SOMATIC_BOOK  = 97;
var TV_DEMONIC_BOOK  = 98;


//Integer presenting racial skills vs. Human Mage
var NO               = 0
var POOR             = 1
var WORSE            = 2
var SAME             = 3
var BETTER           = 4
var SUPER            = 5

var realmChoices =
{
  Warrior       :[ (CH_NONE)                , (CH_NONE) ],
  Mage          :[ (CH_ALL)                 , (CH_ALL) ],
  Priest        :[ (CH_MIRACLES | CH_DEATH) ,  CH_ALL - (CH_MIRACLES | CH_DEATH) ],
  Rogue         :[ (CH_ALL)                 , (CH_NONE) ],
  Hunter        :[ (CH_NATURE)              , (CH_TAROT | CH_CHARMS | CH_SOMATIC | CH_SORCERY) ],
  Paladin       :[ (CH_MIRACLES | CH_DEATH) , (CH_NONE) ],
  Spellblade    :[ (CH_CHARMS)              ,  CH_ALL - CH_CHARMS ],
  "Hell Knight" :[ (CH_DEMONIC)             , (CH_NONE) ],
  Mystic        :[ (CH_SOMATIC)             , (CH_NONE) ],
  Orphic        :[ (CH_NONE)                , (CH_NONE) ],
  "High Mage"   :[ (CH_ALL)                 , (CH_NONE) ],
  Druid         :[ (CH_NATURE)              , (CH_NONE) ],
  Warlock       :[ (CH_DEMONIC)             ,  CH_ALL - CH_DEMONIC ]
};

var realms =
{
  NoMagic: { item:0                , illiterate:"& Book~ of Absent Magic #"  , literate: "& Blank Spellbook~ #"   },
  Miracles:{ item:TV_MIRACLES_BOOK , illiterate:"& Book~ of Miracles #"      , literate: "& Book~ of Miracles #"  },
  Sorcery: { item:TV_SORCERY_BOOK  , illiterate:"& Book~ of Sorcery #"       , literate: "& Sorcery Spellbook~ #" },
  Nature:  { item:TV_NATURE_BOOK   , illiterate:"& Book~ of Nature Magic #"  , literate: "& Nature Spellbook~ #"  },
  Chaos:   { item:TV_CHAOS_BOOK    , illiterate:"& Book~ of the Abyss #"     , literate: "& Chaos Spellbook~ #"   },
  Death:   { item:TV_DEATH_BOOK    , illiterate:"& Book~ of Death Magic #"   , literate: "& Death Spellbook~ #"   },
  Tarot:   { item:TV_TAROT_BOOK    , illiterate:"& Book~ of Tarot Magic #"   , literate: "& Tarot Spellbook~ #"   },
  Charms:  { item:TV_CHARMS_BOOK   , illiterate:"& Book~ of Charms Magic#"   , literate: "& Charms Spellbooks~ #" },
  Somatic: { item:TV_SOMATIC_BOOK  , illiterate:"& Book~ of Somatic Magic #" , literate: "& Somatic Spellbook~ #" },
  Demonic: { item:TV_DEMONIC_BOOK  , illiterate:"& Book~ of the Damned #"    , literate: "& Demonic Spellbook~ #" }
};

indexObject( realms );

var realmTexts = 
{ //         "0123456789012345678901234567890123456789012345678901234\n"
  Miracles  :"Miracle magic is good magic; relying heavily on healing\n" +
             "and protective spells but with few attacking spells. It\n" +
             "is mostly used for harming and banishing foul minions  \n" +
             "evil.",

  Sorcery   :"Sorcery is a meta realm, including utility spells such \n" +
             "as detection and identify, protection spells, spells   \n" +
             "for fleeing and spells to enhance your odds in combat. \n" +
             "It does not, however, have few direct attacking spells.\n",

  Nature    :"Nature magic provides the user with mastery of the     \n" +
             "elements. It contains spells for protection, detection,\n" + 
             "curing and offense. It also contains the only powerful \n" +
             "healing spell outside the Life Realm.",

  Chaos     :"Chaos magic contains the very essence of unmaking, and \n" +
             "the Chaos spells are the most destructives in nature.  \n" +
             "The caster can also call on the primal forces of Chaos \n" + 
             "to to induce mutations in his/her opponents and even in\n" +
             "themselves. Chaos has no protective spells.",

  Death     :"There is no fouler or more evil category of spells than\n" +
             "the necromantic spells of Death Magic. These spells are\n" +
             "relatively hard to learn, but at higher levels give the\n" +
             "caster power over living and the undead. Unfortunately,\n" +
             "the most powerful spells demand their casters' blood as\n" +
             "the focus, often hurting the caster in the process of  \n" +
             "casting.:",

  Tarot     :"Tarot magic has an admirable selection of teleportation\n" +
             "and summoning spells. Like the Tarot, a lot of spells  \n" +
             "have an unpredictable nature, you will not always get  \n" +
             "what you want, but you'll get strong magic.",

  Charms    :"More so than Sorcery, Arcane magic is a general purpose\n" +
             "realm of magic. It attempts to encompass all 'useful'  \n" +
             "spells from all realms, and almost succeeds, with the  \n" + 
             "probable exception of *Identify*. It is the downside of\n" +
             "Arcane magic: while Arcane does have all the necessary \n" +
             "'tool' spells for a dungeon delver, it has no hard-core\n" +
             "ultra-powerful high level spells. As a consequence, all\n" +
             "Arcane spellbooks can be bought in town.",

  Somatic   :"Somatic magic focuses solely on the caster, it offers  \n" +
             "speed, protection, shapeshifting and extreme control   \n" +
             "over the body. Experienced Somatics can walk through   \n" +
             "walss and journey through space and time.",

  Demonic   :"The Demonic realm focuses on tdemons, devils and fallen\n" +
             "angels. Some spells will require sweat, blood and some \n" +
             "of your sanity. The closer you get to hell, the easier \n" +
             "and the more rewarding these spells become."
};

var MAGIC = 0;
var DIVINE = 1;
var MENTAL = 2;

var NO = 0;
var POOR = 1;
var WORSE = 2;
var SAME = 3;
var BETTER = 4;
var SUPER = 5;



//Private Objects

var _yyy;          //xxx

//Initialization

function initxxx(){
}

//Public Functions

function doXXX(){}

//Private Functions

function doYYY(){}
