Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_slither_snake_generator_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
var battle_box = obj_dialogue_box_battle_transformation_any
4
switch attack_tick
5
{
6
    case 30:
7
    case 60:
8
    case 90:
9
        do
10
        {
11
            var snake_spawn_x = choose((battle_box.bbox_left + 20), battle_box.x, (battle_box.bbox_right - 20))
12
        } until (snake_spawn_x != snake_spawn_last);
13
        var snake = instance_create_depth(snake_spawn_x, choose((battle_box.bbox_top - 40), (battle_box.bbox_bottom + 40)), -50, obj_battle_enemy_attack_slither_snake_snake)
14
        if (snake.y < battle_box.y)
15
            snake.direction = 270
16
        else
17
            snake.direction = 90
18
        snake.image_angle = snake.direction
19
        snake_spawn_last = snake_spawn_x
20
        break
21
    case 130:
22
    case 160:
23
    case 190:
24
        do
25
        {
26
            var snake_spawn_y = choose((battle_box.bbox_top + 20), battle_box.y, (battle_box.bbox_bottom - 20))
27
        } until (snake_spawn_y != snake_spawn_last);
28
        snake = instance_create_depth(choose((battle_box.bbox_left - 40), (battle_box.bbox_right + 40)), snake_spawn_y, -50, obj_battle_enemy_attack_slither_snake_snake)
29
        if (snake.x < battle_box.x)
30
            snake.direction = 0
31
        else
32
        {
33
            snake.image_yscale = -1
34
            snake.direction = 180
35
        }
36
        snake.image_angle = snake.direction
37
        snake_spawn_last = snake_spawn_y
38
        break
39
    case 240:
40
        instance_destroy()
41
        break
42
}
43
44
attack_tick += 1