Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_dmgwriter_Draw_0

(view raw script w/o annotations or w/e)
1
if (delaytimer < delay)
2
{
3
    with (obj_dmgwriter)
4
        killtimer = 0;
5
}
6
delaytimer += 1;
7
mercytimer++;
8
if (delaytimer == delay)
9
{
10
    vspeed = -5 - random(2);
11
    hspeed = 10;
12
    vstart = vspeed;
13
    flip = 90;
14
}
15
if (delaytimer >= delay)
16
{
17
    draw_set_color(c_white);
18
    if (type == 0)
19
        draw_set_color(lightb);
20
    if (type == 1)
21
        draw_set_color(lightf);
22
    if (type == 2)
23
        draw_set_color(lightg);
24
    if (type == 3)
25
        draw_set_color(c_lime);
26
    if (type == 4)
27
        draw_set_color(c_red);
28
    if (type == 5 && damage < 0)
29
        draw_set_color(c_ltgray);
30
    if (type == 6)
31
        draw_set_color(lighty);
32
    message = specialmessage;
33
    if (damage == 0)
34
        message = 1;
35
    if (type == 4)
36
        message = 2;
37
    if (type == 5 && damage == 100)
38
        message = 5;
39
    if (type == 12)
40
        message = 10;
41
    if (type == 13)
42
    {
43
        message = 13;
44
        draw_set_color(aqcolor);
45
    }
46
    if (type != 5)
47
        draw_set_font(global.damagefont);
48
    if (type == 5)
49
        draw_set_font(global.damagefontgold);
50
    if (hspeed > 0)
51
        hspeed -= 1;
52
    if (hspeed < 0)
53
        hspeed += 1;
54
    if (abs(hspeed) < 1)
55
        hspeed = 0;
56
    if (init == 0)
57
    {
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
}