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/oWarpPipeTrigger.object.gmx

228 lines
6.4 KiB

<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>sprWarpDoor</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>90</depth>
<persistent>0</persistent>
<parentName>&lt;undefined&gt;</parentName>
<maskName>sEDTrigger</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>
posx = x + 8;
state = 0;
statetime = 0;
door_open = 0;
image_speed = 0;
targetroom = rm_a0h02;
targetx = 1104;
targety = 448;
alarm[0] = 1;
</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>if (oCharacter.state == 60 &amp;&amp; point_distance(x + 8, y + 16, oCharacter.x, oCharacter.y) &lt; 32) {
state = 2;
statetime = 0;
}
</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>//if (instance_id == inst_133698) exit;
if (state == 1) {
if (statetime == 0) {
image_index = 8;
door_open = 1;
oCharacter.canbehit = 0;
}
if (statetime &lt; 60) {
if (oCharacter.x &gt; posx) with (oCharacter) x -= 1;
if (oCharacter.x &lt; posx) with (oCharacter) x += 1;
}
if (statetime == 60) {
depth = -2; // originally 90
door_open = 0;
sfx_play(sndA5WarpDoor);
}
if (statetime == 90) {
fx = instance_create(oCharacter.x, oCharacter.y, oWarpPlayerFX);
fx.direction = direction;
fx.speed = 8;
fx.mode = 0;
with (oCharacter) visible = false;
sfx_play(sndA5Warp);
}
if (statetime == 120) {
global.targetx = targetx;
global.targety = targety;
global.camstartx = targetx;
global.camstarty = targety;
oCamera.x = global.camstartx;
oCamera.y = global.camstarty;
global.offsetx = 0;
global.offsety = 0;
oCharacter.x = 0;//
oCharacter.y = 0;//
room_change(targetroom, 0);
Mute_Loops();
}
} // if (state == 1)
if (state == 2) {
if (statetime == 0) {
depth = -90;
image_index = 0;
fx = instance_create(oCharacter.x + lengthdir_x(160, direction), oCharacter.y + lengthdir_y(160, direction), oWarpPlayerFX);
fx.direction = direction + 180;
fx.speed = 8;
fx.mode = 1;
}
if (statetime == 60) {
sfx_play(sndA5WarpDoor);
door_open = 1;
with (oCharacter) visible = true;
}
if (statetime == 72) depth = 90;
if (statetime == 90) {
with (oCharacter) {
state = 23;
statetime = 0;
morphing = 0;
turning = 0;
canbehit = 1;
}
state = 3;
statetime = 0;
}
} // if (state == 2)
if (state == 3) {
if (statetime &gt; 30 &amp;&amp; point_distance(x + 8, y + 16, oCharacter.x, oCharacter.y) &gt; 40) {
state = 0;
statetime = 0;
}
}
if (state == 0) {
if (door_open == 0) {
if (point_distance(x + 8, y + 16, oCharacter.x, oCharacter.y) &lt; 40) {
door_open = 1;
sfx_stop(sndA5WarpDoor);
sfx_play(sndA5WarpDoor);
}
} else if (point_distance(x + 8, y + 16, oCharacter.x, oCharacter.y) &gt;= 40) {
door_open = 0;
sfx_stop(sndA5WarpDoor);
sfx_play(sndA5WarpDoor);
}
}
if (door_open) {
if (image_index &lt; 8) image_index += 0.5;
} else if (image_index &gt; 0) image_index -= 0.5;
statetime += 1;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="4" ename="oCharacter">
<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>//if (instance_id == inst_133698) { exit; }
if (other.state == 23 &amp;&amp; other.xVel == 0 &amp;&amp; state == 0) {
with (other) {
state = 60;
statetime = 0;
}
state = 1;
statetime = 0;
sfx_play(sndMorphBallSlot);
}
</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>