Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_axis_turret_real_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
        image_alpha += 0.2
7
        image_angle = direction - 180 + 180 * image_alpha
8
        if (image_alpha >= 1)
9
            scene++
10
        break
11
    case 1:
12
        x = xstart
13
        y = ystart
14
        if (irandom(10) == 1)
15
        {
16
            x = xstart + (random_range(-4, 4))
17
            y = ystart + (random_range(-4, 4))
18
        }
19
        if (can_shoot == true)
20
            cutscene_advance()
21
        break
22
    case 2:
23
        image_speed = 1
24
        audio_play_sound(snd_arc_shoot, 1, 0)
25
        var bullet = instance_create_depth(x, y, -100, obj_battle_enemy_attack_axis_turret_bullet)
26
        bullet.direction = direction
27
        bullet.image_angle = bullet.direction
28
        bullet.speed = 8
29
        speed = -3
30
        shot_number--
31
        scene++
32
        break
33
    case 3:
34
        if cutscene_wait(0.1)
35
        {
36
            if (shot_number > 0)
37
                scene = 2
38
            else
39
                scene = 4
40
        }
41
        break
42
    case 4:
43
        image_alpha -= 0.1
44
        if (image_alpha <= 0)
45
            instance_destroy()
46
        break
47
}
48
49
speed = lerp(speed, 0, 0.2)