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

473 lines
13 KiB

<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>sElderSeptogg</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>90</depth>
<persistent>0</persistent>
<parentName>oMovingSolid</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>other</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>/// Initialize.
// Modifiable variables.
max_down_speed = 1; // The max speed it will fall when Sarah is standing on top.
max_up_speed = 2; // The max speed it will rise back to its original position.
// Internal variables.
material = 2;
viscidTop = 1;
makeActive();
image_index = choose(1, 2, 3);
frequency = 0.1;
amplitude = 2;
timer = irandom(100);
parent = irandom(3);
grounded = 0;
lift = 0;
yy = sin(timer*frequency)*amplitude;
alarm[1] = 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>/// Set Septogg sprite based on area.
switch (real(string_char_at(room_get_name(room), 5)))
{
case 1:
flying_sprite = sElderSeptogg_tlRock1AN;
carrying_sprite = sElderSeptogg_tlRock1AN_Carry;
material = 1;
break;
case 2:
flying_sprite = sElderSeptogg_tlRock2NB;
carrying_sprite = sElderSeptogg_tlRock2NB_Carry;
material = 1;
break;
case 3:
var room_let = string(string_char_at(room_get_name(room), 6))
if(room_let == "b") {
flying_sprite = sElderSeptogg_tlArea3Breed;
carrying_sprite = sElderSeptogg_tlArea3Breed_Carry;
material = 5;
}
else {
flying_sprite = sElderSeptogg_tlRock3A;
carrying_sprite = sElderSeptogg_tlRock3A_Carry;
material = 1;
}
break;
case 4:
var room_let = string(string_char_at(room_get_name(room), 6))
if(room_let == "b") {
flying_sprite = sElderSeptogg_tlRock4B;
carrying_sprite = sElderSeptogg_tlRock4B_Carry;
material = 1;
}
else {
flying_sprite = sElderSeptogg_tlRock4A;
carrying_sprite = sElderSeptogg_tlRock4A_Carry;
material = 1;
}
break;
case 5:
flying_sprite = sElderSeptogg_tlRock5A;
carrying_sprite = sElderSeptogg_tlRock5A_Carry;
material = 1;
break;
case 6:
flying_sprite = sElderSeptogg_tlRock6A;
carrying_sprite = sElderSeptogg_tlRock6A_Carry;
material = 1;
break;
default:
var room_num = real(string(string_char_at(room_get_name(room), 7) + string_char_at(room_get_name(room), 8)))
if(room_num &gt;= 16 and room_num &lt;= 23) {
flying_sprite = sElderSeptogg_tlGreenCrystals;
carrying_sprite = sElderSeptogg_tlGreenCrystals_Carry;
material = 1;
}
else if((room_num &gt;= 24 and room_num &lt;= 28) or room_num == 11) {
flying_sprite = sElderSeptogg_tlRock3A;
carrying_sprite = sElderSeptogg_tlRock3A_Carry;
material = 1;
}
else if(room_num &gt;= 5 and room_num &lt;= 15) {
flying_sprite = sElderSeptogg_tlRock1AN;
carrying_sprite = sElderSeptogg_tlRock1AN_Carry;
material = 1;
}
else if(room_num &gt;= 29) {
flying_sprite = sElderSeptogg_tlRock4A;
carrying_sprite = sElderSeptogg_tlRock4A_Carry;
material = 1;
}
else {
switch (global.timeofday) {
case 1:
flying_sprite = sElderSeptoggTwilight;
carrying_sprite = sElderSeptoggTwilight_Carry;
break;
case 2:
flying_sprite = sElderSeptoggNight;
carrying_sprite = sElderSeptoggNight_Carry;
break;
default:
flying_sprite = sElderSeptogg;
carrying_sprite = sElderSeptogg_Carry;
}
material = 2;
}
}
sprite_index = flying_sprite;
</string>
</argument>
</arguments>
</action>
<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>/// Create baby Septoggs if parent.
if(/*(room == rm_a0h01 &amp;&amp; global.timeofday != 2) ||*/ room == rm_a0h05) exit;
repeat(parent) {
var inst = instance_create(x, y, oBabySeptogg);
with (inst) {
parent = other.id;
event_user(0);
}
}
</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>/// Push down from force of jump.
if(oCharacter.state == oCharacter.JUMPING) yVel = 6;
</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>/// Septogg physics.
timer++;
if(timer &gt; 2 * pi/frequency) timer -= 2 * pi/frequency;
if(y&lt;oCharacter.y-1) {
x = -500;
depth = 90
}
else {
x = xstart;
depth = -90
}
if(place_meeting(x, y - 1, oCharacter) and (oCharacter.state != oCharacter.JUMPING)) {
if(!place_meeting(x, y + 1, oSolid)) {
if(lift&lt;=0) {
yVel += 0.1;
if(yVel&gt;max_down_speed) yVel=max_down_speed;
image_speed = 0.55;
grounded = 0;
}
else{
yVel -= 0.1;
if(yVel&lt;-max_down_speed) yVel=-max_down_speed;
image_speed = 0.55;
grounded = 0;
if(y&lt;=ystart-lift) yVel = 0;
}
}
else {
yVel = 0;
image_speed = 0.2;
grounded = 1;
}
timer = 0;
sprite_index = carrying_sprite;
}
else {
if (y&gt;ystart) {
yVel = -min(abs(y - ystart)/15, max_up_speed);
timer = 0;
grounded = 0;
}
if (y&lt;ystart) {
yVel = min(abs(y - ystart)/15, max_up_speed);
timer = 0;
grounded = 0;
}
if(abs(y-ystart)&lt;=1) y = ystart;
if(y&lt;-20) y=-20;
sprite_index = flying_sprite;
image_speed = 0.33;
}
</string>
</argument>
</arguments>
</action>
<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>/// Weapon fizzle.
var collider = collision_rectangle(xstart-8, y, xstart+8, y+24, oBeam, false, false);
if(instance_exists(collider)) {
with(collider) {
event_user(1);
if (!pbeam) instance_destroy();
}
}
collider = collision_rectangle(xstart-8, y, xstart+8, y+24, oMissile, false, true);
if(instance_exists(collider)) {
with(collider) {
event_user(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>/// Destory the dust animation when jumping onto a Septogg.
if(instance_exists(oFXAnimSpark)) {
if(oFXAnimSpark.sprite_index == sSmoke1) {
with(oFXAnimSpark) {
instance_destroy();
}
}
}
if(oCharacter.state != oCharacter.JUMPING) alarm[0] = 2;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="7" enumb="5">
<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>/// Disable moving platform physics.
global.movingobj = 0;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="7" enumb="4">
<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>/// Activate moving platform physics.
global.movingobj = 1;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="8" 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>/// Draw the Septogg.
yy = sin(timer*frequency)*amplitude;
if(lift&gt;0) draw_sprite_ext(sElderSeptoggBackWings, image_index, xstart, y + yy + 4, 1, 1, 0, c_gray, 1);
draw_sprite(sprite_index, image_index, xstart, y + yy);
// Debug
/*
draw_set_alpha(1);
draw_text(xstart, y + yy, string(x) + ", " + string(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>0</PhysicsObjectKinematic>
<PhysicsShapePoints/>
</object>