Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_bigfrog_herofly_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
        image_alpha = lerp(image_alpha, 1.1, 0.25);
7
        if (image_alpha >= 1)
8
        {
9
            image_alpha = 1;
10
            scene++;
11
        }
12
        break;
13
    case 1:
14
        var lerp_speed = 0.2;
15
        x = lerp(x, x_target, lerp_speed);
16
        y = lerp(y, y_target, lerp_speed);
17
        if (abs(x - x_target) <= 5 && abs((y - y_target) <= 5))
18
            scene++;
19
        break;
20
    case 2:
21
        if (target_count > 0)
22
        {
23
            if (target_timer > 0)
24
            {
25
                target_timer--;
26
            }
27
            else
28
            {
29
                var tar = instance_create_depth(irandom_range(target_bounds_left, target_bounds_right), irandom_range(y - 40, y + 40), -110, target_object);
30
                tar.target_x = tar.x;
31
                tar.target_y = tar.y;
32
                target_timer = target_timer_max;
33
                target_count--;
34
            }
35
        }
36
        else
37
        {
38
            target_count = target_count_max;
39
            scene++;
40
        }
41
        break;
42
    case 3:
43
        if (!alarm[0])
44
            alarm[0] = 20;
gml_Object_obj_battle_enemy_attack_bigfrog_herofly_Alarm_0.gml

if (live_call()) return global.live_result; var soul = 2980; scene = 1; x_target = irandom_range(battle_box.bbox_left + 40, battle_box.x - 40); y_target = irandom_range(clamp(soul.y - 15, battle_box.bbox_top + 20, battle_box.bbox_bottom - 20), clamp(soul.y + 15, battle_box.bbox_top + 20, battle_box.bbox_bottom - 20));
45
        break;
46
}