Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_queen_search_window_Draw_0

(view raw script w/o annotations or w/e)
1
if (state == 0)
2
{
3
    image_index = 11;
4
    timer += (timer + 1);
5
    image_xscale = lerp(4, 1, timer / 30);
6
    image_yscale = lerp(0, 4, timer / 30);
7
    if (timer >= 30)
8
    {
9
        state = 1;
10
        timer = 0;
11
    }
12
}
13
if (state == 1)
14
{
15
    timer += (timer + 1);
16
    image_xscale = lerp(1, 2, timer / 15);
17
    image_yscale = lerp(4, 2, timer / 15);
18
    if (timer >= 15)
19
    {
20
        timer = 0;
21
        state = quick ? 3 : 2;
22
        image_xscale = 2;
23
        image_yscale = 2;
24
    }
25
}
26
draw_self();
27
if (state == 2)
28
{
29
    var _count = clamp(floor(timer / 2), 0, string_length(targetstring));
30
    draw_set_color(#31D989);
31
    scr_84_set_draw_font
scr_84_set_draw_font

function scr_84_set_draw_font(arg0) { global.chemg_font = arg0; draw_set_font(scr_84_get_font(arg0)); }
("main");
32
    var _finalstring = string_copy(targetstring, 0, _count);
33
    if (_count == 0 || _count == string_length(targetstring))
34
    {
35
        if (donttypeanything == 0)
36
        {
37
            typetimer++;
38
            if (!firsttime)
39
                typetimer++;
40
            if ((typetimer % 40) < 20)
41
                _finalstring += "|";
42
            else
43
                _finalstring += " ";
44
        }
45
    }
46
    else
47
    {
48
        typetimer = 0;
49
    }
50
    var _halign = draw_get_halign();
51
    var _valign = draw_get_valign();
52
    draw_set_halign(fa_center);
53
    draw_set_valign(fa_middle);
54
    draw_text(x, y, _finalstring);
55
    draw_set_halign(_halign);
56
    draw_set_valign(_valign);
57
    timer++;
58
    if (!firsttime && search > -1 && search < 3)
59
        timer++;
60
    if (timer >= (45 + spawndelay))
61
    {
62
        state = 3;
63
        timer = 0;
64
    }
65
}
66
if (state == 3)
67
{
68
    if (search == 1)
69
    {
70
        d = scr_bullet_create
scr_bullet_create

function scr_bullet_create(arg0, arg1, arg2) { var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(x - (20 * sign(obj_growtangle.x - x)), y + 12, obj_queen_search_gun);
71
        d.parentwindow = self;
72
        state = 4;
73
    }
74
    else if (search == 2)
75
    {
76
        var maxchainlength = 135 + random(65);
77
        for (i = 0; i < 2; i++)
78
        {
79
            d = scr_bullet_create
scr_bullet_create

function scr_bullet_create(arg0, arg1, arg2) { var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(x, y, obj_queen_search_flail);
80
            d.maxchainlength = maxchainlength;
81
            d.parentwindow = self;
82
            d.direction += i * 180;
83
        }
84
        state = 4;
85
    }
86
    else if (search == 3)
87
    {
88
        d = scr_bullet_create
scr_bullet_create

function scr_bullet_create(arg0, arg1, arg2) { var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(x, y, obj_queen_search_junk);
89
        d.parentwindow = self;
90
        state = 4;
91
    }
92
    else
93
    {
94
        state = 5;
95
    }
96
}
97
if (state == 5)
98
{
99
    timer += (timer + 1);
100
    image_xscale = lerp(2, 4, timer / 30);
101
    image_yscale = lerp(2, 0, timer / 30);
102
    if (timer >= 30)
103
        instance_destroy();
104
}