# HG changeset patch # User tiyuri@gmail.com # Date 1281181495 -3600 # Node ID f336f8d52f7e3b440c43a55090e8bef2772988c4 # Parent aecea9aa53dca0f50f581ad80dc4c490efaec684 Remove random placement of health crate, looks like LUA random function may not be synced over network. diff -r aecea9aa53dc -r f336f8d52f7e share/hedgewars/Data/Maps/FlightJoust/map.lua --- a/share/hedgewars/Data/Maps/FlightJoust/map.lua Sat Aug 07 01:45:31 2010 +0200 +++ b/share/hedgewars/Data/Maps/FlightJoust/map.lua Sat Aug 07 12:44:55 2010 +0100 @@ -1,71 +1,71 @@ -local hogs = {} - -function mapM_(func, tbl) - for i,v in pairs(tbl) do - func(v) - end -end - -function map(func, tbl) - local newtbl = {} - for i,v in pairs(tbl) do - newtbl[i] = func(v) - end - return newtbl -end - -function filter(func, tbl) - local newtbl = {} - for i,v in pairs(tbl) do - if func(v) then - table.insert(newtbl, v) - end - end - return newtbl -end - -function onGameInit() - GameFlags = gfSolidLand + gfDivideTeams - TurnTime = 10000 - CaseFreq = 0 - LandAdds = 0 - Explosives = 0 - Delay = 500 - SuddenDeathTurns = 99999 -- "disable" sudden death - Theme = Compost -end - -function onGameStart() - local offset = 50 - local team1hh = filter(function(h) return GetHogClan(h) == 0 end, hogs) - local team2hh = filter(function(h) return GetHogClan(h) == 1 end, hogs) - - for i,h in ipairs(team1hh) do - SetGearPosition(h, 250+(i-1)*offset, 1000) - end - for i,h in ipairs(team2hh) do - SetGearPosition(h, 3500-(i-1)*offset, 1000) - end - - SpawnHealthCrate(1800, 1200) -end - -function onAmmoStoreInit() - SetAmmo(amRCPlane, 9, 0, 0, 0) - SetAmmo(amSkip, 9, 0, 0, 0) -end - -function onGearAdd(gear) - if GetGearType(gear) == gtRCPlane then - SetTimer(gear,60000) - end - if GetGearType(gear) == gtHedgehog then - table.insert(hogs, gear) - end -end - -function onGearDelete(gear) - if GetGearType(gear) == gtCase then - SpawnHealthCrate(1600 + math.random(550), 1150) - end -end +local hogs = {} + +function mapM_(func, tbl) + for i,v in pairs(tbl) do + func(v) + end +end + +function map(func, tbl) + local newtbl = {} + for i,v in pairs(tbl) do + newtbl[i] = func(v) + end + return newtbl +end + +function filter(func, tbl) + local newtbl = {} + for i,v in pairs(tbl) do + if func(v) then + table.insert(newtbl, v) + end + end + return newtbl +end + +function onGameInit() + GameFlags = gfSolidLand + gfDivideTeams + TurnTime = 10000 + CaseFreq = 0 + LandAdds = 0 + Explosives = 0 + Delay = 500 + SuddenDeathTurns = 99999 -- "disable" sudden death + Theme = Compost +end + +function onGameStart() + local offset = 50 + local team1hh = filter(function(h) return GetHogClan(h) == 0 end, hogs) + local team2hh = filter(function(h) return GetHogClan(h) == 1 end, hogs) + + for i,h in ipairs(team1hh) do + SetGearPosition(h, 250+(i-1)*offset, 1000) + end + for i,h in ipairs(team2hh) do + SetGearPosition(h, 3500-(i-1)*offset, 1000) + end + + SpawnHealthCrate(1800, 1200) +end + +function onAmmoStoreInit() + SetAmmo(amRCPlane, 9, 0, 0, 0) + SetAmmo(amSkip, 9, 0, 0, 0) +end + +function onGearAdd(gear) + if GetGearType(gear) == gtRCPlane then + SetTimer(gear,60000) + end + if GetGearType(gear) == gtHedgehog then + table.insert(hogs, gear) + end +end + +function onGearDelete(gear) + if GetGearType(gear) == gtCase then + SpawnHealthCrate(1880, 1150) + end +end