Deltarune script viewer

← back to main script listing

gml_Object_obj_suitbomb_ch1_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    if (type == 0)
4
        sprite_index = spr_bomb_spade_ch1;
5
    if (type == 1)
6
        sprite_index = spr_bomb_diamond_ch1;
7
    if (type == 2)
8
        sprite_index = spr_bomb_heart_ch1;
9
    if (type == 3)
10
        sprite_index = spr_bomb_club_ch1;
11
    visible = 1;
12
    con = 1;
13
}
14
if (con == 1)
15
{
16
    timer += 1;
17
    if (timer >= 10)
18
    {
19
        with (obj_joker_ch1)
20
            beepnoise = 1;
21
        image_speed = timer / maxtimer;
22
    }
23
    if (timer >= maxtimer)
24
    {
25
        con = 2;
26
        timer = 0;
27
        speed = 0;
28
    }
29
}
30
if (con == 2)
31
{
32
    with (obj_joker_ch1)
33
        burstnoise = 1;
34
    if (type == 0)
35
    {
36
        dir = random(360);
37
        maxe = 12;
38
        for (i = 0; i < 12; i += 1)
39
        {
40
            spade[i] = instance_create_ch1(x, y, obj_regularbullet_ch1);
41
            scr_bullet_inherit_ch1
scr_bullet_inherit_ch1

function scr_bullet_inherit_ch1(arg0) { if (instance_exists(arg0)) { arg0.damage = damage; arg0.grazepoints = grazepoints; arg0.timepoints = timepoints; arg0.inv = inv; arg0.target = target; arg0.grazed = 0; arg0.grazetimer = 0; } }
(spade[i]);
42
            spade[i].active = 1;
43
            spade[i].direction = dir + (i * (360 / maxe));
44
            spade[i].speed = 8;
45
            spade[i].image_angle = spade[i].direction;
46
            spade[i].sprite_index = spr_spadebullet_ch1;
47
        }
48
        con = 3;
49
    }
50
    if (type == 1)
51
    {
52
        for (i = 0; i < 3; i += 1)
53
        {
54
            diamond[i] = instance_create_ch1(x, y, obj_regularbullet_ch1);
55
            diamond[i].damage = 100;
56
            scr_bullet_inherit_ch1
scr_bullet_inherit_ch1

function scr_bullet_inherit_ch1(arg0) { if (instance_exists(arg0)) { arg0.damage = damage; arg0.grazepoints = grazepoints; arg0.timepoints = timepoints; arg0.inv = inv; arg0.target = target; arg0.grazed = 0; arg0.grazetimer = 0; } }
(diamond[i]);
57
            with (diamond[i])
58
                move_towards_point(obj_heart_ch1.x + 8, obj_heart_ch1.y + 8, 11);
59
            diamond[i].speed -= i;
60
            diamond[i].image_angle = diamond[i].direction;
61
            diamond[i].sprite_index = spr_diamondbullet_ch1;
62
        }
63
        con = 3;
64
    }
65
    if (type == 2)
66
    {
67
        h = instance_create_ch1(x, y, obj_heartbomb_blast_ch1);
68
        scr_bullet_inherit_ch1
scr_bullet_inherit_ch1

function scr_bullet_inherit_ch1(arg0) { if (instance_exists(arg0)) { arg0.damage = damage; arg0.grazepoints = grazepoints; arg0.timepoints = timepoints; arg0.inv = inv; arg0.target = target; arg0.grazed = 0; arg0.grazetimer = 0; } }
(h);
69
        con = 3;
70
    }
71
    if (type == 3)
72
    {
73
        dir = point_direction(x, y, obj_heart_ch1.x + 8, obj_heart_ch1.y + 8);
74
        for (i = 0; i < 3; i += 1)
75
        {
76
            club[i] = instance_create_ch1(x, y, obj_regularbullet_ch1);
77
            club[i].sprite_index = spr_clubsbullet_ch1;
78
            club[i].damage = 100;
79
            scr_bullet_inherit_ch1
scr_bullet_inherit_ch1

function scr_bullet_inherit_ch1(arg0) { if (instance_exists(arg0)) { arg0.damage = damage; arg0.grazepoints = grazepoints; arg0.timepoints = timepoints; arg0.inv = inv; arg0.target = target; arg0.grazed = 0; arg0.grazetimer = 0; } }
(club[i]);
80
            club[i].active = 1;
81
            club[i].direction = (dir - 20) + (i * 20);
82
            club[i].image_angle = club[i].direction;
83
            club[i].speed = 8;
84
        }
85
        con = 3;
86
    }
87
}
88
if (explodedraw >= 40)
89
    instance_destroy();