10380
|
1 |
|
|
2 |
local ta_pointsize = 63
|
|
3 |
local ta_radius = (ta_pointsize * 10 + 6) / 2
|
|
4 |
|
|
5 |
local sqrttwo = math.sqrt(2)
|
|
6 |
|
|
7 |
-- creates round test area
|
|
8 |
function AddTestArea(testarea)
|
|
9 |
step = 100
|
|
10 |
xstep = step * testarea["xdir"]
|
|
11 |
ystep = step * testarea["ydir"]
|
|
12 |
x = testarea["x"]
|
|
13 |
y = testarea["y"]
|
|
14 |
if xstep * ystep ~= 0 then
|
|
15 |
xstep = math.floor(xstep / sqrttwo)
|
|
16 |
ystep = math.floor(ystep / sqrttwo)
|
|
17 |
end
|
|
18 |
AddPoint(x, y, ta_pointsize);
|
|
19 |
AddPoint(x + xstep, y + ystep, ta_pointsize, true);
|
|
20 |
end
|
|
21 |
|
|
22 |
-- vertical test area
|
|
23 |
local taa_v2 = {x= 350, y=1500, xdir= 0, ydir=-1}
|
|
24 |
|
|
25 |
-- fail counter
|
|
26 |
local nfailed = 0
|
|
27 |
local nspawned = 0
|
|
28 |
local ndied = 0
|
|
29 |
|
|
30 |
function onGameInit()
|
|
31 |
-- At first we have to overwrite/set some global variables
|
|
32 |
-- that define the map, the game has to load, as well as
|
|
33 |
-- other things such as the game rules to use, etc.
|
|
34 |
-- Things we don't modify here will use their default values.
|
|
35 |
|
|
36 |
-- The base number for the random number generator
|
|
37 |
Seed = 1
|
|
38 |
-- The map to be played
|
10421
|
39 |
MapGen = mgDrawn
|
10380
|
40 |
-- The theme to be used
|
|
41 |
Theme = "Bamboo"
|
|
42 |
-- Game settings and rules
|
|
43 |
EnableGameFlags(gfOneClanMode, gfDisableWind, gfDisableLandObjects, gfDisableGirders)
|
|
44 |
CaseFreq = 0
|
|
45 |
MinesNum = 0
|
|
46 |
Explosives = 0
|
|
47 |
|
|
48 |
-- No damage please
|
|
49 |
DamagePercent = 1
|
|
50 |
|
|
51 |
-- Draw Map
|
|
52 |
AddPoint(10,30,0) -- hog spawn platform
|
|
53 |
-- test areas
|
|
54 |
AddTestArea(taa_v2)
|
|
55 |
|
|
56 |
FlushPoints()
|
|
57 |
|
|
58 |
-- Create the player team
|
|
59 |
AddTeam("'Zooka Team", 14483456, "Simple", "Island", "Default")
|
|
60 |
-- And add a hog to it
|
|
61 |
player = AddHog("Hunter", 0, 1, "NoHat")
|
|
62 |
-- place it on how spawn platform
|
|
63 |
SetGearPosition(player, 10, 10)
|
|
64 |
end
|
|
65 |
|
10381
|
66 |
function onNewTurn()
|
10380
|
67 |
if not TestRectForObstacle(300, 1500, 400, 1900, true) then
|
|
68 |
WriteLnToConsole('HOLE DETECTED')
|
|
69 |
EndLuaTest(TEST_SUCCESSFUL)
|
10381
|
70 |
else
|
|
71 |
WriteLnToConsole('FIRE DID NOT BURN THROUGH!')
|
|
72 |
EndLuaTest(TEST_FAILED)
|
10380
|
73 |
end
|
|
74 |
end
|
|
75 |
|
|
76 |
|
|
77 |
function onGameStart()
|
|
78 |
AddGear(350, 1500, gtHellishBomb, 0, 0, 0, 0)
|
|
79 |
end
|
|
80 |
|