You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AM2R-TimeTrials/objects/oMoheekWater.object.gmx

210 lines
5.6 KiB

<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>sMoheekSwimming</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>-3</depth>
<persistent>0</persistent>
<parentName>oEnemy</parentName>
<maskName>&lt;undefined&gt;</maskName>
<events>
<event eventtype="0" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>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 &lt; 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;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="2" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>bubble = instance_create(x, y - 8, oLBubble);
if (instance_exists(bubble)) bubble.alarm[0] = 60;
alarm[0] = 30 + random(60);
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="3" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>enemy_active_check(30);
enemy_target_check(120, 1);
if (active == 1 &amp;&amp; frozen == 0) {
if (state == 0) {
accelx = 0.05;
accely = 0.05;
maxspx = 1;
maxspy = 1;
if (point_distance(x, y, targetx, targety) &lt; 8) {
currtgt += 1;
if (tgtx[currtgt] == startx &amp;&amp; tgty[currtgt] == starty) currtgt = 0;
targetx = tgtx[currtgt];
targety = tgty[currtgt];
}
if (point_distance(x, y, oCharacter.x, oCharacter.y) &lt; 64 &amp;&amp; statetime &gt; 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 &gt;= 300) {
state = 0;
statetime = 0;
}
}
if (targetx &gt; x) xVel += accelx;
if (targetx &lt; x) xVel -= accelx;
if (targety &gt; y) yVel += accely;
if (targety &lt; y) yVel -= accely;
xVel = min(xVel, maxspx);
xVel = max(xVel, -maxspx);
yVel = min(yVel, maxspy);
yVel = max(yVel, -maxspy);
if (yVel &lt; 0 &amp;&amp; y &lt; global.waterlevel + 20) yVel = 0;
if (xVel &gt;= 0) {
facing = 1;
} else facing = -1;
if (stun == 0) moveTo(xVel, yVel);
image_speed = 0.25;
} // if (active == 1 &amp;&amp; frozen == 0)
if (state == 100) enemy_death();
event_inherited();
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="7" enumb="10">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>event_inherited();
if (state != 100) {
xVel *= 0.5;
yVel *= 0.5;
state = 1;
statetime = 0;
}
</string>
</argument>
</arguments>
</action>
</event>
</events>
<PhysicsObject>0</PhysicsObject>
<PhysicsObjectSensor>0</PhysicsObjectSensor>
<PhysicsObjectShape>0</PhysicsObjectShape>
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
<PhysicsObjectGroup>0</PhysicsObjectGroup>
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
<PhysicsObjectKinematic>-1</PhysicsObjectKinematic>
<PhysicsShapePoints/>
</object>