Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_slither_snake_clay_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
        if (!instance_exists(obj_battle_enemy_attack_slither_warning))
7
            scene++
8
        break
9
    case 1:
10
        image_yscale = lerp(image_yscale, 1.51, 0.2)
11
        image_xscale = 1 - image_yscale / 1.5 * 0.3
12
        if (image_yscale >= 1.5)
13
        {
14
            image_xscale = 0.7
15
            image_yscale = 1.5
16
            scene++
17
        }
18
        break
19
    case 2:
20
        image_yscale = lerp(image_yscale, 0.99, 0.25)
21
        image_xscale = 1 - (image_yscale - 1) / 0.5 * 0.3
22
        if (image_yscale <= 1)
23
        {
24
            image_xscale = 1
25
            image_yscale = 1
26
            scene++
27
        }
28
        break
29
    case 3:
30
        cutscene_wait(4)
31
        if (spawn_delay > 0)
32
            spawn_delay--
33
        else
34
        {
35
            var clay_piece = instance_create_depth(x, y, -100, obj_battle_enemy_attack_slither_snake_clay_piece)
36
            clay_piece.direction = spawn_direction
37
            clay_piece.speed = 10
38
            spawn_direction += spawn_direction_inc
39
            if (spawn_direction >= spawn_direction_max || spawn_direction <= spawn_direction_min)
40
            {
41
                spawn_direction_inc *= -1
42
                spawn_direction += (spawn_direction_inc * 0.5)
43
            }
44
            spawn_delay = spawn_delay_max
45
        }
46
        break
47
    case 4:
48
        sprite_index = spr_battle_enemy_attack_sir_slither_clay_finished
49
        image_index = 0
50
        cutscene_advance()
51
        break
52
    case 5:
53
        if (image_index >= (image_number - 1))
54
        {
55
            image_speed = 0
56
            cutscene_wait(0.5)
57
        }
58
        break
59
    case 6:
60
        instance_destroy(obj_battle_enemy_attack_slither_pottery_generator)
61
        break
62
}