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

--====================================================================================
---icons.lua
DefineIcon({
  Name = "icon-unit-beetle",
  Tileset = "tileset-summer",
  Size = {46, 38},
  Index = 0,
  File = "tilesets/summer/beetle_icon.png"})
DefineIcon({
  Name = "icon-unit-beetle",
  Tileset = "tileset-winter",
  Size = {46, 38},
  Index = 0,
  File = "tilesets/summer/beetle_icon.png"})
DefineIcon({
  Name = "icon-unit-beetle",
  Tileset = "tileset-wasteland",
  Size = {46, 38},
  Index = 0,
  File = "tilesets/summer/beetle_icon.png"})
DefineIcon({
  Name = "icon-unit-beetle",
  Tileset = "tileset-swamp",
  Size = {46, 38},
  Index = 0,
  File = "tilesets/summer/beetle_icon.png"})


--====================================================================================
---anim.lua
DefineAnimations("animations-beetle",
  "still", {    -- #24
    { 2, 0,   10,   0}, { 2, 0,   10,   0}, { 3, 0,   10,  0}},
  "move", { -- #12, 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,  5},
    { 0, 3,   2,  5}, { 0, 2,   1,  10}, { 0, 3,   1,  10}, { 3, 2,   1,   0}},
  "attack", {   -- #1
    {2, 0, 10,   15},{12, 0, 10,   20}, 
	{2, 0, 10,   15},{2, 0, 10,   20},{ 3, 0,   1,   15}},
  "die", {  -- #31
    { 0, 0,   1,  0}, { 3, 0,   1,  0}})
--====================================================================================
---units.lua
DefineUnitType("unit-beetle", { Name = "Beetle",
  Files = {"tileset-summer", "red-ants/units/beetle.png"},
  Size = {96, 96},
  -- Shadow = {"file", "red-ants/units/helicopter.png", "size", {80, 88}, "offset", {0, 40}},
  Animations = "animations-beetle", Icon = "icon-unit-beetle",
  Costs = {"time", 100, "sugar", 750, "wood", 350},
  Speed = 14,
  HitPoints = 175,
  TileSize = {1, 1}, BoxSize = {63, 63},
  DrawLevel = 40, SightRange = 5, ComputerReactionRange = 8, PersonReactionRange = 7,
  Armor = 6, BasicDamage = 5, PiercingDamage = 10, Missile = "missile-none",
  MaxAttackRange = 1,
  Priority = 65,
  Points = 125,
  Demand = 1,
  ExplodeWhenKilled = "missile-explosion",
  Type = "land",
  RightMouseAction = "attack",
  CanAttack = true,
  CanTargetLand = true, 
  LandUnit = true,
  organic = true,
  SelectableByRectangle = true,
  Sounds = {
    "selected", "footman-selected",
    "acknowledge", "footman-acknowledge",
    "ready", "footman-ready",
    "help", "basic alliance voices help 1",
    "dead", "basic alliance voices dead",
    "attack", "footman-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-beetle",              "FFFFFFFFFFFFFFFF")
DefineDependency("unit-beetle",                 {"unit-queen-fortress"})

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

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


DefineButton( { Pos = 3, Level = 0, Icon = "icon-unit-beetle",
  Action = "train-unit", Value = "unit-beetle",
  Key = "b", Hint = "TRAIN ~!BEETLE (needs Queen Fortress)",
  ForUnit = {"unit-insect-house"} } )

DefineButton( {Pos = 1, Level = 0, Icon = "icon-move-red-ant-worker",
  Action = "move",
  Key = "m", Hint = "~!MOVE",
  ForUnit = {"unit-beetle"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-shield1",
  Action = "stop",
  Key = "s", Hint = "~!STOP",
  ForUnit = {"unit-beetle"} } )
  
DefineButton( { Pos = 3, Level = 0, Icon = "icon-sword1",
  Action = "attack",
  Key = "a", Hint = "~!ATTACK",
ForUnit = {"unit-beetle"} } )

DefineButton( { Pos = 4, Level = 0, Icon = "icon-patrol-land",
  Action = "patrol",
  Key = "p", Hint = "~!PATROL",
  ForUnit = {"unit-beetle"} } )

DefineButton( { Pos = 5, Level = 0, Icon = "icon-stand-ground",
  Action = "stand-ground",
  Key = "t", Hint = "S~!TAND GROUND",
  ForUnit = {"unit-beetle"} } )



---ui.lua
-- Nothing to add

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

--unit-name = {priority(0,500) ,type(AISoldier, AIShooter, AICavalry, AITanks, etc), level(1,2,3),{Dependency(unit-barracks, unit-blacksmith,unit-castle, etc)}}

unit = { 
UnitName = "unit-beetle",
UnitPriority = 120,
UnitAIType = "AiCavalry",
UnitType = "unit",
Level = 3,
Dependency = {"unit-insect-house","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
