1 |
if (instance_exists(obj_mainchara)) |
2 |
dist = distance_to_point(obj_mainchara.x + 20, obj_mainchara.y + 40); |
3 |
if (dist < 160 && con == 0) |
4 |
{ |
5 |
speed1 = 1; |
6 |
con = 2; |
7 |
} |
8 |
if (con == 2) |
9 |
{ |
10 |
image_speed = 0.25; |
11 |
if (image_index == 7) |
12 |
image_index = 3; |
13 |
speed1 *= 1.5; |
14 |
speed1 = clamp(speed1, 0, 8); |
15 |
if (instance_exists(obj_mainchara)) |
16 |
move_towards_point(obj_mainchara.x + 40, obj_mainchara.y + 80, speed1); |
17 |
} |
18 |
scr_depth_alt(); |
19 |
if (place_meeting(x, y, obj_mainchara)) |
20 |
{ |
21 |
sprite_index = spr_poppup_intro; |
22 |
image_index = 0; |
23 |
marker = instance_create(x, y, obj_marker); |
24 |
marker.image_index = image_index; |
25 |
marker.sprite_index = sprite_index; |
26 |
marker.x = x; |
27 |
marker.y = y; |
28 |
marker.image_speed = 0.25; |
29 |
marker.image_xscale = image_xscale; |
30 |
marker.image_yscale = image_yscale; |
31 |
if (topsprite != 0) |
32 |
{ |
33 |
flyoff = instance_create(x + topxoff, (y - 42) + topyoff, obj_poppup_topobjflyaway); |
34 |
flyoff.sprite_index = topsprite; |
35 |
flyoff.image_xscale = 2; |
36 |
flyoff.image_yscale = 2; |
37 |
flyoff.depth = 2; |
38 |
flyoff.image_angle = -10; |
39 |
} |
40 |
scr_battlescr_battlefunction scr_battle(arg0, arg1, arg2, arg3, arg4)
{
global.specialbattle = arg1;
global.encounterno = arg0;
if ( global.flag[9 battle_music] != 2)
{
global.flag[9 battle_music] = 1;
global.batmusic[0] = snd_init("battle.ogg");
}
instance_create(0, 0, obj_battleback);
instance_create(0, 0, obj_encounterbasic);
__enemymarker[0] = arg2;
__enemymarker[1] = arg3;
__enemymarker[2] = arg4;
for (__ien = 0; __ien < 3; __ien++)
{
if (global.monstertype[__ien] != 0 (None))
{
if (!i_ex(__enemymarker[__ien]))
{
__enemymarker[__ien] = scr_dark_marker(global.monstermakex[__ien] + 300, global.monstermakey[__ien], object_get_sprite(global.monsterinstancetype[__ien]));
__enemymarker[__ien].depth = -__ien;
}
__enemymarker[__ien].__ien = __ien;
with (__enemymarker[__ien])
{
scr_move_to_point_over_time(global.monstermakex[__ien], global.monstermakey[__ien], 20);
__doom = instance_create(x, y, obj_doom);
__doom.target = id;
__doom.alarm[0] = 25;
}
}
}
} (51, 0, marker, 0, 0); |
41 |
instance_destroy(); |
42 |
} |