Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_queen_wineglass_Draw_0

(view raw script w/o annotations or w/e)
1
starty = obj_queen_wineglass.ystart + 52;
2
var y_offset = 0;
3
draw_set_color(acidColor);
4
starttimer++;
5
if (starttimer == 30)
6
    snd_play(snd_spearappear_choppy);
7
if (starttimer == 43)
8
{
9
    state = 1;
10
    obj_queen_wineflass_pushin.visible = true;
11
}
12
winewave.depth = depth + 3;
13
winewave2.depth = depth + 1;
14
if (instance_exists(obj_moveheart))
15
    obj_moveheart.depth = depth - 9999;
16
if (instance_exists(obj_heart))
17
    obj_heart.depth = depth + 2;
18
if (state == 1)
19
{
20
    var xtangle = obj_queen_wineglass.xstart;
21
    var bottomfill = min(fill, 25);
22
    var topfill = min(fill, 36);
23
    var tri_x2 = 0;
24
    var tri_x3 = 0;
25
    var tri_y2 = 0;
26
    var tri_y3 = 0;
27
    if (bottomfill < 18)
28
    {
29
        if (image_angle > 5)
30
        {
31
            tri_x2 = abs(image_angle) / 3;
32
            tri_x3 = (abs(image_angle) / 2) * -1;
33
        }
34
        if (image_angle < -5)
35
        {
36
            tri_x3 = abs(image_angle) / 3;
37
            tri_x2 = (abs(image_angle) / 2) * -1;
38
        }
39
    }
40
    else if (bottomfill < 24)
41
    {
42
        if (image_angle > 5)
43
        {
44
            tri_x2 = abs(image_angle) / 6;
45
            tri_x3 = (abs(image_angle) / 6) * -1;
46
        }
47
        if (image_angle < -5)
48
        {
49
            tri_x3 = abs(image_angle) / 6;
50
            tri_x2 = (abs(image_angle) / 6) * -1;
51
        }
52
    }
53
    else if (bottomfill < 26)
54
    {
55
        if (image_angle > 5)
56
        {
57
            tri_x2 = abs(image_angle) / 3;
58
            tri_x3 = (abs(image_angle) / 6) * -1;
59
        }
60
        else if (image_angle < -5)
61
        {
62
            tri_x3 = abs(image_angle) / 6;
63
            tri_x2 = (abs(image_angle) / 6) * -1;
64
        }
65
        else
66
        {
67
            tri_x2 = 3;
68
            tri_x3 = 3;
69
            tri_y2 = 1;
70
            tri_y3 = 1;
71
        }
72
    }
73
    else if (image_angle > 6)
74
    {
75
        tri_x2 = abs(image_angle) * 1.8;
76
        tri_x3 = 8;
77
        tri_y2 = abs(image_angle) / 2.04;
78
        tri_y3 = abs(image_angle) / 4;
79
    }
80
    else if (image_angle < -6)
81
    {
82
        tri_x3 = abs(image_angle) * 0.85;
83
        tri_x2 = 7;
84
        tri_y3 = abs(image_angle) / 4;
85
        tri_y2 = abs(image_angle) / 4;
86
    }
87
    else
88
    {
89
        tri_x2 = 14;
90
        tri_x3 = 10;
91
        tri_y2 = 3;
92
        tri_y3 = 2;
93
    }
94
    draw_triangle(obj_queen_wineglass.xstart + lengthdir_x(52, image_angle + 270), obj_queen_wineglass.ystart + lengthdir_y(52, image_angle + 270), (obj_queen_wineglass.xstart - 3) + tri_x2 + lengthdir_x(bottomfill * 3, image_angle + 180), obj_queen_wineglass.ystart + 50 + tri_y2 + lengthdir_y(bottomfill * 3, image_angle + 150), (obj_queen_wineglass.xstart - tri_x3) + lengthdir_x(bottomfill * 3, image_angle + 0), obj_queen_wineglass.ystart + 52 + tri_y3 + lengthdir_y(bottomfill * 3, image_angle + 30), 0);
95
    draw_triangle(obj_queen_wineglass.xstart + lengthdir_x(52, image_angle + 270), obj_queen_wineglass.ystart + 2 + lengthdir_y(52, image_angle + 270), (obj_queen_wineglass.xstart - 3) + tri_x2 + lengthdir_x(bottomfill * 3, image_angle + 180), obj_queen_wineglass.ystart + 50 + tri_y2 + lengthdir_y(bottomfill * 3, image_angle + 150), (obj_queen_wineglass.xstart - tri_x3) + lengthdir_x(bottomfill * 3, image_angle + 0), obj_queen_wineglass.ystart + 52 + tri_y3 + lengthdir_y(bottomfill * 3, image_angle + 30), 0);
96
    if (fill >= 36)
97
    {
98
        if (image_angle >= -2 && image_angle <= 2)
99
            draw_rectangle(xtangle - (topfill * 2), starty - 35, xtangle + (topfill * 2), starty - fill, 0);
100
        if (image_angle <= -2)
101
        {
102
            var fill_a = lerp(36, fill, (image_angle * -1) / 33);
103
            var xx_bottom_right = abs(image_angle / 5);
104
            var xx_top_right = -5;
105
            if (fill > 40)
106
                xx_top_right = abs(image_angle) / 5;
107
            if (fill > 50)
108
                xx_top_right = abs(image_angle) / 3;
109
            if (fill > 57)
110
                xx_top_right = abs(image_angle) / 2.1;
111
            if (obj_queen_bulletcontroller.type == 2.1)
112
            {
113
                if (fill > 62)
114
                    xx_top_right = abs(image_angle) * 1;
115
                if (fill > 65)
116
                    xx_top_right = abs(image_angle) * 1.2;
117
                if (fill > 69)
118
                    xx_top_right = abs(image_angle) * 1;
119
            }
120
            else
121
            {
122
                if (fill > 62)
123
                    xx_top_right = abs(image_angle) * 0.8;
124
                if (fill > 65)
125
                    xx_top_right = abs(image_angle) * 0.8;
126
                if (fill > 69)
127
                    xx_top_right = abs(image_angle) * 0.8;
128
            }
129
            if (fill > 71)
130
                xx_top_right = abs(image_angle) * 1.1;
131
            if (fill > 75)
132
                xx_top_right = abs(image_angle) * 1.2;
133
            if (fill > 78)
134
                xx_top_right = abs(image_angle) * 1.3;
135
            if (fill > 81)
136
                xx_top_right = abs(image_angle) * 1.5;
137
            if (fill > 84)
138
                xx_top_right = abs(image_angle) * 1.6;
139
            var xx_top_left = 0;
140
            if (fill > 36)
141
                xx_top_left = abs(image_angle) / 2.3;
142
            if (fill > 55)
143
                xx_top_left = abs(image_angle) / 8.3;
144
            if (fill > 58)
145
                xx_top_left = abs(image_angle) * -0.24;
146
            if (fill > 69)
147
                xx_top_left = abs(image_angle) * -0.2;
148
            if (fill > 71)
149
                xx_top_left = abs(image_angle) * -0.1;
150
            if (fill > 82)
151
                xx_top_left = abs(image_angle) * 0.1;
152
            var xx_bottom_left = 0;
153
            if (fill > 36)
154
                xx_bottom_left = abs(image_angle) / 8;
155
            if (fill > 81)
156
                xx_bottom_left = abs(image_angle) / 8;
157
            draw_primitive_begin(pr_trianglelist);
158
            draw_vertex((obj_queen_wineglass.xstart - xx_bottom_left) + lengthdir_x(topfill * 2, image_angle + 180), obj_queen_wineglass.ystart + 53 + 2 + lengthdir_y(topfill * 2, image_angle + 150));
159
            draw_vertex((obj_queen_wineglass.xstart - xx_bottom_right) + lengthdir_x(topfill * 2, image_angle + 0), obj_queen_wineglass.ystart + 53 + 2 + lengthdir_y(topfill * 2, image_angle + 30));
160
            draw_vertex((obj_queen_wineglass.xstart - xx_top_right) + lengthdir_x(fill_a * 1.97, image_angle + 0), (obj_queen_wineglass.ystart + 52) - fill);
161
            draw_primitive_end();
162
            draw_primitive_begin(pr_trianglelist);
163
            draw_vertex((obj_queen_wineglass.xstart - xx_bottom_left) + lengthdir_x(topfill * 2, image_angle + 180), obj_queen_wineglass.ystart + 53 + 2 + lengthdir_y(topfill * 2, image_angle + 150));
164
            draw_vertex(obj_queen_wineglass.xstart + xx_top_left + lengthdir_x(topfill * 2, image_angle + 180), (obj_queen_wineglass.ystart + 52) - fill);
165
            draw_vertex((obj_queen_wineglass.xstart - xx_top_right) + lengthdir_x(fill_a * 1.97, image_angle + 0), (obj_queen_wineglass.ystart + 52) - fill);
166
            draw_primitive_end();
167
        }
168
        if (image_angle >= 2)
169
        {
170
            var fill_a = lerp(topfill, fill, image_angle / 33);
171
            var xx_bottom_left = abs(image_angle / 2.3);
172
            var xx_top_left = 0;
173
            if (fill > 40)
174
                xx_top_left = abs(image_angle) / 5.6;
175
            if (fill > 47)
176
                xx_top_left = abs(image_angle) / 2.6;
177
            if (fill > 50)
178
                xx_top_left = abs(image_angle) / 1.8;
179
            if (fill > 52)
180
                xx_top_left = abs(image_angle) / 1.3;
181
            if (fill > 57)
182
                xx_top_left = abs(image_angle) / 1.3;
183
            if (fill > 63)
184
                xx_top_left = abs(image_angle) * 0.99;
185
            if (fill > 66)
186
                xx_top_left = abs(image_angle) * 1.09;
187
            if (fill > 69)
188
                xx_top_left = abs(image_angle) * 1.2;
189
            if (fill > 71)
190
                xx_top_left = abs(image_angle) * 1.35;
191
            if (fill > 74)
192
                xx_top_left = abs(image_angle) * 1.49;
193
            if (fill > 78)
194
                xx_top_left = abs(image_angle) * 1.65;
195
            if (fill > 81)
196
                xx_top_left = abs(image_angle) * 1.76;
197
            if (fill > 84)
198
                xx_top_left = abs(image_angle) * 1.83;
199
            if (fill > 86.5)
200
                xx_top_left = abs(image_angle) * 1.96;
201
            var xx_top_right = 0;
202
            if (fill > 36)
203
                xx_top_right = abs(image_angle) / 0.3;
204
            if (fill > 40)
205
                xx_top_right = abs(image_angle) / 2.3;
206
            if (fill > 50)
207
                xx_top_right = 0;
208
            if (fill > 54)
209
                xx_top_right = abs(image_angle) / 40;
210
            if (fill > 60)
211
                xx_top_right = abs(image_angle) * -0.4;
212
            if (fill > 69)
213
                xx_top_right = abs(image_angle) * -0.4;
214
            if (fill > 71)
215
                xx_top_right = abs(image_angle) * -0.2;
216
            if (fill > 80)
217
                xx_top_right = abs(image_angle) * 0.15;
218
            if (fill > 84)
219
                xx_top_right = abs(image_angle) * 0.15;
220
            var e = 0;
221
            if (image_angle >= 2 && image_angle < 7)
222
                e = 4;
223
            var xx_bottom_right = 0;
224
            if (fill > 36)
225
                xx_bottom_right = abs(image_angle) / 2;
226
            if (fill > 54)
227
                xx_bottom_right = abs(image_angle) / 4;
228
            if (fill > 60)
229
                xx_bottom_right = (abs(image_angle) / 4) + e;
230
            if (fill > 71)
231
                xx_bottom_right = (abs(image_angle) / 8) + e;
232
            if (fill > 80)
233
                xx_bottom_right = 0;
234
            var yy_bottom_right = 0;
235
            if (fill > 80)
236
                yy_bottom_right = -3;
237
            draw_primitive_begin(pr_trianglelist);
238
            draw_vertex((obj_queen_wineglass.xstart - 1) + xx_bottom_left + lengthdir_x(topfill * 2, image_angle + 180), obj_queen_wineglass.ystart + 53 + 3 + lengthdir_y(topfill * 2, image_angle + 150));
239
            draw_vertex((obj_queen_wineglass.xstart - xx_bottom_right) + lengthdir_x(topfill * 2.2, image_angle + 0), obj_queen_wineglass.ystart + 54 + yy_bottom_right + 1 + lengthdir_y(topfill * 2, image_angle + 30));
240
            draw_vertex((obj_queen_wineglass.xstart - xx_top_right) + lengthdir_x(topfill * 2, image_angle + 0), (obj_queen_wineglass.ystart + 52) - fill);
241
            draw_primitive_end();
242
            draw_primitive_begin(pr_trianglelist);
243
            draw_vertex((obj_queen_wineglass.xstart - 1) + xx_bottom_left + lengthdir_x(topfill * 2, image_angle + 180), obj_queen_wineglass.ystart + 53 + 3 + lengthdir_y(topfill * 2, image_angle + 150));
244
            draw_vertex(obj_queen_wineglass.xstart + xx_top_left + lengthdir_x(fill_a * 2, image_angle + 180), (obj_queen_wineglass.ystart + 52) - fill);
245
            draw_vertex((obj_queen_wineglass.xstart - xx_top_right) + lengthdir_x(topfill * 2, image_angle + 0), (obj_queen_wineglass.ystart + 52) - fill);
246
            draw_primitive_end();
247
        }
248
    }
249
    if (fill > 88 && global.turntimer > 2)
250
        global.turntimer = 2;
251
    if (fill < 90 && prefill > 0)
252
    {
253
        prefill--;
254
        fill++;
255
        if (fill == 1)
256
        {
257
            hurtbox.damage = damage;
258
            hurtbox.target = target;
259
        }
260
        if (fill < 36)
261
            fill += (1 - (bottomfill / 36));
262
    }
263
    if (obj_queen_enemy.difficulty == 1)
264
    {
265
        if (fill > 48)
266
            draw_sprite_ext(spr_queen_wine_box_fakeittillyoumakeit, 0, x, y, image_xscale, image_yscale, image_angle, c_white, 1);
267
    }
268
    if (obj_queen_enemy.difficulty == 2)
269
    {
270
        if (fill > 52)
271
            draw_sprite_ext(spr_queen_wine_box_fakeittillyoumakeit, 0, x, y, image_xscale, image_yscale, image_angle, c_white, 1);
272
        if (fill > 76)
273
            draw_sprite_ext(spr_queen_wine_box_fakeittillyoumakeit, 1, x, y, image_xscale, image_yscale, image_angle, c_white, 1);
274
    }
275
    draw_self();
276
}