Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gerson_bell_hit_Other_25

(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
        var slowbullet1 = irandom(4);
15
        bell = instance_nearest(x, y, obj_gerson_bell);
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 < 5; i++)
25
            {
26
                if (i == slowbullet1)
27
                    continue;
28
                bulletshot = instance_create(bell.x + 42, bell.y + 60, obj_gerson_bell_bullet);
29
                with (bulletshot)
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
                bulletshot.image_xscale = 1.4;
32
                bulletshot.image_yscale = 1.4;
33
                bulletshot.active = 1;
34
                bulletshot.direction = 180;
35
                bulletshot.pos = i;
36
                bulletshot.depth = depth - 1;
37
                bulletshot.target = 3;
38
                bulletshot.damage = 1;
39
                bulletshot.grazed = 0;
40
            }
41
            var radial = 5;
42
            var dir = 0;
43
            if (bighearttype == 1 && y < obj_growtangle.y)
44
                dir = 25 + random(10);
45
            if (bighearttype == 1 && y > obj_growtangle.y)
46
                dir = (random(10) * -1) - 25;
47
            for (i = 0; i < radial; i++)
48
            {
49
                radialshot = instance_create(x, y, obj_collidebullet);
50
                with (radialshot)
51
                    
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; }
();
52
                radialshot.sprite_index = spr_diamondbullet;
53
                radialshot.direction = ((i / radial) * 180) + 110 + dir;
54
                radialshot.image_angle = radialshot.direction;
55
                radialshot.active = 1;
56
                radialshot.speed = 1;
57
                radialshot.friction = -0.3;
58
                if (bighearttype == 1)
59
                {
60
                    radialshot.speed = 1;
61
                    radialshot.friction = -0.23;
62
                }
63
                radialshot.depth = depth - 1;
64
                radialshot.target = target;
65
                radialshot.damage = damage;
66
                radialshot.grazed = 0;
67
                radialshot.element = 6;
68
                if (obj_spamton_neo_enemy.difficulty == 0)
69
                    radialshot.grazepoints = 3;
70
                if (obj_spamton_neo_enemy.difficulty == 2)
71
                    radialshot.grazepoints = 2;
72
            }
73
        }
74
        else
75
        {
76
            with (bell)
77
            {
78
                shakeobj = instance_create(x, y, obj_shakedirectional);
79
                shakeobj.target = id;
80
                shakeobj.dir = 0;
81
            }
82
        }
83
    }
84
}
85
if (con == 1)
86
{
87
    timer++;
88
    if (timer == 6)
89
    {
90
        timer = 0;
91
        con = 2;
92
        image_index = 2;
93
    }
94
}
95
if (con == 2)
96
{
97
    timer++;
98
    if (timer == 6)
99
    {
100
        timer = -47;
101
        con = 0;
102
        image_index = 0;
103
    }
104
}
105
if (global.turntimer < 1)
106
    instance_destroy();