Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gerson_bell_hit_Other_24

(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
        snd_play(snd_bell);
12
        image_index = 1;
13
        
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); }
();
14
        bell = instance_nearest(x, y, obj_gerson_bell);
15
        var angle_offset = random(60) - 30;
16
        if (image_xscale > 0)
17
        {
18
            with (bell)
19
            {
20
                shakeobj = instance_create(x, y, obj_shakedirectional);
21
                shakeobj.target = id;
22
                shakeobj.dir = 180;
23
            }
24
            for (i = 0; i < 7; i++)
25
            {
26
                radialshot = instance_create(bell.x + 42, bell.y + 60, obj_gerson_bell_bullet_radial);
27
                with (radialshot)
28
                    
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; }
();
29
                radialshot.active = 1;
30
                radialshot.place = (270 - (30 * i)) + angle_offset;
31
                radialshot.depth = depth - 1;
32
                radialshot.target = 3;
33
                radialshot.damage = 1;
34
                radialshot.grazed = 0;
35
            }
36
        }
37
        else
38
        {
39
            with (bell)
40
            {
41
                shakeobj = instance_create(x, y, obj_shakedirectional);
42
                shakeobj.target = id;
43
                shakeobj.dir = 0;
44
            }
45
            for (i = 0; i < 7; i++)
46
            {
47
                radialshot = instance_create(bell.x + 42, bell.y + 60, obj_gerson_bell_bullet_radial);
48
                with (radialshot)
49
                    
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; }
();
50
                radialshot.active = 1;
51
                radialshot.place = 250 + (30 * i) + angle_offset;
52
                radialshot.depth = depth - 1;
53
                radialshot.target = 3;
54
                radialshot.damage = 1;
55
                radialshot.grazed = 0;
56
            }
57
        }
58
    }
59
}
60
if (con == 1)
61
{
62
    timer++;
63
    if (timer == 6)
64
    {
65
        timer = 0;
66
        con = 2;
67
        image_index = 2;
68
    }
69
}
70
if (con == 2)
71
{
72
    timer++;
73
    if (timer == 6)
74
    {
75
        timer = -47;
76
        con = 0;
77
        image_index = 0;
78
    }
79
}
80
if (global.turntimer < 1)
81
    instance_destroy();