Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_bloxer_enemy_Draw_0

(view raw script w/o annotations or w/e)
1
threebuffer -= 1;
2
ss = sin(siner / 4);
3
ssb = cos(siner / 4);
4
if (swaptime == 5)
5
{
6
    returncount = 0;
7
    for (i = 0; i < 3; i += 1)
8
    {
9
        movex[i] += xspeed;
10
        if (movex[i] <= 0)
11
        {
12
            movex[i] = 0;
13
            returncount += 1;
14
        }
15
    }
16
    if (returncount >= 3)
17
    {
18
        swaptime = 6;
19
        part[1] = selectpart[0];
20
        part[2] = selectpart[1];
21
        part[3] = selectpart[2];
22
        if (part[1] == 1 && part[2] == 2 && part[3] == 3)
23
        {
24
            part[1] = 6;
25
            
scr_mercyadd
scr_mercyadd

function
scr_mercyadd(arg0, arg1)
{ global.mercymod[arg0] += arg1; if (global.mercymod[arg0] < 0) global.mercymod[arg0] = 0; }
(myself, 100);
26
        }
27
    }
28
    else
29
    {
30
        xspeed -= 2;
31
        draw_sprite_ext(spr_blockguy_part, part[3], x + movex[2], partyb[2], 2, 2, 0, c_white, 1);
32
        draw_sprite_ext(spr_blockguy_part, part[2], x + movex[1], partyb[1], 2, 2, 0, c_white, 1);
33
        draw_sprite_ext(spr_blockguy_part, part[1], x + movex[0], partyb[0], 2, 2, 0, c_white, 1);
34
    }
35
}
36
if (swaptime == 2 || swaptime == 3)
37
{
38
    if (sinmomentum < 0.8)
39
        sinmomentum += 0.05;
40
    floatsin += sinmomentum;
41
    if (threebuffer <= 0)
42
        selecty = y + 30 + (selecttotal * 26);
43
    if (select[0] < 0)
44
        partyb[0] = y + 53 + (sin((floatsin / 8) + custom[0]) * 25);
45
    if (select[1] < 0)
46
        partyb[1] = y + 53 + (sin((floatsin / 8) + custom[1]) * 25);
47
    if (select[2] < 0)
48
        partyb[2] = y + 53 + (sin((floatsin / 8) + custom[2]) * 25);
49
    closest = -1;
50
    closefactor = 99;
51
    for (i = 0; i < 3; i += 1)
52
    {
53
        scolor[i] = 8421504;
54
        if (select[i] < 0)
55
        {
56
            cfactor = abs(partyb[i] - selecty);
57
            if (cfactor < closefactor && cfactor < 24)
58
            {
59
                closefactor = cfactor;
60
                closest = i;
61
            }
62
        }
63
        else
64
        {
65
            if (movex[i] < 60)
66
                movex[i] += 6;
67
            scolor[i] = 65535;
68
            idealy = y + 28 + (select[i] * 25);
69
            if (abs(partyb[i] - idealy) < 6)
70
                partyb[i] = idealy;
71
            if (partyb[i] < idealy)
72
                partyb[i] += 6;
73
            if (partyb[i] > idealy)
74
                partyb[i] -= 6;
75
        }
76
    }
77
    arrowcolor = c_white;
78
    for (i = 0; i < 3; i += 1)
79
    {
80
        if (closest == i)
81
        {
82
            scolor[i] = 16777215;
83
            arrowcolor = c_yellow;
84
        }
85
    }
86
    draw_sprite_ext(spr_blockguy_part, part[3], x + movex[2], partyb[2], 2, 2, 0, scolor[2], 1);
87
    draw_sprite_ext(spr_blockguy_part, part[2], x + movex[1], partyb[1], 2, 2, 0, scolor[1], 1);
88
    draw_sprite_ext(spr_blockguy_part, part[1], x + movex[0], partyb[0], 2, 2, 0, scolor[0], 1);
89
    arrowpush = threebuffer * 4;
90
    if (arrowpush < 0)
91
        arrowpush = 0;
92
    ypush = 0;
93
    if (threebuffer == 1)
94
        ypush = 15;
95
    draw_set_color(arrowcolor);
96
    if (finishtimer < 8 && selecttotal < (maxpart - 2))
97
        draw_arrow((x - 50) + (sin(floatsin / 6) * 2) + arrowpush, selecty + 10 + ypush, (x - 10) + (sin(floatsin / 6) * 2) + arrowpush, selecty + 10 + ypush, 16);
98
    if (button3_p() && threebuffer < 0 && selecttotal < (maxpart - 2))
99
    {
100
        if (closest >= 0)
101
        {
102
            selectpart[selecttotal] = part[1 + closest];
103
            select[closest] = selecttotal;
104
            selecttotal += 1;
105
            threebuffer = 6;
106
        }
107
        if (selecttotal >= (maxpart - 2))
108
            swaptime = 3;
109
    }
110
    if (swaptime == 3)
111
        finishtimer += 1;
112
    if (finishtimer >= 13)
113
    {
114
        swaptime = 5;
115
        xspeed = 4;
116
    }
117
}
118
if (swaptime == 0 || swaptime == 1 || swaptime == 6)
119
{
120
    hurk = 0;
121
    if (state == 3)
122
    {
123
        hurk = 1;
124
        if (global.monsterhp[myself] <= (global.monstermaxhp[myself] / 3))
125
        {
126
            global.monsterstatus[myself] = 1;
127
            if (global.monstercomment[myself] == " ")
128
                global.monstercomment[myself] = 
(Tired)
scr_84_get_lang_string
scr_84_get_lang_string

function
scr_84_get_lang_string(arg0)
{ return ds_map_find_value(global.lang_map, arg0); }
("obj_bloxer_enemy_slash_Draw_0_gml_141_0")
;
129
        }
130
        hurttimer -= 1;
131
        if (hurttimer < 0)
132
        {
133
            state = 0;
134
        }
135
        else
136
        {
137
            if (global.monster[myself] == 0)
138
                hspeed = 10;
139
            hurtshake += 1;
140
            if (hurtshake > 1)
141
            {
142
                if (shakex > 0)
143
                    shakex -= 1;
144
                if (shakex < 0)
145
                    shakex += 1;
146
                shakex = -shakex;
147
                hurtshake = 0;
148
            }
149
        }
150
    }
151
    if (swaptime == 0)
152
        siner += 1;
153
    if (swaptime == 1)
154
        swapx += 2;
155
    if (swaptime == 6)
156
    {
157
        if (swapx > 0)
158
            swapx -= 2;
159
        if (swapx <= 0)
160
            swaptime = 0;
161
    }
162
    if (swapx >= 16 && swaptime == 1)
163
        swaptime = 2;
164
    if (swaptime == 0)
165
    {
166
        if (part[1] == 1 && part[2] == 2 && part[3] == 3)
167
            part[1] = 6;
168
    }
169
    if (swaptime == 1 && part[1] == 6)
170
        part[1] = 1;
171
    thissprite = spr_blockguy_part;
172
    if (hurk == 1)
173
        thissprite = spr_blockguy_part_hurt;
174
    draw_sprite_ext(thissprite, 5, (x - 24) + (ss * 2) + (swapx * 1.5) + shakex, y + 54 + (ssb * 2), 2, 2, 0, c_white, 1);
175
    draw_sprite_ext(thissprite, part[4], (x - ss) + shakex, (y + 100) - swapx, 2, 2, 0, c_white, 1);
176
    if (swaptime == 1 || swaptime == 6)
177
        draw_sprite_ext(thissprite, part[0], x + (ss * 2) + shakex, y + swapx, 2, 2, 0, c_white, 1);
178
    draw_sprite_ext(thissprite, part[3], (x - 4) + (ss * 2) + shakex, y + 78, 2, 2, 0, c_white, 1);
179
    draw_sprite_ext(thissprite, part[2], ((x + 4) - (ss * 2)) + shakex, y + 54, 2, 2, 0, c_white, 1);
180
    draw_sprite_ext(thissprite, part[1], x + (ss * 2) + shakex, y + 28, 2, 2, 0, c_white, 1);
181
    if (swaptime == 0)
182
        draw_sprite_ext(thissprite, part[0], x + (ss * 2) + shakex, y + swapx, 2, 2, 0, c_white, 1);
183
    if (state == 0 && flash == 1)
184
    {
185
        fsiner += 1;
186
        d3d_set_fog(true, c_white, 0, 1);
187
        draw_sprite_ext(thissprite, 5, (x - 24) + (ss * 2) + (swapx * 1.5) + shakex, y + 54 + (ssb * 2), 2, 2, 0, image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
188
        draw_sprite_ext(thissprite, part[4], (x - ss) + shakex, (y + 100) - swapx, 2, 2, 0, image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
189
        if (swaptime == 1 || swaptime == 6)
190
            draw_sprite_ext(thissprite, part[0], x + (ss * 2) + shakex, y + swapx, 2, 2, 0, image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
191
        draw_sprite_ext(thissprite, part[3], (x - 4) + (ss * 2) + shakex, y + 78, 2, 2, 0, image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
192
        draw_sprite_ext(thissprite, part[2], ((x + 4) - (ss * 2)) + shakex, y + 54, 2, 2, 0, image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
193
        draw_sprite_ext(thissprite, part[1], x + (ss * 2) + shakex, y + 28, 2, 2, 0, image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
194
        d3d_set_fog(false, c_black, 0, 0);
195
    }
196
}
197
if (swaptime == 10)
198
{
199
    introtimer = 0;
200
    idealy[0] = 0;
201
    idealy[1] = 28;
202
    idealy[2] = 54;
203
    idealy[3] = 78;
204
    idealy[4] = 100;
205
    for (i = 0; i < 5; i += 1)
206
    {
207
        cury[i] = 100;
208
        yfactor[i] = (100 - idealy[i]) / 16;
209
    }
210
    cury[0] = 78;
211
    yfactor[0] = 4.875;
212
    swaptime = 11;
213
}
214
if (swaptime == 11)
215
{
216
    draw_sprite_ext(spr_blockguy_part, 5, (x - (introtimer * 2)) + 6, y + cury[2], 2, 2, 0, c_white, 1);
217
    for (i = 4; i >= 0; i -= 1)
218
    {
219
        cury[i] -= yfactor[i];
220
        draw_sprite_ext(spr_blockguy_part, part[i], x, y + cury[i], 2, 2, 0, c_white, 1);
221
    }
222
    draw_sprite_ext(spr_blockguy_part, part[headpart], x, y + cury[headpart], 2, 2, 0, c_white, 1);
223
    draw_sprite_ext(spr_blockguy_part, part[0], x, y + cury[0], 2, 2, 0, c_white, 1);
224
    introtimer += 1;
225
    if (introtimer >= 16)
226
        swaptime = 0;
227
}
228
if (becomeflash == 0)
229
    flash = 0;
230
becomeflash = 0;