Deltarune (Chapter 4) 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) > 0)
50
        {
51
            if (!border_fade)
52
            {
53
                border_fade = true;
54
                with (obj_border_controller)
55
                    hide_border(0.025, c_white);
56
            }
57
        }
58
        if ((fake_v / 80) >= 1.2)
59
        {
60
            pers = instance_create(0, 0, obj_persistentfadein);
61
            pers.image_blend = c_white;
62
            global.interact = 3;
63
            global.entrance = 24;
64
            snd_free(global.currentsong[0]);
65
            if (!unlock_mode)
66
                
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; scr_equip_lw_weapon_by_dw_id(global.charweapon[1]); global.lwstrength = get_lw_weapon_strength(global.lweapon); if (
scr_weaponcheck_inventory(26) > 0 || 
scr_weaponcheck_equipped_any(26) > 0)
{ if (!
scr_litemcheck(17) && global.lweapon != 17)
scr_litemget(17);
} 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; }
();
67
            else
68
                global.tempflag[58] = 1;
69
            room_goto(nextroom);
70
        }
71
    }
72
}
73
if (bottom == 1)
74
{
75
    if (draw_kris == 1)
76
    {
77
        fake_v -= 0.2;
78
        kris_y += fake_v;
79
        sus_y += fake_v;
80
        siner += (1 + (siner / 60));
81
        if (kris_only == 0)
82
            draw_sprite_ext(spr_susie_dw_fall_d, siner / 6, sus_x, sus_y, 2, 2, 0, c_white, 1);
83
        draw_sprite_ext(spr_kris_fall_d_dw, siner / 6, kris_x, kris_y, 2, 2, 0, c_white, 1);
84
    }
85
}