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