--__________         __    __  .__           ___________
--\______   \_____ _/  |__/  |_|  |   ____   \_   _____/__________
-- |    |  _/\__  \\   __\   __\  | _/ __ \   |    __)/  _ \_  __ \
-- |    |   \ / __ \|  |  |  | |  |_\  ___/   |     \(  <_> )  | \/
-- |______  /(____  /__|  |__| |____/\___  >  \___  / \____/|__|
--        \/      \/                     \/       \/
--   _____                     .___.__
--  /     \ _____    ____    __| _/|__| ____  ___________
-- /  \ /  \\__  \  /    \  / __ | |  |/ ___\/  _ \_  __ \
--/    Y    \/ __ \|   |  \/ /_/ | |  \  \__(  <_> )  | \/
--\____|__  (____  /___|  /\____ | |__|\___  >____/|__|
--        \/     \/     \/      \/         \/

--      constructions.lua - Constructions
--
--      (c) Copyright 2005 by Kimmo Merikivi
--
--      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

---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------

--=============================================================================
--	Define a construction.
--
--	(define-construction ident 'files '(tileset-name filename ..)
--	    'size '(x y))

DefineConstruction("construction-dwarves-guard-tower", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/guard-tower.png",
    Size = {160, 160}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 4},
   {Percent = 20,
    File = "main",
    Frame = 3},
   {Percent = 35,
    File = "main",
    Frame = 2},
   {Percent = 60,
    File = "main",
    Frame = 1},
   {Percent = 80,
    File = "main",
    Frame = 0}}
})

DefineConstruction("construction-dwarves-heros-guild", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/heros-guild.png",
    Size = {256, 256}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 1},
   {Percent = 90,
    File = "main",
    Frame = 0}}
})

DefineConstruction("construction-dwarves-mining-post", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/mining-post.png",
    Size = {192, 192}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 1},
   {Percent = 90,
    File = "main",
    Frame = 0}}
})


DefineConstruction("construction-dwarves-shipyard", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/shipyard.png",
    Size = {192, 192}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 5},
   {Percent = 20,
    File = "main",
    Frame = 4},
   {Percent = 40,
    File = "main",
    Frame = 3},
   {Percent = 60,
    File = "main",
    Frame = 2},
   {Percent = 80,
    File = "main",
    Frame = 1},
   {Percent = 90,
    File = "main",
    Frame = 0}}
})

DefineConstruction("construction-dwarves-barracks", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/barracks.png",
    Size = {192, 192}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 11},
   {Percent = 5,
    File = "main",
    Frame = 10},
   {Percent = 10,
    File = "main",
    Frame = 9},
   {Percent = 15,
    File = "main",
    Frame = 8},
   {Percent = 20,
    File = "main",
    Frame = 7},
   {Percent = 30,
    File = "main",
    Frame = 6},
   {Percent = 40,
    File = "main",
    Frame = 5},
   {Percent = 50,
    File = "main",
    Frame = 4},
   {Percent = 60,
    File = "main",
    Frame = 4},
   {Percent = 70,
    File = "main",
    Frame = 3},
   {Percent = 80,
    File = "main",
    Frame = 2},
   {Percent = 90,
    File = "main",
    Frame = 1},
   {Percent = 100,
    File = "main",
    Frame = 0}}
})

if (cartoonish_graphics) then
DefineConstruction("construction-dwarves-barracks", {
  Files = {
   {Tileset = "summer",
    File = "cartoonish/dwarves/buildings/barracks.png",
    Size = {192, 192}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 4},
   {Percent = 20,
    File = "main",
    Frame = 3},
   {Percent = 35,
    File = "main",
    Frame = 2},
   {Percent = 60,
    File = "main",
    Frame = 1},
   {Percent = 80,
    File = "main",
    Frame = 0}}
})
end

DefineConstruction("construction-dwarves-town-center", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/town-center.png",
    Size = {256, 256}}},
  Constructions = {
   {Percent = 5,
    File = "main",
    Frame = 3},
   {Percent = 30,
    File = "main",
    Frame = 2},
   {Percent = 60,
    File = "main",
    Frame = 1},
   {Percent = 95,
    File = "main",
    Frame = 0}}
})

if (cartoonish_graphics) then
  DefineConstruction("construction-dwarves-town-center", {
    Files = {
     {Tileset = "summer",
      File = "cartoonish/dwarves/buildings/town-center.png",
      Size = {256, 256}}},
    Constructions = {
     {Percent = 5,
      File = "main",
      Frame = 3},
     {Percent = 30,
      File = "main",
      Frame = 2},
     {Percent = 60,
      File = "main",
      Frame = 1},
     {Percent = 95,
      File = "main",
      Frame = 0}}
})
end

DefineConstruction("construction-dwarves-cottage", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/cottage.png",
    Size = {96, 96}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 3},
   {Percent = 35,
    File = "main",
    Frame = 2},
   {Percent = 60,
    File = "main",
    Frame = 1},
   {Percent = 80,
    File = "main",
    Frame = 0}}
})

DefineConstruction("construction-dwarves-wall", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/wall.png",
    Size = {96, 96}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 3},
   {Percent = 35,
    File = "main",
    Frame = 2},
   {Percent = 60,
    File = "main",
    Frame = 1},
   {Percent = 80,
    File = "main",
    Frame = 0}}
})

DefineConstruction("construction-dwarves-farm", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/farm.png",
    Size = {128, 128}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 3},
   {Percent = 35,
    File = "main",
    Frame = 2},
   {Percent = 60,
    File = "main",
    Frame = 1},
   {Percent = 80,
    File = "main",
    Frame = 0}}
})

DefineConstruction("construction-dwarves-lumber-mill", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/lumber-mill.png",
    Size = {192, 192}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 9},
   {Percent = 5,
    File = "main",
    Frame = 8},
   {Percent = 20,
    File = "main",
    Frame = 7},
   {Percent = 30,
    File = "main",
    Frame = 6},
   {Percent = 40,
    File = "main",
    Frame = 5},
   {Percent = 50,
    File = "main",
    Frame = 4},
   {Percent = 60,
    File = "main",
    Frame = 3},
   {Percent = 70,
    File = "main",
    Frame = 2},
   {Percent = 80,
    File = "main",
    Frame = 1},
   {Percent = 95,
    File = "main",
    Frame = 0}
    }})

if (cartoonish_graphics) then
  DefineConstruction("construction-dwarves-lumber-mill", {
    Files = {
     {Tileset = "summer",
      File = "cartoonish/dwarves/buildings/lumber-mill.png",
      Size = {192, 192}}},
    Constructions = {
     {Percent = 0,
      File = "main",
      Frame = 3},
     {Percent = 40,
      File = "main",
      Frame = 2},
     {Percent = 70,
      File = "main",
      Frame = 1},
     {Percent = 95,
      File = "main",
      Frame = 0}}})
end

DefineConstruction("construction-dwarves-market", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/market.png",
    Size = {160, 160}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 4},
   {Percent = 20,
    File = "main",
    Frame = 3},
   {Percent = 50,
    File = "main",
    Frame = 2},
   {Percent = 70,
    File = "main",
    Frame = 1},
   {Percent = 95,
    File = "main",
    Frame = 0}}
})


DefineConstruction("construction-dwarves-blacksmith", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/blacksmith.png",
    Size = {128, 128}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 3},
   {Percent = 35,
    File = "main",
    Frame = 2},
   {Percent = 60,
    File = "main",
    Frame = 1},
   {Percent = 80,
    File = "main",
    Frame = 0}}
})

if (cartoonish_graphics) then
  DefineConstruction("construction-dwarves-blacksmith", {
    Files = {
     {Tileset = "summer",
      File = "cartoonish/dwarves/buildings/blacksmith.png",
      Size = {128, 128}}},
    Constructions = {
     {Percent = 0,
      File = "main",
      Frame = 3},
     {Percent = 35,
      File = "main",
      Frame = 2},
     {Percent = 60,
      File = "main",
      Frame = 1},
     {Percent = 80,
      File = "main",
      Frame = 0}}
})

end

DefineConstruction("construction-dwarves-town-hall", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/town-hall.png",
    Size = {256, 256}}},
  Constructions = {
   {Percent = 5,
    File = "main",
    Frame = 3},
   {Percent = 30,
    File = "main",
    Frame = 2},
   {Percent = 60,
    File = "main",
    Frame = 1},
   {Percent = 95,
    File = "main",
    Frame = 0}}
})

if (cartoonish_graphics) then
  DefineConstruction("construction-dwarves-town-hall", {
    Files = {
     {Tileset = "summer",
      File = "cartoonish/dwarves/buildings/town-hall.png",
      Size = {256, 256}}},
    Constructions = {
     {Percent = 0,
      File = "main",
      Frame = 1},
     {Percent = 50,
      File = "main",
      Frame = 0}}
})
end

DefineConstruction("construction-dwarves-shipyard", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/shipyard.png",
    Size = {192, 192}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 2},
   {Percent = 40,
    File = "main",
    Frame = 1},
   {Percent = 80,
    File = "main",
    Frame = 0}}
})

DefineConstruction("construction-dwarves-bunker", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/bunker.png",
    Size = {96, 96}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 1},
   {Percent = 40,
    File = "main",
    Frame = 0}}
})

DefineConstruction("construction-dwarves-city-hall", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/city-hall.png",
    Size = {256, 256}}},
   Constructions = {
     {Percent = 5,
      File = "main",
      Frame = 3},
     {Percent = 30,
      File = "main",
      Frame = 2},
     {Percent = 60,
      File = "main",
      Frame = 1},
     {Percent = 95,
      File = "main",
      Frame = 0}}
})

if (cartoonish_graphics) then
  DefineConstruction("construction-dwarves-city-hall", {
    Files = {
     {Tileset = "summer",
      File = "cartoonish/dwarves/buildings/city-hall.png",
      Size = {256, 256}}},
     Constructions = {
       {Percent = 0,
        File = "main",
        Frame = 1},
       {Percent = 50,
        File = "main",
        Frame = 0}}
})
end

DefineConstruction("construction-dwarves-temple", {
  Files = {
   {Tileset = "summer",
    File = "dwarves/buildings/temple.png",
    Size = {256, 256}}},
  Constructions = {
   {Percent = 0,
    File = "main",
    Frame = 1},
   {Percent = 40,
    File = "main",
    Frame = 0}}
})
