Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_dw_leave_Draw_0

(view raw script w/o annotations or w/e)
1
pillarsiner++;
2
dist = 0;
3
if (instance_exists(obj_mainchara))
4
    dist = point_distance(x, y, obj_mainchara.x + 20, obj_mainchara.y + 30) - 30;
5
if (dist < 0)
6
    dist = 0;
7
alphadist = dist / 1500;
8
if (alphadist >= 0.3)
9
    alphadist = 0.3;
10
for (i = 0; i < 3; i++)
11
{
12
    sinoff = sin((i / 4) + (pillarsiner / 10));
13
    if (bottom == 1)
14
        draw_sprite_ext(sprite_index, 0, x, y, (image_xscale - (0.3 * i)) + (sin(sinoff) * 0.1), image_yscale, 0, c_white, ((0.7 - alphadist) + (sin(sinoff) * 0.01) + pillaralpha) / 2);
15
    if (top == 1)
16
        draw_sprite_ext(sprite_index, 1, x, y, (pillarscale - (0.3 * i)) + (sin(sinoff) * 0.1), image_yscale, 0, c_white, ((0.4 - alphadist) + (sin(sinoff) * 0.01) + pillaralpha) / 3);
17
}
18
draw_set_blend_mode(bm_normal);
19
if (top == 1)
20
{
21
    particletimer++;
22
    if (particletimer >= 2)
23
    {
24
        instance_create(random_range(x - (sprite_width / 2), x + (sprite_width / 2)), y - random(sprite_height), obj_dw_transition_particle);
25
        particletimer = 0;
26
    }
27
    if (con == 1)
28
    {
29
        snd_play(snd_dtrans_lw);
30
        with (obj_dw_leave)
31
        {
32
            if (bottom == 1)
33
            {
34
                draw_kris = 1;
35
                fake_v = 1;
36
            }
37
        }
38
        con = 2;
39
        alphab = 0;
40
        fake_v = -10;
41
    }
42
    if (con == 2)
43
    {
44
        alphab += 0.001;
45
        fake_v += (0.5 + (alphab * 20));
46
        draw_set_blend_mode(bm_add);
47
        draw_sprite_ext(sprite_index, 1, x, y, 99, 99, 0, c_white, fake_v / 80);
48
        draw_set_blend_mode(bm_normal);
49
        if ((fake_v / 80) >= 1.2)
50
        {
51
            pers = instance_create(0, 0, obj_persistentfadein);
52
            pers.image_blend = c_white;
53
            global.interact = 3;
54
            global.entrance = 24;
55
            snd_free(global.currentsong[0]);
56
            scr_become_light
scr_become_light

function scr_become_light() { if (scr_litemcheck(5) == 0) scr_litemget(5); if (scr_keyitemcheck(2)) { if (scr_litemcheck(8) == 0) scr_litemget(8); } else { scr_litemremove(8); } if (scr_keyitemcheck(13)) { if (scr_litemcheck(11) == 0) scr_litemget(11); } else { scr_litemremove(11); } global.lhp = ceil((global.hp[1] / global.maxhp[1]) * global.lmaxhp); if (global.lhp < 1) global.lhp = 1; if (global.lhp > global.lmaxhp) global.lhp = global.lmaxhp; global.lwstrength = 1; if (global.charweapon[1] == 1) global.lweapon = 2; if (global.charweapon[1] == 5) global.lweapon = 6; if (global.charweapon[1] == 8) global.lweapon = 7; if (global.charweapon[1] == 14) global.lweapon = 12; if (global.charweapon[1] == 16) global.lweapon = 13; var armorconverted = 0; if (scr_armorcheck_equipped(1, 14) > 0) { armorconverted = 1; global.larmor = 14; } if (armorconverted == 1) global.ladef = 1; else global.ladef = 0; global.darkzone = 0; }
();
57
            if (global.plot == 16 && global.chapter == 2)
58
                scr_losechar
scr_losechar

function scr_losechar() { global.char[2] = 0; global.char[1] = 0; with (obj_darkcontroller) { chartotal = 0; havechar[0] = 0; havechar[1] = 0; havechar[2] = 0; havechar[3] = 0; for (i = 0; i < 3; i += 1) { global.faceaction[i] = 0; if (global.char[i] != 0) chartotal += 1; if (global.char[i] == 1) { havechar[0] = 1; charpos[0] = i; } if (global.char[i] == 2) { havechar[1] = 1; charpos[1] = i; } if (global.char[i] == 3) { havechar[2] = 1; charpos[2] = i; } if (global.char[i] == 4) { havechar[3] = 1; charpos[3] = i; } } } global.submenu = 0; global.charselect = -1; for (i = 0; i < 36; i += 1) global.submenucoord[i] = 0; }
();
59
            room_goto(nextroom);
60
        }
61
    }
62
}
63
if (bottom == 1)
64
{
65
    if (draw_kris == 1)
66
    {
67
        fake_v -= 0.2;
68
        kris_y += fake_v;
69
        sus_y += fake_v;
70
        siner += (1 + (siner / 60));
71
        if (kris_only == 0)
72
            draw_sprite_ext(spr_susie_dw_fall_d, siner / 6, sus_x, sus_y, 2, 2, 0, c_white, 1);
73
        draw_sprite_ext(spr_kris_fall_d_dw, siner / 6, kris_x, kris_y, 2, 2, 0, c_white, 1);
74
    }
75
}