Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dw_church_arena_bg_Create_0

(view raw script w/o annotations or w/e)
1
makecolorset = function(arg0, arg1, arg2, arg3)
2
{
3
    return 
4
    {
5
        r: arg0,
6
        g: arg1,
7
        b: arg2,
8
        l: arg3
9
    };
10
};
11
12
makegradientset = function(arg0, arg1)
13
{
14
    return 
15
    {
16
        t: arg0,
17
        b: arg1
18
    };
19
};
20
21
con = 0;
22
bgsurface = surface_create(640, 480);
23
windowsurface = surface_create(302, 122);
24
25
draw_to_window = function(arg0)
26
{
27
    with (arg0)
28
        draw_self();
29
};
30
31
delay = 0;
32
hammeralpha = 0;
33
cityalpha = 0;
34
to_draw = ds_list_create();
35
window_opacity = 1;
36
37
create_object_to_draw = function(arg0, arg1, arg2)
38
{
39
    var obj = instance_create(arg0, arg1, obj_marker_fancy);
40
    with (obj)
41
    {
42
        
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
43
        sprite_index = arg2;
44
        
45
        draw_func = function()
46
        {
47
        };
48
    }
49
    ds_list_add(to_draw, obj);
50
    return obj;
51
};
52
53
timer = 0;
54
cityobj = create_object_to_draw(0, 0, 3079);
55
cityobj.image_alpha = 0;
56
cityobj.image_blend = c_black;
57
hammerobj = create_object_to_draw(100, 10, 530);
58
hammerobj.image_alpha = 0;
59
hammerobj.timer = 0;
60
with (hammerobj)
61
{
62
    step_func = function()
63
    {
64
        timer++;
65
        if (image_alpha > 0 && (timer % 12) == 0)
66
        {
67
            if (!i_ex(obj_dw_church_arena))
68
            {
69
                instance_destroy();
70
                exit;
71
            }
72
            else
73
            {
74
                image_blend = c_white;
75
            }
76
        }
77
    };
78
}
79
for (var i = 0; i < 10; i++)
80
{
81
    var petal = create_object_to_draw((i * 30) + random_range(0, 15), random_range(20, 120), 3578);
82
    petal.image_alpha = 0;
83
    petal.image_speed = random_range(0.125, 0.25);
84
    petal.image_blend = #323299;
85
    petal.direction = random_range(-15, 15);
86
    petal.timer = 0;
87
    with (petal)
88
    {
89
        step_func = function()
90
        {
91
            timer++;
92
            if (i_ex(obj_dw_church_arena_bg))
93
                image_alpha = obj_dw_church_arena_bg.staralpha * 0.8;
94
        };
95
    }
96
}
97
bellalpha = 0;
98
staralpha = 0;
99
petalalpha = 0;
100
depth = 500;
101
colors_default = makecolorset(3165210, 5163080, 201738, 2584886);
102
colors_cardcastle = makecolorset(4139303, 8667457, 2692114, 7819857);
103
colors_mansion = makecolorset(5959081, 13873450, 3483914, 11184674);
104
colors_teevie = makecolorset(4591889, 6697522, 3483683, 8931914);
105
colors_garden = makecolorset(4261519, 2992324, 2102325, 6663647);
106
colors_dark = makecolorset(3278918, 5910896, 2952729, 4850001);
107
colors_greenish = makecolorset(3165210, 5163080, 201738, 2584886);
108
bgcolors_default = makegradientset(3297554, 2381604);
109
bgcolors_cardcastle = makegradientset(7623249, 4790561);
110
bgcolors_cybercity = makegradientset(6478178, 14065681);
111
bgcolors_teevie = makegradientset(4591889, 7811634);
112
bgcolors_garden = makegradientset(52667135, 7410175);
113
bgcolors_dark = makegradientset(6422882, 2752785);
114
bgcolors_greenish = makegradientset(3297554, 2381604);
115
colors_index = 1;
116
colors_current = colors_default;
117
colors_last = colors_current;
118
colors_lerp = 0;
119
gradient_current = bgcolors_default;
120
gradient_last = gradient_current;
121
gradient_lerp = 0;
122
image_alpha = 0;
123
124
change_color_set = function(arg0)
125
{
126
    colors_index++;
127
    colors_last = colors_current;
128
    colors_current = arg0;
129
    colors_lerp = 0;
130
};
131
132
change_gradient_set = function(arg0)
133
{
134
    gradient_last = gradient_current;
135
    gradient_current = arg0;
136
    gradient_lerp = 0;
137
};
138
139
colcon = 0;
140
introflashalpha = 4;
141
uniform_red = shader_get_uniform(shd_rgb_replace, "in_red");
142
uniform_green = shader_get_uniform(shd_rgb_replace, "in_green");
143
uniform_blue = shader_get_uniform(shd_rgb_replace, "in_blue");
144
145
disappear = function()
146
{
147
    depth = 1000000;
148
    
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; }
("image_blend", 16777215, 0, 15);
149
    
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; }
("image_alpha", 1, 0, 15);
150
    
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; } }
(self, 15);
151
};
152
153
myShader = 24;
154
textureSprite1 = 2081;
155
sampler1 = shader_get_sampler_index(myShader, "sampler_1");
156
textureSprite2 = 4679;
157
sampler2 = shader_get_sampler_index(myShader, "sampler_2");
158
uniformTime = shader_get_uniform(myShader, "time");
159
uniformOpacity = shader_get_uniform(myShader, "opacity");
160
uniformCol = shader_get_uniform(myShader, "col");
161
colour = [0.2588, 0.8157, 1];