Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_micro_froggit_Step_0

(view raw script w/o annotations or w/e)
1
var enemy_dead = global.enemy_dead
2
var enemy_spared = global.enemy_spared
3
if (enemy_dead == false && enemy_spared == false)
4
    image_alpha = global.image_alpha_enemy_attacking
5
if instance_exists(obj_dialogue_battle_win_genocide)
6
    enemy_dead = true
7
if (enemy_dead == true)
8
{
9
    x = starting_point_x
10
    y = starting_point_y
11
    instance_create(starting_point_x, starting_point_y, obj_micro_froggit_dead)
12
    instance_destroy()
13
    return;
14
}
15
else if (enemy_spared == true)
16
{
17
    x = starting_point_x
18
    y = starting_point_y
19
    image_alpha = 0.5
20
    if (no_loop_create_clouds == false)
21
    {
22
        for (i = 0; i <= 11; i += 1)
23
        {
24
            var micro_cloud = instance_create(x, y, obj_spare_cloud)
25
            micro_cloud.image_xscale = 0.5
26
            micro_cloud.image_yscale = 0.5
27
        }
28
    }
29
    no_loop_create_clouds = true
30
}
31
if (damage_disjoint_count > 0)
32
    damage_disjoint_count -= 1
33
else if (enemy_dead == false && enemy_spared == false)
34
    sprite_index = spr_micro_froggit
35
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && global.attacking_damage_stat > 0 && no_loop_damage_disjoint_count == false)
36
{
37
    time_elapsed = 0
38
    damage_disjoint_count = 12
39
    no_loop_damage_disjoint_count = true
40
}
41
else if (!instance_exists(obj_text_damage_count))
42
    no_loop_damage_disjoint_count = false
43
if (damage_disjoint_count == 12)
44
    damage_disjoint_x = -50
45
else if (damage_disjoint_count == 10)
46
    damage_disjoint_x = 50
47
else if (damage_disjoint_count == 8)
48
    damage_disjoint_x = -20
49
else if (damage_disjoint_count == 6)
50
    damage_disjoint_x = 20
51
else if (damage_disjoint_count == 4)
52
    damage_disjoint_x = -10
53
else if (damage_disjoint_count == 2)
54
    damage_disjoint_x = 10
55
else if (damage_disjoint_count == 0)
56
    damage_disjoint_x = 0
57
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0)
58
    sprite_index = spr_micro_froggit
59
x = draw_position_x + damage_disjoint_x
60
y = draw_position_y + damage_disjoint_y
61
if ((!((instance_exists(obj_text_damage_count) && global.fight_number == 1))) && enemy_dead == false && enemy_spared == false)
62
{
63
    if (jump_type == 0)
64
    {
65
        game_maker_cannot_do_math = power((time_elapsed / (time_max_low / 2 * (1 / sqrt(max_rise_low))) - sqrt(max_rise_low)), 2)
66
        animation_disjoint_y = sign_modifier * (max_rise_low - round(game_maker_cannot_do_math))
67
        time_elapsed += time_increase
68
        if (time_elapsed >= time_max_low)
69
        {
70
            time_elapsed = 0
71
            jump_count += 1
72
            if (jump_count >= jump_count_max_low)
73
            {
74
                jump_count = 0
75
                jump_type = 1
76
            }
77
        }
78
    }
79
    else if (jump_type == 1 && can_jump == true)
80
    {
81
        game_maker_cannot_do_math = power((time_elapsed / (time_max_high / 2 * (1 / sqrt(max_rise_high))) - sqrt(max_rise_high)), 2)
82
        animation_disjoint_y = sign_modifier * (max_rise_high - round(game_maker_cannot_do_math))
83
        time_elapsed += time_increase
84
        if (time_elapsed >= time_max_high)
85
        {
86
            time_elapsed = 0
87
            jump_count += 1
88
            if (jump_count >= jump_count_max_high)
89
            {
90
                jump_count = 0
91
                jump_type = 0
92
            }
93
        }
94
    }
95
    y = draw_position_y + animation_disjoint_y
96
}
97
if (stomped_on == true)
98
{
99
    if (stomp_counter < stomp_counter_max)
100
    {
101
        var shake_direction_x = irandom_range((-shake_intensity_x), shake_intensity_x)
102
        var shake_direction_y = irandom_range((-shake_intensity_y), shake_intensity_y)
103
        stomp_counter += 1
104
    }
105
    else
106
    {
107
        shake_direction_x = 0
108
        shake_direction_y = 0
109
    }
110
    x = draw_position_x + shake_direction_x
111
    y = draw_position_y + shake_direction_y
112
    if (stomp_counter >= stomp_counter_max && no_loop_stomp == false)
113
    {
114
        alarm[0] = 30
alarm[0]

instance_create(0, 0, obj_dialogue_battle_win_pregenocide)
115
        no_loop_stomp = true
116
    }
117
    image_alpha = 0.5
118
}