Undertale script viewer

← back to main script listing

gml_Object_obj_asriel_swordarm_Draw_0

(view raw script w/o annotations or w/e)
1
if (start == 1)
2
{
3
    if (image_alpha < 1)
4
        image_alpha += 0.2;
5
    else
6
        start = 0;
7
}
8
if (dontdraw == 0)
9
    draw_sprite_ext(sprite_index, image_index, (x + random(shake)) - random(shake), (y + random(shake)) - random(shake), image_xscale, 2, image_angle, image_blend, image_alpha);
10
timer += 1;
11
if (timer == 5)
12
    con = 1;
13
if (con == 1)
14
{
15
    s_offset -= 1;
16
    if (flip == 0)
17
    {
18
        if (o_o == 1)
19
            draw_sprite_ext(spr_asriel_sword, image_index, x - s_offset - 22, y - 148, image_xscale, 2, image_angle, image_blend, image_alpha);
20
        if (o_o == 0)
21
            draw_sprite_ext(spr_asriel_sword, image_index, (x + s_offset) - 22, y - 148, image_xscale, 2, image_angle, image_blend, image_alpha);
22
    }
23
    if (flip == 1)
24
    {
25
        if (o_o == 1)
26
            draw_sprite_ext(spr_asriel_sword, image_index, (x - s_offset) + 22, y - 148, image_xscale, 2, image_angle, image_blend, image_alpha);
27
        if (o_o == 0)
28
            draw_sprite_ext(spr_asriel_sword, image_index, x + s_offset + 22, y - 148, image_xscale, 2, image_angle, image_blend, image_alpha);
29
    }
30
    if (o_o == 0)
31
        o_o = 1;
32
    else
33
        o_o = 0;
34
    if (s_offset <= 1)
35
    {
36
        with (sm)
37
            event_user(8);
38
        sprite_index = spr_asriel_swordarm;
39
        con = 2;
40
        timer = 999;
41
        timer = 999;
42
        if (flip == 0)
43
            sm.alarm[5] = 14;
44
    }
45
}
46
if (twinkle == 0)
47
{
48
    if (h_mode == 0)
49
    {
50
        if (timer == 107)
51
        {
52
            with (sm)
53
                event_user(5);
54
        }
55
        if (timer > 105 && timer < 116)
56
        {
57
            y -= 0.5;
58
            if (flip == 0)
59
            {
60
                king.headrot += 4;
61
                with (sm)
62
                    event_user(2);
63
                image_angle += 1;
64
            }
65
            if (flip == 1)
66
            {
67
                king.headrot -= 4;
68
                with (sm)
69
                    event_user(3);
70
                image_angle -= 1;
71
            }
72
        }
73
    }
74
    if (h_mode == 1)
75
    {
76
        if (timer == 110)
77
        {
78
            with (sm)
79
                event_user(5);
80
        }
81
        if (timer > 108 && timer < 116)
82
        {
83
            y -= 0.75;
84
            if (flip == 0)
85
            {
86
                king.headrot += 6;
87
                with (sm)
88
                    event_user(2);
89
                image_angle += 1.5;
90
            }
91
            if (flip == 1)
92
            {
93
                king.headrot -= 6;
94
                with (sm)
95
                    event_user(3);
96
                image_angle -= 1.5;
97
            }
98
        }
99
    }
100
    if (h_mode == 2)
101
    {
102
        if (timer == 113)
103
        {
104
            with (sm)
105
                event_user(5);
106
        }
107
        if (timer > 111 && timer < 116)
108
        {
109
            y -= 1.5;
110
            if (flip == 0)
111
            {
112
                king.headrot += 12;
113
                with (sm)
114
                    event_user(2);
115
                image_angle += 3;
116
            }
117
            if (flip == 1)
118
            {
119
                king.headrot -= 12;
120
                with (sm)
121
                    event_user(3);
122
                image_angle -= 3;
123
            }
124
        }
125
    }
126
}
127
if (twinkle == 1)
128
{
129
    if (timer > 90 && timer < 105)
130
    {
131
        blazing = 1;
132
        y -= 0.5;
133
        if (flip == 0)
134
        {
135
            with (sm)
136
                event_user(9);
137
            image_angle += 1.5;
138
        }
139
        if (flip == 1)
140
        {
141
            with (sm)
142
                event_user(9);
143
            image_angle -= 1.5;
144
        }
145
    }
146
    if (timer > 90 && timer < 115)
147
        shake = 5;
148
    if (timer == 115)
149
        shake = 0;
150
    if (timer == 120)
151
        blazing = 0;
152
}
153
if (timer == 124)
154
{
155
    with (sm)
156
        event_user(6);
157
    depth = king.depth - 10;
158
    dontdraw = 1;
159
    smear = 5;
160
}
161
if (timer >= 124 && timer < 127)
162
{
163
    if (flip == 0)
164
        king.headrot -= 12;
165
    if (flip == 1)
166
        king.headrot += 12;
167
    dontdraw = 0;
168
    image_angle = 0;
169
    if (timer >= 125)
170
        col = 1;
171
    sprite_index = spr_asriel_swordextend;
172
    y += 3;
173
}
174
if (timer == 125 && twinkle == 1)
175
{
176
    global.border = 6;
177
    SCR_BORDERSETUP
SCR_BORDERSETUP

if (global.border == 0) { global.idealborder[0] = 32; global.idealborder[1] = 602; global.idealborder[2] = 250; global.idealborder[3] = 385; } if (global.border == 1) { global.idealborder[0] = 217; global.idealborder[1] = 417; global.idealborder[2] = 180; global.idealborder[3] = 385; } if (global.border == 2) { global.idealborder[0] = 217; global.idealborder[1] = 417; global.idealborder[2] = 125; global.idealborder[3] = 385; } if (global.border == 3) { global.idealborder[0] = 237; global.idealborder[1] = 397; global.idealborder[2] = 250; global.idealborder[3] = 385; } if (global.border == 4) { global.idealborder[0] = 267; global.idealborder[1] = 367; global.idealborder[2] = 295; global.idealborder[3] = 385; } if (global.border == 5) { global.idealborder[0] = 192; global.idealborder[1] = 442; global.idealborder[2] = 250; global.idealborder[3] = 385; } if (global.border == 6) { global.idealborder[0] = 227; global.idealborder[1] = 407; global.idealborder[2] = 250; global.idealborder[3] = 385; } if (global.border == 7) { global.idealborder[0] = 227; global.idealborder[1] = 407; global.idealborder[2] = 200; global.idealborder[3] = 385; } if (global.border == 8) { global.idealborder[0] = 202; global.idealborder[1] = 432; global.idealborder[2] = 290; global.idealborder[3] = 385; } if (global.border == 9) { global.idealborder[0] = 132; global.idealborder[1] = 492; global.idealborder[2] = 250; global.idealborder[3] = 385; } if (global.border == 10) { global.idealborder[0] = 147; global.idealborder[1] = 487; global.idealborder[2] = 200; global.idealborder[3] = 385; } if (global.border == 11) { global.idealborder[0] = 32; global.idealborder[1] = 602; global.idealborder[2] = 330; global.idealborder[3] = 465; } if (global.border == 12) { global.idealborder[0] = (room_width / 2) - 40; global.idealborder[1] = (room_width / 2) + 40; global.idealborder[2] = (room_height / 2) - 40; global.idealborder[3] = (room_height / 2) + 40; } if (global.border == 13) { global.idealborder[0] = (room_width / 2) - 40; global.idealborder[1] = (room_width / 2) + 40; global.idealborder[2] = 250; global.idealborder[3] = 385; } if (global.border == 14) { global.idealborder[0] = (room_width / 2) - 35; ...
();
178
    timer = 200;
179
    vspeed = 5;
180
    friction = 0.5;
181
    sprite_index = spr_asriel_swordextend_shatter;
182
    for (i = 0; i < 4; i += 1)
183
        instance_create(x, y + 120 + (i * 35), obj_swordtwinkle);
184
}
185
if (timer >= 127 && timer < 130)
186
{
187
    col = 0;
188
    y += 5;
189
    if (flip == 0)
190
        image_angle += 30;
191
    if (flip == 1)
192
        image_angle -= 30;
193
}
194
if (timer == 130)
195
{
196
    king.headrot /= 2;
197
    depth = king.depth + 1;
198
    y = ystart;
199
    image_angle = 0;
200
    sprite_index = spr_asriel_swordarm_half;
201
}
202
if (timer == 131)
203
{
204
    king.headrot /= 2;
205
    y = ystart;
206
    image_angle = 0;
207
    sprite_index = spr_asriel_swordarm;
208
}
209
if (timer > 200 && twinkle == 1)
210
{
211
    if (timer > 201)
212
        col = 0;
213
    image_alpha -= 0.1;
214
    if (image_alpha <= 0)
215
        instance_destroy();
216
}
217
if (smear > 0)
218
{
219
    if (flip == 0)
220
        draw_sprite_ext(spr_asriel_swordsmear, image_index, x - 40, y - 168, image_xscale, 2.5, 0, image_blend, smear / 5);
221
    if (flip == 1)
222
        draw_sprite_ext(spr_asriel_swordsmear, image_index, x + 40, y - 168, image_xscale, 2.5, 0, image_blend, smear / 5);
223
    smear -= 1;
224
}
225
if (blazing == 1)
226
{
227
    if (bl_o == 0)
228
        bl_o = 1;
229
    else
230
        bl_o = 0;
231
    if (bl_o == 1)
232
        draw_sprite_ext(spr_asriel_swordarm_power, 0, x, y, image_xscale, 2, image_angle, image_blend, image_alpha);
233
}
234
if (col == 1)
235
{
236
    if (flip == 0)
237
    {
238
        if (collision_rectangle(x - 3, y, x + 80, y + 260, obj_heart, 0, 1))
239
            event_user(7);
240
    }
241
    if (flip == 1)
242
    {
243
        if (collision_rectangle(x + 3, y, x - 80, y + 260, obj_heart, 0, 1))
244
            event_user(7);
245
    }
246
}