Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_bookshelf_moveable2x2_Draw_0

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