Undertale script viewer

← back to main script listing

gml_Object_obj_asriel_body_Draw_0

(view raw script w/o annotations or w/e)
1
if (transform == 1)
2
    stetch += 0.2;
3
if (normal == 1)
4
{
5
    siner += 1;
6
    rely += sin(siner / 12);
7
    x += (cos(siner / 24) * 6);
8
    y += (sin(siner / 6) * 0.25);
9
}
10
yoff = sin(siner / 6);
11
xoff = cos(siner / 3);
12
draw_set_color(c_black);
13
draw_set_alpha(image_alpha);
14
ossafe_fill_rectangle(x - 40, y + 20 + rely, x + 42, y + 46 + rely);
15
draw_set_alpha(1);
16
draw_sprite_ext(spr_asrielfeet, 0, x + (yoff * 2), ((y + 168) - 112) + (rely * 0.9), 2 + stetch, 2, torsorot, image_blend, image_alpha);
17
draw_sprite_ext(spr_torsoball, 0, x + yoff, y + 48 + rely, 2 + stetch, 2, 0, image_blend, image_alpha);
18
draw_sprite_ext(spr_asrieltorso, 0, x + yoff, y + 48 + rely, 2 + stetch, 2, torsorot, image_blend, image_alpha);
19
draw_sprite_ext(spr_asriellocket, 0, x + 2, y + 34 + (rely * 1.2), 2 + stetch, 2, 0, image_blend, image_alpha);
20
if (specialarm == 0)
21
{
22
    if (shrug == 0)
23
    {
24
        draw_sprite_ext(spr_asrielarm_r, 0, x - 28, y + 38 + (rely * 1.2), -2 - stetch, 2, armrot_l, image_blend, image_alpha);
25
        draw_sprite_ext(spr_asrielarm_r, 0, x + 30, y + 38 + (rely * 1.2), 2 + stetch, 2, armrot_r, image_blend, image_alpha);
26
    }
27
    if (shrug == 1)
28
    {
29
        draw_sprite_ext(spr_asrielarm_r_shrug, 0, x - 28, y + 38 + (rely * 1.2), -2, 2, armrot_l, image_blend, image_alpha);
30
        draw_sprite_ext(spr_asrielarm_r_shrug, 0, x + 30, y + 38 + (rely * 1.2), 2, 2, armrot_r, image_blend, image_alpha);
31
    }
32
}
33
if (specialarm == 1)
34
{
35
    draw_sprite_ext(spr_asrielarm_r, 0, x - 28, y + 38 + (rely * 1.2), -2, 2, armrot_l, image_blend, arm_alpha);
36
    draw_sprite_ext(spr_asrielarm_r, 0, x + 30, y + 38 + (rely * 1.2), 2, 2, armrot_r, image_blend, arm_alpha);
37
}
38
if (specialarm == 2)
39
{
40
    draw_sprite_ext(spr_asrielarm_r, 0, x - 28, y + 38 + (rely * 1.2), -2, 2, armrot_l, image_blend, image_alpha);
41
    draw_sprite_ext(spr_asrielarm_r, 0, x + 30, y + 38 + (rely * 1.2), 2, 2, armrot_r, image_blend, arm_alpha);
42
}
43
draw_sprite_ext(spr_asrielshoulder_r, 0, x - 28, y + 26 + (rely * 1.2), -2 - stetch, 2, 0, image_blend, image_alpha);
44
draw_sprite_ext(spr_asrielshoulder_r, 0, x + 30, y + 26 + (rely * 1.2), 2 + stetch, 2, 0, image_blend, image_alpha);
45
draw_sprite_ext(spr_asrielcollar, 0, x, y + 22 + (rely * 1), 2 + stetch, 2, 0, image_blend, image_alpha);
46
if (shrug == 0)
47
    draw_sprite_ext(spr_asrielhead, global.faceemotion, x + headx, y + (rely * 1.2) + heady, 2 + stetch, 2, headrot, image_blend, image_alpha);
48
if (shrug == 1)
49
{
50
    shrug_x += 1;
51
    draw_sprite_ext(spr_asriel_headshake_sassy, floor(shrug_x / 6), x + headx, y + (rely * 1.2) + heady, 2 + stetch, 2, headrot, image_blend, image_alpha);
52
}
53
if (aligncon == 1)
54
{
55
    normal = 0;
56
    xxx = mouse_x;
57
    yyy = mouse_y;
58
    xxx = 320;
59
    yyy = 45;
60
    if (s_s == 1)
61
        yyy = 100;
62
    xxoff = x - xxx;
63
    yyoff = y - yyy;
64
    aligncon = 2;
65
    altimer = 0;
66
}
67
if (aligncon == 2)
68
{
69
    image_alpha = 1;
70
    if (abs(relx) > 1)
71
        relx *= 0.7;
72
    else
73
        relx = 0;
74
    if (abs(rely) > 1)
75
        rely *= 0.7;
76
    else
77
        rely = 0;
78
    if (abs(yyoff) > 1)
79
        yyoff *= 0.7;
80
    else
81
        yyoff = 0;
82
    if (abs(xxoff) > 1)
83
        xxoff *= 0.7;
84
    else
85
        xxoff = 0;
86
    if (abs(armrot_l) > 1)
87
        armrot_l *= 0.7;
88
    else
89
        armrot_l = 0;
90
    if (abs(armrot_r) > 1)
91
        armrot_r *= 0.7;
92
    else
93
        armrot_r = 0;
94
    if (abs(torsorot) > 1)
95
        torsorot *= 0.7;
96
    else
97
        torsorot = 0;
98
    if (abs(headrot) > 1)
99
        headrot *= 0.7;
100
    else
101
        headrot = 0;
102
    altimer += 1;
103
    x = xxx + xxoff;
104
    y = yyy + yyoff;
105
    if (altimer > 15)
106
    {
107
        image_alpha = 1;
108
        aligncon = 3;
109
        aimage = 0;
110
    }
111
}
112
if (aligncon == 4)
113
{
114
    heady = 0;
115
    headx = 0;
116
    specialarm = 0;
117
    arm_alpha = 0;
118
    relx = 0;
119
    rely = 0;
120
    xxoff = 0;
121
    yyoff = 0;
122
    armrot_l = 0;
123
    armrot_r = 0;
124
    torsorot = 0;
125
    headrot = 0;
126
    aligncon = 0;
127
    siner = 0;
128
    aimage = 1;
129
    normal = 1;
130
    altimer = 0;
131
}
132
if (global.debug == 1)
133
{
134
    if (keyboard_check_pressed(ord("S")) && aligncon == 3)
135
    {
136
        type = 0;
137
        starcon = 1;
138
    }
139
    if (keyboard_check_pressed(ord("B")) && aligncon == 3)
140
    {
141
        type = 1;
142
        starcon = 1;
143
    }
144
    if (keyboard_check_pressed(ord("W")) && aligncon == 3)
145
    {
146
        type = 1;
147
        bladecon = 1;
148
    }
149
    if (keyboard_check_pressed(ord("G")) && aligncon == 3)
150
    {
151
        type = 1;
152
        guncon = 1;
153
    }
154
    if (keyboard_check_pressed(ord("H")) && aligncon == 3)
155
    {
156
        type = 1;
157
        gonercon = 1;
158
    }
159
}
160
if (starcon > 0)
161
{
162
    if (starcon == 1)
163
    {
164
        global.faceemotion = 2;
165
        caster_play(powersfx, 0.8, 1);
166
        armraise = 20;
167
        starcon = 2;
168
        alarm[5] = 1;
169
    }
170
    if (starcon == 3)
171
    {
172
        starcon = 4;
173
        alarm[5] = 1;
174
    }
175
    if (starcon == 5)
176
    {
177
        armrot_l -= armraise;
178
        armrot_r += armraise;
179
        armraise -= 2;
180
        if (armraise <= 0)
181
        {
182
            starcon = 6;
183
            alarm[5] = 20;
184
        }
185
    }
186
    if (starcon >= 5 && starcon <= 9)
187
    {
188
        a_xx1 = x - 28;
189
        a_yy1 = y + 38 + (rely * 1.2);
190
        a_x1_add = lengthdir_x(90, armrot_l - 90 - 15);
191
        a_y1_add = lengthdir_y(90, armrot_l - 90 - 15);
192
        repeat (2)
193
        {
194
            hl = instance_create(a_xx1 + a_x1_add, a_yy1 + a_y1_add, obj_handlightning);
195
            hl.depth = depth + 1;
196
            hl.type = type;
197
        }
198
        a_xx2 = x + 30;
199
        a_yy2 = y + 38 + (rely * 1.2);
200
        a_x2_add = lengthdir_x(90, (armrot_r - 90) + 15);
201
        a_y2_add = lengthdir_y(90, (armrot_r - 90) + 15);
202
        repeat (2)
203
        {
204
            hl = instance_create(a_xx2 + a_x2_add, a_yy2 + a_y2_add, obj_handlightning);
205
            hl.depth = depth + 1;
206
            hl.type = type;
207
        }
208
    }
209
    if (starcon == 7)
210
    {
211
        starcon = 8;
212
        alarm[5] = 15;
213
    }
214
    if (starcon == 9)
215
        starcon = 12;
216
    if (starcon == 12)
217
    {
218
        if (type == 0)
219
            gen = instance_create(0, 0, obj_stormstar_gen);
220
        if (type == 1)
221
            gen = instance_create(0, 0, obj_rainbowbolt_realgen);
222
        gen.h_mode = h_mode;
223
        starcon = 13;
224
        alarm[5] = 300;
225
        if (type == 1)
226
            alarm[5] = 180;
227
    }
228
    if (starcon == 13)
229
    {
230
        if (image_alpha > 0)
231
            image_alpha -= 0.05;
232
    }
233
    if (starcon == 14)
234
    {
235
        global.faceemotion = 0;
236
        with (gen)
237
            instance_destroy();
238
        armrot_l = 0;
239
        armrot_r = 0;
240
        image_alpha += 0.05;
241
        if (image_alpha >= 1)
242
        {
243
            event_user(1);
244
            aligncon = 4;
245
            starcon = 0;
246
        }
247
    }
248
}
249
if (bladecon > 0)
250
{
251
    if (bladecon == 1)
252
    {
253
        armraise = 20;
254
        bladecon = 2;
255
        specialarm = 1;
256
        alarm[6] = 30;
257
    }
258
    if (bladecon == 2)
259
    {
260
        if (arm_alpha > 0)
261
            arm_alpha -= 0.05;
262
    }
263
    if (bladecon == 3)
264
    {
265
        gen = instance_create(x, y, obj_asriel_swordmaster);
266
        gen.h_mode = h_mode;
267
        bladecon = 4;
268
        alarm[6] = 30;
269
    }
270
    if (bladecon == 10)
271
    {
272
        heady = 0;
273
        headrot = 0;
274
        specialarm = 1;
275
        arm_alpha = 0;
276
        bladecon = 11;
277
    }
278
    if (bladecon == 11)
279
    {
280
        image_alpha = 0;
281
        heady = 0;
282
        headx = 0;
283
        specialarm = 0;
284
        arm_alpha = 1;
285
        x = 320;
286
        y = 50;
287
        relx = 0;
288
        rely = 0;
289
        xxoff = 0;
290
        yyoff = 0;
291
        armrot_l = 0;
292
        armrot_r = 0;
293
        torsorot = 0;
294
        headrot = 0;
295
        siner = 0;
296
        altimer = 0;
297
        bladecon = 12;
298
    }
299
    if (bladecon == 12)
300
    {
301
        siner = 0;
302
        image_alpha += 0.05;
303
        if (image_alpha >= 1)
304
        {
305
            event_user(1);
306
            specialarm = 0;
307
            aligncon = 4;
308
            bladecon = 0;
309
        }
310
    }
311
}
312
if (guncon > 0)
313
{
314
    if (guncon == 1)
315
    {
316
        arm_alpha = 1;
317
        guncon = 2;
318
        specialarm = 2;
319
        alarm[7] = 20;
320
    }
321
    if (guncon == 2)
322
    {
323
        if (arm_alpha > 0)
324
            arm_alpha -= 0.05;
325
    }
326
    if (guncon == 3)
327
    {
328
        gen = instance_create(x + 70, y + 15, obj_gunarm_firepattern);
329
        gen.h_mode = h_mode;
330
        guncon = 4;
331
        alarm[7] = 30;
332
    }
333
    if (guncon == 7)
334
    {
335
        arm_alpha += 0.1;
336
        if (arm_alpha >= 1)
337
            guncon = 8;
338
    }
339
    if (guncon == 8)
340
    {
341
        aligncon = 1;
342
        guncon = 9;
343
        alarm[7] = 10;
344
    }
345
    if (guncon == 10)
346
    {
347
        event_user(1);
348
        aligncon = 4;
349
        guncon = 0;
350
    }
351
}
352
if (gonercon > 0)
353
{
354
    if (gonercon == 1)
355
    {
356
        global.flag[20 animation_index] = 1;
357
        gonercon = 2;
358
        alarm[8] = 1;
359
    }
360
    if (gonercon == 3)
361
    {
362
        gonercon = 4;
363
        alarm[8] = 30;
364
    }
365
    if (gonercon == 5)
366
    {
367
        with (obj_heart)
368
            ignore_border = 1;
369
        ws = instance_create(0, 0, obj_hg_wholescreen);
370
        gonercon = 6;
371
        alarm[8] = 40;
372
    }
373
    if (gonercon == 7)
374
    {
375
        hg = instance_create(176, 16, obj_hg_body);
376
        gonercon = 8;
377
    }
378
    if (gonercon == 10)
379
    {
380
        ws.con = 2;
381
        shrug = 0;
382
        specialnormal = 1;
383
        global.faceemotion = 0;
384
        global.flag[20 animation_index] = 0;
385
        with (obj_hg_debris)
386
            instance_destroy();
387
        caster_play(cr, 0.9, 0.8);
388
        obj_heart.image_alpha = 1;
389
        image_alpha = 0;
390
        with (obj_heart)
391
        {
392
            ignore_border = 0;
393
            x = 312;
394
            y = (global.idealborder[2] + global.idealborder[3]) / 2;
395
        }
396
        gonercon = 11;
397
    }
398
    if (gonercon == 11)
399
    {
400
        obj_heart.depth = 0;
401
        image_alpha += 0.1;
402
        if (image_alpha >= 1)
403
        {
404
            image_alpha = 1;
405
            gonercon = 12;
406
            alarm[8] = 30;
407
        }
408
    }
409
    if (gonercon == 13)
410
    {
411
        global.mnfight = 5;
412
        gonercon = 0;
413
    }
414
}
415
if (global.debug == 1)
416
{
417
    if (keyboard_check_pressed(vk_space))
418
    {
419
        s_s = 0;
420
        if (aligncon == 0)
421
            aligncon = 1;
422
        if (aligncon == 3)
423
            aligncon = 4;
424
    }
425
    if (control_check_pressed(2))
426
    {
427
        s_s = 1;
428
        if (aligncon == 0)
429
            aligncon = 1;
430
        if (aligncon == 3)
431
            aligncon = 4;
432
    }
433
}
434
if (specialnormal == 1)
435
{
436
    sn += 1;
437
    y = 50 + (sin(sn / 8) * 4);
438
}
439
if (specialnormal == 0 && global.mnfight == 0 && global.myfight == 0)
440
{
441
    if (global.bmenuno == 1 || global.bmenuno == 2)
442
    {
443
        var mon_name = 
Asriel Dreemurr
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("monstername_99")
;
444
        fullphrase = " " + mon_name + " ";
445
        len = string_length(fullphrase);
446
        if (global.language == "ja")
447
            global.monstername[0] = string_repeat(" ", string_length(mon_name));
448
        else
449
            global.monstername[0] = string_repeat(" ", 2 + string_length(mon_name));
450
        if (instance_exists(OBJ_INSTAWRITER))
451
            OBJ_INSTAWRITER.originalstring = 
*
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("battle_name_header")
+ global.monstername[0];
452
        n_siner += 1;
453
        scr_setfont
scr_setfont

var newfont = argument0; if (global.language == "ja") { if (newfont == fnt_main) newfont = fnt_ja_main; if (newfont == fnt_maintext) newfont = fnt_ja_maintext; if (newfont == fnt_plain) newfont = fnt_ja_plain; } draw_set_font(newfont);
(fnt_main);
454
        var textx = 110;
455
        if (global.language == "ja")
456
            textx = 104;
457
        for (i = 0; i < len; i += 1)
458
        {
459
            tcolor = make_color_hsv((siner * 8) + (i * 8), 140, 255);
460
            draw_set_color(tcolor);
461
            letter = string_char_at(fullphrase, i);
462
            draw_text_transformed(textx + (sin((siner + i) / 5) * 8), 270 + (cos((siner + i) / 5) * 4), letter, 1, 1, 0);
463
            if (global.language == "ja")
464
            {
465
                var ch = ord(letter);
466
                if (ch == 32 || ch >= 65377)
467
                    textx += 13;
468
                else if (ch < 8192)
469
                    textx += 16;
470
                else
471
                    textx += 26;
472
            }
473
            else
474
            {
475
                textx += 16;
476
            }
477
        }
478
    }
479
}
480
if (global.flag[20 animation_index] == 1)
481
    shrug = 1;
482
else
483
    shrug = 0;