Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_guardener_guy_bow_Step_0

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
var xx = obj_heart_battle_fighting_parent.x;
4
var yy = obj_heart_battle_fighting_parent.y - 10;
5
var point_dir = point_direction(x, y, xx, yy);
6
if (robot_parent != -4)
7
{
8
    switch (robot_parent.object_index)
9
    {
10
        case obj_guardener_guy_a_noarms:
11
            x = robot_parent.x - 3;
12
            y = robot_parent.y - 15;
13
            break;
14
        case obj_guardener_guy_b_noarms:
15
            x = robot_parent.x + 8;
16
            y = robot_parent.y - 16;
17
            break;
18
    }
19
}
20
direction -= (angle_difference(direction, point_dir) * 0.3);
21
image_angle = direction;
22
if (!can_shoot)
23
    exit;
24
if (image_speed == 0)
25
{
26
    if (shoot_delay > 0)
27
    {
28
        shoot_delay--;
29
    }
30
    else
31
    {
32
        sprite_index = spr_guardener_guy_bow_release;
33
        image_index = 0;
34
        image_speed = 1;
35
        if (shoot_noloop == false)
36
        {
37
            var item = instance_create_depth(x, y, depth, obj_battle_enemy_attack_guardener_arrow);
38
            item.direction = direction;
39
            item.speed = 6;
40
            shoot_noloop = true;
41
            audio_play_sound(snd_yellow_soul_dash, 1, 0);
42
            audio_play_sound(snd_undertale_swoosh, 1, 0);
43
            var shoot_sound = audio_play_sound(snd_undertale_swoosh, 1, 0);
44
            audio_sound_gain(shoot_sound, 1, 0.5);
45
        }
46
    }
47
}
48
if (image_index >= (image_number - 1) && sprite_index == spr_guardener_guy_bow_release)
49
{
50
    sprite_index = spr_guardener_guy_bow;
51
    image_speed = 1;
52
    image_index = 0;
53
    shoot_noloop = false;
54
    audio_play_sound(snd_starlo_rope_strain, 1, 0);
55
}