Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dmgwriter_boogie_Draw_0

(view raw script w/o annotations or w/e)
1
if (delaytimer < delay)
2
{
3
    with (obj_dmgwriter_boogie)
4
        killtimer = 0;
5
}
6
delaytimer += 1;
7
if (delaytimer == delay)
8
{
9
    vspeed = -5 - random(2);
10
    hspeed = 10;
11
    vstart = vspeed;
12
    flip = 90;
13
}
14
if (delaytimer >= delay)
15
{
16
    draw_set_color(c_white);
17
    if (type == 0)
18
        draw_set_color(lightb);
19
    if (type == 1)
20
        draw_set_color(lightf);
21
    if (type == 2)
22
        draw_set_color(lightg);
23
    if (type == 3)
24
        draw_set_color(c_lime);
25
    if (type == 4)
26
        draw_set_color(c_red);
27
    if (type == 5 && damage < 0)
28
        draw_set_color(c_ltgray);
29
    if (type == 6)
30
        draw_set_color(lighty);
31
    message = specialmessage;
32
    if (damage == 0)
33
        message = 1;
34
    if (type == 4)
35
        message = 2;
36
    if (type == 5 && damage == 100)
37
        message = 5;
38
    if (type == 12)
39
        message = 10;
40
    if (type == 13)
41
    {
42
        message = 13;
43
        draw_set_color(aqcolor);
44
    }
45
    if (type != 5)
46
        draw_set_font(global.damagefont);
47
    if (type == 5)
48
        draw_set_font(global.damagefontgold);
49
    if (hspeed > 0)
50
        hspeed -= 1;
51
    if (hspeed < 0)
52
        hspeed += 1;
53
    if (abs(hspeed) < 1)
54
        hspeed = 0;
55
    if (init == 0)
56
    {
57
        var _damage = round(damage);
58
        damagemessage = string(_damage);
59
        if (type == 5)
60
            damagemessage = "+" + string(_damage) + "%";
61
        if (type == 5 && damage < 0)
62
            damagemessage = string(_damage) + "%";
63
        init = 1;
64
    }
65
    if (message == 0)
66
    {
67
        draw_set_alpha(1 - kill);
68
        draw_set_halign(fa_right);
69
        if (spec == 0)
70
            draw_text_transformed(x + 30, y, damagemessage, 2 - stretch, stretch + kill, 0);
71
        if (spec == 1)
72
            draw_text_transformed(x + 30, y, damagemessage, 2 - stretch, stretch + kill, 90);
73
        draw_set_halign(fa_left);
74
        draw_set_alpha(1);
75
    }
76
    else
77
    {
78
        if (message == 1)
79
            draw_sprite_ext(message_sprite, 0, x + 30, y, 2 - stretch, stretch + kill, 0, draw_get_color(), 1 - kill);
80
        if (message == 2)
81
            draw_sprite_ext(message_sprite, 1, x + 30, y, 2 - stretch, stretch + kill, 0, c_red, 1 - kill);
82
        if (message == 3)
83
            draw_sprite_ext(message_sprite, 2, x + 30, y, 2 - stretch, stretch + kill, 0, c_lime, 1 - kill);
84
        if (message == 4)
85
            draw_sprite_ext(message_sprite, 3, x + 30, y, 2 - stretch, stretch + kill, 0, c_lime, 1 - kill);
86
        if (message == 5)
87
            draw_sprite_ext(message_sprite, 5, x + 30, y, 2 - stretch, stretch + kill, 0, c_lime, 1 - kill);
88
        if (message == 6)
89
            draw_sprite_ext(message_sprite, 8, x + 30, y, 2 - stretch, stretch + kill, 0, c_white, 1 - kill);
90
        if (message == 7)
91
            draw_sprite_ext(message_sprite, 9, x + 30, y, 2 - stretch, stretch + kill, 0, c_white, 1 - kill);
92
        if (message == 8)
93
            draw_sprite_ext(message_sprite, 10, x + 30, y, 2 - stretch, stretch + kill, 0, c_white, 1 - kill);
94
        if (message == 9)
95
            draw_sprite_ext(message_sprite, 11, x + 30, y, 2 - stretch, stretch + kill, 0, c_white, 1 - kill);
96
        if (message == 10)
97
            draw_sprite_ext(message_sprite, 13, x + 30, y, 2 - stretch, stretch + kill, 0, c_red, 1 - kill);
98
        if (message == 13)
99
            draw_sprite_ext(message_sprite, 14, x + 30, y, 2 - stretch, stretch + kill, 0, aqcolor, 1 - kill);
100
    }
101
    if (bounces < 2)
102
        vspeed += 1;
103
    if (y > ystart && bounces < 2 && killactive == 0)
104
    {
105
        y = ystart;
106
        vspeed = vstart / 2;
107
        bounces += 1;
108
    }
109
    if (bounces >= 2 && killactive == 0)
110
    {
111
        vspeed = 0;
112
        y = ystart;
113
    }
114
    if (stretchgo == 1)
115
        stretch += 0.4;
116
    if (stretch >= 1.2)
117
    {
118
        stretch = 1;
119
        stretchgo = 0;
120
    }
121
    killtimer += 1;
122
    if (killtimer > 35)
123
        killactive = 1;
124
    if (killactive == 1)
125
    {
126
        kill += 0.08;
127
        y -= 4;
128
    }
129
    if (kill > 1)
130
        instance_destroy();
131
}
132
if (global.fighting == 1)
133
{
134
    if (stayincamera == 1)
135
    {
136
        if (x >= (xx + 600))
137
            x = xx + 600;
138
    }
139
}