Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_boxing_loss_controller_Draw_0

(view raw script w/o annotations or w/e)
1
timer++;
2
if (state == 0)
3
{
4
    if (timer > (200 / f))
5
        state = 1;
6
}
7
if (state == 1)
8
{
9
    if (image_alpha > 2.2)
10
    {
11
        if (button1_p() || button2_p() || button3_p())
12
        {
13
            state = 2;
14
            instance_create(x, y, o_bq_whitefade);
15
            o_bq_whitefade.depth = -150;
16
        }
17
        if (right_p())
18
            con = 1;
19
        if (left_p())
20
            con = 0;
21
    }
22
    else
23
    {
24
        image_alpha += 0.02;
25
    }
26
}
27
if (state == 2)
28
{
29
    image_alpha += 0.01;
30
    if (image_alpha > 2.6 && con == 1)
31
    {
32
        with (obj_event_manager)
33
            resolve_trophies();
34
        gameend = instance_create(0, 0, DEVICE_FAILURE);
35
        gameend.EVENT = 8;
36
    }
37
    if (image_alpha > 2.6 && con == 0)
38
    {
39
        with (obj_event_manager)
40
            resolve_trophies();
41
        for (j = 0; j < 13; j += 1)
42
            global.item[j] = obj_gigaqueen_enemy.items[j];
43
        for (j = 0; j < 3; j += 1)
44
        {
45
            for (i = 0; i < 13; i += 1)
46
                obj_battlecontroller.tempitem[i][j] = global.item[i];
47
        }
48
        global.battlemsg[0] = stringsetloc(
* GIGA Queen blocks the way!
"* GIGA Queen blocks the way!", "scr_encountersetup_slash_scr_encountersetup_gml_1104_0"
);
49
        instance_create(0, 0, o_bq_whitefade_persistent);
50
        global.batmusic[0] = snd_init("boxing_boss.ogg");
51
        mus_loop_ext(global.batmusic[0], 1, 1);
52
        global.boxingphase = 3;
53
        with (obj_gigaqueen_enemy)
54
        {
55
            balloonorder = 0;
56
            ballooncon = 0;
57
            balloonend = 1;
58
            talkedcon = 0;
59
            playerhasntdodged = 0;
60
            playerhasntdodgedorder = 0;
61
            init = 0;
62
            didntcounterthisturn = 0;
63
            didntpunchthisturn = 0;
64
            didntdodgethisturn = 0;
65
            recentphasetransition = 0;
66
        }
67
        with (o_boxingcontroller)
68
        {
69
            global.hp[1] = global.maxhp[1];
70
            global.tension = 0;
71
            specialcon = 0;
72
            health_count = 200;
73
            dead = 0;
74
            cancontrol = 1;
75
            drawflip = 1;
76
            image_xscale = 2;
77
            dead = 0;
78
            x = xstart;
79
            y = ystart;
80
            sprite_index = spr_bhero;
81
            image_index = 0;
82
            vspeed = 0;
83
            specialcon = 0;
84
            specialcontimer = 0;
85
            special_punch_count = 0;
86
            special_punch_turns = 0;
87
            flameactive = 0;
88
            flametimer = 0;
89
            flamepunch = 0;
90
            swordactive = 0;
91
            swordtimer = 0;
92
            swordpunch = 0;
93
            laseractive = 0;
94
            lasertimer = 0;
95
            laserpunch = 0;
96
            duckactive = 0;
97
            ducktimer = 0;
98
            duckpunch = 0;
99
            turboactive = 0;
100
            turbotimer = 0;
101
            turbopunch = 0;
102
            healactive = 0;
103
            healtimer = 0;
104
            healpunch = 0;
105
        }
106
        with (o_boxinghud)
107
        {
108
            sub_healthbar_count = 2;
109
            healthbar_flash = 0;
110
            hide_ui = 0;
111
            hide_ui_quick = 0;
112
        }
113
        with (o_boxing_wireframe)
114
        {
115
            pacifist_timer = 0;
116
            pacifist_state = 0;
117
            draw_draw_timer = 0;
118
        }
119
        with (o_boxingqueen)
120
        {
121
            health_count = 1500;
122
            phase_transition = 0;
123
            attackcount = 0;
124
            attackcountmax = 0;
125
            useattacklist = 1;
126
            pattern_state = 0;
127
            player_dead_timer = 0;
128
            attackpattern = 0;
129
            attackcon = 0;
130
            attacktype = 1;
131
            punch_amount = 1;
132
            state = 0;
133
            sprite_index = spr_bqueen_idle;
134
            x = xstart;
135
            y = ystart;
136
            scr_qb_reset
scr_qb_reset

function 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; } }
();
137
            with (o_boxingcontroller)
138
                boxingtimer = 270;
139
            event_user(1);
140
        }
141
        with (obj_closing_block_left)
142
            instance_destroy();
143
        with (obj_closing_block_right)
144
            instance_destroy();
145
        with (obj_rotating_sprite)
146
            instance_destroy();
147
        with (obj_rotating_sprites_controller)
148
            instance_destroy();
149
        instance_destroy();
150
    }
151
}
152
draw_set_color(c_white);
153
draw_set_halign(fa_center);
154
draw_set_alpha(image_alpha);
155
draw_text_transformed(340, 150, stringsetloc(
Don't give up...!
"Don't give up...!", "obj_boxing_loss_controller_slash_Draw_0_gml_116_0"
), 2, 2, 0);
156
draw_sprite(spr_bhero_bench, 0, 320, 320);
157
if (o_boxingcontroller.headsprite == spr_bhero_head_a)
158
    draw_sprite(spr_bhero_head_a, 9, 322, 305);
159
if (o_boxingcontroller.headsprite == spr_bhero_head_b)
160
    draw_sprite(spr_bhero_head_b, 9, 320, 306);
161
if (o_boxingcontroller.headsprite == spr_bhero_head_c)
162
    draw_sprite(spr_bhero_head_c, 9, 321, 303);
163
if (o_boxingcontroller.headsprite == spr_bhero_head_d)
164
    draw_sprite(spr_bhero_head_d, 9, 321, 300);
165
draw_set_alpha(image_alpha - 1);
166
draw_sprite(spr_bhero_bench, 0, 320, 320);
167
if (o_boxingcontroller.headsprite == spr_bhero_head_a)
168
    draw_sprite(spr_bhero_head_a, 9, 322, 305);
169
if (o_boxingcontroller.headsprite == spr_bhero_head_b)
170
    draw_sprite(spr_bhero_head_b, 9, 320, 306);
171
if (o_boxingcontroller.headsprite == spr_bhero_head_c)
172
    draw_sprite(spr_bhero_head_c, 9, 321, 303);
173
if (o_boxingcontroller.headsprite == spr_bhero_head_d)
174
    draw_sprite(spr_bhero_head_d, 9, 321, 300);
175
draw_set_halign(fa_left);
176
draw_set_alpha(1);
177
if (con == 0)
178
    draw_sprite_ext(spr_acrade_fightagain, 1, 190, 400, 1, 1, 0, c_white, image_alpha);
179
else
180
    draw_sprite_ext(spr_acrade_fightagain, 0, 190, 400, 1, 1, 0, c_white, image_alpha);
181
if (con == 1)
182
    draw_sprite_ext(scr_84_get_sprite
scr_84_get_sprite

function scr_84_get_sprite(arg0) { return ds_map_find_value(global.chemg_sprite_map, arg0); }
("spr_acrade_retire"), 1, 370, 400, 1, 1, 0, c_white, image_alpha);
183
else
184
    draw_sprite_ext(scr_84_get_sprite
scr_84_get_sprite

function scr_84_get_sprite(arg0) { return ds_map_find_value(global.chemg_sprite_map, arg0); }
("spr_acrade_retire"), 0, 370, 400, 1, 1, 0, c_white, image_alpha);