Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_feisty_four_mooch_body_full_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 (mooch_fly_away == true && mooch_fly_away_no_loop == false)
4
{
5
    sprite_index = spr_feisty_four_mooch_hurt
6
    alarm[0] = 150
alarm[0]

instance_destroy(self, false)
7
    scr_screenshake_battle
scr_screenshake_battle

function scr_screenshake_battle() //gml_Script_scr_screenshake_battle { instance_destroy(obj_screenshake_battle) var screenshake = instance_create(0, 0, obj_screenshake_battle) battle_screenshake_duration = argument[0] battle_screenshake_intensity = argument[1] battle_screenshake_dec = battle_screenshake_intensity / battle_screenshake_duration }
(15, 3)
8
    hspeed = -30
9
    vspeed = -20
10
    mooch_fly_away_no_loop = true
11
    audio_play_sound(snd_attackhitcrit, 1, 0)
12
    obj_enemy_controller_feisty_four.current_hp_mooch -= 1
13
    return;
14
}
15
if (mooch_fly_away_no_loop == true)
16
{
17
    image_angle -= 40
18
    return;
19
}
20
if (enemy_dead == false && enemy_spared == false)
21
    image_alpha = global.image_alpha_enemy_attacking
22
if (enemy_dead == true)
23
{
24
    x = starting_point_x
25
    y = starting_point_y
26
    instance_create(starting_point_x, starting_point_y, obj_dalv_dead)
27
    instance_destroy()
28
    return;
29
}
30
else if (enemy_spared == true)
31
{
32
    sprite_index = spr_dalv_spared
33
    x = starting_point_x
34
    y = starting_point_y
35
    image_xscale = starting_point_xscale
36
    image_yscale = starting_point_yscale
37
    image_alpha = 0.5
38
    if (no_loop_create_clouds == false)
39
    {
40
        for (i = 0; i <= 11; i += 1)
41
            instance_create(x, (y - 100), obj_spare_cloud)
42
    }
43
    no_loop_create_clouds = true
44
}
45
if (damage_disjoint_count > 0)
46
    damage_disjoint_count -= 1
47
else if (enemy_dead == false && enemy_spared == false)
48
{
49
    if (global.current_hp_enemy <= 0)
50
        sprite_index = spr_feisty_four_mooch_body_full
51
    else
52
        sprite_index = spr_feisty_four_mooch_body_full
53
}
54
if (instance_exists(obj_text_damage_count) && ((global.fight_number == 1 && global.enemy_count == 1) || (global.fight_number == 2 && global.enemy_count == 2)) && no_loop_damage_disjoint_count == false)
55
{
56
    time_elapsed = 0
57
    sign_modifier = 1
58
    damage_disjoint_count = 12
59
    no_loop_damage_disjoint_count = true
60
}
61
else if (!instance_exists(obj_text_damage_count))
62
    no_loop_damage_disjoint_count = false
63
if (damage_disjoint_count == 12)
64
    damage_disjoint_x = -50
65
else if (damage_disjoint_count == 10)
66
    damage_disjoint_x = 50
67
else if (damage_disjoint_count == 8)
68
    damage_disjoint_x = -20
69
else if (damage_disjoint_count == 6)
70
    damage_disjoint_x = 20
71
else if (damage_disjoint_count == 4)
72
    damage_disjoint_x = -10
73
else if (damage_disjoint_count == 2)
74
    damage_disjoint_x = 10
75
else if (damage_disjoint_count == 0)
76
    damage_disjoint_x = 0
77
if (damage_disjoint_count > 0)
78
{
79
    if (global.current_hp_enemy <= 0)
80
        sprite_index = spr_feisty_four_ace_body_legs
81
    else
82
        sprite_index = hurt_sprite
83
    image_xscale = starting_point_xscale
84
    image_yscale = starting_point_yscale
85
}
86
else if (sprite_index == hurt_sprite)
87
    sprite_index = spr_feisty_four_mooch_body_full
88
if (global.current_hp_enemy <= 0)
89
{
90
    time_elapsed = 0
91
    sign_modifier = 1
92
}
93
x = draw_position_x + damage_disjoint_x
94
y = draw_position_y + damage_disjoint_y
95
if ((!((instance_exists(obj_text_damage_count) && global.fight_number == 1))) && enemy_dead == false && enemy_spared == false)
96
{
97
    game_maker_cannot_do_math = power((time_elapsed / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
98
    animation_disjoint_yscale = sign_modifier * (max_rise - game_maker_cannot_do_math)
99
    image_yscale = draw_position_yscale + animation_disjoint_yscale
100
    image_xscale = draw_position_xscale - animation_disjoint_yscale * (max_rise_ext / max_rise)
101
    var image_yscale_store = image_yscale
102
    time_elapsed += time_increase
103
    if (time_elapsed >= time_max)
104
    {
105
        time_elapsed = 0
106
        sign_modifier = (-sign_modifier)
107
    }
108
    animating = true
109
}
110
else
111
    animating = false
112
if (vanish == true)
113
{
114
    if (vanish_state == 1)
115
    {
116
        game_maker_cannot_do_math = power((time_elapsed_move / (time_max_move * 0.5 / 2 * (1 / (sqrt(max_rise_move * 0.15)))) - (sqrt(max_rise_move * 0.15))), 2)
117
        animation_disjoint_x_move = (-sign_modifier_move) * (max_rise_move * 0.15 - game_maker_cannot_do_math)
118
        x = draw_position_x + animation_disjoint_x_move
119
        time_elapsed_move += time_increase_move
120
        if (time_elapsed_move > (time_max_move * 0.5 / 2))
121
        {
122
            time_elapsed_move = 0
123
            vanish_state = 2
124
        }
125
    }
126
    if (vanish_state == 2)
127
    {
128
        game_maker_cannot_do_math = power((time_elapsed_move / (time_max_move / 2 * (1 / sqrt(max_rise_move))) - sqrt(max_rise_move)), 2)
129
        animation_disjoint_x_move = sign_modifier_move * (max_rise_move - game_maker_cannot_do_math)
130
        x = draw_position_x + animation_disjoint_x_move
131
        time_elapsed_move += time_increase_move
132
        if (time_elapsed_move > (time_max_move / 2))
133
            instance_destroy()
134
    }
135
}