Undertale script viewer

← back to main script listing

gml_Object_obj_asgorespear_Draw_0

(view raw script w/o annotations or w/e)
1
if (obj_time.left && debuggo == 1)
2
{
3
    angle -= 8;
4
    if (control_check(1))
5
        angle -= 16;
6
    if (control_check(0))
7
    {
8
        simg = instance_create(x, y, obj_spearafterimage);
9
        simg.originx = x;
10
        simg.originy = y;
11
        simg.outx = x + lengthdir_x(320, angle + 8);
12
        simg.outy = y + lengthdir_y(320, angle + 8);
13
        simg.outx2 = x + lengthdir_x(320, angle - 40);
14
        simg.outy2 = y + lengthdir_y(320, angle - 40);
15
        simg.color = color;
16
        simg2 = instance_create(x, y, obj_spearafterimage2);
17
        simg2.angle = angle - 16;
18
        simg2.alpha -= 0.017;
19
        simg2.color = color;
20
        simg3 = instance_create(x, y, obj_spearafterimage2);
21
        simg3.angle = angle - 40;
22
        simg3.color = color;
23
        simg4 = instance_create(x, y, obj_spearafterimage2);
24
        simg4.angle = angle + 8;
25
        simg4.alpha -= 0.034;
26
        simg4.color = color;
27
        angle -= 40;
28
    }
29
}
30
if (obj_time.right && debuggo == 1)
31
{
32
    angle += 8;
33
    if (control_check(1))
34
        angle += 16;
35
    if (control_check(0))
36
    {
37
        simg = instance_create(x, y, obj_spearafterimage);
38
        simg.originx = x;
39
        simg.originy = y;
40
        simg.outx = x + lengthdir_x(320, angle - 8);
41
        simg.outy = y + lengthdir_y(320, angle - 8);
42
        simg.outx2 = x + lengthdir_x(320, angle + 40);
43
        simg.outy2 = y + lengthdir_y(320, angle + 40);
44
        simg.color = color;
45
        simg2 = instance_create(x, y, obj_spearafterimage2);
46
        simg2.angle = angle + 16;
47
        simg2.alpha -= 0.017;
48
        simg2.color = color;
49
        simg3 = instance_create(x, y, obj_spearafterimage2);
50
        simg3.angle = angle + 40;
51
        simg3.color = color;
52
        simg4 = instance_create(x, y, obj_spearafterimage2);
53
        simg4.angle = angle - 8;
54
        simg4.alpha -= 0.034;
55
        simg4.color = color;
56
        angle += 40;
57
    }
58
}
59
siner += 1;
60
y += (sin(siner / 15) * 0.3);
61
angle += (sin(siner / 15) * 0.02);
62
xhand1 = lengthdir_x(55, angle);
63
yhand1 = lengthdir_y(55, angle);
64
rdistx = x + (xhand1 * 2);
65
rdisty = y + (yhand1 * 2);
66
if (armtest == 1)
67
{
68
    if (instance_exists(obj_asgoreb_body))
69
    {
70
        point1y = obj_asgoreb_body.party[5] + 64 + obj_asgoreb_body.y;
71
        point1x = obj_asgoreb_body.partx[5] + 14 + obj_asgoreb_body.x;
72
        armlength = point_distance(point1x, point1y, x - xhand1, y - yhand1);
73
        armangle = point_direction(point1x, point1y, x - xhand1, y - yhand1);
74
        armsize = armlength / 40;
75
        if (armsize < 0.35)
76
            armsize = 0;
77
        draw_sprite_ext(spr_asgoreb_ballarm, 0, point1x, point1y, armsize * 2, 2, armangle, c_white, 1);
78
        point1y = obj_asgoreb_body.party[4] + 64 + obj_asgoreb_body.y;
79
        point1x = obj_asgoreb_body.partx[4] + 34 + obj_asgoreb_body.x;
80
        armlength = point_distance(point1x, point1y, rdistx, rdisty);
81
        if (armlength > 100)
82
        {
83
            armoff = (armlength - 100) / 2;
84
            rdistx = x + (lengthdir_x(55 - armoff, angle) * 2);
85
            rdisty = y + (lengthdir_y(55 - armoff, angle) * 2);
86
            armlength = point_distance(point1x, point1y, rdistx, rdisty);
87
        }
88
        armangle = point_direction(point1x, point1y, rdistx, rdisty);
89
        if (armangle > 100)
90
            point1y -= 12;
91
        armsize = armlength / 40;
92
        if (armsize < 0.6)
93
            armsize = 0;
94
        draw_sprite_ext(spr_asgoreb_ballarm, 0, point1x, point1y, armsize * 2, 2, armangle, c_white, 1);
95
    }
96
}
97
if (keyboard_check(ord("1")) && debuggo == 1)
98
    color = c_red;
99
if (keyboard_check(ord("2")) && debuggo == 1)
100
    color = c_orange;
101
if (keyboard_check(ord("3")) && debuggo == 1)
102
    color = make_color_rgb(90, 130, 255);
103
draw_sprite_ext(sprite_index, image_index, x, y, 2, 2, angle, color, 1);
104
draw_sprite_ext(spr_spearhandr, image_index, rdistx, rdisty, 2, 2, angle, c_white, 1);
105
draw_sprite_ext(spr_spearhandl, image_index, x - xhand1, y - yhand1, 2, 2, angle, c_white, 1);