Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_flowey_1_attack_4_head_Step_0

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
var box = 3154;
4
var x_target = box.x + (side * 200);
5
switch (scene)
6
{
7
    case 0:
8
        image_xscale += (0.4 * side);
9
        image_yscale += 0.2;
10
        if (abs(image_xscale * side) >= 1.4)
11
            scene++;
12
        break;
13
    case 1:
14
        image_xscale = lerp(image_xscale, 0.8 * side, 0.35);
15
        image_yscale = lerp(image_yscale, 1.2, 0.35);
16
        if (image_yscale >= 1.15)
17
            scene++;
18
        break;
19
    case 2:
20
        image_xscale = lerp(image_xscale, 1 * side, 0.35);
21
        image_yscale = lerp(image_yscale, 1, 0.35);
22
        if (abs(image_yscale - 1) < 0.05)
23
            scene++;
24
        break;
25
    case 3:
26
        if (abs(x - x_origin) > 10 || abs(y - y_origin) > 10)
27
        {
28
            x_origin = x;
29
            y_origin = y;
30
        }
31
        x = x_origin + irandom_range(-3, 3);
32
        y = y_origin + irandom_range(-3, 3);
33
        cutscene_wait(0.35);
34
        break;
35
    case 4:
36
        image_speed = 1;
37
        if (image_index >= (image_number - 1))
38
        {
39
            image_index = image_number - 1;
40
            image_speed = 0;
41
        }
42
        else
43
        {
44
            exit;
45
        }
46
        if (spiral_offset <= 0)
47
        {
48
            var bullet_dir_base = 0;
49
            if (side == 1)
50
                bullet_dir_base = 180;
51
            spiral_offset = spiral_offset_max;
52
            var spiral_count = 4;
53
            var spiral_dir_inc = 11;
54
            var spiral_dir = -((spiral_count - 1) * 0.5 * spiral_dir_inc);
55
            for (var i = 0; i < spiral_count; i++)
56
            {
57
                var spiral = instance_create_depth(x, y, -100, obj_battle_enemy_attack_flowey_spiral);
58
                spiral.direction = bullet_dir_base + spiral_dir;
59
                spiral.speed = 5;
60
                spiral_dir += spiral_dir_inc;
61
            }
62
        }
63
        else
64
        {
65
            spiral_offset -= 1;
66
        }
67
        if (bullet_offset <= 0)
68
        {
69
            var bullet_dir_base = 0;
70
            if (side == 1)
71
                bullet_dir_base = 180;
72
            bullet_offset = bullet_offset_max;
73
            var bullet_count = 5;
74
            var bullet_dir_inc = 11;
75
            var bullet_dir = -((bullet_count - 1) * 0.5 * bullet_dir_inc);
76
            for (var i = 0; i < bullet_count; i++)
77
            {
78
                var bullet = instance_create_depth(x, y, -100, obj_battle_enemy_attack_fpellets_simple);
79
                bullet.direction = bullet_dir_base + bullet_dir;
80
                bullet.speed = 5;
81
                bullet_dir += bullet_dir_inc;
82
            }
83
        }
84
        else
85
        {
86
            bullet_offset -= 1;
87
        }
88
        cutscene_wait(1.5);
89
        break;
90
    case 5:
91
        image_index = 0;
92
        cutscene_wait(0.25);
93
        break;
94
    case 6:
95
        side *= -1;
96
        cutscene_advance();
97
        break;
98
    case 7:
99
        if (cutscene_wait(1))
100
        {
101
            var bullet_dir = 0;
102
            attack_count--;
103
            if (attack_count < 0)
104
                instance_destroy(obj_flowey_1_attack_4_creator);
105
            cutscene_advance(4);
106
        }
107
        break;
108
}
109
if (abs(x - x_target) > 3)
110
    image_alpha = lerp(image_alpha, 0.25, 0.5);
111
else
112
    image_alpha = lerp(image_alpha, 1, 0.5);
113
x = lerp(x, x_target, 0.4);
114
if (scene >= 3)
115
{
116
    if (instance_exists(box) && x > box.x)
117
        image_xscale = 1;
118
    else
119
        image_xscale = -1;
120
}
121
image_xscale += irandom_range(-0.1, 0.1);
122
image_yscale += irandom_range(-0.1, 0.1);