Files
AM2R-Community-Updates/objects/oElevator.object.gmx
2020-12-22 20:54:55 -06:00

199 lines
5.4 KiB
XML

<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>sElevator</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>-90</depth>
<persistent>0</persistent>
<parentName>&lt;undefined&gt;</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>image_speed = 0.5;
global.savexpos = x;
active = 1;
state = 0;
statetime = 0;
targety = 0;
mysolid = instance_create(x - 16, y, oSolid1);
mysolid.image_xscale = 2;
elev_dir = 0;
target_top = 0;
target_bottom = 0;
alarm[0] = 1;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="2" enumb="1">
<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>active = 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>event_user(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>//
var canride;
if (collision_line(x - 9, y - 2, x + 9, y - 2, oCharacter, false, true)) {
canride = 1;
} else canride = 0;
//
if (state == 0 &amp;&amp; active &amp;&amp; canride &amp;&amp; (oCharacter.state == 10 || oCharacter.state == 12) &amp;&amp; (elev_dir == 1 &amp;&amp; oControl.kUp || elev_dir == 0 &amp;&amp; oControl.kDown)) {
state = 1;
statetime = 0;
with (oCharacter) {
state = ELEVATOR;
statetime = 0;
canrun = 0;
if (facing == RIGHT) sprite_index = sFrontR;
if (facing == LEFT) sprite_index = sFrontL;
}
}
if (state == 1) {
if (statetime == 20) sfx_loop(sndElevatorLoop);
if (statetime &gt; 20) {
if (y &lt; targety) y += 2;
if (y &gt; targety) y -= 2;
}
oCharacter.y = y;
mysolid.y = y;
if (y == targety) {
with (oCharacter) {
state = IDLE;
statetime = 0;
}
state = 0;
statetime = 0;
active = 0;
alarm[1] = 60;
sfx_stop(sndElevatorLoop);
event_user(0);
}
}
//
statetime += 1;
</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>if (oCharacter.y &lt; room_height / 2) {
y = target_top;
targety = target_bottom;
elev_dir = 0;
} else {
y = target_bottom;
targety = target_top;
elev_dir = 1;
}
mysolid.y = y;
</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>