Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_cs_2_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
switch attack_tick
4
{
5
    case 60:
6
        do
7
        {
8
            var snake_spawn_x = choose((battle_box.bbox_left + 20), battle_box.x, (battle_box.bbox_right - 20))
9
        } until (snake_spawn_x != snake_spawn_last);
10
        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)
11
        if (snake.y < battle_box.y)
12
            snake.direction = 270
13
        else
14
            snake.direction = 90
15
        snake.image_angle = snake.direction
16
        snake.speed = 3
17
        snake_spawn_last = snake_spawn_x
18
        attack_tick = 0
19
        break
20
}
21
22
attack_tick += 1