Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_martlet_final_2_base_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
mask_index = spr_martlet_f2_torso
4
if (martlet_sprites_reset == true)
5
{
6
    martlet_animation_enabled = true
7
    martlet_sprites_reset = false
8
    sprite_index = martlet_sprite_base
9
    image_xscale = 1
10
    image_yscale = 1
11
}
12
if (sprite_index == martlet_sprite_base)
13
{
14
    with (obj_martlet_body_part_base)
15
        visible = true
16
}
17
else
18
{
19
    if (sprite_index != spr_martlet_f2_start)
20
        image_speed = 1
21
    martlet_animation_enabled = false
22
    with (obj_martlet_body_part_base)
23
        visible = false
24
}
25
if (martlet_animation_enabled == true)
26
{
27
    no_loop = false
28
    sin_timer += 33
29
    if (sin_timer > 2000000)
30
        sin_timer = 0
31
    image_angle = (cos(current_time / 750)) * -3
32
    y = ystart + (cos(current_time / 750)) * 3
33
    x = xstart + damage_disjoint_x
34
    with (martlet_head)
35
    {
36
        y = ystart + (cos(current_time / 750)) * 3
37
        x = xstart + (cos(current_time / 750)) * 3 + other.damage_disjoint_x
38
    }
39
    with (martlet_hair)
40
    {
41
        y = ystart + (cos(current_time / 750)) * 3
42
        x = xstart + (cos(current_time / 750)) * 3 + other.damage_disjoint_x
43
    }
44
    with (martlet_fist_left)
45
    {
46
        y = ystart + (cos(current_time / 750)) * 2
47
        x = xstart + (sin(current_time / 750)) * 2 + other.damage_disjoint_x
48
        image_angle = (cos(current_time / 750)) * 8
49
    }
50
    with (martlet_fist_right)
51
    {
52
        y = ystart + (cos(current_time / 750)) * 4
53
        x = xstart + (sin(current_time / 900)) * 4 + other.damage_disjoint_x
54
        image_angle = (cos(current_time / 900)) * 6
55
    }
56
    with (martlet_legs)
57
    {
58
        image_xscale = 1 + (sin(current_time / 750)) * 0.02
59
        x = xstart + other.damage_disjoint_x
60
    }
61
}
62
else if (!no_loop)
63
{
64
    no_loop = true
65
    sin_timer = 0
66
    image_angle = 0
67
    y = lerp(y, ystart, 0.25)
68
    x = lerp(x, xstart, 0.25)
69
}
70
else
71
    x = xstart + damage_disjoint_x
72
if (damage_disjoint_count > 0)
73
    damage_disjoint_count -= 1
74
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
75
{
76
    damage_disjoint_count = 12
77
    no_loop_damage_disjoint_count = true
78
}
79
else if (!instance_exists(obj_text_damage_count))
80
    no_loop_damage_disjoint_count = false
81
if (damage_disjoint_count == 12)
82
    damage_disjoint_x = -50
83
else if (damage_disjoint_count == 10)
84
    damage_disjoint_x = 50
85
else if (damage_disjoint_count == 8)
86
    damage_disjoint_x = -20
87
else if (damage_disjoint_count == 6)
88
    damage_disjoint_x = 20
89
else if (damage_disjoint_count == 4)
90
    damage_disjoint_x = -10
91
else if (damage_disjoint_count == 2)
92
    damage_disjoint_x = 10
93
else if (damage_disjoint_count == 0)
94
    damage_disjoint_x = 0
95
if (martlet_target_melt_sprite != martlet_previous_melt_sprite && martlet_previous_melt_sprite_alpha == 0)
96
{
97
    sprite_index = martlet_target_melt_sprite
98
    martlet_previous_melt_sprite_alpha = 1
99
}
100
martlet_previous_melt_sprite_alpha = lerp(martlet_previous_melt_sprite_alpha, 0, 0.1)
101
if (martlet_previous_melt_sprite_alpha <= 0.1)
102
{
103
    martlet_previous_melt_sprite_alpha = 0
104
    martlet_previous_melt_sprite = martlet_target_melt_sprite
105
}
106
if (healthbar_timer > 0)
107
    healthbar_timer--
108
else if (healthbar_alpha > 0)
109
    healthbar_alpha -= 0.1
110
if (damage_flash_timer > 0)
111
    damage_flash_timer -= 1
112
if (image_alpha > 0)
113
{
114
    with (obj_heart_yellow_shot)
115
    {
116
        if place_meeting(x, y, obj_martlet_final_2_base)
117
        {
118
            other.healthbar_timer = other.healthbar_timer_max
119
            other.healthbar_alpha = 1
120
            other.damage_flash_timer = 3
121
            var shot_damage = 3
122
            global.current_hp_enemy = clamp((global.current_hp_enemy - shot_damage), 1, 9999)
123
            global.current_hp_enemy_draw = global.current_hp_enemy
124
            audio_play_sound(snd_arc_hit, 0.1, 0)
125
            if (object_index != obj_heart_yellow_shot_blast_collider)
126
                instance_destroy()
127
        }
128
    }
129
}