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 = obj_dialogue_box_battle_transformation_any
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
            return;
44
        if (spiral_offset <= 0)
45
        {
46
            var bullet_dir_base = 0
47
            if (side == 1)
48
                bullet_dir_base = 180
49
            spiral_offset = spiral_offset_max
50
            var spiral_count = 4
51
            var spiral_dir_inc = 11
52
            var spiral_dir = (-(((spiral_count - 1) * 0.5 * spiral_dir_inc)))
53
            for (var i = 0; i < spiral_count; i++)
54
            {
55
                var spiral = instance_create_depth(x, y, -100, obj_battle_enemy_attack_flowey_spiral)
56
                spiral.direction = bullet_dir_base + spiral_dir
57
                spiral.speed = 5
58
                spiral_dir += spiral_dir_inc
59
            }
60
        }
61
        else
62
            spiral_offset -= 1
63
        if (bullet_offset <= 0)
64
        {
65
            bullet_dir_base = 0
66
            if (side == 1)
67
                bullet_dir_base = 180
68
            bullet_offset = bullet_offset_max
69
            var bullet_count = 5
70
            var bullet_dir_inc = 11
71
            var bullet_dir = (-(((bullet_count - 1) * 0.5 * bullet_dir_inc)))
72
            for (i = 0; i < bullet_count; i++)
73
            {
74
                var bullet = instance_create_depth(x, y, -100, obj_battle_enemy_attack_fpellets_simple)
75
                bullet.direction = bullet_dir_base + bullet_dir
76
                bullet.speed = 5
77
                bullet_dir += bullet_dir_inc
78
            }
79
        }
80
        else
81
            bullet_offset -= 1
82
        cutscene_wait(1.5)
83
        break
84
    case 5:
85
        image_index = 0
86
        cutscene_wait(0.25)
87
        break
88
    case 6:
89
        side *= -1
90
        cutscene_advance()
91
        break
92
    case 7:
93
        if cutscene_wait(1)
94
        {
95
            bullet_dir = 0
96
            attack_count--
97
            if (attack_count < 0)
98
                instance_destroy(obj_flowey_1_attack_4_creator)
99
            cutscene_advance(4)
100
        }
101
        break
102
}
103
104
if (abs(x - x_target) > 3)
105
    image_alpha = lerp(image_alpha, 0.25, 0.5)
106
else
107
    image_alpha = lerp(image_alpha, 1, 0.5)
108
x = lerp(x, x_target, 0.4)
109
if (scene >= 3)
110
{
111
    if (instance_exists(box) && x > box.x)
112
        image_xscale = 1
113
    else
114
        image_xscale = -1
115
}
116
image_xscale += irandom_range(-0.1, 0.1)
117
image_yscale += irandom_range(-0.1, 0.1)