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

--====================================================================================
---icons.lua
DefineIcon({
  Name = "icon-missile-house",
  Tileset = "tileset-summer",
  Size = {46, 38},
  Index = 39,
  File = "tilesets/summer/icons.png"})
DefineIcon({
  Name = "icon-missile-house",
  Tileset = "tileset-winter",
  Size = {46, 38},
  Index = 39,
  File = "tilesets/summer/icons.png"})
DefineIcon({
  Name = "icon-missile-house",
  Tileset = "tileset-wasteland",
  Size = {46, 38},
  Index = 39,
  File = "tilesets/summer/icons.png"})
DefineIcon({
  Name = "icon-missile-house",
  Tileset = "tileset-swamp",
  Size = {46, 38},
  Index = 39,
  File = "tilesets/summer/icons.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}}
})
]]

--====================================================================================
---spells.lua -- FOR BUILDING? USE AUTOCAST
--[[
DefineUnitType("unit-hole", {})
DefineSpell("spell-spawn-tunnel-exit",
    "showname", "Spawn tunnel exit.",
    "manacost", 0,
    "range", "infinite",
    "target", "position",
    "action", {{"spawn-portal", "portal-type", "unit-hole"}},
    "condition", {}
--  "sound-when-cast", "circle of power",
--  "missile-when-cast", "missile-normal-spell"
)
]]

--====================================================================================
---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-missile-house", { Name = "Missile House",
 Files = {"tileset-summer",  "tilesets/summer/red-ants/buildings/unit-missile-house.png"},
  Size = {96, 96},
  Shadow = {"file", "tilesets/summer/red-ants/buildings/shadow_missile-house.png", "size", {96, 96}, "offset", {0, 0}},
  Animations = "animations-building", Icon = "icon-missile-house",
  Costs = {"time", 75, "sugar", 1000, "wood", 700},
  Construction = "construction-land",
  Speed = 0,
  HitPoints = 500,
  TileSize = {3, 3}, BoxSize = {95, 95},
  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},
  Sounds = {
    "selected", "missile-house-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-missile-house",              "FFFFFFFFFFFFFFFF")
DefineDependency("unit-missile-house",                 {"unit-queen-fortress"})

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

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

DefineButton( { Pos = 1, Level = 3, Icon = "icon-missile-house",
  Action = "build", Value = "unit-missile-house",
  Key = "m", Hint = "BUILD ~!MISSILE HOUSE",
  ForUnit = {"unit-worker", "unit-worker1"} } )

---ui.lua
-- Nothing to add

---ai.lua
DefineAiHelper(
{"build", "unit-worker","unit-missile-house"},
{"build", "unit-worker1","unit-missile-house"}
--{"train", "unit-missile-house", "unit-sniper"}
--{"upgrade", "unit-queen", "unit-queen-castle"},
--{"research", "unit-blacksmith",  "upgrade-sword1",
--{"repair", "unit-worker",
--{"unit-equiv", "unit-knight",  "unit-advanced-knight"},
)


unit = { 
UnitName = "unit-missile-house",
UnitPriority = 110,
UnitAIType = "AiEliteBarracks",
UnitType = "building",
Level = 3,
Dependency = {"unit-queen-fortress"},
ShouldRushToThisUnit= "false"
}
table.insert(UnitsAI,unit)

---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
