Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gigaprophecy_Create_0

(view raw script w/o annotations or w/e)
1
surf_width = 320;
2
surf_height = 240;
3
depth = 2000010;
4
prophspace_width = 1024;
5
prophspace_height = 1024;
6
roomglow = instance_create(0, 0, obj_roomglow);
7
roomglow.active = true;
8
roomglow.actind = 1;
9
roomglow.tiles_only = true;
10
colour_bluenonsense = 16764994;
11
sprite_blueswirly = 3124;
12
sprite_blueswirly_blur = 1522;
13
surf_frontprophecies = -1;
14
surf_parallax_close = -1;
15
surf_parallax_stars = -1;
16
if (layer_exists("BGCOLOR"))
17
    layer_background_blend(layer_background_get_id("BGCOLOR"), c_black);
18
time_seconds = 0;
19
which_prophecy = ds_list_create();
20
var i = 0;
21
repeat (sprite_get_number(spr_dw_church_prophecy_set))
22
{
23
    ds_list_add(which_prophecy, i);
24
    i++;
25
}
26
ds_list_shuffle(which_prophecy);
27
28
var _get_prophecy = function()
29
{
30
    static current = 0;
31
    
32
    current++;
33
    if (current >= ds_list_size(which_prophecy))
34
    {
35
        current = 0;
36
        ds_list_shuffle(which_prophecy);
37
    }
38
    return ds_list_find_value(which_prophecy, current);
39
};
40
41
var _gap = 256;
42
for (var j = 0; j <= (1 + (prophspace_height div _gap)); j++)
43
{
44
    for (i = 0; i <= (1 + (prophspace_width div _gap)); i++)
45
    {
46
        if ((!(j % 2) && i % 2) || (j % 2 && !(i % 2)))
47
        {
48
            instance_create_layer(50 + (i * _gap) + irandom_range(-42, 42), 50 + (j * _gap) + irandom_range(-42, 42), "PARALLAX_1", obj_prophecy_mask, 
49
            {
50
                image_xscale: 1,
51
                image_yscale: 1,
52
                image_index: _get_prophecy(),
53
                image_blend: colour_bluenonsense,
54
                lay: 0
55
            });
56
        }
57
    }
58
}
59
_gap = 170;
60
for (var j = 0; j <= (1 + (prophspace_height div _gap)); j++)
61
{
62
    for (i = 0; i <= (1 + (prophspace_width div _gap)); i++)
63
    {
64
        instance_create_layer(50 + (i * _gap) + irandom_range(-52, 52), 50 + (j * _gap) + irandom_range(-52, 52), "PARALLAX_2", obj_prophecy_mask, 
65
        {
66
            image_xscale: 0.5,
67
            image_yscale: 0.5,
68
            image_alpha: 0.9,
69
            image_index: _get_prophecy(),
70
            image_blend: colour_bluenonsense,
71
            lay: 1
72
        });
73
    }
74
}
75
_gap = 96;
76
for (var j = 0; j <= (1 + (prophspace_height div _gap)); j++)
77
{
78
    for (i = 0; i <= (1 + (prophspace_width div _gap)); i++)
79
    {
80
        instance_create_layer(50 + (i * _gap) + irandom_range(-42, 42), 50 + (j * _gap) + irandom_range(-42, 42), "PARALLAX_3", obj_prophecy_mask, 
81
        {
82
            image_xscale: 0.25,
83
            image_yscale: 0.25,
84
            image_alpha: 0.85,
85
            image_index: _get_prophecy(),
86
            image_blend: colour_bluenonsense,
87
            lay: 2
88
        });
89
    }
90
}
91
92
MakeStarfield = function()
93
{
94
    surf_parallax_stars = surface_create(surf_width, surf_height);
95
    surface_set_target(surf_parallax_stars);
96
    draw_clear_alpha(c_black, 0);
97
    gpu_set_colorwriteenable(true, true, true, false);
98
    var _cx = camerax();
99
    var _cy = cameray();
100
    draw_sprite_tiled_ext(sprite_blueswirly, 0, 0, 0, 1, 1, c_white, 1);
101
    gpu_set_colorwriteenable(true, true, true, true);
102
    gpu_set_colorwriteenable(false, false, false, true);
103
    for (var j = 0; j <= (1 + (surf_height div 30)); j++)
104
    {
105
        for (var i = 0; i <= (1 + (surf_width div 30)); i++)
106
            draw_sprite(spr_whitepx, 0, (i * 30) + irandom_range(-12, 12), (j * 30) + irandom_range(-12, 12));
107
    }
108
    surface_reset_target();
109
};
110
111
ds_list_destroy(which_prophecy);