--__________         __    __  .__           ___________
--\______   \_____ _/  |__/  |_|  |   ____   \_   _____/__________
-- |    |  _/\__  \\   __\   __\  | _/ __ \   |    __)/  _ \_  __ \
-- |    |   \ / __ \|  |  |  | |  |_\  ___/   |     \(  <_> )  | \/
-- |______  /(____  /__|  |__| |____/\___  >  \___  / \____/|__|
--        \/      \/                     \/       \/
--   _____                     .___.__
--  /     \ _____    ____    __| _/|__| ____  ___________
-- /  \ /  \\__  \  /    \  / __ | |  |/ ___\/  _ \_  __ \
--/    Y    \/ __ \|   |  \/ /_/ | |  \  \__(  <_> )  | \/
--\____|__  (____  /___|  /\____ | |__|\___  >____/|__|
--        \/     \/     \/      \/         \/

--      upgrade.lua - Upgrades and researchs for darkness
--
--      (c) Copyright 2005 by Kimmo Merikivi
--
--      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

---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------

DefineUpgrade("upgrade-darkness-swords", "icon", "icon-darkness-swords",
	"costs", {   100,   450,     0,     0,     0,     0,     0})
DefineUpgrade("upgrade-darkness-level2", "icon", "icon-darkness-level2",
	"costs", {   500,   2500,     1500,     0,     0,     0,     0})
DefineUpgrade("upgrade-darkness-better-swords", "icon", "icon-darkness-better-swords",
	"costs", {   400,   2000,     0,     0,     0,     0,     0})
DefineUpgrade("upgrade-darkness-better-shields", "icon", "icon-darkness-better-shields",
	"costs", {   500,   1500,     1000,     0,     0,     0,     0})
DefineUpgrade("upgrade-darkness-better-helmets", "icon", "icon-darkness-better-helmets",
	"costs", {   500,   2000,     500,     0,     0,     0,     0})
DefineUpgrade("upgrade-darkness-bows", "icon", "icon-darkness-bows",
	"costs", {   200,   1500,     500,     0,     0,     0,     0})
DefineUpgrade("upgrade-darkness-spears", "icon", "icon-darkness-spears",
	"costs", {   200,   2500,     750,     0,     0,     0,     0})
DefineUpgrade("upgrade-darkness-level3", "icon", "icon-darkness-level3",
	"costs", {   600,   4000,     2000,     0,     0,     0,     0})

DefineModifier("upgrade-darkness-better-swords",
	{"piercing-damage", 2},
	{"apply-to", "unit-darkness-warrior"},
	{"apply-to", "unit-darkness-big-goblin"})
DefineModifier("upgrade-darkness-better-shields",
	{"armor", 2},
	{"apply-to", "unit-darkness-warrior"},
	{"apply-to", "unit-darkness-big-goblin"},
	{"apply-to", "unit-darkness-spearman"})
DefineModifier("upgrade-darkness-better-helmets",
	{"armor", 1},
	{"apply-to", "unit-darkness-warrior"},
	{"apply-to", "unit-darkness-big-goblin"},
	{"apply-to", "unit-darkness-spearman"},
	{"apply-to", "unit-darkness-bowman"})

DefineAllow("unit-darkness-worker",			"AAAAAAAAAAAAAAAA")
DefineAllow("unit-darkness-camp",			"AAAAAAAAAAAAAAAA")
DefineAllow("unit-darkness-warrior",			"AAAAAAAAAAAAAAAA")
DefineAllow("unit-darkness-farm",			"AAAAAAAAAAAAAAAA")
DefineAllow("unit-darkness-garrison",			"AAAAAAAAAAAAAAAA")
DefineAllow("unit-darkness-blacksmith",			"AAAAAAAAAAAAAAAA")
DefineAllow("unit-darkness-bowman",			"AAAAAAAAAAAAAAAA")
DefineAllow("unit-darkness-spearman",			"AAAAAAAAAAAAAAAA")
DefineAllow("unit-wolf",				"AAAAAAAAAAAAAAAA")
DefineAllow("unit-darkness-lumber-storage",		"AAAAAAAAAAAAAAAA")
DefineAllow("upgrade-darkness-swords",			"AAAAAAAAAAAAAAAA")
DefineAllow("upgrade-darkness-level2",			"AAAAAAAAAAAAAAAA")
DefineAllow("upgrade-darkness-better-swords",		"AAAAAAAAAAAAAAAA")
DefineAllow("upgrade-darkness-better-shields",		"AAAAAAAAAAAAAAAA")
DefineAllow("upgrade-darkness-better-helmets",		"AAAAAAAAAAAAAAAA")
DefineAllow("upgrade-darkness-bows",			"AAAAAAAAAAAAAAAA")
DefineAllow("upgrade-darkness-spears",			"AAAAAAAAAAAAAAAA")
DefineAllow("upgrade-darkness-level3",			"AAAAAAAAAAAAAAAA")
DefineAllow("unit-nasty-wolf",				"AAAAAAAAAAAAAAAA")
DefineAllow("unit-goblin",				"AAAAAAAAAAAAAAAA")
DefineAllow("unit-goblin-guard",			"AAAAAAAAAAAAAAAA")
DefineAllow("unit-goblin-bowman-guard",			"AAAAAAAAAAAAAAAA")
DefineAllow("unit-goblin-spearman-guard",		"AAAAAAAAAAAAAAAA")
DefineAllow("unit-darkness-big-goblin",			"AAAAAAAAAAAAAAAA")

DefineDependency("upgrade-darkness-level2",
	{"unit-darkness-camp", "unit-darkness-farm", "unit-darkness-garrison", "unit-darkness-blacksmith",
	"upgrade-darkness-bows", "upgrade-darkness-swords"})
DefineDependency("upgrade-darkness-better-swords",
	{"upgrade-darkness-level2"})
DefineDependency("unit-darkness-warrior",
	{"upgrade-darkness-swords"})
DefineDependency("unit-darkness-bowman",
	{"upgrade-darkness-bows"})
DefineDependency("unit-darkness-bows",
	{"upgrade-darkness-level2"})
DefineDependency("upgrade-darkness-better-shields",
	{"upgrade-darkness-level2"})
DefineDependency("upgrade-darkness-better-helmets",
	{"upgrade-darkness-level2"})
DefineDependency("upgrade-darkness-spears",
	{"upgrade-darkness-level2"})
DefineDependency("unit-wolf",
	{"upgrade-darkness-level2"})
DefineDependency("unit-darkness-lumber-storage",
	{"upgrade-darkness-level2"})
DefineDependency("unit-darkness-spearman",
	{"upgrade-darkness-spears"})
DefineDependency("upgrade-darkness-level3",
	{"upgrade-darkness-level2", "unit-darkness-lumber-storage", "upgrade-darkness-better-helmets",
	"upgrade-darkness-better-swords", "upgrade-darkness-spears"})
DefineDependency("unit-darkness-big-goblin",
	 {"upgrade-darkness-level3"})