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

instance_create(0, 0, obj_dialogue_battle_win_pregenocide);
119
        no_loop_stomp = true;
120
    }
121
    image_alpha = 0.5;
122
}