Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_bookshelf_destructable_Draw_0

(view raw script w/o annotations or w/e)
1
if (extflag == "treasure")
2
    sprite_index = spr_dw_church_2x2shelf_pink;
3
draw_self();
4
if (extflag == "treasure")
5
{
6
    active = 0;
7
    with (obj_dw_church_remotepianomove)
8
    {
9
        if (engaged)
10
            other.active = 1;
11
    }
12
    if (global.flag[1538] == 1)
13
        active = 0;
14
    alpha = lerp(alpha, active, 0.125);
15
    draw_sprite_ext(sprite_index, 1, x, y, 2, 2, 0, c_white, (abs(sin(siner / 15) * 0.2) + 0.8) * alpha);
16
    var myicon = 0;
17
    var mycol = 16777215;
18
    var alt = 0;
19
    switch (sprite_index)
20
    {
21
        case spr_dw_church_2x2shelf_blue:
22
            myicon = 4912;
23
            mycol = 5711637;
24
            break;
25
        case spr_dw_church_2x2shelf_red:
26
            myicon = 5271;
27
            mycol = 1905236;
28
            break;
29
        case spr_dw_church_2x2shelf_green:
30
            myicon = 4601;
31
            mycol = 16896;
32
            break;
33
        case spr_dw_church_2x2shelf_pink:
34
            myicon = 3194;
35
            mycol = 9717932;
36
            break;
37
        case spr_dw_church_2x2shelf_purple:
38
            myicon = 1378;
39
            mycol = 5114958;
40
            break;
41
        case spr_dw_church_2x2shelf_orange:
42
            myicon = 1378;
43
            mycol = 77861;
44
            alt = 1;
45
            break;
46
    }
47
    if (myicon)
48
    {
49
        var modifier = 1;
50
        if (alt)
51
            modifier = -1;
52
        draw_sprite_ext(myicon, 0, x + 40, y + 40, 2 * modifier, 2 * modifier, 0, mycol, 1 - (alpha * 2));
53
    }
54
    if (alpha > 0 && myicon)
55
    {
56
        if (!left_h() && !down_h() && !right_h() && !up_h())
57
            soundtoplay = 0;
58
        if (left_h())
59
            soundtoplay = 1;
60
        if (down_h())
61
            soundtoplay = 3;
62
        if (right_h())
63
            soundtoplay = 5;
64
        if (up_h())
65
            soundtoplay = 7;
66
        var drawx = x + 40;
67
        var drawy = y + 40;
68
        var litblue = 16777215;
69
        var sprangle = 0;
70
        var scale = 2;
71
        var circlespr = myicon;
72
        var arrowspr = 4477;
73
        var _space = 24;
74
        var sinstrength = 0;
75
        var sintimevar = 15;
76
        var sintimevariance = 3;
77
        var afterimagemovespeed = 5;
78
        var afterimagefriction = -1;
79
        var basealpha = 0.35;
80
        var bonusalpha = 0;
81
        var xloc = drawx + _space;
82
        var sinmod = (1/3) * sintimevar;
83
        var yloc = drawy + (sin((siner + sinmod) / sintimevar) * sinstrength);
84
        var angle = 90;
85
        var xscale = 2;
86
        var yscale = 2;
87
        if (soundtoplay == 5)
88
            bonusalpha = 0.5;
89
        draw_sprite_ext(arrowspr, 0, xloc, yloc, xscale, yscale, angle, litblue, (basealpha + bonusalpha) * alpha);
90
        bonusalpha = 0;
91
        xloc = drawx - _space;
92
        sinmod = (2/3) * sintimevar;
93
        yloc = drawy + (sin((siner + sinmod) / sintimevar) * sinstrength);
94
        xscale = -2;
95
        yscale = 2;
96
        angle = 270;
97
        if (soundtoplay == 1)
98
            bonusalpha = 0.5;
99
        draw_sprite_ext(arrowspr, 0, xloc, yloc, -2, 2, angle, litblue, (basealpha + bonusalpha) * alpha);
100
        bonusalpha = 0;
101
        xloc = drawx;
102
        sinmod = 1 * sintimevar;
103
        yloc = (drawy - _space) + (sin((siner + sinmod) / sintimevar) * sinstrength);
104
        xscale = 2;
105
        yscale = 2;
106
        angle = 180;
107
        if (soundtoplay == 7)
108
            bonusalpha = 0.5;
109
        draw_sprite_ext(arrowspr, 0, xloc, yloc, 2, 2, angle, litblue, (basealpha + bonusalpha) * alpha);
110
        bonusalpha = 0;
111
        xloc = drawx;
112
        sinmod = (4/3) * sintimevar;
113
        yloc = drawy + _space + (sin((siner + sinmod) / sintimevar) * sinstrength);
114
        xscale = 2;
115
        yscale = 2;
116
        angle = 0;
117
        if (soundtoplay == 3)
118
            bonusalpha = 0.5;
119
        draw_sprite_ext(arrowspr, 0, xloc, yloc, xscale, yscale, angle, litblue, (basealpha + bonusalpha) * alpha);
120
        bonusalpha = 0;
121
        xloc = drawx;
122
        sinmod = 1.6666666666666667 * sintimevar;
123
        yloc = drawy + (sin((siner + sinmod) / sintimevar) * sinstrength);
124
        xscale = 2;
125
        yscale = 2;
126
        angle = 0;
127
        if (soundtoplay == 0)
128
            bonusalpha = 0.5;
129
        var modifier = 1;
130
        if (alt)
131
            modifier = -1;
132
        draw_sprite_ext(myicon, 0, xloc, yloc, xscale * modifier, yscale * modifier, 0, litblue, (basealpha + bonusalpha) * alpha);
133
    }
134
}