Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_tensionbar_Draw_0

(view raw script w/o annotations or w/e)
1
if ((room == room_board_1 || room == room_board_2 || room == room_board_3) && i_ex(obj_shootout_controller))
2
    exit;
3
if (global.chapter == 3 && i_ex(obj_susiezilla_gamecontroller))
4
    exit;
5
if (global.chapter == 3 && i_ex(obj_chefs_game))
6
    exit;
7
if (global.chapter == 3 && i_ex(obj_rhythmgame))
8
    exit;
9
if (global.chapter == 3 && i_ex(obj_shootout_controller))
10
    exit;
11
if (global.chapter == 3 && i_ex(obj_gameover_board))
12
    exit;
13
if (global.chapter == 3 && i_ex(obj_gameover_minigame))
14
    exit;
15
if (global.chapter == 3 && instance_exists(obj_knight_enemy) && obj_knight_enemy.end_cutscene_version > 0)
16
    exit;
17
if (!surface_exists(healthbar_surf))
18
    healthbar_surf = surface_create(96, 250);
19
surface_set_target(healthbar_surf);
20
draw_clear_alpha(c_white, 0);
21
if (i_ex(obj_battlecontroller) && obj_battlecontroller.rouxlsgridenabled == true && global.bmenuno == 0 && global.myfight == 0 && global.charturn == 0)
22
    yoffset = lerp(yoffset, -90, 0.25);
23
else
24
    yoffset = lerp(yoffset, 0, 0.25);
25
yy = __view_get(e__VW.YView, 0);
26
y = yy + 40 + yoffset;
27
if (i_ex(obj_shadowman_sharpshoot_cursor) && obj_shadowman_sharpshoot_cursor.disablesbattleui == true)
28
    y = -999;
29
draw_sprite(spr_tensionbar, 1, 0, 0);
30
if (abs(apparent - global.tension) < 20)
31
    apparent = global.tension;
32
if (apparent < global.tension)
33
    apparent += 20;
34
if (apparent > global.tension)
35
    apparent -= 20;
36
if (apparent != current)
37
{
38
    changetimer += 1;
39
    if (changetimer > 15)
40
    {
41
        if ((apparent - current) > 0)
42
            current += 2;
43
        if ((apparent - current) > 10)
44
            current += 2;
45
        if ((apparent - current) > 25)
46
            current += 3;
47
        if ((apparent - current) > 50)
48
            current += 4;
49
        if ((apparent - current) > 100)
50
            current += 5;
51
        if ((apparent - current) < 0)
52
            current -= 2;
53
        if ((apparent - current) < -10)
54
            current -= 2;
55
        if ((apparent - current) < -25)
56
            current -= 3;
57
        if ((apparent - current) < -50)
58
            current -= 4;
59
        if ((apparent - current) < -100)
60
            current -= 5;
61
        if (abs(apparent - current) < 3)
62
            current = apparent;
63
    }
64
}
65
if (current > 0)
66
{
67
    if (apparent < current)
68
    {
69
        draw_set_color(c_red);
70
        draw_rectangle(3, (0 + sprite_height) - 1, (0 + sprite_width) - 1, (0 + sprite_height) - ((current / global.maxtension) * sprite_height), false);
71
        draw_set_color(c_orange);
72
        draw_rectangle(3, (0 + sprite_height) - 1, (0 + sprite_width) - 1, (0 + sprite_height) - ((apparent / global.maxtension) * sprite_height), false);
73
    }
74
    if (apparent > current)
75
    {
76
        draw_set_color(c_white);
77
        draw_rectangle(3, (0 + sprite_height) - 1, (0 + sprite_width) - 1, (0 + sprite_height) - ((apparent / global.maxtension) * sprite_height), false);
78
        draw_set_color(c_orange);
79
        if (maxed == 1)
80
            draw_set_color(merge_color(c_yellow, c_orange, 0.5));
81
        draw_rectangle(3, (0 + sprite_height) - 1, (0 + sprite_width) - 1, (0 + sprite_height) - ((current / global.maxtension) * sprite_height), false);
82
    }
83
    if (apparent == current)
84
    {
85
        draw_set_color(c_orange);
86
        if (maxed == 1)
87
            draw_set_color(merge_color(c_yellow, c_orange, 0.5));
88
        draw_rectangle(3, (0 + sprite_height) - 1, (0 + sprite_width) - 1, (0 + sprite_height) - ((current / global.maxtension) * sprite_height), false);
89
    }
90
}
91
shit = 0;
92
try
93
{
94
    if (global.tensionselect >= 0)
95
        shit = 1;
96
}
97
catch (_ex)
98
{
99
    shit = 2;
100
}
101
if (shit == 2)
102
    snd_play(snd_splat);
103
if (global.tensionselect > 0)
104
{
105
    tsiner += 1;
106
    draw_set_color(c_white);
107
    draw_set_alpha(abs(sin(tsiner / 8) * 0.5) + 0.2);
108
    theight = (0 + sprite_height) - ((current / global.maxtension) * sprite_height);
109
    theight2 = theight + ((global.tensionselect / global.maxtension) * sprite_height);
110
    if (theight2 > ((0 + sprite_height) - 1))
111
    {
112
        theight2 = (0 + sprite_height) - 1;
113
        draw_set_color(c_dkgray);
114
        draw_set_alpha(0.7);
115
    }
116
    draw_rectangle(3, theight2, (0 + sprite_width) - 1, theight, false);
117
    draw_set_alpha(1);
118
}
119
else
120
{
121
    tsiner++;
122
}
123
if (apparent > 20 && apparent < global.maxtension)
124
    draw_sprite(spr_tensionmarker, 0, 3, (0 + sprite_height) - ((current / global.maxtension) * sprite_height));
125
if (room == room_board_1 || room == room_board_2 || room == room_board_3)
126
{
127
    var col = merge_color(c_white, c_yellow, abs(sin(tsiner / 8) * 0.5) + 0.1);
128
    var col2 = 16777215;
129
    if (apparent > global.rank1tp)
130
        col2 = col;
131
    draw_set_color(col);
132
    draw_set_color(col2);
133
    draw_rectangle(3, (4 + sprite_height) - ((global.rank1tp / global.maxtension) * sprite_height), (0 + sprite_width) - 1, (0 + sprite_height) - ((global.rank1tp / global.maxtension) * sprite_height), false);
134
    draw_sprite_ext(spr_thrash_star, 0, (x + 6) - 14, (1 + sprite_height) - ((global.rank1tp / global.maxtension) * sprite_height), 0.5, 0.5, 0, col2, 1);
135
    draw_set_color(c_white);
136
}
137
draw_sprite(spr_tensionbar, 0, 0, 0);
138
gpu_set_blendmode(bm_subtract);
139
draw_sprite_ext(spr_tensionbar_cutout, 0, 0, 0, 1, 1, 0, c_white, 1);
140
gpu_set_blendmode(bm_normal);
141
surface_reset_target();
142
draw_surface(healthbar_surf, x, y);
143
draw_sprite(spr_tplogo, 0, x - 30, y + 30);
144
draw_set_color(c_white);
145
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("mainbig");
146
flashsiner += 1;
147
tamt = floor((apparent / global.maxtension) * 100);
148
maxed = 0;
149
if (tamt < 100)
150
{
151
    draw_text(x - 30, y + 70, string_hash_to_newline(string(floor((apparent / global.maxtension) * 100))));
152
    draw_text(x - 25, y + 95, string_hash_to_newline(stringsetloc(
Close Message
"%", "obj_tensionbar_slash_Draw_0_gml_18_0"
)));
153
}
154
if (tamt >= 100)
155
{
156
    maxed = 1;
157
    draw_set_color(c_yellow);
158
    draw_text(x - 28, y + 70, string_hash_to_newline(stringsetloc(
M
"M", "obj_tensionbar_slash_Draw_0_gml_25_0"
)));
159
    draw_text(x - 24, y + 90, string_hash_to_newline(stringsetloc(
A
"A", "obj_tensionbar_slash_Draw_0_gml_26_0"
)));
160
    draw_text(x - 20, y + 110, string_hash_to_newline(stringsetloc(
X
"X", "obj_tensionbar_slash_Draw_0_gml_27_0"
)));
161
}
162
163
enum e__VW
164
{
165
    XView,
166
    YView,
167
    WView,
168
    HView,
169
    Angle,
170
    HBorder,
171
    VBorder,
172
    HSpeed,
173
    VSpeed,
174
    Object,
175
    Visible,
176
    XPort,
177
    YPort,
178
    WPort,
179
    HPort,
180
    Camera,
181
    SurfaceID
182
}