Undertale script viewer

← back to main script listing

gml_Object_obj_afinal_body_Draw_0

(view raw script w/o annotations or w/e)
1
anim += 1;
2
siner += 1;
3
side += 2;
4
if (side > 800)
5
    side -= 800;
6
yoff = sin(siner / 4);
7
yoff2 = sin(siner / 16);
8
draw_set_color(c_black);
9
ossafe_fill_rectangle(-10, 240, 999, -10);
10
thiscolor = make_color_hsv(siner * 6, 200, 200);
11
draw_set_color(thiscolor);
12
draw_sprite_part_ext(spr_asrielbg, 0, side, 0, 276, 216, 640, 0, -1, 1, thiscolor, 0.5);
13
draw_sprite_part_ext(spr_asrielbg, 0, side + 60, 0, 276, 216, 640, 0, -1, 1, thiscolor, 0.5);
14
draw_sprite_part_ext(spr_asrielbg, 0, side + 120, 0, 276, 216, 640, 0, -1, 1, thiscolor, 0.5);
15
draw_set_color(thiscolor);
16
draw_sprite_part_ext(spr_asrielbg, 0, side, 0, 276, 216, 0, 0, 1, 1, thiscolor, 0.5);
17
draw_sprite_part_ext(spr_asrielbg, 0, side + 60, 0, 276, 216, 0, 0, 1, 1, thiscolor, 0.5);
18
draw_sprite_part_ext(spr_asrielbg, 0, side + 120, 0, 276, 216, 0, 0, 1, 1, thiscolor, 0.5);
19
draw_sprite_ext(spr_afinal_cosmoswing, floor(anim / 6), x + 42, (y - 52) + (yoff2 * 4), 2, 2, 0, image_blend, image_alpha);
20
draw_sprite_ext(spr_afinal_cosmoswing, floor(anim / 6), x - 44, (y - 52) + (yoff2 * 4), -2, 2, 0, image_blend, image_alpha);
21
draw_sprite_ext(spr_afinal_orbwing, floor(anim / 6), x - 110, y - 52, 2, 2, 0, image_blend, image_alpha);
22
draw_sprite_ext(spr_afinal_orbwing, floor(anim / 6), x + 108, y - 52, -2, 2, 0, image_blend, image_alpha);
23
draw_sprite_ext(spr_afinal_stem, floor(anim / 6), x - 2, y + 146, 2, 2, 0, image_blend, image_alpha);
24
draw_sprite_ext(spr_afinal_orb, floor(anim / 6), x - 2, y + 68, 2, 2, 0, image_blend, image_alpha);
25
rx = random(ar_shake) - random(ar_shake);
26
ry = random(ar_shake) - random(ar_shake);
27
ry *= 1.5;
28
rx *= 0.7;
29
draw_set_alpha(bodyfader);
30
draw_set_color(c_black);
31
ossafe_fill_rectangle(-10, -10, 999, 999);
32
draw_set_alpha(1);
33
if (cry == 0)
34
    draw_sprite_ext(spr_afinal_face, global.faceemotion, x, y, 2, 2, 0, image_blend, image_alpha);
35
if (cry == 1)
36
    draw_sprite_ext(spr_afinal_face_cry, floor(siner / 8), x + (rx / 3), y + (ry / 3), 2, 2, 0, image_blend, image_alpha);
37
if (cry == 2)
38
    draw_sprite_ext(spr_afinal_face_cry2, floor(siner / 2), x + (rx / 3), y + (ry / 3), 2, 2, 0, image_blend, image_alpha);
39
draw_sprite_ext(spr_afinal_arm, floor(anim / 6), (x - 58) + rx, y + 56 + (yoff * 2) + ry, 2, 2, armrot, image_blend, image_alpha - bodyfader);
40
draw_sprite_ext(spr_afinal_arm, floor(anim / 6), x + 56 + rx, y + 56 + (yoff * 2) + ry, -2, 2, -armrot, image_blend, image_alpha - bodyfader);
41
draw_sprite_ext(spr_afinal_shoulder, floor(anim / 6), x - 84, y + 32, 2, 2, 0, image_blend, image_alpha - bodyfader);
42
draw_sprite_ext(spr_afinal_shoulder, floor(anim / 6), x + 82, y + 32, -2, 2, 0, image_blend, image_alpha - bodyfader);
43
if (ucon > 0)
44
{
45
    if (ucon == 1)
46
    {
47
        caster_play(psfx, 0.7, 1.2);
48
        arf = 30;
49
        ucon = 2;
50
    }
51
    if (ucon == 2)
52
    {
53
        armrot += arf;
54
        arf -= 2;
55
        if (arf <= 0)
56
        {
57
            ucon = 3;
58
            alarm[10] = 5;
59
        }
60
    }
61
    if (ucon == 4)
62
    {
63
        gen = instance_create(x, y, obj_ultimagen);
64
        gen.type = u_gen;
65
        if (instance_exists(obj_ultimatarget) == 0)
66
            target = instance_create(obj_heart.x, obj_heart.y, obj_ultimatarget);
67
        ucon = 5;
68
        alarm[10] = 140;
69
        if (gen.type == 2)
70
            alarm[10] = 130;
71
        arf = -30;
72
    }
73
    if (ucon == 6)
74
    {
75
        with (gen)
76
            instance_destroy();
77
        armrot += arf;
78
        arf += 2;
79
        if (arf >= 0)
80
        {
81
            ucon = 0;
82
            global.mnfight = 3;
83
        }
84
    }
85
}
86
if (instance_exists(obj_ultimabullet) == 0)
87
{
88
    if (instance_exists(obj_ultimatarget) == 0)
89
    {
90
        with (obj_ultimatarget)
91
            instance_destroy();
92
    }
93
}
94
if (bcon > 0)
95
{
96
    if (bcon == 1)
97
    {
98
        ps = 0;
99
        alarm[9] = 7;
gml_Object_obj_afinal_body_Alarm_9.gml

caster_stop(psfx); caster_play(psfx, 0.6 + (ps / 8), 0.5 + (ps / 6)); ps += 1; if (ps < 6) alarm[9] = 5;
100
        r_break = 0;
101
        r_al = 1;
102
        radi = 0;
103
        r_siner = 0;
104
        arf = 30;
105
        bcon = 2;
106
    }
107
    if (bcon == 2)
108
    {
109
        armrot -= arf;
110
        arf -= 5;
111
        if (arf <= 0)
112
        {
113
            bcon = 3;
114
            alarm[11] = 35;
115
        }
116
    }
117
    if (bcon == 4)
118
    {
119
        bcon = 4.1;
120
        alarm[11] = 2;
121
    }
122
    if (bcon == 4.1)
123
        armrot -= 5;
124
    if (bcon == 5.1)
125
    {
126
        bcon = 5;
127
        alarm[11] = 5;
128
    }
129
    if (bcon == 5)
130
    {
131
        ar_shake = 0;
132
        armrot += 26;
133
    }
134
    if (bcon == 6)
135
    {
136
        cry = 2;
137
        ar_shake = 5;
138
        armx = lengthdir_x(150, -armrot - 90);
139
        army = lengthdir_y(150, -armrot - 90);
140
        beam = instance_create(320, (y + 56 + army) - 20, obj_lastbeam);
141
        bcon = 7;
142
        alarm[11] = 400;
143
    }
144
    if (bcon < 7 && r_al > 0)
145
    {
146
        ar_shake += 0.2;
147
        if (radi < 60)
148
            radi += 1.5;
149
        r_siner += 1;
150
        radi_s = sin(r_siner / 2) * (radi / 8);
151
        armx = lengthdir_x(150, -armrot - 90);
152
        army = lengthdir_y(150, -armrot - 90);
153
        if (r_break == 1)
154
        {
155
            radi -= 6;
156
            r_al -= 0.1;
157
            if (r_al <= 0)
158
                r_al = 0;
159
        }
160
        draw_set_alpha(r_al);
161
        draw_set_color(c_white);
162
        draw_circle(x + 56 + armx, y + 56 + army, radi + radi_s, 1);
163
        draw_circle(x + 56 + armx, y + 56 + army, (radi + radi_s) - 1, 1);
164
        draw_sprite_ext(spr_beamcircle, 0, x + 56 + armx, y + 56 + army, 2 * ((radi + radi_s) / 40), 2 * ((radi + radi_s) / 40), 0, c_white, r_al);
165
        draw_circle(x - 58 - armx, y + 56 + army, radi + radi_s, 1);
166
        draw_circle(x - 58 - armx, y + 56 + army, (radi + radi_s) - 1, 1);
167
        draw_sprite_ext(spr_beamcircle, 0, x - 58 - armx, y + 56 + army, 2 * ((radi + radi_s) / 40), 2 * ((radi + radi_s) / 40), 0, c_white, r_al);
168
        draw_set_alpha(1);
169
    }
170
    if (bcon == 8)
171
    {
172
        cry = 0;
173
        global.faceemotion = 5;
174
        if (ar_shake > 0)
175
            ar_shake -= 1;
176
        if (armrot > 0)
177
            armrot -= 2;
178
        else
179
            armrot = 0;
180
        if (ar_shake <= 0)
181
        {
182
            ar_shake = 0;
183
            bcon = 0;
184
            global.mnfight = 3;
185
        }
186
    }
187
}
188
if (global.debug == 1)
189
{
190
}
191
if (darker == 1)
192
{
193
    with (obj_hpname)
194
        depth += 1;
195
    if (darker_x < 1)
196
        darker_x += 0.04;
197
    draw_set_alpha(darker_x);
198
    draw_set_color(c_black);
199
    ossafe_fill_rectangle(-10, -10, 999, 999);
200
    draw_set_alpha(1);
201
}