Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gerson_bell_hit_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    timer++;
4
    if (timer == 14)
5
        snd_play(motor_upper_quick_mid);
6
    if (timer == 16)
7
    {
8
        con = 1;
9
        timer = 0;
10
        snd_play(snd_queen_punched_lower);
11
        image_index = 1;
12
        
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
();
13
        bell = instance_nearest(x, y, obj_gerson_bell);
14
        var angle_offset = random(40) - 20;
15
        if (image_xscale > 0)
16
        {
17
            with (bell)
18
            {
19
                shakeobj = instance_create(x, y, obj_shakedirectional);
20
                shakeobj.target = id;
21
                shakeobj.dir = 180;
22
            }
23
            if (choose(0, 1) == 0)
24
            {
25
                snd_play_pitch(snd_bell, 0.8);
26
                for (i = 0; i < 7; i++)
27
                {
28
                    radialshot = instance_create(bell.x + 42, bell.y + 60, obj_gerson_bell_bullet_radial);
29
                    with (radialshot)
30
                        
scr_bullet_init
scr_bullet_init

function
scr_bullet_init()
{ grazed = 0; grazetimer = 0; destroyonhit = 1; target = 0; inv = 60; damage = 10; element = 0; grazepoints = 1; timepoints = 1; active = 1; updateimageangle = 0; }
();
31
                    radialshot.active = 1;
32
                    radialshot.place = (220 - (24 * i)) + angle_offset;
33
                    radialshot.depth = depth - 1;
34
                    radialshot.target = 3;
35
                    radialshot.damage = 1;
36
                    radialshot.grazed = 0;
37
                }
38
            }
39
            else
40
            {
41
                snd_play_pitch(snd_bell, 1.1);
42
                for (i = 0; i < 10; i++)
43
                {
44
                    radialshot = instance_create(bell.x + 22, bell.y + 60, obj_gerson_bell_bullet_radial);
45
                    with (radialshot)
46
                        
scr_bullet_init
scr_bullet_init

function
scr_bullet_init()
{ grazed = 0; grazetimer = 0; destroyonhit = 1; target = 0; inv = 60; damage = 10; element = 0; grazepoints = 1; timepoints = 1; active = 1; updateimageangle = 0; }
();
47
                    radialshot.active = 1;
48
                    radialshot.place = (220 - (16 * i)) + angle_offset;
49
                    radialshot.depth = depth - 1;
50
                    radialshot.target = 3;
51
                    radialshot.type = 1;
52
                    radialshot.damage = 1;
53
                    radialshot.grazed = 0;
54
                }
55
            }
56
        }
57
        else
58
        {
59
            with (bell)
60
            {
61
                shakeobj = instance_create(x, y, obj_shakedirectional);
62
                shakeobj.target = id;
63
                shakeobj.dir = 0;
64
            }
65
            if (choose(0, 1) == 0)
66
            {
67
                snd_play_pitch(snd_bell, 0.8);
68
                for (i = 0; i < 7; i++)
69
                {
70
                    radialshot = instance_create(bell.x + 22, bell.y + 60, obj_gerson_bell_bullet_radial);
71
                    with (radialshot)
72
                        
scr_bullet_init
scr_bullet_init

function
scr_bullet_init()
{ grazed = 0; grazetimer = 0; destroyonhit = 1; target = 0; inv = 60; damage = 10; element = 0; grazepoints = 1; timepoints = 1; active = 1; updateimageangle = 0; }
();
73
                    radialshot.active = 1;
74
                    radialshot.place = 220 + (24 * i) + angle_offset;
75
                    radialshot.depth = depth - 1;
76
                    radialshot.target = 3;
77
                    radialshot.damage = 1;
78
                    radialshot.grazed = 0;
79
                }
80
            }
81
            else
82
            {
83
                snd_play_pitch(snd_bell, 1.1);
84
                for (i = 0; i < 11; i++)
85
                {
86
                    radialshot = instance_create(bell.x + 22, bell.y + 60, obj_gerson_bell_bullet_radial);
87
                    with (radialshot)
88
                        
scr_bullet_init
scr_bullet_init

function
scr_bullet_init()
{ grazed = 0; grazetimer = 0; destroyonhit = 1; target = 0; inv = 60; damage = 10; element = 0; grazepoints = 1; timepoints = 1; active = 1; updateimageangle = 0; }
();
89
                    radialshot.active = 1;
90
                    radialshot.place = 220 + (16 * i) + angle_offset;
91
                    radialshot.depth = depth - 1;
92
                    radialshot.target = 3;
93
                    radialshot.type = 1;
94
                    radialshot.damage = 1;
95
                    radialshot.grazed = 0;
96
                }
97
            }
98
        }
99
    }
100
}
101
if (con == 1)
102
{
103
    timer++;
104
    if (timer == 4)
105
    {
106
        timer = 0;
107
        con = 2;
108
        image_index = 2;
109
    }
110
}
111
if (con == 2)
112
{
113
    timer++;
114
    if (timer == 4)
115
    {
116
        timer = -22;
117
        con = 0;
118
        image_index = 0;
119
    }
120
}
121
if (global.turntimer < 1)
122
    instance_destroy();