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

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

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

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


--====================================================================================
---anim.lua
DefineAnimations("animations-medic-ant",
  "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, 3,   1,  10},
    	{ 0, 3,   1,  10}, 
	{ 0, 3,   1,   0}, 
	{ 0, 3,   1,   0}, 
	{ 0, 3,   1,  5},
    	{ 0, 3,   1,  5}, 
	{ 3, 3,   1,   0}},
  "attack", {   -- #25
    { 0, 0,   3,  0}, { 0, 0,   3,  0}, { 0, 0,   3,  15},
    { 0, 0,   3,  15},{ 0, 0,   3,  0},{ 0, 0,   3,  0},{ 12, 0,   3,  20}, { 3, 0,   1,   20}},
  "die", {  -- #107
    { 0, 0,   3,  25}, { 0, 0,   3,  30}, { 0, 0, 10,  35}, { 3, 0,   1,  35}})

--====================================================================================
---units.lua
DefineUnitType("unit-medic-ant", { Name = "MEDIC ANT",
  Files = {"tileset-summer", "red-ants/units/unit-medic-ant.png"},
  Size = {72, 72},
  Animations = "animations-medic-ant", Icon = "icon-unit-medic-ant",
  Costs = {"time", 60, "sugar", 1000, "wood", 500},
  Speed = 10,
  HitPoints = 70,
  DrawLevel = 40,
  TileSize = {1, 1}, BoxSize = {31, 31},
  SightRange = 9, ComputerReactionRange = 9, PersonReactionRange = 9,
  Armor = 2, BasicDamage = 1, PiercingDamage = 0, Missile = "missile-none",
  MaxAttackRange = 10,
  Priority = 60,
  Points = 50,
  Demand = 1,
  MaxMana = 255,
  Corpse = {"unit-dead-body", 6},
  Type = "land",
  RightMouseAction = "attack",
  CanAttack = true,
  CanTargetLand = true,
  LandUnit = true,
  Coward = true,
  organic = true,
 --RightMouseAction = "attack", --"spell-cast",
 CanCastSpell = {"spell-healing"},
  --CanTargetFlag = {"organic", "only"},
  SelectableByRectangle = true,
 AutoCastActive = {"spell-healing"},
  Sounds = {
    "selected", "red-ant-worker-selected",
    "acknowledge", "red-ant-worker-acknowledge",
    "ready", "red-ant-worker-ready",
    "help", "basic alliance voices help 1",
    "dead", "basic alliance voices dead",
    "attack", "sound-unit-sniper"} } )

--====================================================================================
---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-medic-ant",              	"FFFFFFFFFFFFFFFF")
DefineDependency("unit-medic-ant",            {"unit-medic-house"})

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

--====================================================================================
---buttons.lua
--[[ DefineButton( {Pos = 3, Level = 0, Icon = "icon-unit-test",
  Action = "move",
  Key = "m", Hint = "~!MOVE",
  ForUnit = {"unit-warrior", "unit-knight", "unit-archer", "unit-advanced-knight",
    "unit-dynamite-ant", "unit-advanced-archer", "unit-tank", "unit-worker",
    "unit-female-hero",
    "unit-flying-angle", "unit-advanced-witch", "unit-flying-ant",
    "unit-dragonfly", "unit-witch", "unit-ladybug",
    "red-ants-group"} } )
]]
DefineButton( { Pos = 1, Level = 0, Icon = "icon-unit-medic-ant",
  Action = "train-unit", Value = "unit-medic-ant",
  Key = "m", Hint = "TRAIN ~!MEDIC ANT",
  ForUnit = {"unit-medic-house"} } )


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

DefineButton( { Pos = 2, Level = 0, Icon = "icon-shield1",
  Action = "stop",
  Key = "s", Hint = "~!STOP",
  ForUnit = {"unit-medic-ant"} } )
 

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

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

DefineButton( { Pos = 8, Level = 0, Icon = "icon-spell-healing",
  Action = "cast-spell", Value = "spell-healing",
  Allowed = "check-true", 
  Key = "h", Hint = "~!HEAL",
  ForUnit = {"unit-medic-ant"} } )

---ui.lua
-- Nothing to add


if GetUnitTypeIdent("unit-medic-house") ~= "unit not defined" then 

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


unit = { 
UnitName = "unit-medic-ant",
UnitPriority = 110,
UnitAIType = "AiHealer",
UnitType = "unit",
Level = 3,
Dependency = {"unit-medic-house"},
ShouldRushToThisUnit= "false"
}
table.insert(UnitsAI,unit)

end

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