Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shadowmantleExample_Step_0

(view raw script w/o annotations or w/e)
1
timer++;
2
if (move != 0)
3
    mantle.x = round((320 + (sin(timer / 15) * 48)) / 2) * 2;
4
else
5
    mantle.x = 320;
6
fireballtimer++;
7
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
8
{
9
    if (keyboard_check_pressed(ord("R")))
10
        room_restart();
11
}
12
if (keyboard_check_pressed(vk_subtract))
13
{
14
    type--;
15
    fireballtimer = 0;
16
}
17
if (keyboard_check_pressed(vk_add))
18
{
19
    type++;
20
    fireballtimer = 0;
21
}
22
if (keyboard_check_pressed(ord("M")))
23
{
24
    move = 1 - move;
25
    timer = 0;
26
}
27
if (keyboard_check_pressed(ord("B")))
28
    layer_set_visible("TILES", 1 - layer_get_visible("TILES"));
29
if (type == 0)
30
{
31
    if (fireballtimer > 30)
32
    {
33
        if (fireballcount < 8)
34
        {
35
            snd_stop(snd_board_torch);
36
            snd_play(snd_board_torch);
37
            for (var i = 0; i < 6; i++)
38
            {
39
                var fireball = instance_create(mantle.x + centerx(mantle), mantle.y + centery(mantle), obj_shadowmantleFireball_example);
40
                fireball.speed = 7;
41
                fireball.direction = i * 60;
42
                fireball.gravity_direction = fireball.direction + 180;
43
                fireball.gravity = 0.7;
44
                fireball.depth = mantle.depth - 10;
45
                fireball.image_speed = 0.25;
46
                
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(fireball);
47
            }
48
            fireballcount++;
49
            fireballtimer -= 2;
50
        }
51
    }
52
    if (fireballtimer >= 90)
53
    {
54
        fireballcount = 0;
55
        fireballtimer = 0;
56
    }
57
}
58
if (type == 1)
59
{
60
    if (fireballtimer > 30)
61
    {
62
        if (fireballcount < 8)
63
        {
64
            snd_stop(snd_board_torch);
65
            snd_play(snd_board_torch);
66
            for (var i = 0; i < 6; i++)
67
            {
68
                var fireball = instance_create(mantle.x + centerx(mantle), mantle.y + centery(mantle), obj_shadowmantleFireball_example);
69
                fireball.speed = 6;
70
                fireball.direction = (i * 60) + (fireballcount * 4);
71
                fireball.gravity_direction = fireball.direction + 180;
72
                fireball.gravity = 0.7;
73
                fireball.depth = mantle.depth - 10;
74
                fireball.image_speed = 0.25;
75
                
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(fireball);
76
            }
77
            fireballcount++;
78
            fireballtimer -= 2;
79
        }
80
    }
81
    if (fireballtimer >= 90)
82
    {
83
        fireballcount = 0;
84
        fireballtimer = 0;
85
    }
86
}
87
if (type == 2)
88
{
89
    if (fireballtimer > 30)
90
    {
91
        if (fireballcount < 6)
92
        {
93
            snd_stop(snd_board_torch);
94
            snd_play(snd_board_torch);
95
            for (var i = 0; i < 6; i++)
96
            {
97
                var fireball = instance_create(mantle.x + centerx(mantle), mantle.y + centery(mantle), obj_shadowmantleFireball_example);
98
                fireball.speed = 2;
99
                fireball.direction = (i * 60) + (fireballcount * 8);
100
                fireball.gravity_direction = fireball.direction + 180;
101
                fireball.gravity = 0.2333333333333333;
102
                fireball.depth = mantle.depth - 10;
103
                fireball.image_speed = 0.25;
104
                
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(fireball);
105
            }
106
            fireballcount++;
107
            fireballtimer -= 2;
108
        }
109
    }
110
    if (fireballtimer >= 90)
111
    {
112
        fireballcount = 0;
113
        fireballtimer = 0;
114
    }
115
}
116
if (type == 3)
117
{
118
    if (fireballtimer > 30)
119
    {
120
        if (fireballcount < 3)
121
        {
122
            snd_stop(snd_board_torch);
123
            snd_play(snd_board_torch);
124
            for (var i = 0; i < 6; i++)
125
            {
126
                var fireball = instance_create(mantle.x + centerx(mantle), mantle.y + centery(mantle), obj_shadowmantleFireball_example);
127
                fireball.speed = 2;
128
                fireball.direction = (i * 60) + (totalcount * 8);
129
                fireball.gravity_direction = fireball.direction + 180;
130
                fireball.gravity = 0.2333333333333333;
131
                fireball.depth = mantle.depth - 10;
132
                fireball.image_speed = 0.25;
133
                
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(fireball);
134
            }
135
            fireballcount++;
136
            totalcount++;
137
            fireballtimer -= 2;
138
        }
139
    }
140
    if (fireballtimer >= 40)
141
    {
142
        fireballcount = 0;
143
        fireballtimer = 10;
144
    }
145
}
146
if (type == 4)
147
{
148
    if (fireballtimer > 30)
149
    {
150
        if (fireballcount < 90)
151
        {
152
            snd_stop(snd_board_torch);
153
            snd_play(snd_board_torch);
154
            for (var i = 0; i < 5; i++)
155
            {
156
                var fireball = instance_create(mantle.x + centerx(mantle), mantle.y + centery(mantle), obj_shadowmantleFireball_example);
157
                fireball.speed = 6;
158
                fireball.direction = (i * 72) + (fireballcount * 6);
159
                fireball.gravity_direction = fireball.direction + 180;
160
                fireball.gravity = 0.7;
161
                fireball.depth = mantle.depth - 10;
162
                fireball.image_speed = 0.25;
163
                
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(fireball);
164
            }
165
            fireballcount++;
166
            fireballtimer -= 3;
167
        }
168
    }
169
    if (fireballtimer >= 90)
170
    {
171
        fireballcount = 0;
172
        fireballtimer = 0;
173
    }
174
}
175
if (type == 5)
176
{
177
    if (fireballtimer == 30)
178
    {
179
        for (var i = 0; i < 5; i++)
180
        {
181
            var fireball = instance_create(mantle.x + centerx(mantle), mantle.y + centery(mantle), obj_shadowmantleFireball_example);
182
            fireball.image_speed = 0.25;
183
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(fireball);
184
            scr_lerp_var_instance(fireball, "x", fireball.x, 176 + (i * 64), 30, -1, "in");
185
            scr_lerp_var_instance(fireball, "y", fireball.y, 80, 30, 2, "out");
186
            
scr_script_delayed
scr_script_delayed

function
scr_script_delayed()
{ var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; }
(scr_lerp_var_instance, 45, fireball, "gravity", 0, 1, 15);
187
        }
188
    }
189
    if (fireballtimer == 60)
190
    {
191
        for (var i = 0; i < 5; i++)
192
        {
193
            var fireball = instance_create(mantle.x + centerx(mantle), mantle.y + centery(mantle), obj_shadowmantleFireball_example);
194
            fireball.image_speed = 0.25;
195
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(fireball);
196
            scr_lerp_var_instance(fireball, "x", fireball.x, 208 + (i * 64), 30, -1, "in");
197
            scr_lerp_var_instance(fireball, "y", fireball.y, 304, 30, 2, "out");
198
            
scr_script_delayed
scr_script_delayed

function
scr_script_delayed()
{ var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; }
(scr_lerp_var_instance, 45, fireball, "gravity", 0, -1, 15);
199
        }
200
    }
201
    if (fireballtimer == 90)
202
    {
203
        for (var i = 0; i < 3; i++)
204
        {
205
            var fireball = instance_create(mantle.x + centerx(mantle), mantle.y + centery(mantle), obj_shadowmantleFireball_example);
206
            fireball.image_speed = 0.25;
207
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(fireball);
208
            scr_lerp_var_instance(fireball, "x", fireball.x, 144, 30, -1, "in");
209
            scr_lerp_var_instance(fireball, "y", fireball.y, 112 + (i * 64), 30, 2, "out");
210
            
scr_script_delayed
scr_script_delayed

function
scr_script_delayed()
{ var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; }
(scr_lerp_var_instance, 45, fireball, "gravity", 0, -1, 15);
211
            fireball.gravity_direction = 180;
212
        }
213
    }
214
    if (fireballtimer == 120)
215
    {
216
        for (var i = 0; i < 3; i++)
217
        {
218
            var fireball = instance_create(mantle.x + centerx(mantle), mantle.y + centery(mantle), obj_shadowmantleFireball_example);
219
            fireball.image_speed = 0.25;
220
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(fireball);
221
            scr_lerp_var_instance(fireball, "x", fireball.x, 496, 30, -1, "in");
222
            scr_lerp_var_instance(fireball, "y", fireball.y, 144 + (i * 64), 30, 2, "out");
223
            
scr_script_delayed
scr_script_delayed

function
scr_script_delayed()
{ var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; }
(scr_lerp_var_instance, 45, fireball, "gravity", 0, -1, 15);
224
            fireball.gravity_direction = 0;
225
        }
226
    }
227
    if (fireballtimer >= 180)
228
        fireballtimer = 0;
229
}