sMoheekSwimming
0
-1
-3
0
oEnemy
<undefined>
1
603
7
0
0
-1
2
self
0
0
1
action_inherited();
makeActive();
setCollisionBounds(-8, -4, 8, 12);
myhealth = 60;
damage = 35;
hitsound = sndEHit1;
deathsound = sndEDeath2;
platyoffset = -4;
frozenspr = sMoheekSwimming_Frozen;
target = 0;
canattack = 1;
flipx = 1;
state = 0;
facing = 1;
stuntime = 5;
alarm[0] = 30 + random(60);
accelx = 0.1;
accely = 0.05;
maxspx = 3;
maxspy = 2;
targetx = x;
targety = y;
startx = x;
starty = y;
currtgt = 0;
for (i = 0; i < 10; i += 1) {
tgtx[i] = x;
tgty[i] = y;
}
tgtx[1] = startx + 32;
tgty[1] = starty + 32;
tgtx[2] = startx + 64;
tgty[2] = starty;
tgtx[3] = startx + 32;
tgty[3] = starty;
tgtx[4] = startx;
tgty[4] = starty;
1
603
7
0
0
-1
2
self
0
0
1
bubble = instance_create(x, y - 8, oLBubble);
if (instance_exists(bubble)) bubble.alarm[0] = 60;
alarm[0] = 30 + random(60);
1
603
7
0
0
-1
2
self
0
0
1
enemy_active_check(30);
enemy_target_check(120, 1);
if (active == 1 && frozen == 0) {
if (state == 0) {
accelx = 0.05;
accely = 0.05;
maxspx = 1;
maxspy = 1;
if (point_distance(x, y, targetx, targety) < 8) {
currtgt += 1;
if (tgtx[currtgt] == startx && tgty[currtgt] == starty) currtgt = 0;
targetx = tgtx[currtgt];
targety = tgty[currtgt];
}
if (point_distance(x, y, oCharacter.x, oCharacter.y) < 64 && statetime > 120) {
state = 1;
statetime = 0;
}
}
if (state == 1) {
accelx = 0.1;
accely = 0.05;
maxspx = 3;
maxspy = 2;
targetx = oCharacter.x;
targety = oCharacter.y - 8;
if (statetime >= 300) {
state = 0;
statetime = 0;
}
}
if (targetx > x) xVel += accelx;
if (targetx < x) xVel -= accelx;
if (targety > y) yVel += accely;
if (targety < y) yVel -= accely;
xVel = min(xVel, maxspx);
xVel = max(xVel, -maxspx);
yVel = min(yVel, maxspy);
yVel = max(yVel, -maxspy);
if (yVel < 0 && y < global.waterlevel + 20) yVel = 0;
if (xVel >= 0) {
facing = 1;
} else facing = -1;
if (stun == 0) moveTo(xVel, yVel);
image_speed = 0.25;
} // if (active == 1 && frozen == 0)
if (state == 100) enemy_death();
event_inherited();
1
603
7
0
0
-1
2
self
0
0
1
event_inherited();
if (state != 100) {
xVel *= 0.5;
yVel *= 0.5;
state = 1;
statetime = 0;
}
0
0
0
0.5
0.100000001490116
0
0.100000001490116
0.100000001490116
0.200000002980232
-1
-1