--====================================================================================
---tilesets.lua
--- Nothing to add except maybe "tileset-summer", winter, definitions if not previously defined

--====================================================================================
---icons.lua
DefineIcon({
  Name = "icon-temple",
  Tileset = "tileset-summer",
  Size = {46, 38},
  Index = 62,
  File = "tilesets/summer/icons.png"})
DefineIcon({
  Name = "icon-temple",
  Tileset = "tileset-winter",
  Size = {46, 38},
  Index = 62,
  File = "tilesets/summer/icons.png"})
DefineIcon({
  Name = "icon-temple",
  Tileset = "tileset-wasteland",
  Size = {46, 38},
  Index = 62,
  File = "tilesets/summer/icons.png"})
DefineIcon({
  Name = "icon-temple",
  Tileset = "tileset-swamp",
  Size = {46, 38},
  Index = 62,
  File = "tilesets/summer/icons.png"})
------------------------------------------------
DefineIcon({
  Name = "icon-spell-thunder",
  Tileset = "tileset-summer",
  Size = {46, 38},
  Index = 0,
  File = "tilesets/summer/unit-medic-spell-healing-icon.png"})
DefineIcon({
  Name = "icon-spell-thunder",
  Tileset = "tileset-winter",
  Size = {46, 38},
  Index = 0,
  File = "tilesets/summer/unit-medic-spell-healing-icon.png"})
DefineIcon({
  Name = "icon-spell-thunder",
  Tileset = "tileset-wasteland",
  Size = {46, 38},
  Index = 0,
  File = "tilesets/summer/unit-medic-spell-healing-icon.png"})
DefineIcon({
  Name = "icon-spell-thunder",
  Tileset = "tileset-swamp",
  Size = {46, 38},
  Index = 0,
  File = "tilesets/summer/unit-medic-spell-healing-icon.png"})
-------------------------------------
--====================================================================================
---sound.lua
---
---MakeSound("sound-unit-sniper", "misc/sound-unit-sniper.wav")
---

--====================================================================================
---missiles.lua
--DefineMissileType("missile-test",
--  { File = "missiles/lightning.png", Size = {32, 32}, Frames = 30, NumDirections = 5,
--  Class = "missile-class-point-to-point-with-hit", Sleep = 1, Speed = 16, Range = 1,
--  DrawLevel = 50 } )

--====================================================================================
---constructions.lua -If necessary
--[[
DefineConstruction("construction-alliance-foundry", {
  Files = {
   {Tileset = "summer",
    File = "red-ants/buildings/foundry_construction_site.png",
    Size = {96, 96}}},
  Constructions = {
   {Percent = 0,
    File = "construction",
    Frame = 0},
   {Percent = 25,
    File = "construction",
    Frame = 1},
   {Percent = 50,
    File = "main",
    Frame = 1}}
})
]]

------------------------------------------------------
---- Healing spell for medic ant (should be different for medic house). Uses the missile-normal-spell atm.
------------------------------------------------------

DefineSpell("spell-thunder",
	"showname", "Healing",
	"manacost", 3,
	"range",  10,
	"target", "unit",
	"action", {	{"spawn-missile", "missile", "missile-normal-spell", "start-point", {"base", "target"} }, 
				{"adjust-vitals", "hit-points", 1}},
	"condition", {
		"organic", "only",
		"building", "false",
		"self", "false",
		"max-hp-percent", 100},
	"sound-when-cast", "polymorph",
	"autocast", {
		"range", 10,
		"condition", {"alliance", "only", "max-hp-percent", 70 }}
)

--====================================================================================
---anim.lua
--[[DefineAnimations("animations-sniper",
  "still", {    -- #5
    { 0, 0,   4,   0}, { 3, 0,   1,   0}},
  "move", { -- #16, P32
    { 0, 3,   2,   0}, { 0, 3,   1,   5}, { 0, 3,   2,   5}, { 0, 2,   1,  10},
    { 0, 3,   1,  10}, { 0, 2,   1,   0}, { 0, 3,   2,   0}, { 0, 3,   1,  15},
    { 0, 3,   2,  15}, { 0, 2,   1,  20}, { 0, 3,   1,  20}, { 3, 2,   1,   0}},
  "attack", {   -- #25
    { 0, 0,   75,  25}, {12, 0,   3,  40},
    { 0, 0,  50,   0}, { 3, 0,   1,   0}},
  "die", {  -- #107
    { 0, 0,   3,  45}, { 0, 0,   3,  50}, { 0, 0, 100,  55}, { 3, 0,   1,  55}})
]]
--====================================================================================
---units.lua
DefineUnitType("unit-temple", { Name = "Temple",
 Files = {"tileset-summer",  "tilesets/summer/red-ants/buildings/temple.png"},
  Size = {128, 128},
---  Shadow = {"file", "tilesets/summer/red-ants/buildings/shadow_missile-house.png", "size", {96, 96}, "offset", {0, 0}},
  Animations = "animations-building", Icon = "icon-temple",
  Costs = {"time", 150, "sugar", 1500, "wood", 1000},
  Construction = "construction-land",
  Speed = 0,
  HitPoints = 500,
 MaxMana = 255,
  TileSize = {4, 4}, BoxSize = {127, 127},
  DrawLevel = 40, SightRange = 1,
  Armor = 20, BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 15, AnnoyComputerFactor = 20,
  Points = 230,
  Corpse = {"unit-destroyed-3x3-place", 0},
  ExplodeWhenKilled = "missile-explosion",
  Type = "land",
  Building = true, VisibleUnderFog = true, 
  BurnPercent = 25, BurnDamageRate = 1,
  BuilderOutside = true,
  RepairHp = 4,
  RepairCosts = {"sugar", 1, "wood", 1},
  CanCastSpell = {"spell-thunder"},
  AutoCastActive = {"spell-thunder"},
  Sounds = {
    "selected", "inventor-selected",
    "acknowledge", "inventor-acknowledge",
    "ready", "inventor-ready",
    "help", "basic alliance voices help 2",
    "dead", "building destroyed",
    "attack", "inventor-attack"} } )


--====================================================================================
---upgrade.lua
---DefineUpgrade("upgrade-worker1", "icon", "icon-harvest",
--  "costs", {   200,   1000,   500,     0,     0,     0,     0})
---DefineModifier("upgrade-sword1",
--  {"piercing-damage", 2},
--  {"apply-to", "unit-warrior"}, {"apply-to", "unit-knight"}, {"apply-to", "unit-advanced-knight"},
--  {"apply-to", "unit-dynamite-ant"},
--  {"apply-to", "unit-knight-rider"})
DefineAllow("unit-temple",              "FFFFFFFFFFFFFFFF")
DefineDependency("unit-temple",                 {"unit-queen-fortress"})

--====================================================================================
---fonts.lua
-- Nothing to add

--====================================================================================
---buttons.lua

DefineButton( { Pos = 3, Level = 3, Icon = "icon-temple",
  Action = "build", Value = "unit-temple",
  Key = "t", Hint = "BUILD ~!TEMPLE",
  ForUnit = {"unit-worker", "unit-worker1"} } )


--TODO: add thunder button

---ui.lua
-- Nothing to add

---ai.lua
-- Complex to add

---campaigns.lua
-- Complex to add

---credits.lua
-- Nothing to add

---tips.lua
-- Nothing to add

---ranks.lua
-- Nothing to add

---menus.lua
-- Nothing to add

---cheats.lua
-- Nothing to add
