Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_ch3_dw_man_scenetransition_persistent_Step_2

(view raw script w/o annotations or w/e)
1
var kris = 1185;
2
var proc = 0;
3
if (i_ex(kris))
4
{
5
    var ver = 1;
6
    if (ver == 0)
7
    {
8
        if (kris.image_index == 1 && stepped == 0)
9
        {
10
            proc = 1;
11
            stepped = 1;
12
        }
13
        if (kris.image_index == 0 || kris.image_index == 2)
14
            stepped = 0;
15
        if (kris.image_index == 3 && stepped == 0)
16
        {
17
            proc = 1;
18
            stepped = 1;
19
        }
20
    }
21
    if (ver == 1)
22
    {
23
        if (point_distance(kris.x, kris.y, kris.xprevious, kris.yprevious) > 1)
24
            proc = 1;
25
    }
26
}
27
if (con == 0)
28
{
29
    timer++;
30
    if (timer == 1)
31
    {
32
        mus_fade(global.currentsong[1], 60);
33
        with (obj_border_controller)
34
            show_border(0.017);
35
    }
36
    if (timer == 1)
37
    {
38
        whitenoise = snd_loop(snd_whitenoise);
39
        snd_volume(whitenoise, 0, 0);
40
        snd_volume(whitenoise, 0.2, 60);
41
        var steps = 12;
42
        for (var i = 1; i < (steps + 1); i++)
43
        {
44
            scr_delay_var("image_blend", merge_color(#D8EEC2, c_white, (1 / steps) * i), round(60 / steps) * i);
45
            scr_delay_var("fadeamt", (1 / steps) * i, round(60 / steps) * i);
46
        }
47
    }
48
    if (timer == 92)
49
    {
50
        room_goto(room_dw_green_room);
51
        setinplace = 1;
52
    }
53
    if (timer > 136 && room == room_dw_green_room)
54
    {
55
        timer = 0;
56
        con = 2;
57
        with (obj_border_controller)
58
            stop_custom_effect();
59
    }
60
}
61
if (con == 2)
62
{
63
    timer++;
64
    if (timer == 15)
65
    {
66
        
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("fadeamt", 1, 0, 60);
67
        snd_volume(whitenoise, 0, 60);
68
    }
69
    if (timer == 30)
70
    {
71
        global.interact = 0;
72
        con = 3;
73
    }
74
}
75
if (con == 3)
76
{
77
    if (fadeamt == 0)
78
        instance_destroy();
79
}
80
if (setinplace == 1)
81
{
82
    var xloc = 700;
83
    var yloc = 170;
84
    if (room == room_dw_green_room)
85
    {
86
        with (obj_mainchara)
87
            setxy(xloc, yloc);
88
        with (obj_caterpillarchara)
89
        {
90
            if (name == "susie")
91
                setxy(xloc - 54, yloc - valign);
92
            if (name == "ralsei")
93
                setxy(xloc - 98, (yloc - valign) + 4);
94
            
scr_caterpillar_interpolate
scr_caterpillar_interpolate

function
scr_caterpillar_interpolate()
{ _newfacing =
scr_facing_letter_to_number(
scr_get_cardinal_direction(point_direction(x, y, obj_mainchara.x, obj_mainchara.y)));
remx[0] = obj_mainchara.x; remy[0] = obj_mainchara.y; facing[0] = _newfacing; for (_iaia = target; _iaia > 0; _iaia -= 1) { remx[_iaia] = lerp(obj_mainchara.x, x, _iaia / target); if (global.darkzone == 1) remy[_iaia] = lerp(obj_mainchara.y, y + 16, _iaia / target); else remy[_iaia] = lerp(obj_mainchara.y, y + 6, _iaia / target); facing[_iaia] = _newfacing; } }
();
95
        }
96
        setinplace = 0;
97
    }
98
}