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
alarm[0]

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