share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
changeset 10967 1434cec96ca3
parent 10961 b30f29396f0c
child 10968 d2f9e25d1d79
equal deleted inserted replaced
10966:a8749503c130 10967:1434cec96ca3
     1 ------------------------------------------
     1 ------------------------------------------
     2 -- TECH RACER v0.7
     2 -- TECH RACER v0.8
     3 -----------------------------------------
     3 -----------------------------------------
     4 
     4 
     5 --------------
     5 --------------
     6 -- TO DO
     6 -- TO DO
     7 --------------
     7 --------------
     8 -- allow scrolling of maps
     8 -- allow scrolling of maps (was going to add this in the engine itself, but it can be done now by refreshing preview)
     9 -- place waypoints for the registered maps automatically.
       
    10 
     9 
    11 --------------
    10 --------------
    12 --0.2
    11 --0.2
    13 --------------
    12 --------------
    14 -- should work better "out the box"
    13 -- should work better "out the box"
    52 --------------
    51 --------------
    53 -- allow waypoints to be loaded automatically via TechMaps or HWMAP
    52 -- allow waypoints to be loaded automatically via TechMaps or HWMAP
    54 -- (temporarily?) remove ability to place waypoints manually
    53 -- (temporarily?) remove ability to place waypoints manually
    55 -- break stuff?
    54 -- break stuff?
    56 
    55 
       
    56 --------------
       
    57 --0.8
       
    58 --------------
       
    59 -- should (more or less) work "out of the box" now
       
    60 -- generate map previews for level
       
    61 -- randomly assign a map in the case of no map param
       
    62 -- no longer allow custom ammosets (ammo should be specified by map so that records can be valid, though we probably still need to completely limit gameflags)
       
    63 
    57 -----------------------------
    64 -----------------------------
    58 -- SCRIPT BEGINS
    65 -- SCRIPT BEGINS
    59 -----------------------------
    66 -----------------------------
    60 
    67 
    61 HedgewarsScriptLoad("/Scripts/Locale.lua")
    68 HedgewarsScriptLoad("/Scripts/Locale.lua")
   168 local specialPointsX = {}
   175 local specialPointsX = {}
   169 local specialPointsY = {}
   176 local specialPointsY = {}
   170 local specialPointsFlag = {}
   177 local specialPointsFlag = {}
   171 local specialPointsCount = 0
   178 local specialPointsCount = 0
   172 
   179 
   173 mapID = 22
   180 mapID = nil
   174 
   181 
   175 --------------------------
   182 --------------------------
   176 -- hog and team tracking variales
   183 -- hog and team tracking variales
   177 --------------------------
   184 --------------------------
   178 
   185 
   667 
   674 
   668 	if (roundLimit == 0) or (roundLimit == nil) then
   675 	if (roundLimit == 0) or (roundLimit == nil) then
   669 		roundLimit = 3
   676 		roundLimit = 3
   670 	end
   677 	end
   671 
   678 
       
   679 	if mapID == nil then
       
   680 		mapID = 2 + GetRandom(7)
       
   681 	end
       
   682 
   672 end
   683 end
   673 
   684 
   674 function onGameInit()
   685 function onGameInit()
   675 
   686 
   676 		Theme = "Cave"
   687 		Theme = "Cave"
   677 
   688 
   678 		MapGen = mgDrawn
   689 		MapGen = mgDrawn
   679 		TemplateFilter = 0
   690 		TemplateFilter = 0
   680 
   691 
   681 		EnableGameFlags(gfInfAttack, gfDisableWind)
   692 		EnableGameFlags(gfInfAttack, gfDisableWind, gfBorder)
   682 		DisableGameFlags(gfSolidLand)
   693 		DisableGameFlags(gfSolidLand)
   683 		CaseFreq = 0
   694 		CaseFreq = 0
   684         TurnTime = 90000
   695         TurnTime = 90000
   685         WaterRise = 0
   696         WaterRise = 0
   686 
   697 
  1184             DeclareAchievement(raceType, teamNameArr[i], map, teamScore[i])
  1195             DeclareAchievement(raceType, teamNameArr[i], map, teamScore[i])
  1185         end
  1196         end
  1186     end
  1197     end
  1187 end
  1198 end
  1188 
  1199 
  1189 
  1200 function onAmmoStoreInit()
  1190 
  1201 
       
  1202 	SetAmmo(amSkip, 9, 0, 0, 0)
       
  1203 
       
  1204 	for i = 1, #atkArray do
       
  1205 		SetAmmo(atkArray[i][1], 0, 0, 0, 1)
       
  1206 	end
       
  1207 
       
  1208 	for i = 1, #utilArray do
       
  1209 		SetAmmo(utilArray[i][1], 0, 0, 0, 1)
       
  1210 	end
       
  1211 
       
  1212 end
       
  1213