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 != noone)
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 2390:
15
            x = robot_parent.x + 8
16
            y = robot_parent.y - 16
17
            break
18
    }
19
20
}
21
direction -= ((angle_difference(direction, point_dir)) * 0.3)
22
image_angle = direction
23
if (!can_shoot)
24
    return;
25
if (image_speed == 0)
26
{
27
    if (shoot_delay > 0)
28
        shoot_delay--
29
    else
30
    {
31
        sprite_index = spr_guardener_guy_bow_release
32
        image_index = 0
33
        image_speed = 1
34
        if (shoot_noloop == false)
35
        {
36
            var item = instance_create_depth(x, y, depth, obj_battle_enemy_attack_guardener_arrow)
37
            item.direction = direction
38
            item.speed = 6
39
            shoot_noloop = true
40
            audio_play_sound(snd_yellow_soul_dash, 1, 0)
41
            audio_play_sound(snd_undertale_swoosh, 1, 0)
42
            var shoot_sound = audio_play_sound(snd_undertale_swoosh, 1, 0)
43
            audio_sound_gain(shoot_sound, 1, 0.5)
44
        }
45
    }
46
}
47
if (image_index >= (image_number - 1) && sprite_index == spr_guardener_guy_bow_release)
48
{
49
    sprite_index = spr_guardener_guy_bow
50
    image_speed = 1
51
    image_index = 0
52
    shoot_noloop = false
53
    audio_play_sound(snd_starlo_rope_strain, 1, 0)
54
}