Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_martlet_wing_gust_body_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
var particles_spawn = false
4
if (sprite_index == spr_martlet_p_full_fly_begin || sprite_index == spr_martlet_g_full_fly_begin)
5
{
6
    if (floor(image_index) == 6 && no_loop_sound == false)
7
    {
8
        audio_play_sound(snd_mart_wings_out, 20, 0)
9
        no_loop_sound = true
10
    }
11
    else if (floor(image_index) > 6)
12
        no_loop_sound = false
13
}
14
else if (sprite_index == spr_martlet_p_full_fly_during || sprite_index == spr_martlet_g_full_fly_during)
15
{
16
    if (fly_state == 0)
17
    {
18
        if (y > (default_y - max_y))
19
        {
20
            if (floor(image_index) >= 2 && floor(image_index) <= 4)
21
                y -= speed_y
22
            if (y <= (default_y - max_y))
23
            {
24
                y = default_y - max_y
25
                fly_state = 1
26
                if (!audio_is_playing(snd_mart_wind))
27
                    audio_play_sound(snd_mart_wind, 20, 1)
28
            }
29
        }
30
    }
31
    if (fly_state == 1)
32
    {
33
        if (floor(image_index) >= 1 && floor(image_index) <= 3)
34
        {
35
            with (obj_heart_battle_fighting_parent)
36
                vsp_factor = round(4.8)
37
        }
38
        else
39
        {
40
            with (obj_heart_battle_fighting_parent)
41
                vsp_factor = 0
42
        }
43
        if (atk_counter_current == 0)
44
            event_user(0)
45
        if (atk_alarm_no_loop == false)
46
        {
47
            alarm[0] = atk_alarm
alarm[0]

event_user(0)
48
            atk_alarm_no_loop = true
49
        }
50
    }
51
    if (fly_state == 2)
52
    {
53
        if (!instance_exists(obj_battle_enemy_attack_martlet_wing_gust_junk))
54
            event_user(1)
55
    }
56
    if (fly_state == 3)
57
    {
58
        if (floor(image_index) == image_index_during_e)
59
        {
60
            image_index = 0
61
            image_speed = 0
62
            fly_state = 4
63
        }
64
    }
65
    if (fly_state == 4)
66
    {
67
        game_maker_cannot_do_math = power((time_elapsed / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
68
        animation_disjoint_y = sign_modifier * (max_rise - round(game_maker_cannot_do_math))
69
        time_elapsed += time_increase
70
        if (time_elapsed >= (time_max + 1))
71
        {
72
            if (sprite_index == spr_martlet_p_full_fly_during)
73
            {
74
                audio_play_sound(snd_mart_pacifistland, 20, 0)
75
                sprite_index = spr_martlet_p_full_fly_end
76
            }
77
            else
78
            {
79
                audio_play_sound(snd_mart_genoland, 20, 0)
80
                sprite_index = spr_martlet_g_full_fly_end
81
            }
82
            image_speed = image_speed_end
83
            image_index = image_index_end
84
        }
85
        y = default_y + animation_disjoint_y
86
    }
87
    if (fly_state < 4)
88
    {
89
        if (floor(image_index) == 2 && no_loop_sound == false)
90
        {
91
            particles_spawn = true
92
            audio_play_sound(snd_mart_flap, 20, 0)
93
            no_loop_sound = true
94
        }
95
        else if (floor(image_index) != 2)
96
            no_loop_sound = false
97
    }
98
}
99
if particles_spawn
100
{
101
    var inc = 22.857142857142858
102
    for (var i = 0; i < 7; i++)
103
    {
104
        var xx = 250 + i * inc
105
        var yy = 270 + (sign(i % 2)) * 20 + (random_range(-10, 10))
106
        part_particles_create(global.ps, xx, yy, global.pt_Effect1, 1)
107
        part_particles_create(global.ps, xx, (yy - 60 + (random_range(-10, 10))), global.pt_Effect1, 1)
108
    }
109
}