Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_axis_turret_circling_geno_Step_0

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
switch (scene)
4
{
5
    case 0:
6
        var heart = obj_heart_battle_fighting_parent;
7
        attack_target_x = heart.x;
8
        attack_target_y = heart.y;
9
        if (!fade_out)
10
        {
11
            if (image_alpha < 1)
12
                image_alpha += 0.1;
13
            else if (!alarm[0])
14
                alarm[0] = 30;
15
        }
16
        else if (image_alpha > 0)
17
        {
18
            image_alpha -= 0.1;
19
        }
20
        else
21
        {
22
            instance_destroy();
23
        }
24
        image_xscale = lerp(image_xscale, 1, 0.15);
25
        image_yscale = image_xscale;
26
        if (can_track == true)
27
        {
28
            x = attack_target_x + lengthdir_x(attack_distance, attack_dir);
29
            y = attack_target_y + lengthdir_y(attack_distance, attack_dir);
30
            image_angle = point_direction(x, y, attack_target_x, attack_target_y);
31
        }
32
        if (image_alpha < 1 && can_move == false)
33
        {
34
            image_alpha += 0.2;
35
            if (image_alpha > 1)
36
                image_alpha = 1;
37
        }
38
        if (attack_dir < 360)
39
            attack_dir += bullet_speed;
40
        else
41
            attack_dir = bullet_speed;
42
        break;
43
    case 1:
44
        image_speed = 1;
45
        var shootsnd = audio_play_sound(snd_arc_shoot, 1, 0);
46
        audio_sound_gain(shootsnd, 0.3, 0);
47
        var bullet = instance_create_depth(x, y, depth + 1, obj_battle_enemy_attack_axis_turret_bullet_geno);
48
        bullet.direction = image_angle;
49
        bullet.image_angle = bullet.direction;
50
        bullet.speed = 11;
51
        direction = image_angle;
52
        speed = -5;
53
        shot_number--;
54
        scene++;
55
        break;
56
    case 2:
57
        if (cutscene_wait(0.12))
58
        {
59
            if (shot_number > 0)
60
                scene = 1;
61
            else
62
                scene = 3;
63
        }
64
        break;
65
    case 3:
66
        image_alpha -= 0.2;
67
        if (image_alpha <= 0)
68
            instance_destroy();
69
        break;
70
}
71
if (image_xscale > 1.01)
72
    image_xscale = lerp(image_xscale, 1, 0.15);
73
else
74
    image_xscale = 1;
75
image_yscale = image_xscale;