Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_queenscreen_dance_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
    init = 1;
3
if (activecon == 0)
4
{
5
    if (instance_exists(obj_mainchara))
6
    {
7
        aligned = 0;
8
        if (extflag == 3)
9
            aligned = 1;
10
        if (extflag == 7)
11
        {
12
            if (align_x == true && x >= camerax() && x <= (camerax() + camerawidth()))
13
            {
14
                if (abs((obj_mainchara.x + 20) - x) <= align_amount)
15
                    aligned = 1;
16
            }
17
            if (align_y == true && y >= cameray() && y <= (cameray() + cameraheight()))
18
            {
19
                if (abs((obj_mainchara.y + 20) - y) <= align_amount)
20
                    aligned = 1;
21
            }
22
            if (align_distance == true)
23
            {
24
                if (distance_to_object(obj_mainchara) < align_amount)
25
                    aligned = 1;
26
            }
27
        }
28
        if (aligned == 1)
29
        {
30
            visible = 1;
31
            con = 0;
32
            activecon = 1;
33
        }
34
    }
35
}
36
if (activecon == 1)
37
{
38
    if (con == 0)
39
    {
40
        timer += (timer + 1);
41
        image_xscale = lerp(4, 1, timer / 30);
42
        image_yscale = lerp(0, 4, timer / 30);
43
        if (timer >= 30)
44
        {
45
            con = 1;
46
            timer = 0;
47
        }
48
    }
49
    if (con == 1)
50
    {
51
        timer += (timer + 1);
52
        image_xscale = lerp(1, 2, timer / 15);
53
        image_yscale = lerp(4, 2, timer / 15);
54
        if (timer >= 15)
55
        {
56
            timer = 0;
57
            con = 2;
58
            image_xscale = 2;
59
            image_yscale = 2;
60
        }
61
    }
62
    if (con == 2)
63
    {
64
        if (image_index == 9)
65
        {
66
            tasquecon = 1;
67
            con = 99;
68
        }
69
    }
70
    if (dismiss == 1)
71
    {
72
        timer = 0;
73
        con = 3;
74
        dismiss = 0;
75
    }
76
    if (con == 3)
77
    {
78
        timer += (timer + 1);
79
        image_xscale = lerp(2, 4, timer / 30);
80
        image_yscale = lerp(2, 0, timer / 30);
81
        if (timer >= 30)
82
            instance_destroy();
83
    }
84
}
85
if (dance_active)
86
{
87
    var countmod = 0.4877;
88
    var audio_pos = audio_sound_get_track_position(global.currentsong[1]);
89
    if (audio_pos >= 16.5)
90
        countmod = 1.9508;
91
    else if (audio_pos >= 130)
92
        countmod = 0.4877;
93
    count += countmod;
94
    if (count >= 30)
95
    {
96
        count -= 30;
97
        dance_con = 1;
98
    }
99
    if (dance_con == 1)
100
    {
101
        dance_con = 0;
102
        image_index++;
103
        image_alpha = 1;
104
        if (global.flag[8 simplify_vfx] == 0)
105
            scr_lerpvar_instance
scr_lerpvar_instance

function scr_lerpvar_instance() { __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; }
(id, "image_alpha", 2, 0.5, 14);
106
    }
107
}