--       _________ __                 __                               
--      /   _____//  |_____________ _/  |______     ____  __ __  ______
--      \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
--      /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \ 
--     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
--             \/                  \/          \//_____/            \/ 
--  ______________________                           ______________________
--            T H E   W A R   B E G I N S
--     Stratagus - A free fantasy real time strategy game engine
--
--  units.ccl   -   Define the used unit-types.
--
--  (c) Copyright 1998,2000-2004 by Jim Salmon and Mohydine
--
--      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
--
--  $Id: units.lua,v 1.21 2004/05/10 12:30:29 mohydine Exp $

-- Load the animations for the units.
Load("scripts/anim.lua")

--=============================================================================
--  Define unit-types.
--
--  NOTE: Save can generate this table.
--
DefineUnitType("unit-nothing-22", { Name = "Nothing 22",
  Files = {},
  Size = {0, 0},
  Animations = "animations-building", Icon = "icon-cancel",
  Speed = 99,
  HitPoints = 10,
  DrawLevel = 0,
  TileSize = {0, 0}, BoxSize = {0, 0},
  SightRange = 0,
  BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Type = "land",
  Sounds = {} } )

DefineUnitType("unit-nothing-24", { Name = "Nothing 24",
  Files = {},
  Size = {32, 32},
  Animations = "animations-building", Icon = "icon-cancel",
  Costs = {"time", 60, "sugar", 400},
  Speed = 99,
  HitPoints = 60,
  TileSize = {1, 1}, BoxSize = {63, 63},
  SightRange = 4, ComputerReactionRange = 20, PersonReactionRange = 10,
  Armor = 2, BasicDamage = 9, PiercingDamage = 1, Missile = "missile-none",
  MaxAttackRange = 1,
  Priority = 40,
  Type = "naval",
  SeaUnit = true,
  SelectableByRectangle = true,
  Sounds = {} } )

DefineUnitType("unit-deco-Rock1", { Name = "Rock 1",
  Files = {"tileset-summer", "neutral/buildings/rock.png"},
  Size = {128, 128},
  Animations = "animations-building", Icon = "icon-blank78",
  Costs = {"time", 150},
  Construction = "construction-land",
  Speed = 0,
  HitPoints = 25500,
  TileSize = {2, 2}, BoxSize = {95, 95},
  SightRange = 3,
  Armor = 20, BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Corpse = {"unit-destroyed-3x3-place", 0},
  ExplodeWhenKilled = "missile-explosion",
  Type = "land",
  Building = true, VisibleUnderFog = true,
  Sounds = {} } )



DefineUnitType("unit-deco-cactus1", { Name = "Cactus",
  Files = {"tileset-summer", "neutral/buildings/cactus1.png",
		"tileset-winter", "neutral/buildings/cactus1winter.png",
		"tileset-wasteland", "neutral/buildings/cactus1.png"},
  Size = {128, 128},
  Shadow = {"file", "neutral/buildings/shadow_cactus1.png", "size", {128, 128}, "offset", {0, 0}},
  Animations = "animations-building", Icon = "icon-blank92",
  NeutralMinimapColor = {36, 175, 92},
  --Decoration = true,
  Costs = {"time", 150},
  Construction = "construction-land",
  Speed = 0,
  HitPoints = 5000,
  TileSize = {2, 2}, BoxSize = {128, 128},
  SightRange = 3,
  DrawLevel = 40,
  Armor = 20, BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Corpse = {"unit-destroyed-2x2-place", 0},
GivesResource = "wood", CanHarvest = true,
  ExplodeWhenKilled = "missile-explosion",
  Type = "land",
  Building = true, VisibleUnderFog = true,
  Sounds = {} } )


DefineUnitType("unit-deco-cactus2", { Name = "Cactus",
    Files = {"tileset-summer", "neutral/buildings/cactus2.png",
		"tileset-winter", "neutral/buildings/cactus2winter.png",
		"tileset-wasteland", "neutral/buildings/cactus2.png"},
  Size = {128, 128},
  Shadow = {"file", "neutral/buildings/shadow_cactus2.png", "size", {128, 128}, "offset", {0, 0}},
  Animations = "animations-building", Icon = "icon-blank93",
  NeutralMinimapColor = {36, 175, 92},
  --Decoration = true,
  Costs = {"time", 150},
  Construction = "construction-land",
  Speed = 0,
  HitPoints = 5000,
  TileSize = {2, 2}, BoxSize = {128, 128},
  SightRange = 3,
  DrawLevel = 40,
  Armor = 20, BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Corpse = {"unit-destroyed-2x2-place", 0},
  ExplodeWhenKilled = "missile-explosion",
GivesResource = "wood", CanHarvest = true,
  Type = "land",
  Building = true, VisibleUnderFog = true,
  Sounds = {} } )

DefineUnitType("unit-deco-cactus3", { Name = "Cactus",
    Files = {"tileset-summer", "neutral/buildings/cactus3.png",
		"tileset-winter", "neutral/buildings/cactus3winter.png",
		"tileset-wasteland", "neutral/buildings/cactus3.png"},
  Size = {128, 128},
  Shadow = {"file", "neutral/buildings/shadow_cactus3.png", "size", {128, 128}, "offset", {0, 0}},
  Animations = "animations-building", Icon = "icon-blank94",
  NeutralMinimapColor = {36, 175, 92},
  --Decoration = true,
  Costs = {"time", 150},
  Construction = "construction-land",
  Speed = 0,
  HitPoints = 5000,
  TileSize = {2, 2}, BoxSize = {128, 128},
  SightRange = 3,
  DrawLevel = 40,
  Armor = 20, BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Corpse = {"unit-destroyed-2x2-place", 0},
  ExplodeWhenKilled = "missile-explosion",
GivesResource = "wood", CanHarvest = true,
  Type = "land",
  Building = true, VisibleUnderFog = true,
  Sounds = {} } )



DefineUnitType("unit-deco-Plant1", { Name = "Plant 1",
  Files = {"tileset-summer", "neutral/buildings/plant_leaf.png"},
  Size = {128, 128},
  Animations = "animations-building", Icon = "icon-blank76",
  NeutralMinimapColor = {36, 175, 92},
  Costs = {"time", 150},
  Construction = "construction-land",
  Speed = 0,
  HitPoints = 10,
  TileSize = {2, 2}, BoxSize = {95, 95},
  SightRange = 3,
  Armor = 20, BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Corpse = {"unit-destroyed-2x2-place", 0},
  ExplodeWhenKilled = "missile-explosion",
  Type = "land",
  Building = true, VisibleUnderFog = true,
  Sounds = {} } )



DefineUnitType("unit-daemon", { Name = "Daemon",
  Files = {"tileset-summer", "neutral/units/daemon.png"},
  Size = {72, 72},
  Animations = "animations-daemon", Icon = "icon-blank20",
  Costs = {"time", 70, "sugar", 500, "plancton", 50},
  Speed = 14,
  HitPoints = 60,
  TileSize = {1, 1}, BoxSize = {31, 31},
  SightRange = 5, ComputerReactionRange = 7, PersonReactionRange = 5,
  Armor = 3, BasicDamage = 10, PiercingDamage = 2, Missile = "missile-daemon-fire",
  MaxAttackRange = 3,
  Priority = 63,
  Points = 100,
  Demand = 1,
  Type = "fly",
  RightMouseAction = "attack",
  CanAttack = true,
  CanTargetLand = true, CanTargetSea = true, CanTargetAir = true,
  AirUnit = true,
  DetectCloak = true,
  organic = true,
  SelectableByRectangle = true,
  Sounds = {
    "selected", "daemon-selected",
    "acknowledge", "daemon-acknowledge",
    "ready", "daemon-ready",
    "help", "basic orc voices help 1",
    "dead", "basic orc voices dead",
    "attack", "daemon-attack"} } )

DefineUnitType("unit-ladybug", { Name = "Critter",
  Files = {"tileset-summer", "tilesets/summer/neutral/units/critter.png"},
  Size = {32, 32},
  Animations = "animations-ladybug", Icon = "icon-ladybug",
  NeutralMinimapColor = {192, 192, 192},
  Speed = 3,
  HitPoints = 5,
  TileSize = {1, 1}, BoxSize = {31, 31},
  SightRange = 2, ComputerReactionRange = 20, PersonReactionRange = 10,
  BasicDamage = 80, PiercingDamage = 0, Missile = "missile-critter-explosion",
  MaxAttackRange = 1,
  Priority = 37,
  Points = 1,
  Demand = 1,
  Type = "land",
  RightMouseAction = "move",
  CanTargetLand = true,
  LandUnit = true,
  RandomMovementProbability = 100,
  ClicksToExplode = 10,
  organic = true,
  Sounds = {
    "selected", "critter-selected",
    "acknowledge", "critter-acknowledge",
    "ready", "critter-ready",
    "help", "critter-help",
    "dead", "critter-dead",
    "attack", "critter-attack"} } )

DefineUnitType("unit-sugar-mine", { Name = "Sugar Mine",
  Files = {"tileset-summer", "tilesets/summer/neutral/buildings/gold_mine.png"},
  Size = {96, 96},
  Animations = "animations-building", Icon = "icon-sugar-mine",
  NeutralMinimapColor = {0, 255, 255},
  Costs = {"time", 150},
  Construction = "construction-land2",
  Speed = 0,
  HitPoints = 25500,
  DrawLevel = 40,
  TileSize = {3, 3}, BoxSize = {95, 95},
  SightRange = 1,
  Armor = 20, BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Corpse = {"unit-destroyed-3x3-place", 0},
  ExplodeWhenKilled = "missile-explosion",
  Type = "land",
  Building = true, VisibleUnderFog = true,
  GivesResource = "sugar", CanHarvest = true,
  Sounds = {
    "selected", "gold-mine-selected",
    "acknowledge", "gold-mine-acknowledge",
    "ready", "gold-mine-ready",
    "help", "gold-mine-help",
    "dead", "building destroyed",
    "attack", "gold-mine-attack"} } )

DefineUnitType("unit-plancton-patch", { Name = "Planton Patch",
  Files = {"tileset-summer", "tilesets/summer/neutral/buildings/oil_patch.png"},
  Size = {96, 96},
  Animations = "animations-building", Icon = "icon-plancton-patch",
  NeutralMinimapColor = {0, 140, 0},
  Speed = 0,
  HitPoints = 0,
  TileSize = {3, 3}, BoxSize = {95, 95},
  SightRange = 0,
  BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Type = "naval",
  Building = true, VisibleUnderFog = true,
  GivesResource = "plancton",
  Sounds = {
    "selected", "oil-patch-selected",
    "acknowledge", "oil-patch-acknowledge",
    "ready", "oil-patch-ready",
    "help", "oil-patch-help",
    "dead", "building destroyed",
    "attack", "oil-patch-attack"} } )

  DefineUnitType("unit-hole", { Name = "Tunnel Hole",
  Files = {"tileset-summer", "neutral/buildings/circle_of_power.png"},
  Size = {64, 64},
  Animations = "animations-building", Icon = "icon-hole",
--Costs = {"sugar", 500},
  Speed = 0,
  HitPoints = 0,
  TileSize = {2, 2}, BoxSize = {63, 63},
  SightRange = 0,
  BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Corpse = {"unit-destroyed-2x2-place", 0},
  ExplodeWhenKilled = "missile-explosion",
  Type = "land",
  Building = true, VisibleUnderFog = true,
  Sounds = {
    "selected", "circle-of-power-selected",
    "acknowledge", "circle-of-power-acknowledge",
    "ready", "circle-of-power-ready",
    "help", "basic human voices help 2",
    "dead", "building destroyed",
    "attack", "circle-of-power-attack"} } )

DefineUnitType("unit-tunnel", { Name = "Tunnel Entry",
  Files = {"tileset-summer", "tilesets/summer/neutral/buildings/dark_portal.png"},
  Size = {128, 128},
  Animations = "animations-building", Icon = "icon-tunnel",
  Costs = {"time", 100, "sugar", 3000},
  RepairHp = 4,
  RepairCosts = {"sugar", 1, "wood", 1, "plancton", 1},
  Construction = "construction-land2",
  Speed = 0,
  HitPoints = 500,
  MaxMana = 255,
  TileSize = {4, 4}, BoxSize = {127, 127},
  SightRange = 10,
  BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 70,
  Corpse = {"unit-destroyed-4x4-place", 0},
  ExplodeWhenKilled = "missile-explosion",
  Type = "land",
  CanCastSpell = {"spell-spawn-tunnel-exit"},
  Building = true, VisibleUnderFog = true,
  Teleporter = true,
  Sounds = {
    "selected", "dark-portal-selected",
    "acknowledge", "dark-portal-acknowledge",
    "ready", "dark-portal-ready",
    "help", "basic orc voices help 2",
    "dead", "building destroyed",
    "attack", "dark-portal-attack"} } )



DefineUnitType("unit-runestone", { Name = "Runestone",
  Files = {"tileset-summer", "neutral/buildings/runestone.png"},
  Size = {64, 64},
  Animations = "animations-building", Icon = "icon-blank39",
  Costs = {"time", 175, "sugar", 900, "sugar", 500},
  RepairHp = 4,
  RepairCosts = {"sugar", 1, "wood", 1},
  Construction = "construction-land2",
  Speed = 0,
  HitPoints = 5000,
  MaxMana = 255,
  TileSize = {2, 2}, BoxSize = {63, 63},
  SightRange = 4,
  Armor = 20, BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 15, AnnoyComputerFactor = 35,
  Points = 150,
  Corpse = {"unit-destroyed-2x2-place", 0},
  ExplodeWhenKilled = "missile-explosion",
  Type = "land",
  Building = true, VisibleUnderFog = true,
  Sounds = {
    "selected", "runestone-selected",
    "acknowledge", "runestone-acknowledge",
    "ready", "runestone-ready",
    "help", "basic orc voices help 2",
    "dead", "building destroyed",
    "attack", "runestone-attack"} } )

DefineUnitType("unit-dead-body", { Name = "Dead Body",
  Files = {"tileset-summer", "neutral/units/corpses.png"},
  Size = {72, 72},
  Animations = "animations-dead-body", Icon = "icon-red-ant-worker",
  Speed = 0,
  HitPoints = 255,
  TileSize = {1, 1}, BoxSize = {31, 31},
  SightRange = 1,
  BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Type = "land",
  Vanishes = true,
  Sounds = {} } )

DefineUnitType("unit-destroyed-1x1-place", { Name = "Destroyed 1x1 Place",
  Files = {
    "tileset-summer", "tilesets/summer/neutral/buildings/small_destroyed_site.png"},
  Size = {32, 32},
  Animations = "animations-destroyed-place", Icon = "icon-red-ant-worker",
  Speed = 0,
  HitPoints = 255,
  TileSize = {1, 1}, BoxSize = {31, 31},
  SightRange = 2,
  BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Type = "land",
  Building = true, VisibleUnderFog = true,
  Vanishes = true,
  Sounds = {} } )

DefineUnitType("unit-destroyed-2x2-place", { Name = "Destroyed 2x2 Place",
  Files = {"tileset-summer", "tilesets/summer/neutral/buildings/destroyed_site.png"},
  Size = {64, 64},
  Animations = "animations-destroyed-place", Icon = "icon-red-ant-worker",
  Speed = 0,
  HitPoints = 255,
  TileSize = {2, 2}, BoxSize = {63, 63},
  SightRange = 2,
  BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Type = "land",
  Building = true, VisibleUnderFog = true,
  Vanishes = true,
  Sounds = {} } )

DefineUnitType("unit-destroyed-3x3-place", { Name = "Destroyed 3x3 Place",
  Use = "unit-destroyed-2x2-place",
  Size = {96, 96},
  Animations = "animations-destroyed-place", Icon = "icon-red-ant-worker",
  Speed = 0,
  HitPoints = 255,
  TileSize = {3, 3}, BoxSize = {95, 95},
  SightRange = 3,
  BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Type = "land",
  Building = true, VisibleUnderFog = true,
  Vanishes = true,
  Sounds = {} } )

DefineUnitType("unit-destroyed-4x4-place", { Name = "Destroyed 4x4 Place",
  Use = "unit-destroyed-2x2-place",
  Size = {128, 128},
  Animations = "animations-destroyed-place", Icon = "icon-red-ant-worker",
  Speed = 0,
  HitPoints = 255,
  TileSize = {4, 4}, BoxSize = {127, 127},
  SightRange = 3,
  BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  Type = "land",
  Building = true, VisibleUnderFog = true,
  Vanishes = true,
  Sounds = {} } )

DefineUnitType("unit-revealer", { Name = "Dummy unit",
  Size = {0, 0},
  Animations = "animations-building", Icon = "icon-vision",
  Speed = 0,
  HitPoints = 1,
  TileSize = {1, 1}, BoxSize = {1, 1},
  SightRange = 12,
  BasicDamage = 0, PiercingDamage = 0, Missile = "missile-none",
  Priority = 0,
  DecayRate = 1,
  Type = "land",
  Building = true, VisibleUnderFog = true,
  Revealer = true,
  DetectCloak = true,
  Sounds = {} } )


-- Load the different races
Load("scripts/red-ants/units.lua")

DefineUnitType("unit-orc-wall", { Name = "Wall",
  Animations = "animations-building", Icon = "icon-wall",
  Missile = "missile-none", Use = "unit-human-wall" 
  } )   

DefineUnitType("unit-berseker", { Name = "Hard Coded",
  Animations = "animations-building", Icon = "icon-vision",
  Missile = "missile-none", Use = "unit-revealer" 
  } )

DefineUnitType("unit-ogre-mage", { Name = "Hard Coded",
  Animations = "animations-building", Icon = "icon-vision",
  Missile = "missile-none", Use = "unit-revealer" 
  } )

DefineUnitType("unit-eye-of-vision", { Name = "Hard Coded",
  Animations = "animations-building", Icon = "icon-vision",
  Missile = "missile-none", Use = "unit-revealer" 
  } )

DefineUnitType("unit-death-knight", { Name = "Hard Coded",
  Animations = "animations-building", Icon = "icon-vision",
  Missile = "missile-none", Use = "unit-revealer" 
  } )
