Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_climb_water_Draw_0

(view raw script w/o annotations or w/e)
1
var adjustment = 0;
2
if (i_ex(obj_rotating_tower_controller_new) && obj_rotating_tower_controller_new.appearance == 1)
3
    adjustment = 40;
4
var xx = x + adjustment;
5
var yy = y;
6
var xscale = 2;
7
var yscale = 2;
8
if (i_ex(obj_rotating_tower_controller_new))
9
{
10
    with (obj_rotating_tower_controller_new)
11
    {
12
        var _tilex = (xx / tile_width_fine) + 1;
13
        if (_tilex > (horizontaltilecount - 1))
14
            _tilex -= horizontaltilecount;
15
        if (_tilex < 0)
16
            _tilex += horizontaltilecount;
17
        var _tiley = other.y / tile_width_fine;
18
        xx = tower_x + tile_x[_tilex];
19
        xscale = (tile_xscale[_tilex] * 2) / tile_width_fine;
20
        if (tile_vis[_tilex] != 1)
21
            exit;
22
    }
23
}
24
if (watertype == 2)
25
{
26
    var topy = clamp(yy + drawy, ystart, endy);
27
    var boty = clamp((yy - 40) + (image_yscale * 40) + drawy, ystart, endy);
28
    var maxalpha = 1;
29
    if (boty >= endy)
30
    {
31
        var extratimer = (totaltimer - ((tilelimit + 2) * moverate)) * 2;
32
        boty += extratimer;
33
        maxalpha -= clamp(extratimer * 0.025, 0, 1);
34
    }
35
    var blend = clamp((boty - topy) / 50, 0, maxalpha);
36
    var merge = merge_color(c_black, c_white, blend);
37
    var mergeA = lerp(0, 1, blend);
38
    draw_sprite_ext(spr_climb_eyewater_new_loop, 0, xx, topy, xscale * 0.5, (boty - topy) / 200, 0, merge, mergeA);
39
    draw_sprite_ext(spr_climb_eyewater_new_end, 0, xx, boty, xscale * 0.5, 1, 0, merge, mergeA);
40
    var drawcollision = true;
41
    if (drawcollision)
42
    {
43
    }
44
}
45
else if (watertype == 1)
46
{
47
    var watcol = 15317774;
48
    var topy = clamp(yy + drawy, ystart + 10, endy);
49
    var boty = clamp((yy - 40) + (image_yscale * 40) + drawy, ystart + 20, endy);
50
    var alph = clamp(animindex + (sin(animindex * 4) * 0.25), 0, 0.8);
51
    animindex += 0.25;
52
    col[0] = 15313408;
53
    col[1] = 15313408;
54
    col[2] = 15317774;
55
    col[3] = 15313408;
56
    col[4] = 15381248;
57
    var colindex = floor(animindex) % 4;
58
    watcol = col[colindex];
59
    var offset = -8;
60
    if (ending)
61
    {
62
        offset = 0;
63
        alph *= clamp((boty - topy) / 20, 0, 1);
64
    }
65
    draw_set_blend_mode(bm_add);
66
    draw_sprite_ext(spr_dw_church_watertile_top, colindex, xx, topy, xscale, 2, 0, c_white, alph);
67
    draw_sprite_ext(spr_pxwhite, 0, xx, topy, 20 * xscale, (boty - topy) + offset, 0, watcol, alph);
68
    if (!ending)
69
        draw_sprite_ext(spr_dw_church_watertile_top, colindex, xx, boty - 8, xscale, -2, 0, c_white, alph);
70
    draw_set_blend_mode(bm_normal);
71
    var drawcollision = false;
72
    if (drawcollision)
73
    {
74
        if (abs(boty - topy) > 20)
75
            ossafe_fill_rectangle(xx + 8, topy + 8, (xx + 40) - 8, boty - 8, 1);
76
    }
77
}