Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_dw_castle_church_climb_Draw_0

related scripts: Create_0Draw_0 Other_11Other_12Other_15Other_19Step_0Step_1Step_2

(view raw script w/o annotations or w/e)
1
var _cx = camerax();
2
var _cy = cameray();
3
with (scoreboard)
4
{
5
    var active = false;
6
    if (other.climbingcon == 1)
7
        active = true;
8
    siner++;
9
    image_index += 0.5;
10
    var _time = 0;
11
    if (active)
12
        _time = other.fulltime - other.timber;
13
    if (other.thisclimbtime != -1)
14
        _time = other.thisclimbtime;
15
    if (active)
16
    {
17
        x = lerp(x, _cx + 40, 0.125);
18
        y = lerp(y, _cy + 340 + (sin(siner / 15) * 8), 0.25);
19
    }
20
    else if (other.thisclimbtime != -1)
21
    {
22
        x = lerp(x, _cx + 30, 1/30);
23
        y = lerp(y, _cy + 30 + (sin(siner / 15) * 4), 0.08333333333333333);
24
    }
25
    else
26
    {
27
        x = lerp(x, _cx - 40, 0.25);
28
        y = lerp(y, _cy + 540, 0.25);
29
    }
30
    var formatted = floor(_time / 3);
31
    var num = other.formatnum(formatted);
32
    var col = merge_color(#FFFFC2, c_white, 0.5 + (sin(siner / 15) * 0.5));
33
    if (formatted >= 999)
34
        col = merge_color(c_red, #8781BE, 
scr_progress
scr_progress

function
scr_progress(arg0, arg1, arg2, arg3, arg4)
{ return clamp(arg3 + (((arg0 - arg1) / (arg2 - arg1)) * (arg4 - arg3)), arg3, arg4); } function scr_xprog(arg0, arg1, arg2, arg3 = false) { var _progress = 0; if ((arg2 - arg1) != 0) { if (arg3) _progress = clamp((arg0 - arg1) / (arg2 - arg1), 0, 1); else _progress = (arg0 - arg1) / (arg2 - arg1); return _progress; } }
(formatted, 999, 9000, 0, 1));
35
    if (formatted >= 9000)
36
    {
37
        x += random_range(-1, 1);
38
        y += random_range(-1, 1);
39
    }
40
    if (formatted == 0)
41
        col = 1184274;
42
    if (other.thisclimbtime != -1)
43
        col = 187386;
44
    draw_sprite_ext(spr_glowpuzzletimer_simple, 0, x, y, 2, 2, 0, c_white, 1);
45
    draw_sprite_ext(spr_pxwhite, 0, x + 9, y + 9, 66, 32, 0, c_black, 0.5);
46
    for (var i = 0; i < 3; i++)
47
    {
48
        var bon = 0;
49
        if (i == 2)
50
            bon = 4;
51
        draw_sprite_ext(spr_timer_digits, num[i], (x - 24) + (20 * i) + bon, y - 10, 2, 2, 0, col, 1);
52
    }
53
    draw_sprite_ext(spr_pxwhite, 0, x + 50, y + 36, 4, 4, 0, col, 1);
54
    draw_sprite_ext(spr_glowpuzzletimer_simple_fire, siner / 2, x + 6, y + 50, 2, 2, 0, c_white, 1);
55
    draw_sprite_ext(spr_glowpuzzletimer_simple_fire, siner / 2, x + 64, y + 50, 2, 2, 0, c_white, 1);
56
}