/* tables.c
 * Definitions and tables for XdY+
 */


#include "tables.h"



/* Strength / SWI (now called ASB) / +to_hit / weight_limit / +to_dam */
str_tableline str_table[39] =
{
	{ 3, 3, -3, 4.0, -2 },  { 4, 4, -2, 5.0, -2 },  { 5, 5, -1, 6.0, -1 },
	{ 6, 6, -1, 7.0, -1 },  { 7, 7, 0,  8.0, 0 },   { 8, 8, 0, 10.0, 0 },
	{ 9, 9, 0, 12.0, 0 },   { 10, 10, 0, 14.0, 0 }, { 11, 11, 0, 16.0, 0 },
	{ 12, 12, 0, 18.0, 0 }, { 13, 13, 0, 20.0, 0 }, { 14, 14, 0, 22.0, 0 },
	{ 15, 15, 0, 24.0, 0 }, { 16, 16, 0, 26.0, 1 }, { 17, 17, 0, 28.0, 2 },
	{ 18, 20, 1, 30.0, 2 }, /* Okay, that's the plain values */
	{ 27, 20, 1, 30.0, 2 }, { 37, 30, 1, 30.0, 2 }, /* 18/09, 18/19 */
	{ 47, 40, 1, 35.0, 3 }, { 57, 50, 1, 40.0, 3 }, /* 18/29, 18/39 */
	{ 67, 60, 1, 45.0, 3 }, { 77, 70, 1, 50.0, 3 }, /* 18/49, 18/59 */
	{ 87, 80, 1, 55.0, 3 }, { 97, 90, 2, 60.0, 4 }, /* 18/69, 18/79 */
	{ 107, 100, 3, 65.0, 5 }, { 117, 110, 4, 70.0, 5 }, /* 18/89, 18/99 */
	{ 127, 120, 5, 80.0, 6 }, { 137, 130, 6, 80.0, 7 }, /* 18/109, 18/119 */
	{ 147, 140, 7, 80.0, 8 }, { 157, 150, 8, 80.0, 9 }, /* 18/129, 18/139 */
	{ 167, 160, 9, 80.0, 10 }, { 177, 170, 10, 90.0, 11 }, /* 18/149, 18/159 */
	{ 187, 180, 11, 90.0, 12 }, { 197, 190, 12, 90.0, 13 }, /* /169, /179 */
	{ 207, 200, 13, 90.0, 14 }, { 217, 210, 14, 90.0, 15 }, /* /189, /199 */
	{ 227, 220, 15, 100.0, 16 }, { 237, 230, 15, 100.0, 18 }, /* 209, 219 */
	{ 247, 240, 15, 100.0, 20 }	/* 18/220+ (ie. 18***) (18/229 actually) */
};

/* Weapon speed modifier, indexed on class */
double class_wsm[6] = { 0.5, 0.2, 0.3, 0.3, 0.4, 0.4 };

/* Minimum weapon weight divisor, indexed on class */
double	class_mww[6] = { 3.0, 4.0, 3.5, 3.0, 3.5, 3.0 };

/* Max attacks/round, indexed on class */
int max_attacks[6] = { 6, 4, 5, 5, 5, 5 };

/* dex/SWI table for attacks/round ie. this[dex].bpr[SWI] == bpr, ish. */
bpr_tableline blows_per_round[12] =
{
	{   9, { 1,1,1,1,1,2,2,2,3,3,3,3 } },
	{  27, { 1,1,1,2,2,2,2,3,3,3,3,3 } }, /* ... 18/09 (incl) */
	{  67, { 1,1,2,2,2,3,3,3,3,4,4,4 } }, /* ... 18/49 (incl) */
	{  87, { 1,1,2,3,3,3,3,4,4,4,4,4 } }, /* ... 18/69 (incl) */
	{ 107, { 1,2,3,3,3,4,4,4,4,4,4,4 } }, /* ... 18/89 (incl) */
	{ 117, { 1,2,3,4,4,4,4,4,4,4,4,4 } }, /* ... 18/99 (incl) */
	{ 127, { 2,3,4,4,4,5,5,5,5,5,5,5 } }, /* ... 18/109 (incl) */
	{ 137, { 2,3,4,4,5,5,5,5,5,5,5,5 } }, /* 119 */
	{ 147, { 2,3,4,5,5,5,5,5,5,5,5,6 } }, /* 129 */
	{ 157, { 2,4,5,5,5,5,5,5,5,5,6,6 } }, /* 139 */
	{ 167, { 2,4,5,5,5,5,5,5,6,6,6,6 } }, /* 149 */
	{ 247, { 3,4,5,5,5,6,6,6,6,6,6,6 } }  /* *** */
};

dth_tableline dex_modtohit[19] =
{
	{ 3,-3 }, { 5,-2 }, { 7,-1 }, { 15,0 }, { 16,1 }, { 17,2 }, { 67,3 },
	{ 107,4 }, { 117,5 }, { 127,6 }, { 137,7 }, { 147,8 }, { 167,9 },
	{ 177,10 }, { 187,11 }, { 197,12 }, { 207,13 }, { 217,14 }, { 247,15 }
};

/* base melee skill, indexed on class */
int class_bms[6] = { 70, 34, 48, 60, 56, 68 };

/* Racial melee skill modifier, indexed on race */
int race_msm[10] = { 0, -1, -5, -10, -8, 15, 12, 20, 15, 10 };

/* melee skill level multiplier bonus, indexed on class */
double class_mslm[6] = { 4.5, 1.5, 2.0, 4.0, 3.0, 3.5 };

char *class_name[6] = { "Warrior","Mage","Priest","Rogue","Ranger","Paladin" };
char *race_name[10] = { "Human","Half-Elf","Elf","Hobbit","Gnome","Dwarf",
						"Half-Orc","Half-Troll","Dunadan","High-Elf" };

std_weapon_info std_weapons[49] =
{									/*   X d Y   Wgt  Edged */
	/* Awl-Pike                     */ {  1, 8, 16.0, 1 },
	/* Ball-and-Chain               */ {  2, 4, 15.0, 0 },
	/* Bastard Sword                */ {  3, 4, 14.0, 1 },
	/* Battle Axe                   */ {  2, 8, 17.0, 1 },
	/* Beaked Axe                   */ {  2, 6, 18.0, 1 },
	/* Blade of Chaos               */ {  6, 5, 18.0, 1 },
	/* Broad Axe                    */ {  2, 6, 16.0, 1 },
	/* Broad Sword                  */ {  2, 5, 15.0, 1 },
	/* Broken Dagger                */ {  1, 1,  0.5, 1 },
	/* Broken Sword                 */ {  1, 2,  3.0, 1 },
	/* Cutlass                      */ {  1, 7, 11.0, 1 },
	/* Dagger                       */ {  1, 4,  1.2, 1 },
	/* Dwarven Pick                 */ {  1, 4, 20.0, 0 },
	/* Dwarven Shovel               */ {  1, 3, 12.0, 0 },
	/* Executioner's Sword          */ {  4, 5, 26.0, 1 },
	/* Flail                        */ {  2, 6, 15.0, 0 },
	/* Glaive                       */ {  2, 6, 19.0, 1 },
	/* Gnomish Shovel               */ {  1, 2,  6.0, 0 },
	/* Great Axe                    */ {  4, 4, 23.0, 1 },
	/* Halberd                      */ {  3, 4, 19.0, 1 },
	/* Katana                       */ {  3, 4, 12.0, 1 },
	/* Lance                        */ {  2, 8, 30.0, 1 },
	/* Lead-Filled Mace             */ {  3, 4, 18.0, 0 },
	/* Lochaber Axe                 */ {  3, 8, 25.0, 1 },
	/* Long Sword                   */ {  2, 5, 13.0, 1 },
	/* Lucerne Hammer               */ {  2, 5, 12.0, 0 },
	/* Mace                         */ {  2, 4, 12.0, 0 },
	/* Mace of Disruption           */ {  5, 8, 40.0, 0 },
	/* Main Gauche                  */ {  1, 5,  3.0, 1 },
	/* Morning Star                 */ {  2, 6, 15.0, 0 },
	/* Orcish Pick                  */ {  1, 3, 15.0, 0 },
	/* Pick                         */ {  1, 3, 15.0, 0 },
	/* Pike                         */ {  2, 5, 16.0, 1 },
	/* Quarterstaff                 */ {  1, 9, 15.0, 0 },
	/* Rapier                       */ {  1, 6,  4.0, 1 },
	/* Sabre                        */ {  1, 7,  5.0, 1 },
	/* Scimitar                     */ {  2, 5, 13.0, 1 },
	/* Scythe                       */ {  5, 3, 25.0, 1 },
	/* Scythe of Slicing            */ {  8, 4, 25.0, 1 },
	/* Short Sword                  */ {  1, 7,  8.0, 1 },
	/* Shovel                       */ {  1, 2,  6.0, 0 },
	/* Small Sword                  */ {  1, 6,  7.5, 1 },
	/* Spear                        */ {  1, 6,  5.0, 1 },
	/* Trident                      */ {  1, 8,  7.0, 1 },
	/* Tulwar                       */ {  2, 4, 10.0, 1 },
	/* Two-Handed Flail             */ {  3, 6, 28.0, 0 },
	/* Two-Handed Sword             */ {  3, 6, 20.0, 1 },
	/* War Hammer                   */ {  3, 3, 12.0, 0 },
	/* Whip                         */ {  1, 6,  3.0, 0 }
};

char *std_names[49] =
{
"Awl-Pike",
"Ball-and-Chain",
"Bastard Sword",
"Battle Axe",
"Beaked Axe",
"Blade of Chaos",
"Broad Axe",
"Broad Sword",
"Broken Dagger",
"Broken Sword",
"Cutlass",
"Dagger",
"Dwarven Pick",
"Dwarven Shovel",
"Executioner's Sword",
"Flail",
"Glaive",
"Gnomish Shovel",
"Great Axe",
"Halberd",
"Katana",
"Lance",
"Lead-Filled Mace",
"Lochaber Axe",
"Long Sword",
"Lucerne Hammer",
"Mace",
"Mace of Disruption",
"Main Gauche",
"Morning Star",
"Orcish Pick",
"Pick",
"Pike",
"Quarterstaff",
"Rapier",
"Sabre",
"Scimitar",
"Scythe",
"Scythe of Slicing",
"Short Sword",
"Shovel",
"Small Sword",
"Spear",
"Trident",
"Tulwar",
"Two-Handed Flail",
"Two-Handed Sword",
"War Hammer",
"Whip"
};

