blob: 3f9cdc52f5902181002e5c8bb2daa4d384a03d5d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/*-- Brick --*/
#strict 2
local yMin, yMax;
protected func Initialize()
{
SetAction("Flying");
SetPhase(Random(2));
SetDir(Random(2));
ContactTop();
yMin = 100;
yMax = 650;
}
protected func ContactBottom() { SetYDir(-10); }
protected func ContactTop() { SetYDir(10); }
func CheckHit()
{
if (GetXDir() == 0 && GetYDir() == 0)
{
SetXDir(RandomX(-100, 100));
SetYDir(RandomX(-100, 100));
}
if (GetY() >= yMax) ContactBottom();
if (GetY() <= yMin) ContactTop();
}
protected func IgnoreFloatSpell() { return true; }
|