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-Item-Roulette/objects/oHatchling.object.gmx

325 lines
9.3 KiB

<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>sHatchling</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>-155</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.25;
targetx = x;
targety = y;
accel = 0.4;
maxspeed = 3;
followplayer = 1;
roaring = 0;
alarm[0] = 120 + random(100);
mealtimer = 0;
flash = 0;
chaseX = 0;
alarm1set = 0;
myid = 0;
name = "";
</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>chaseX = 1;
followplayer = 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>if(myid == 0){
if(sprite_index != sFedtogg) sfx_play(choose(sndHatchling,sndHatchling2,sndHatchling3,sndHatchling4));
if(sprite_index == sFedtogg) sfx_play(choose(sndSeptogg1, sndSeptogg2, sndSeptogg3));
alarm[0] = 300 + irandom(320);
roaring = 60;
}
/*sfx_play(sndHatchling);
</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(myid == 0 &amp;&amp; instance_exists(oClient) &amp;&amp; string_lower(oClient.name) == "shirty"){
if(sprite_index != sFedtogg) sprite_index = sFedtogg;
image_speed = 0.33;
}
if(myid != 0 &amp;&amp; string_lower(name) == "shirty"){
if(sprite_index != sFedtogg) sprite_index = sFedtogg;
image_speed = 0.33;
}
if(myid == 0){
if (global.event[304] == 1 &amp;&amp; distance_to_object(oA7Crystal1) &lt; 120) {
tgtobj = instance_nearest(x, y, oA7Crystal1);
if (tgtobj != -4) {
targetx = tgtobj.x + 8;
targety = tgtobj.y + 8;
accel = 0.4;
maxspeed = 3.2;
if (mealtimer &gt; 600) accel *= 2;
}
followplayer = 0;
}
else if (distance_to_object(oXPickup) &lt; 150 ) {
if (chaseX == 1)
{
tgtobj = instance_nearest(x, y, oXPickup);
if (tgtobj != -4) {
targetx = tgtobj.x;
targety = tgtobj.y - 11;
accel = 0.4;
maxspeed = 3.2;
if (mealtimer &gt; 600) accel *= 2;
}
followplayer = 0;
}
else if (alarm1set == 0)
{
alarm1set = 1;
alarm[1] = 45;
}
}
else
{
followplayer = 1;
chaseX = 0;
alarm1set = 0;
}
} else {
if(instance_exists(oClient)){
if(ds_list_size(global.hatchlingList) &gt; 0){
var findHatchlingID = ds_list_find_index(global.hatchlingList, myid);
if(findHatchlingID == -1){
instance_destroy();
}
} else {
instance_destroy();
}
} else {
instance_destroy();
}
}
/*
else if (distance_to_object(oEnemy) &lt; 120 ) {
if (chaseX == 1)
{
tgtobj = instance_nearest(x, y, oEnemy);
if (tgtobj != -4) {
targetx = tgtobj.x;
targety = tgtobj.y - 11;
accel = 0.4;
maxspeed = 3.2;
if (mealtimer &gt; 600) accel *= 2;
}
followplayer = 0;
}
else if (alarm1set == 0)
{
alarm1set = 1;
alarm[1] = 90;
}
}
*/
if (followplayer &amp;&amp; myid == 0) {
targetx = oCharacter.x;
targety = oCharacter.y - 30;
if (distance_to_point(oCharacter.x, oCharacter.y - 16) &gt; 128) {
accel = 0.8;
maxspeed = 8;
}
if (distance_to_point(oCharacter.x, oCharacter.y - 16) &gt; 64) {
accel = 0.6;
maxspeed = 6;
} else if (distance_to_point(oCharacter.x, oCharacter.y - 16) &gt; 32) {
accel = 0.4;
maxspeed = 4;
} else {
accel = 0.3;
maxspeed = 2.5;
}
} else if(followplayer &amp;&amp; myid != 0){
if(instance_exists(oClient)){
if(ds_list_size(global.hatchlingList) &gt; 0){
var findHatchlingID = ds_list_find_index(global.hatchlingList, myid);
if(findHatchlingID &gt;= 0){
if(ds_list_size(oClient.roomListData) &gt; 0){
for(var h=0; h&lt;ds_list_size(oClient.roomListData); h++){
var arrList = oClient.roomListData[| h];
var arrID = arrList[0];
var arrX = arrList[1];
var arrY = arrList[2];
if(arrID == myid){
targetx = arrX;
targety = arrY - 30;
if (distance_to_point(arrX, arrY - 16) &gt; 128) {
accel = 0.8;
maxspeed = 8;
}
if (distance_to_point(arrX, arrY - 16) &gt; 64) {
accel = 0.6;
maxspeed = 6;
} else if (distance_to_point(arrX, arrY - 16) &gt; 32) {
accel = 0.4;
maxspeed = 4;
} else {
accel = 0.3;
maxspeed = 2.5;
}
}
}
} else {
instance_destroy();
}
}
}
}
}
if (roaring &gt; 0) {
roaring -= 1;
image_speed = 1;
} else if (image_speed &gt; 0.25) image_speed -= 0.1;
if (flash &gt; 0) flash -= 0.1;
gravity_direction = point_direction(x, y, targetx, targety);
gravity = accel;
if (speed &gt; 4) speed = maxspeed;
mealtimer += 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>if(myid == 0){
draw_self();
draw_set_blend_mode(bm_add);
draw_sprite_ext(sprite_index, -1, x, y, 1, 1, 0, -1, flash);
draw_set_blend_mode(bm_normal);
} else {
if(global.shaders_compiled &amp;&amp; os_type != os_android){
pal_swap_set(oControl.MultitroidBabyPalette, myid, false);
}
draw_self();
draw_sprite_ext(sprite_index, -1, x, y, 1, 1, 0, -1, flash);
pal_swap_reset();
shader_reset();
}
</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>