Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gerson_windowbg_Draw_0

(view raw script w/o annotations or w/e)
1
timer++;
2
ossafe_fill_rectangle_color(camerax(), cameray(), camerax() + 640, cameray() + 164, #609F92, #609F92, #167B66, #167B66, 0);
3
if (keyboard_check(ord("P")) && (timer % 4) == 0 && 
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
4
{
5
    lan = 
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; }
(camerax() + 106, camerax() + 106, spr_lancer_dt);
6
    lan.image_alpha = -69;
7
    lan.speed = random_range(10, 20);
8
    lan.gravity = 0.75;
9
    lan.direction = random_range(35, 55);
10
    
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(lan);
11
    lan.image_angle = random(360);
12
    
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; } }
(lan, 60);
13
}
14
event_user(11);
15
latmode = 5;
16
var lockround = false;
17
drawbell = false;
18
if (latmode == 0)
19
{
20
    lockround = true;
21
    latdir = 0;
22
    latspeed = 0;
23
    latidealhspeed = lengthdir_x(latspeed, latdir);
24
    latidealvspeed = lengthdir_y(latspeed, latdir);
25
}
26
if (latmode == 1)
27
{
28
    lockround = true;
29
    latdir = 0;
30
    latspeed = 2;
31
}
32
if (latmode == 2)
33
{
34
    lockround = true;
35
    latdir = 45;
36
    latspeed = 2;
37
}
38
if (latmode == 3)
39
{
40
    latdir = sin(timer / 27) * 20;
41
    lathspeed = cos(timer / 30) * 4;
42
}
43
if (latmode == 4)
44
{
45
    lockround = true;
46
    latdir = 90;
47
    latspeed = 2;
48
}
49
if (latmode == 5)
50
{
51
    drawbell = true;
52
    lockround = true;
53
    latdir = 90;
54
    latspeed = 2;
55
}
56
if (drawbell)
57
{
58
    if ((timer % 50) == 0)
59
    {
60
        for (var i = 0; i < 3; i++)
61
        {
62
            var randno = 20;
63
            if (i == 1)
64
                randno = 40;
65
            var bell = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(camerax() + 196 + (126 * i) +
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(irandom_range(-randno, randno)), cameray() + 172 +
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(irandom_range(-20, 20)), spr_bell_small);
66
            bell.image_alpha = -69;
67
            
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; } }
(bell, 240);
68
            bell.vspeed = latvspeed;
69
        }
70
    }
71
    with (obj_marker)
72
    {
73
        if (image_alpha == -69)
74
            image_angle = 
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(sin((other.timer + x) / 6) * 8);
75
    }
76
}
77
latidealhspeed = lengthdir_x(latspeed, latdir);
78
latidealvspeed = lengthdir_y(latspeed, latdir);
79
lathspeed = lerp(lathspeed, latidealhspeed, 0.2);
80
latvspeed = lerp(latvspeed, latidealvspeed, 0.2);
81
if (lockround == true)
82
{
83
    latposx = round(lathspeed + latposx);
84
    latposy = round(latvspeed + latposy);
85
}
86
else
87
{
88
    latposx = lathspeed + latposx;
89
    latposy = latvspeed + latposy;
90
}
91
draw_sprite_tiled_ext(spr_gerson_lattice, 0, camerax() + latposx, cameray() + latposy, 2, 2, c_black, 1);
92
draw_sprite_ext(spr_gerson_windows_bg, 0, camerax(), cameray(), 2, 2, 0, c_black, 1);
93
ossafe_fill_rectangle_color(camerax() + 0, cameray() + 164, camerax() + 640, cameray() + 480, c_black, c_black, c_black, c_black, 0);
94
draw_set_color(#241E17);
95
ossafe_fill_rectangle(camerax() + 0, cameray() + 172, camerax() + 640, cameray() + 480, 0);
96
draw_set_color(c_white);
97
windows = sprite_create_from_surface(application_surface, 146, 6, 346, 124, 1, 0, 0, 0);
98
var x2 = camerax() + 640 + 40;
99
var y2 = cameray() + 480 + 200;
100
var x1 = (camerax() + 0) - 40;
101
var y1 = cameray() + 480 + 200;
102
var x4 = camerax() + 132;
103
var y4 = (cameray() + 170) - 2;
104
var x3 = (camerax() + 640) - 132;
105
var y3 = (cameray() + 170) - 2;
106
draw_sprite_pos_fixed(windows, 0, x1, y1, x2, y2, x3, y3, x4, y4, 1);
107
if (i_ex(obj_herosusie))
108
{
109
    with (obj_herosusie)
110
    {
111
        x1 = x + 18;
112
        y1 = y + 84;
113
        x2 = x1 + 32;
114
        y2 = y1;
115
        x3 = x2 - 60;
116
        y3 = y1 + 200;
117
        x4 = x1 - 60;
118
        y4 = y1 + 200;
119
        draw_set_color(#241E17);
120
        draw_rectangle_pos(x1, y1, x2, y2, x3, y3, x4, y4);
121
    }
122
}
123
if (i_ex(obj_hammer_of_justice_enemy))
124
{
125
    with (obj_hammer_of_justice_enemy)
126
    {
127
        if (image_alpha > 0 && visible == true)
128
        {
129
            x1 = x + 38;
130
            y1 = y + 72;
131
            x2 = x1 + 60;
132
            y2 = y1;
133
            x3 = x2 + 60;
134
            y3 = y1 + 200;
135
            x4 = x1 + 60;
136
            y4 = y1 + 200;
137
            draw_set_color(#241E17);
138
            draw_rectangle_pos(x1, y1, x2, y2, x3, y3, x4, y4);
139
        }
140
    }
141
}
142
if (sprite_exists(windows))
143
    sprite_delete(windows);