--       _________ __                 __                               
--      /   _____//  |_____________ _/  |______     ____  __ __  ______
--      \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
--      /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \ 
--     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
--             \/                  \/          \//_____/            \/ 
--  ______________________                           ______________________
--            T H E   W A R   B E G I N S
--     Stratagus - A free fantasy real time strategy game engine
--
--  buttons.ccl -   Define the", "unit-buttons of the human race.
--
--	(c) Copyright 2000,2004 by Jimmy 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: buttons.lua,v 1.21 2004/03/14 23:25:06 mohydine Exp $

------------------------------------------------------------------------------
--  Define", "unit-button.
--
--  DefineButton( { Pos = n, Level = n 'icon ident Action = name ['value value]
--      ['allowed check ['values]] Key = key, Hint = hint 'for-unit", "units)
--

-- general commands -- almost all", "units have it -------------------------------

DefineButton( { Pos = 1, Level = 0, Icon = "icon-move-red-ant-worker",
  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-worker1",
    "unit-female-hero",
    "unit-flying-angle", "unit-advanced-witch", "unit-flying-ant",
    "unit-dragonfly", "unit-witch", "unit-ladybug",
    "red-ants-group"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-shield1",
  Action = "stop",
  Key = "s", Hint = "~!STOP",
  ForUnit = {"unit-warrior", "unit-knight", "unit-archer", "unit-advanced-knight",
    "unit-dynamite-ant", "unit-advanced-archer", "unit-tank", "unit-worker", "unit-worker1",
    "unit-female-hero",
    "unit-flying-angle", "unit-advanced-witch", "unit-flying-ant",
    "unit-dragonfly", "unit-witch", "unit-ladybug",
    "red-ants-group"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-shield2",
  Action = "stop",
  Allowed = "check-upgrade", AllowArg = {"upgrade-human-shield1"},
  Key = "s", Hint = "~!STOP",
  ForUnit = {"unit-warrior", "unit-knight", "unit-archer", "unit-advanced-knight",
    "unit-dynamite-ant", "unit-advanced-archer", "unit-tank"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-shield3",
  Action = "stop",
  Allowed = "check-upgrade", AllowArg = {"upgrade-human-shield2"},
  Key = "s", Hint = "~!STOP",
  ForUnit = {"unit-warrior", "unit-knight", "unit-archer", "unit-advanced-knight",
    "unit-dynamite-ant", "unit-advanced-archer", "unit-tank"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-sword1",
  Action = "attack",
  Key = "a", Hint = "~!ATTACK",
  ForUnit = {"unit-warrior", "unit-knight", "unit-archer", "unit-advanced-knight",
    "unit-dynamite-ant", "unit-advanced-archer", "unit-tank", "unit-worker","unit-worker1",
    "unit-female-hero",
    "unit-flying-angle", "unit-advanced-witch", "unit-dragonfly", "red-ants-group"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-sword2",
  Action = "attack",
  Allowed = "check-upgrade", AllowArg = {"upgrade-sword1"},
  Key = "a", Hint = "~!ATTACK",
  ForUnit = {"unit-warrior", "unit-knight", "unit-archer", "unit-advanced-knight",
    "unit-dynamite-ant", "unit-advanced-archer", "unit-tank"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-sword3",
  Action = "attack",
  Allowed = "check-upgrade", AllowArg = {"upgrade-sword2"},
  Key = "a", Hint = "~!ATTACK",
  ForUnit = {"unit-warrior", "unit-knight", "unit-archer", "unit-advanced-knight",
    "unit-dynamite-ant", "unit-advanced-archer", "unit-tank"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-arrow1",
  Action = "attack",
  Key = "a", Hint = "~!ATTACK",
  ForUnit = {"unit-archer", "unit-advanced-archer", "unit-female-hero"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-arrow2",
  Action = "attack",
  Allowed = "check-upgrade", AllowArg = {"upgrade-arrow1"},
  Key = "a", Hint = "~!ATTACK",
  ForUnit = {"unit-archer", "unit-advanced-archer", "unit-female-hero"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-arrow3",
  Action = "attack",
  Allowed = "check-upgrade", AllowArg = {"upgrade-arrow2"},
  Key = "a", Hint = "~!ATTACK",
  ForUnit = {"unit-archer", "unit-advanced-archer", "unit-female-hero"} } )

if (extensions) then
DefineButton( { Pos = 4, Level = 0, Icon = "icon-patrol-land",
  Action = "patrol",
  Key = "p", Hint = "~!PATROL",
  ForUnit = {"unit-warrior", "unit-knight", "unit-archer", "unit-advanced-knight",
    "unit-dynamite-ant", "unit-advanced-archer", "unit-tank", "unit-female-hero",
    "unit-flying-angle", "unit-dragonfly", "red-ants-group",
    "unit-flying-ant"} } )
else
DefineButton( { Pos = 4, Level = 0, Icon = "icon-patrol-land",
  Action = "patrol",
  Key = "p", Hint = "~!PATROL",
  ForUnit = {"unit-warrior", "unit-knight", "unit-archer", "unit-advanced-knight",
    "unit-dynamite-ant", "unit-advanced-archer", "unit-tank", "unit-female-hero",
    "unit-flying-angle", "unit-dragonfly", "red-ants-group"} } )
end

DefineButton( { Pos = 5, Level = 0, Icon = "icon-stand-ground",
  Action = "stand-ground",
  Key = "t", Hint = "S~!TAND GROUND",
  ForUnit = {"unit-warrior", "unit-knight", "unit-archer", "unit-advanced-knight",
    "unit-dynamite-ant", "unit-advanced-archer", "unit-tank", "unit-female-hero",
    "unit-flying-angle", "unit-dragonfly", "red-ants-group",
    "unit-submarine", "unit-gallion", "unit-gunboat"} } )

DefineButton( { Pos = 6, Level = 0, Icon = "icon-attack-ground",
  Action = "attack-ground",
  Key = "g", Hint = "ATTACK ~!GROUND",
  ForUnit = {"unit-tank", "unit-gallion", "red-ants-group"} } )

DefineButton( { Pos = 9, Level = 0, Icon = "icon-demolish",
  Action = "cast-spell", Value = "spell-suicide-bomber",
  Allowed = "check-true",
  Key = "d", Hint = "~!DEMOLISH",
  ForUnit = {"unit-dynamite-ant"} } )

-- paladin specific actions ---------------------------------------------------

--(if extensions
--DefineButton( { Pos = 6, Level = 0, Icon = "icon-heal
--  Action = "cast-spell", Value = "spell-area-healing
--  Allowed = "check-upgrade", AllowArg = {"upgrade-area-healing)
--  Key = "l", Hint = "AREA HEA~!LING (per 1 HP)",
--  ForUnit = {"unit-advanced-knight", "unit-knight-rider 
--    "unit-man-of-light"} } )
--)


-- mage specific actions ------------------------------------------------------

DefineButton( { Pos = 3, Level = 0, Icon = "icon-lightning",
  Action = "attack",
  Key = "a", Hint = "LIGHTNING ~!ATTACK",
  ForUnit = {"unit-witch", "unit-advanced-witch"} } )


DefineButton( { Pos = 8, Level = 0, Icon = "icon-polymorph",
  Action = "cast-spell", Value = "spell-polymorph",
--  Action = "cast-spell", Value = "spell-suicide-bomber",
  Allowed = "check-upgrade", AllowArg = {"upgrade-polymorph"},
  Key = "p", Hint = "~!POLYMORPH",
  ForUnit = {"unit-witch", "unit-advanced-witch"} } )


DefineButton( { Pos = 7, Level = 0, Icon = "icon-rain",
  Action = "cast-spell", Value = "spell-rain",
  Allowed = "check-upgrade", AllowArg = {"upgrade-blizzard"},
  Key = "r", Hint = "~!RAIN (needs Temple)",
  ForUnit = {"unit-witch", "unit-advanced-witch"} } )


-- peasant specific actions ---------------------------------------------------

DefineButton( { Pos = 4, Level = 0, Icon = "icon-repair",
  Action = "repair",
  Key = "r", Hint = "~!REPAIR",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 5, Level = 0, Icon = "icon-harvest",
  Action = "harvest",
  Key = "h", Hint = "~!HARVEST LUMBER/COLLECT SUGAR",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 6, Level = 0, Icon = "icon-return-goods-worker",
  Action = "return-goods",
  Key = "g", Hint = "RETURN WITH ~!GOODS",
  ForUnit = {"unit-worker", "unit-worker1"} } )

-- build basic/advanced structs -----------------------------------------------

DefineButton( { Pos = 7, Level = 0, Icon = "icon-build-basic",
  Action = "button", Value = 1,
  Key = "b", Hint = "~!BUILD STRUCTURE LEVEL I",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 8, Level = 0, Icon = "icon-build-advanced",
  Action = "button", Value = 2,
  Allowed = "check-units-or", AllowArg = {"unit-queen-castle", "unit-queen-fortress" },
  Key = "t", Hint = "BUILD S~!TRUCTURE LEVEL II (Requires Castle upgrade)",
  ForUnit = {"unit-worker", "unit-worker1"} } )

if (extensions) then
DefineButton( { Pos = 9, Level = 0, Icon = "icon-wall",
  Action = "button", Value = 3,
  Allowed = "check-units-and", AllowArg = {"unit-queen-fortress" },
  Key = "e", Hint = "BUILD STRUCTURE L~!EVEL III (Requires Fortress upgrade)",
  ForUnit = {"unit-worker", "unit-worker1"} } )
end

-- simple buildings human -----------------------------------------------------

DefineButton( { Pos = 1, Level = 1, Icon = "icon-egg-collector",
  Action = "build", Value = "unit-egg-collector",
  Key = "e", Hint = "BUILD ~!EGG COLLECTOR",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 2, Level = 1, Icon = "icon-barracks",
  Action = "build", Value = "unit-barracks",
  Key = "b", Hint = "BUILD ~!BARRACKS",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 3, Level = 1, Icon = "icon-queen",
  Action = "build", Value = "unit-queen",
  Key = "q", Hint = "BUILD ~!QUEEN",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 4, Level = 1, Icon = "icon-wood-house",
  Action = "build", Value = "unit-wood-house",
  Key = "o", Hint = "BUILD  ST~!ORE HOUSE",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 5, Level = 1, Icon = "icon-blacksmith",
  Action = "build", Value = "unit-blacksmith",
  Key = "s", Hint = "BUILD BLACK~!SMITH",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 7, Level = 1, Icon = "icon-watch-tower",
  Action = "build", Value = "unit-watch-tower",
  Key = "t", Hint = "BUILD ~!TOWER",
  ForUnit = {"unit-worker", "unit-worker1"} } )

---DefineButton( { Pos = 8, Level = 1, Icon = "icon-wall",
---  Action = "build", Value = "unit-human-wall",
---  Allowed = "check-network",
---  Key = "w", Hint = "BUILD ~!WALL",
---  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 9, Level = 1, Icon = "icon-cancel",
  Action = "button", Value = 0,
  Key = "\033", Hint = " CANCEL",
  ForUnit = {"unit-worker", "unit-worker1"} } )

-- human advanced buildings ---------------------------------------------------

DefineButton( { Pos = 1, Level = 2, Icon = "icon-dock",
  Action = "build", Value = "unit-dock",
  Key = "d", Hint = "BUILD ~!DOCK",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 2, Level = 2, Icon = "icon-foundry",
  Action = "build", Value = "unit-foundry",
  Key = "f", Hint = "BUILD ~!FOUNDRY (Need Dock)",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 3, Level = 2, Icon = "icon-plancton-house",
  Action = "build", Value = "unit-plancton-house",
  Key = "p", Hint = "BUILD ~!PLANCTON PLATFORM (Need Dock)",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 4, Level = 2, Icon = "icon-alchemist",
  Action = "build", Value = "unit-alchemist",
  Key = "a", Hint = "BUILD ~!ALCHEMIST",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 5, Level = 2, Icon = "icon-insect-house",
  Action = "build", Value = "unit-insect-house",
  Key = "i", Hint = "BUILD ~!INSECT HOUSE",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 6, Level = 2, Icon = "icon-witch-tower",
  Action = "build", Value = "unit-witch-tower",
  Key = "w", Hint = "BUILD ~!SPELL HOUSE",
  ForUnit = {"unit-worker", "unit-worker1"} } )

---DefineButton( { Pos = 7, Level = 2, Icon = "icon-temple",
---  Action = "build", Value = "unit-temple",
---  Key = "t", Hint = "BUILD ~!TEMPLE",
---  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 8, Level = 2, Icon = "icon-flying-house",
  Action = "build", Value = "unit-flying-house",
  Key = "g", Hint = "BUILD ~!FLYING HOUSE",
  ForUnit = {"unit-worker", "unit-worker1"} } )

DefineButton( { Pos = 9, Level = 2, Icon = "icon-cancel",
  Action = "button", Value = 0,
  Key = "\033", Hint = " CANCEL",
  ForUnit = {"unit-worker"} } )

-- human special buildings ----------------------------------------------------

----DefineButton( { Pos = 1, Level = 3, Icon = "icon-tunnel",
----  Action = "build", Value = "unit-tunnel",
----  Allowed = "check-no-network",
----  Key = "p", Hint = "BUILD DARK ~!PORTAL",
----  ForUnit = {"unit-worker"} } )

---DefineButton( { Pos = 2, Level = 3, Icon = "icon-blank39",
---  Action = "build", Value = "unit-runestone",
---  Allowed = "check-no-network",
---  Key = "r", Hint = "BUILD ~!RUNESTONE",
---  ForUnit = {"unit-worker"} } )

DefineButton( { Pos = 9, Level = 3, Icon = "icon-cancel",
  Action = "button", Value = 0,
  Key = "\033", Hint = " CANCEL",
  ForUnit = {"unit-worker", "unit-worker1"} } )

-- buildings commands ---------------------------------------------------------

--if (extensions) then
--DefineButton( { Pos = 1, Level = 0, Icon = "icon-ladybug",
--  Action = "train-unit", Value = "unit-ladybug",
--  Key = "l", Hint = "TRAIN ~!LADYBUG",
--  ForUnit = {"unit-egg-collector"} } )
-- end


DefineButton( { Pos = 1, Level = 0, Icon = "icon-red-ant-worker",
  Action = "train-unit", Value = "unit-worker",
  Key = "w", Hint = "TRAIN ~!WORKER",
  ForUnit = {"unit-queen", "unit-queen-castle", "unit-queen-fortress"} } )

DefineButton( { Pos = 1, Level = 0, Icon = "icon-red-ant-worker",
  Action = "train-unit", Value = "unit-worker1",
  Key = "w", Hint = "TRAIN ADVANCED ~!WORKER",
  ForUnit = {"unit-queen", "unit-queen-castle", "unit-queen-fortress"} } )

-- town hall upgrades ---------------------------------------------------------

DefineButton( { Pos = 2, Level = 0, Icon = "icon-queen-castle",
  Action = "upgrade-to", Value = "unit-queen-castle",
  Allowed = "check-upgrade-to",
  Key = "c", Hint = "UPGRADE TO ~!CASTLE (needs Barracks)",
  ForUnit = {"unit-queen"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-queen-fortress-upgrade",
  Action = "upgrade-to", Value = "unit-queen-fortress",
  Allowed = "check-upgrade-to",
  Key = "c", Hint = "UPGRADE TO ~!FORTRESS (needs Blacksmith and Level II building)",
  ForUnit = {"unit-queen-castle"} } )

if (extensions) then
do
DefineButton( { Pos = 5, Level = 0, Icon = "icon-harvest",
  Action = "harvest",
  Key = "h", Hint = "SET ~!HARVEST LUMBER/COLLECT SUGAR",
  ForUnit = {"unit-queen", "unit-queen-castle", "unit-queen-fortress"} } )

DefineButton( { Pos = 7, Level = 0, Icon = "icon-move-red-ant-worker",
  Action = "move",
  Key = "m", Hint = "SET ~!MOVE",
  ForUnit = {"unit-queen", "unit-queen-castle", "unit-queen-fortress", "unit-barracks",
    "unit-witch-tower", "unit-flying-house", "unit-alchemist"} } )

DefineButton( { Pos = 8, Level = 0, Icon = "icon-shield1",
  Action = "stop",
  Key = "z", Hint = "SET ~!ZTOP",
  ForUnit = {"unit-queen", "unit-queen-castle", "unit-queen-fortress", "unit-barracks",
    "unit-witch-tower", "unit-flying-house", "unit-alchemist"} } )

DefineButton( { Pos = 9, Level = 0, Icon = "icon-sword1",
  Action = "attack",
  Key = "e", Hint = "S~!ET ATTACK",
  ForUnit = {"unit-queen", "unit-queen-castle", "unit-queen-fortress", "unit-barracks",
    "unit-witch-tower", "unit-flying-house", "unit-alchemist"} } )
end
end

DefineButton( { Pos = 1, Level = 0, Icon = "icon-warrior",
  Action = "train-unit", Value = "unit-warrior",
  Key = "W", Hint = "TRAIN ~!WARRIOR",
  ForUnit = {"unit-barracks"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-archer",
  Action = "train-unit", Value = "unit-archer",
  Key = "a", Hint = "TRAIN ~!ARCHER",
  ForUnit = {"unit-barracks"} } )

----DefineButton( { Pos = 2, Level = 0, Icon = "icon-advanced-archer",
---  Action = "train-unit", Value = "unit-advanced-archer",
---  Key = "r", Hint = "TRAIN ~!RANGER",
---  ForUnit = {"unit-barracks"} } )

---   *************   Insecthouse creates tanks

DefineButton( { Pos = 2, Level = 0, Icon = "icon-tank",
  Action = "train-unit", Value = "unit-tank",
  Key = "t", Hint = "BUILD ~!TANK",
  ForUnit = {"unit-insect-house"} } )

DefineButton( { Pos = 1, Level = 0, Icon = "icon-knight",
  Action = "train-unit", Value = "unit-knight",
  Key = "k", Hint = "TRAIN ~!KNIGHT",
  ForUnit = {"unit-insect-house"} } )

---DefineButton( { Pos = 4, Level = 0, Icon = "icon-advanced-knight",
---  Action = "train-unit", Value = "unit-advanced-knight",
---  Key = "p", Hint = "TRAIN ~!PALADIN",
---  ForUnit = {"unit-barracks"} } )

DefineButton( { Pos = 1, Level = 0, Icon = "icon-flying-ant",
  Action = "train-unit", Value = "unit-flying-ant",
  Key = "f", Hint = "BUILD ~!FLYING ANT",
  ForUnit = {"unit-flying-house"} } )

DefineButton( { Pos = 1, Level = 0, Icon = "icon-dynamite-ant",
  Action = "train-unit", Value = "unit-dynamite-ant",
  Key = "d", Hint = "TRAIN ~!DYNAMITE ANT",
  ForUnit = {"unit-alchemist"} } )

DefineButton( { Pos = 1, Level = 0, Icon = "icon-witch",
  Action = "train-unit", Value = "unit-witch",
  Key = "t", Hint = "~!TRAIN WITCH",
  ForUnit = {"unit-witch-tower"} } )

---DefineButton( { Pos = 1, Level = 0, Icon = "icon-blank14fly",
---  Action = "train-unit", Value = "unit-dragonfly",
---  Key = "g", Hint = "TRAIN ~!GRYPHON RIDER",
---  ForUnit = {"unit-flying-house"} } )

DefineButton( { Pos = 1, Level = 0, Icon = "icon-plancton-collector",
  Action = "train-unit", Value = "unit-plancton-collector",
  Key = "p", Hint = "BUILD ~!PLANCTON COLLECTOR",
  ForUnit = {"unit-dock"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-gunboat",
  Action = "train-unit", Value = "unit-gunboat",
  Key = "g", Hint = "BUILD ~!GUNBOAT",
  ForUnit = {"unit-dock"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-shuttle",
  Action = "train-unit", Value = "unit-shuttle",
  Key = "s", Hint = "BUILD ~!SHUTTLE (needs Foundry)",
  ForUnit = {"unit-dock"} } )

DefineButton( { Pos = 4, Level = 0, Icon = "icon-submarine",
  Action = "train-unit", Value = "unit-submarine",
  Key = "u", Hint = "BUILD S~!UBMARINE (needs Foundry)",
  ForUnit = {"unit-dock"} } )

DefineButton( { Pos = 5, Level = 0, Icon = "icon-gallion",
  Action = "train-unit", Value = "unit-gallion",
  Key = "l", Hint = "BUILD GAL~!LION (needs Foundry)",
  ForUnit = {"unit-dock"} } )

if (extensions) then
-----------------------------------------------------
DefineButton( { Pos = 6, Level = 0, Icon = "icon-boat-set-plancton",
  Action = "harvest",
  Key = "p", Hint = "SET ~!PLANCTON",
  ForUnit = {"unit-dock"} } )
-----------------------------------------------------
end

DefineButton( { Pos = 1, Level = 0, Icon = "icon-arrow-tower",
  Action = "upgrade-to", Value = "unit-arrow-tower",
  Key = "a", Hint = "UPGRADE TO ~!ARROW TOWER",
  ForUnit = {"unit-watch-tower"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-cannon-tower",
  Action = "upgrade-to", Value = "unit-cannon-tower",
  Key = "c", Hint = "UPGRADE TO ~!CANNON TOWER",
  ForUnit = {"unit-watch-tower"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-acid-tower",
  Action = "upgrade-to", Value = "unit-acid-tower",
  Key = "d", Hint = "UPGRADE TO ACI~!D TOWER (needs Castle)",
  ForUnit = {"unit-watch-tower"} } )

-- ships ----------------------------------------------------------------------

DefineButton( { Pos = 1, Level = 0, Icon = "icon-boat-move",
  Action = "move",
  Key = "m", Hint = "~!MOVE",
  ForUnit = {"unit-plancton-collector",
    "unit-submarine", "unit-gallion", "unit-gunboat",
    "unit-shuttle"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-boat-armor1",
  Action = "stop",
  Key = "s", Hint = "~!STOP",
  ForUnit = {"unit-plancton-collector",
    "unit-submarine", "unit-gallion", "unit-gunboat",
    "unit-shuttle"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-shuttle-unload",
  Action = "unload",
  Key = "u", Hint = "~!UNLOAD",
  ForUnit = {"unit-shuttle"} } )

DefineButton( { Pos = 6, Level = 0, Icon = "icon-shuttle-unload",
  Action = "unload",
  Key = "u", Hint = "~!UNLOAD",
  ForUnit = {"unit-queen"} } )

DefineButton( { Pos = 4, Level = 0, Icon = "icon-plancton-platform",
  Action = "build", Value = "unit-plancton-platform",
  Key = "b", Hint = "~!BUILD PLANCTON PLATFORM",
  ForUnit = {"unit-plancton-collector"} } )

DefineButton( { Pos = 5, Level = 0, Icon = "icon-boat-set-plancton",
  Action = "harvest",
  Key = "c", Hint = "~!COLLECT PLANCTON",
  ForUnit = {"unit-plancton-collector"} } )

DefineButton( { Pos = 6, Level = 0, Icon = "icon-boat-return-plancton",
  Action = "return-goods",
  Key = "g", Hint = "RETURN WITH ~!GOODS",
  ForUnit = {"unit-plancton-collector"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-boat-cannon1",
  Action = "attack",
  Key = "a", Hint = "~!ATTACK",
  ForUnit = {"unit-submarine", "unit-gallion", "unit-gunboat"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-boat-cannon2",
  Action = "attack",
  Allowed = "check-upgrade", AllowArg = {"upgrade-human-ship-cannon1"},
  Key = "a", Hint = "~!ATTACK",
  ForUnit = {"unit-submarine", "unit-gallion", "unit-gunboat"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-boat-cannon3",
  Action = "attack",
  Allowed = "check-upgrade", AllowArg = {"upgrade-human-ship-cannon2"},
  Key = "a", Hint = "~!ATTACK",
  ForUnit = {"unit-submarine", "unit-gallion", "unit-gunboat"} } )

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

if (extensions) then
do
DefineButton( { Pos = 7, Level = 0, Icon = "icon-boat-move",
  Action = "move",
  Key = "m", Hint = "SET ~!MOVE",
  ForUnit = {"unit-dock"} } )

DefineButton( { Pos = 8, Level = 0, Icon = "icon-boat-armor1",
  Action = "stop",
  Key = "z", Hint = "SET ~!ZTOP",
  ForUnit = {"unit-dock"} } )

DefineButton( { Pos = 9, Level = 0, Icon = "icon-boat-cannon1",
  Action = "attack",
  Key = "e", Hint = "S~!ET ATTACK",
  ForUnit = {"unit-dock"} } )
end
end

-- upgrades -------------------------------------------------------------------

DefineButton( { Pos = 1, Level = 0, Icon = "icon-harvest",
  Action = "research", Value = "upgrade-worker1",
  Allowed = "check-single-research",
  Key = "m", Hint = "UPGRADE ~!MINING ",
  ForUnit = {"unit-wood-house"} } )

DefineButton( { Pos = 1, Level = 0, Icon = "icon-sword2",
  Action = "research", Value = "upgrade-sword1",
  Allowed = "check-single-research",
  Key = "s", Hint = "UPGRADE ~!STRENGTH (Damage +2)",
  ForUnit = {"unit-blacksmith"} } )

DefineButton( { Pos = 1, Level = 0, Icon = "icon-sword3",
  Action = "research", Value = "upgrade-sword2",
  Allowed = "check-single-research",
  Key = "s", Hint = "UPGRADE ~!STRENGTH (Damage +2)",
  ForUnit = {"unit-blacksmith"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-shield2",
  Action = "research", Value = "upgrade-human-shield1",
  Allowed = "check-single-research",
  Key = "c", Hint = "UPGRADE ~!CARAPACE (Armor +2)",
  ForUnit = {"unit-blacksmith"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-shield3",
  Action = "research", Value = "upgrade-human-shield2",
  Allowed = "check-single-research",
  Key = "c", Hint = "UPGRADE ~!CARAPACE (Armor +2)",
  ForUnit = {"unit-blacksmith"} } )

DefineButton( { Pos = 5, Level = 0, Icon = "icon-tank1",
  Action = "research", Value = "upgrade-ballista1",
  Allowed = "check-single-research",
  Key = "t", Hint = "UPGRADE ~!TANK (Damage +15)",
  ForUnit = {"unit-insect-house"} } )

DefineButton( { Pos = 5, Level = 0, Icon = "icon-tank2",
  Action = "research", Value = "upgrade-ballista2",
  Allowed = "check-single-research",
  Key = "b", Hint = "UPGRADE ~!TANK (Damage +15)",
  ForUnit = {"unit-insect-house"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-arrow2",
  Action = "research", Value = "upgrade-arrow1",
  Allowed = "check-single-research",
  Key = "u", Hint = "~!UPGRADE ARROWS (Damage +1)",
  ForUnit = {"unit-blacksmith"} } )

DefineButton( { Pos = 3, Level = 0, Icon = "icon-arrow3",
  Action = "research", Value = "upgrade-arrow2",
  Allowed = "check-single-research",
  Key = "u", Hint = "~!UPGRADE ARROWS (Damage +1)",
  ForUnit = {"unit-blacksmith"} } )

---DefineButton( { Pos = 4, Level = 0, Icon = "icon-advanced-archer",
---  Action = "research", Value = "upgrade-ranger",
---  Allowed = "check-single-research",
---  Key = "r", Hint = "ELVEN ~!RANGER TRAINING",
---  ForUnit = {"unit-wood-house"} } )

---DefineButton( { Pos = 4, Level = 0, Icon = "icon-advanced-archer-scouting",
---  Action = "research", Value = "upgrade-ranger-scouting",
---  Allowed = "check-single-research",
---  Key = "s", Hint = "RANGER ~!SCOUTING (Sight:9)",
---  ForUnit = {"unit-wood-house"} } )

---DefineButton( { Pos = 5, Level = 0, Icon = "icon-longbow",
---  Action = "research", Value = "upgrade-longbow",
---  Allowed = "check-single-research",
---  Key = "l", Hint = "RESEARCH ~!LONGBOW (Range +1)",
---  ForUnit = {"unit-wood-house"} } )

---DefineButton( { Pos = 6, Level = 0, Icon = "icon-advanced-archer-marksmanship",
----  Action = "research", Value = "upgrade-ranger-marksmanship",
---  Allowed = "check-single-research",
---  Key = "m", Hint = "RANGER ~!MARKSMANSHIP (Damage +3)",
---  ForUnit = {"unit-wood-house"} } )

---DefineButton( { Pos = 1, Level = 0, Icon = "icon-advanced-knight",
---  Action = "research", Value = "upgrade-paladin",
---  Allowed = "check-single-research",
---  Key = "p", Hint = "UPGRADES KNIGHTS TO ~!PALADINS",
---  ForUnit = {"unit-temple"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-polymorph",
  Action = "research", Value = "upgrade-polymorph",
  Allowed = "check-single-research",
  Key = "p", Hint = "RESEARCH ~!POLYMORPH",
  ForUnit = {"unit-witch-tower"} } )

DefineButton( { Pos = 1, Level = 0, Icon = "icon-rain",
  Action = "research", Value = "upgrade-blizzard",
  Allowed = "check-single-research",
  Key = "r", Hint = "RESEARCH ~!RAIN",
  ForUnit = {"unit-temple"} } )

DefineButton( { Pos = 1, Level = 0, Icon = "icon-boat-cannon2",
  Action = "research", Value = "upgrade-human-ship-cannon1",
  Allowed = "check-single-research",
  Key = "c", Hint = "UPGRADE ~!CANNONS (Damage +5)",
  ForUnit = {"unit-foundry"} } )

DefineButton( { Pos = 1, Level = 0, Icon = "icon-boat-cannon3",
  Action = "research", Value = "upgrade-human-ship-cannon2",
  Allowed = "check-single-research",
  Key = "c", Hint = "UPGRADE ~!CANNONS (Damage +5)",
  ForUnit = {"unit-foundry"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-boat-armor2",
  Action = "research", Value = "upgrade-human-ship-armor1",
  Allowed = "check-single-research",
  Key = "a", Hint = "UPGRADE SHIP ~!ARMOR (Armor +5)",
  ForUnit = {"unit-foundry"} } )

DefineButton( { Pos = 2, Level = 0, Icon = "icon-boat-armor3",
  Action = "research", Value = "upgrade-human-ship-armor2",
  Allowed = "check-single-research",
  Key = "a", Hint = "UPGRADE SHIP ~!ARMOR (Armor +5)",
  ForUnit = {"unit-foundry"} } )
