--	Stratagus Map - Single player campaign

Load("campaigns/human/level01h_c2.sms")

Briefing(
  title,
  objectives,
  "../campaigns/human/interface/introscreen1.png",
  "campaigns/human/level01h.txt",
  {"campaigns/human/level01h-intro1.wav",
   "campaigns/human/level01h-intro2.wav"}
)

AddTrigger(
  function() return GetPlayerData(GetThisPlayer(), "UnitTypesCount", "unit-farm") >= 4 and
		GetPlayerData(GetThisPlayer(), "UnitTypesCount", "unit-human-barracks") >= 1 end,
  function() return ActionVictory() end)
AddTrigger(
  function() return GetPlayerData(GetThisPlayer(), "TotalNumUnits") == 0 end,
  function() return ActionDefeat() end)

--Units
local allowedHumanUnits = {"unit-farm",
	"unit-town-hall", "unit-peasant",
	"unit-human-barracks", "unit-footman"
}
local function DefineAllowTable(table, flags)
	for i, unitName in ipairs(table) do
		DefineAllow(unitName, flags)
	end
end

DefineAllowNormalHumanUnits("FFFFFFFFFFFFFFFF")
DefineAllowExtraHumanUnits("FFFFFFFFFFFFFFFF")
DefineAllowNormalOrcUnits("FFFFFFFFFFFFFFFF")
DefineAllowExtraOrcUnits("FFFFFFFFFFFFFFFF")
DefineAllowSpecialUnits("FFFFFFFFFFFFFFFF")
DefineAllowHumanAlways()
DefineAllowOrcAlways()

DefineAllowTable(allowedHumanUnits, "AAAAAAAAAAAAAAAA")

-- Default Spells Researched
DefineAllow("upgrade-holy-vision", "RRRRRRRRRRRRRRRR")
DefineAllow("upgrade-fireball", "RRRRRRRRRRRRRRRR")
DefineAllow("upgrade-eye-of-kilrogg", "RRRRRRRRRRRRRRRR")
DefineAllow("upgrade-death-coil", "RRRRRRRRRRRRRRRR")

Load("campaigns/human/level01h.sms")
