Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_bg_palette_swap_Create_0

(view raw script w/o annotations or w/e)
1
layer_name = ["BACKGROUND"];
2
if (room == room_town_north)
3
    layer_name = ["Compatibility_Tiles_Depth_5000", "Compatibility_Tiles_Depth_950000", "Compatibility_Tiles_Depth_990000", "Compatibility_Tiles_Depth_1000000"];
4
if (room == room_beach)
5
    layer_name = ["Compatibility_Instances_Depth_0", "FGTreeLayer_5000", "BGTreeLayer", "GroundLayer", "_oldShoreLine"];
6
if (room == room_town_krisyard)
7
    layer_name = ["Compatibility_Tiles_Depth_5000", "Compatibility_Tiles_Depth_950000", "Compatibility_Tiles_Depth_990000", "Compatibility_Tiles_Depth_1000000"];
8
if (room == room_town_krisyard_dark)
9
    layer_name = ["Compatibility_Tiles_Depth_5000", "Compatibility_Tiles_Depth_950000", "Compatibility_Tiles_Depth_990000", "Compatibility_Tiles_Depth_1000000"];
10
if (room == room_town_mid)
11
    layer_name = ["Compatibility_Tiles_Depth_5000", "Compatibility_Tiles_Depth_990000", "Compatibility_Tiles_Depth_995000", "Compatibility_Tiles_Depth_1000000"];
12
if (room == room_town_south)
13
    layer_name = ["Compatibility_Tiles_Depth_5000", "Compatibility_Tiles_Depth_980000", "Compatibility_Tiles_Depth_990000", "Compatibility_Tiles_Depth_995000", "Compatibility_Tiles_Depth_1000000"];
14
if (room == room_town_school)
15
    layer_name = ["Compatibility_Tiles_Depth_5000", "Compatibility_Tiles_Depth_950000", "Compatibility_Tiles_Depth_990000", "Compatibility_Tiles_Depth_995000", "Compatibility_Tiles_Depth_1000000"];
16
if (room == room_town_church)
17
    layer_name = ["Compatibility_Tiles_Depth_5000", "Compatibility_Tiles_Depth_990000", "Compatibility_Instances_Depth_990000", "Compatibility_Tiles_Depth_995000", "Compatibility_Tiles_Depth_1000000"];
18
if (room == room_graveyard)
19
    layer_name = ["Compatibility_Tiles_Depth_5000", "Compatibility_Tiles_Depth_950000", "Compatibility_Tiles_Depth_990000", "Compatibility_Tiles_Depth_995000", "Compatibility_Tiles_Depth_1000000"];
20
if (room == room_town_shelter)
21
    layer_name = ["Compatibility_Tiles_Depth_5000", "Compatibility_Instances_Depth_800000", "Compatibility_Tiles_Depth_990000", "Compatibility_Tiles_Depth_992000", "Compatibility_Tiles_Depth_995000", "Compatibility_Tiles_Depth_1000000"];
22
if (room == room_alphysalley)
23
    layer_name = ["Compatibility_Background_0_bg_alphysalley"];
24
plot_begin = 0;
25
plot_end = 300;
26
if (global.chapter == 4)
27
{
28
    plot_begin = 290;
29
    plot_end = 330;
30
    if (global.plot >= 290)
31
    {
32
        overlay = 
scr_marker
scr_marker

function
scr_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; } return thismarker; }
(-10, -10, spr_whitepx_10);
33
        overlay.image_xscale = (room_width / 10) + 2;
34
        overlay.image_yscale = (room_height / 10) + 2;
35
        overlay.image_blend = merge_color(c_black, c_navy, 0.5);
36
        overlay.image_alpha = 0.6;
37
        overlay.depth = 990;
38
        if (room == room_graveyard)
39
        {
40
            with (obj_backgrounder_sprite)
41
                image_blend = merge_color(c_black, c_navy, 0.5);
42
        }
43
        if (room == room_town_krisyard)
44
        {
45
            var dark_overlay = 
scr_marker
scr_marker

function
scr_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; } return thismarker; }
(-10, -10, spr_whitepx_10);
46
            dark_overlay.image_xscale = (room_width / 10) + 2;
47
            dark_overlay.image_yscale = (room_height / 10) + 2;
48
            dark_overlay.image_blend = c_black;
49
            dark_overlay.image_alpha = 1;
50
            dark_overlay.depth = 980;
51
            
scr_doom
scr_doom

function
scr_doom(arg0 = id, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; persistent = arg0.persistent; } }
(dark_overlay, 2);
52
            with (overlay)
53
                instance_destroy();
54
            var yard_overlay = instance_create(0, 0, obj_krisyard_night_overlay);
55
        }
56
        if (room == room_town_krisyard_dark)
57
        {
58
            var window_pos = [];
59
            var y_offset = 0;
60
            window_pos[0][0] = 125;
61
            window_pos[0][1] = 236 + y_offset;
62
            window_pos[1][0] = 199;
63
            window_pos[1][1] = 236 + y_offset;
64
            overlay.depth = 992;
65
            for (var i = 0; i < array_length(window_pos); i++)
66
            {
67
                var _x = window_pos[i][0];
68
                var _y = window_pos[i][1];
69
                var _marker = 
scr_marker
scr_marker

function
scr_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; } return thismarker; }
(_x, _y, bg_building_krishouse_window_night);
70
                _marker.depth = overlay.depth - 1;
71
            }
72
        }
73
    }
74
}
75
if (global.plot >= plot_begin && global.plot < plot_end)
76
{
77
    pal_swap_layer_init();
78
    for (var i = 0; i < array_length_1d(layer_name); i++)
79
    {
80
        pal_swap_enable_layer(layer_name[i]);
81
        pal_swap_set_layer(palette_sprite, palette_index, layer_name[i], false);
82
    }
83
    pal_swap_reset();
84
}