Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_queenart_red_Draw_0

(view raw script w/o annotations or w/e)
1
if (flip == false)
2
    draw_self();
3
if (flip == true)
4
{
5
    con = 0;
6
    global.interact = 1;
7
    if (flipcon == 0)
8
    {
9
        draw_set_alpha(0.2);
10
        draw_rectangle(x - 38, y + 2, x + 38, (y + 120) - 2, 0);
11
        draw_set_alpha(1);
12
        if (flipped == 0)
13
        {
14
            draw_sprite_ext(spriteindex2, image_index, x + 2, y, image_xscale, image_yscale, image_angle, c_gray, image_alpha);
15
            draw_sprite_ext(spriteindex2, image_index, x + 1, y, image_xscale, image_yscale, image_angle, c_gray, image_alpha);
16
        }
17
        if (flipped == 1)
18
        {
19
            draw_sprite_ext(spriteindex1, image_index, x + 2, y, image_xscale, image_yscale, image_angle, c_gray, image_alpha);
20
            draw_sprite_ext(spriteindex1, image_index, x + 1, y, image_xscale, image_yscale, image_angle, c_gray, image_alpha);
21
        }
22
        draw_sprite_ext(sprite_index, image_index, x, y, image_xscale, image_yscale, image_angle, c_white, image_alpha);
23
        if (image_xscale > 0.1)
24
        {
25
            image_xscale *= flipfactor;
26
            image_xscale = clamp(image_xscale, 0, 2);
27
        }
28
        else
29
        {
30
            flipcon = 1;
31
            image_xscale = 0.1;
32
            fliptimer = 0;
33
        }
34
    }
35
    if (flipcon == 1)
36
    {
37
        draw_sprite_ext(spriteindex1, 0, x - 2, y, image_xscale, image_yscale, 0, c_white, 1);
38
        draw_sprite_ext(spriteindex2, 0, x, y, image_xscale, image_yscale, 0, c_white, 1);
39
        fliptimer++;
40
        if (fliptimer == 2)
41
        {
42
            if (flipped == 0)
43
            {
44
                sprite_index = spriteindex2;
45
                flipped = true;
46
                flipcon = 2;
47
            }
48
            else
49
            {
50
                sprite_index = spriteindex1;
51
                flipped = false;
52
                flipcon = 2;
53
            }
54
        }
55
    }
56
    if (flipcon == 2)
57
    {
58
        draw_set_alpha(0.2);
59
        draw_rectangle(x - 38, y + 2, x + 38, (y + 120) - 2, 0);
60
        draw_set_alpha(1);
61
        draw_self();
62
        if (image_xscale < 1.99)
63
        {
64
            image_xscale *= (1 / flipfactor);
65
            image_xscale = clamp(image_xscale, 0, 2);
66
        }
67
        else
68
        {
69
            image_xscale = 2;
70
            flip = false;
71
            global.interact = 0;
72
            flipcon = 0;
73
        }
74
    }
75
}
76
if (decorative == true && flip == false)
77
{
78
    shadow = instance_create(x, y, obj_marker);
79
    shadow.image_xscale = 2;
80
    shadow.image_yscale = 2;
81
    shadow.sprite_index = sprite_index;
82
    shadow.image_index = image_index;
83
    shadow.depth = depth;
84
    shadow.image_speed = image_speed;
85
    instance_destroy();
86
}
87
if (isswitch && dontshine == 0)
88
{
89
    if (!shine_init)
90
    {
91
        shine_init = true;
92
        shine = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(x - 8, y + 84, spr_shine_white);
93
        shine.depth = depth - 10;
94
        shine.image_speed = 0.1;
95
    }
96
}