Deltarune script viewer

← back to main script listing

gml_Object_obj_berdly_wire_release_example_2_Step_0

(view raw script w/o annotations or w/e)
1
if (initialize == 0)
2
{
3
    depth = 100000;
4
    initialize = 1;
5
    floatcon = 1;
6
    image_xscale = 2;
7
    image_yscale = 2;
8
    timer = 0;
9
}
10
if (floatcon == 1)
11
{
12
    siner++;
13
    y += (sin(siner / 12) / 2);
14
}
15
if (floatcon == 2)
16
{
17
    remx = x;
18
    remy = y;
19
    floatcon = 3;
20
}
21
if (floatcon == 3)
22
{
23
    x = remx + random_range(-shakeamount, shakeamount);
24
    y = remy + random_range(-shakeamount, shakeamount);
25
}
26
if (tornadocon == 1)
27
{
28
    if (timer == 0)
29
        floatcon = 2;
30
    timer++;
31
    if (timer == 5 || timer == 15 || timer == 25)
32
    {
33
        floatcon = 1;
34
        x = remx;
35
        y = remy;
36
        scr_oflash
scr_oflash

function scr_oflash() { _oflash = instance_create(x, y, obj_oflash); _oflash.image_xscale = image_xscale; _oflash.image_speed = 0; _oflash.image_index = image_index; _oflash.image_yscale = image_yscale; if (global.chapter == 2 && object_index == obj_mauswheel_enemy) _oflash.sprite_index = spr_mauswheel_idle; else _oflash.sprite_index = sprite_index; _oflash.depth = depth - 1; _oflash.target = id; return _oflash; }
();
37
        snd_play(snd_wing);
38
        for (i = 0; i < 12; i++)
39
        {
40
            tornado = 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 + 30, y + 60, spr_berdlyb_tornado);
41
            tornado.gravity = -0.5 - random(0.2);
42
            tornado.friction = 0.2;
43
            tornado.image_speed = 0.25;
44
            tornado.image_xscale = choose(1, -1);
45
            tornado.hspeed = random_range(-5, 5);
46
            tornado.depth = depth - 10;
47
            scr_doom
scr_doom

function scr_doom(arg0, arg1) { with (instance_create_depth(0, 0, 0, obj_doom)) {alarm[0] target = arg0; } }
(tornado, 60);
48
        }
49
    }
50
    if (timer == 60)
51
    {
52
        timer = 0;
53
        tornadocon = 0;
54
    }
55
}
56
if (con == 1)
57
{
58
    floatcon = 0;
59
    scr_shakeobj
scr_shakeobj

function scr_shakeobj() { shakeobj = instance_create(x, y, obj_shakeobj); shakeobj.target = id; with (shakeobj) event_user(0); }
();
60
    snd_play(snd_grab);
61
    sprite_index = spr_cutscene_25_berdly_grab_plug_old;
62
    con = 2;
63
}
64
if (con == 5 || con == 10)
65
{
66
    sprite_index = spr_cutscene_25_berdly_grab_electrocute_bluearm;
67
    image_speed = 0.5;
68
    if (floatcon < 2)
69
        floatcon = 2;
70
    if (image_index == 0)
71
    {
72
        tornado = instance_create(x + 30, y + 20, obj_afterimage);
73
        tornado.sprite_index = spr_cakesmoke;
74
        tornado.gravity = -0.3 - random(0.2);
75
        tornado.friction = 0.3;
76
        tornado.image_speed = 0.25;
77
        tornado.hspeed = random_range(-5, 5);
78
        tornado.depth = depth - 10;
79
        scr_doom
scr_doom

function scr_doom(arg0, arg1) { with (instance_create_depth(0, 0, 0, obj_doom)) {alarm[0] target = arg0; } }
(tornado, 60);
80
    }
81
}
82
if (con == 15 || con == 20)
83
{
84
    tornado = instance_create(x + 30, y + 20, obj_afterimage);
85
    tornado.sprite_index = spr_ch2_gimmick_hangplug_spark;
86
    tornado.gravity = 1;
87
    tornado.friction = 0.1;
88
    tornado.image_speed = 0.25;
89
    tornado.image_xscale = 0.5;
90
    tornado.image_yscale = 0.5;
91
    tornado.vspeed = -10 - random(4);
92
    tornado.hspeed = random_range(-4, 4);
93
    tornado.depth = depth - 10;
94
    scr_doom
scr_doom

function scr_doom(arg0, arg1) { with (instance_create_depth(0, 0, 0, obj_doom)) {alarm[0] target = arg0; } }
(tornado, 60);
95
}
96
if (scr_debug
scr_debug

function scr_debug() { if (global.debug == 1) return 1; }
())
97
{
98
    if (keyboard_check_pressed(vk_space))
99
    {
100
        if (con == 0)
101
            con = 1;
102
        else if (con == 2)
103
            con = 5;
104
        else
105
            con = 0;
106
    }
107
}