Deltarune script viewer

← back to main script listing

gml_Object_o_boxinghud_Draw_0

(view raw script w/o annotations or w/e)
1
if (hide_ui == 1)
2
{
3
    if (topyy >= -800)
4
    {
5
        topyy *= 1.1
6
        topyy -= 50
7
        if (topyy <= -800)
8
            topyy = -800
9
    }
10
}
11
else if (hide_ui == 2)
12
{
13
    if (topyy >= -800)
14
    {
15
        topyy *= 0.95
16
        topyy += 23
17
        if (topyy >= 50)
18
        {
19
            hide_ui = 0
20
            topyy = 50
21
        }
22
    }
23
}
24
else if (global.boxingphase == 0 || global.boxingphase == 3 || o_boxingqueen.phase_transition > 0)
25
{
26
    if (topyy >= 0)
27
    {
28
        topyy *= 0.8
29
        topyy -= 1
30
        if (topyy <= 0)
31
            topyy = 0
32
    }
33
    if (bottomyy < 160)
34
    {
35
        bottomyy += 1
36
        bottomyy *= 1.2
37
        if (bottomyy >= 160)
38
            bottomyy = 160
39
    }
40
}
41
else if (global.boxingphase == 1 || global.boxingphase == 2)
42
{
43
    if (topyy <= 50)
44
    {
45
        topyy *= 1.2
46
        topyy += 4
47
        if (topyy >= 50)
48
            topyy = 50
49
    }
50
    if (bottomyy > 60)
51
    {
52
        bottomyy -= 1
53
        bottomyy *= 0.8
54
        if (bottomyy <= 60)
55
            bottomyy = 60
56
    }
57
}
58
if (hide_ui_quick == 1 || instance_exists(obj_thrash_intro) || instance_exists(obj_thrash_transformation_transition))
59
    return;
60
if (sub_healthbar_count == 0 && o_boxingqueen.health_count < 1 && o_boxingcontroller.wireframe_boxing == 0)
61
{
62
    o_boxingqueen.health_count = 1
63
    if (o_boxingqueen.attackpattern != 99)
64
    {
65
        with (o_boxingqueen)
66
            scr_qb_reset
scr_qb_reset

function scr_qb_reset() //gml_Script_scr_qb_reset { attackcount = 0 attackcountmax = 0 attackpattern = 0 for (i = 0; i < 20; i++) { list_attacktype[i] = 0 list_attackamount[i] = 0 list_attackvariant[i] = 0 list_attackwait[i] = 0 } }
()
67
    }
68
}
69
if (o_boxingcontroller.health_count > 0 && sub_healthbar_count != -1 && o_boxingqueen.sprite_index != spr_bqueen_defeated)
70
{
71
    var _ratio = 3.75
72
    if (sub_healthbar_count == 0)
73
        _ratio = 4.5
74
    draw_set_color(c_white)
75
    draw_text(50, (-31 + topyy), 
BOSS
stringsetloc("BOSS", "o_boxinghud_slash_Draw_0_gml_66_0")
)
76
    draw_set_color(c_black)
77
    draw_rectangle(118, (-30 + topyy - 2), (122 + o_boxingqueen.health_count_max / _ratio), (-20 + topyy + 2), false)
78
    col = merge_colour(c_red, c_black, 0.85)
79
    draw_set_color(col)
80
    draw_rectangle(120, (-30 + topyy), (120 + o_boxingqueen.health_count_max / _ratio), (-20 + topyy), false)
81
    draw_set_color(c_red)
82
    draw_rectangle(120, (-30 + topyy), (120 + o_boxingqueen.health_count_prev / _ratio), (-20 + topyy), false)
83
    draw_set_color(c_lime)
84
    draw_rectangle(120, (-30 + topyy), (120 + o_boxingqueen.health_count / _ratio), (-20 + topyy), false)
85
    draw_set_color(c_white)
86
    draw_set_alpha(healthbar_flash / 100)
87
    healthbar_flash -= 10
88
    draw_rectangle_colour(120, (-30 + topyy), (120 + o_boxingqueen.health_count / _ratio), (-20 + topyy), c_white, c_white, c_white, c_white, false)
89
    draw_set_alpha(1)
90
    o_boxingqueen.health_count_prev_timer -= 1
91
    if (o_boxingqueen.health_count_prev_timer < 1 && o_boxingqueen.health_count_prev > o_boxingqueen.health_count)
92
    {
93
        o_boxingqueen.health_count_prev -= 8
94
        if (o_boxingqueen.health_count_prev < o_boxingqueen.health_count)
95
            o_boxingqueen.health_count_prev = o_boxingqueen.health_count
96
    }
97
    if (o_boxingqueen.health_count < 1)
98
    {
99
        sub_healthbar_count -= 1
100
        if (sub_healthbar_count == -1)
101
        {
102
            if (o_boxingcontroller.wireframe_boxing == 0)
103
                o_boxingqueen.health_count = 0
104
            if (o_boxingcontroller.wireframe_boxing == 1)
105
                o_boxingqueen.phase_transition = 1
106
        }
107
        else
108
        {
109
            if arcade
110
            {
111
                if audio_is_playing(snd_squeaky_bc)
112
                    audio_stop_sound(snd_squeaky)
113
                if audio_is_playing(snd_punchheavythunder_bc)
114
                    audio_stop_sound(snd_punchheavythunder)
115
                if audio_is_playing(snd_ultraswing_bc)
116
                    audio_stop_sound(snd_ultraswing)
117
                if audio_is_playing(punch_ish_1_bc)
118
                    audio_stop_sound(punch_ish_1)
119
                if audio_is_playing(snd_criticalswing_bc)
120
                    audio_stop_sound(snd_criticalswing)
121
                snd_play(snd_scytheburst_bc)
122
            }
123
            else
124
            {
125
                if audio_is_playing(snd_squeaky)
126
                    audio_stop_sound(snd_squeaky)
127
                if audio_is_playing(snd_punchheavythunder)
128
                    audio_stop_sound(snd_punchheavythunder)
129
                if audio_is_playing(snd_ultraswing)
130
                    audio_stop_sound(snd_ultraswing)
131
                if audio_is_playing(punch_ish_1)
132
                    audio_stop_sound(punch_ish_1)
133
                if audio_is_playing(snd_criticalswing)
134
                    audio_stop_sound(snd_criticalswing)
135
                snd_play(snd_scytheburst)
136
            }
137
            if (o_boxinghud.sub_healthbar_count == 0)
138
                o_boxingqueen.health_count_max = 1800
139
            o_boxingqueen.health_count = o_boxingqueen.health_count_max
140
            o_boxingqueen.health_count_prev = o_boxingqueen.health_count_max
141
            o_boxingqueen.phase_transition = 1
142
            o_boxingqueen.state = 1
143
            o_boxingqueen.combo = 0
144
            o_boxingqueen.times_hit_in_a_row = 0
145
            o_boxingqueen.pattern_state = 0
146
            if (o_boxingcontroller.beat_phase1_no_damage_taken_check == 0)
147
                global.flag[527 encount_first_viro] = 1
148
            if (o_boxingcontroller.beat_phase2_no_damage_taken_check == 0 && sub_healthbar_count == 0)
149
                o_boxingcontroller.beat_phase2_no_damage_taken = 1
150
            if (o_boxinghud.sub_healthbar_count == 1)
151
            {
152
                with (o_boxingqueen)
153
                {
154
                    scr_qb_reset
scr_qb_reset

function scr_qb_reset() //gml_Script_scr_qb_reset { attackcount = 0 attackcountmax = 0 attackpattern = 0 for (i = 0; i < 20; i++) { list_attacktype[i] = 0 list_attackamount[i] = 0 list_attackvariant[i] = 0 list_attackwait[i] = 0 } }
()
155
                    attackpattern = 2
156
                    if (usedbaseball == 0)
157
                    {
158
                        attackpattern = 1.4
159
                        usedbaseball = 1
160
                    }
161
                }
162
                obj_gigaqueen_enemy.recentphasetransition = 2
163
            }
164
            if (o_boxinghud.sub_healthbar_count == 0 && o_boxingcontroller.beat_phase2_no_damage_taken == 0)
165
            {
166
                with (o_boxingqueen)
167
                {
168
                    scr_qb_reset
scr_qb_reset

function scr_qb_reset() //gml_Script_scr_qb_reset { attackcount = 0 attackcountmax = 0 attackpattern = 0 for (i = 0; i < 20; i++) { list_attacktype[i] = 0 list_attackamount[i] = 0 list_attackvariant[i] = 0 list_attackwait[i] = 0 } }
()
169
                    attackpattern = 15
170
                }
171
                obj_gigaqueen_enemy.recentphasetransition = 3
172
            }
173
            if (o_boxinghud.sub_healthbar_count == 0 && o_boxingcontroller.beat_phase2_no_damage_taken == 1)
174
            {
175
                with (o_boxingqueen)
176
                {
177
                    scr_qb_reset
scr_qb_reset

function scr_qb_reset() //gml_Script_scr_qb_reset { attackcount = 0 attackcountmax = 0 attackpattern = 0 for (i = 0; i < 20; i++) { list_attacktype[i] = 0 list_attackamount[i] = 0 list_attackvariant[i] = 0 list_attackwait[i] = 0 } }
()
178
                    attackpattern = 21
179
                }
180
                o_boxingcontroller.phase3_hit_check = 1
181
                obj_gigaqueen_enemy.recentphasetransition = 3
182
            }
183
            instance_create(o_boxingcontroller.x, y, obj_bq_fist_flash)
184
            obj_bq_fist_flash.rep = 3
185
        }
186
    }
187
    if (sub_healthbar_count == 2)
188
    {
189
        draw_sprite_ext(spr_sub_healthbar, 0, 140, (topyy - 7), (image_xscale * 1.2), (image_yscale * 1.2), 0, c_black, 1)
190
        draw_sprite_ext(spr_sub_healthbar, 0, 140, (topyy - 7), image_xscale, image_yscale, 0, c_white, 1)
191
    }
192
    if (sub_healthbar_count >= 1)
193
    {
194
        draw_sprite_ext(spr_sub_healthbar, 0, 125, (topyy - 7), (image_xscale * 1.2), (image_yscale * 1.2), 0, c_black, 1)
195
        draw_sprite_ext(spr_sub_healthbar, 0, 125, (topyy - 7), image_xscale, image_yscale, 0, c_white, 1)
196
    }
197
    if (sub_healthbar_count <= 1)
198
    {
199
        draw_sprite_ext(spr_sub_healthbar_black, 0, 140, (topyy - 7), (image_xscale * 1.2), (image_yscale * 1.2), 0, c_black, 1)
200
        draw_sprite_ext(spr_sub_healthbar_black, 0, 140, (topyy - 7), image_xscale, image_yscale, 0, c_white, 1)
201
    }
202
    if (sub_healthbar_count == 0)
203
    {
204
        draw_sprite_ext(spr_sub_healthbar_black, 0, 125, (topyy - 7), (image_xscale * 1.2), (image_yscale * 1.2), 0, c_black, 1)
205
        draw_sprite_ext(spr_sub_healthbar_black, 0, 125, (topyy - 7), image_xscale, image_yscale, 0, c_white, 1)
206
    }
207
}