Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_incense_cloud_destroyed_Draw_0

(view raw script w/o annotations or w/e)
1
if (global.turntimer < 1)
2
{
3
    with (obj_animation)
4
    {
5
        if (sprite_index == spr_incense_fire_explosion1c)
6
            instance_destroy();
7
    }
8
    instance_destroy();
9
}
10
chainreactiontimer++;
11
if (type == 2)
12
{
13
    timer++;
14
    if (timer == 1)
15
    {
16
        snd_stop(snd_explosion_firework);
17
        snd_play(snd_explosion_firework);
18
    }
19
    if (timer == 1)
20
    {
21
        var dir = -20 + random(40) + image_angle;
22
        var len = 10 + random(15);
23
        fx = instance_create_depth(x + lengthdir_x(len, dir), y + lengthdir_y(len, dir), depth - 5, obj_animation);
24
        fx.sprite_index = spr_incense_fire_explosion1c;
25
        fx.image_speed = 0.5;
26
        dir = 160 + random(40) + image_angle;
27
        len = random(25);
28
        fx = instance_create_depth(x + lengthdir_x(len, dir), y + lengthdir_y(len, dir), depth - 5, obj_animation);
29
        fx.sprite_index = spr_incense_fire_explosion1c;
30
        fx.image_speed = 0.5;
31
    }
32
    if (timer == 5)
33
    {
34
        var angle = irandom(360);
35
        repeat (4)
36
        {
37
            inst = instance_create(x, y, obj_incense_bullet_fire);
38
            inst.image_angle = angle;
39
            inst.direction = angle;
40
            inst.image_speed = 0.5;
41
            inst.image_xscale = 0.5;
42
            inst.image_yscale = 0.5;
43
            inst.speed = 1;
44
            inst.friction = -0.1;
45
            inst.chainreaction = chainreaction;
46
            angle += 90;
47
        }
48
        instance_destroy();
49
    }
50
}
51
if (type == 1)
52
{
53
    if (con == 0)
54
    {
55
        timer++;
56
        if (timer == 1)
57
        {
58
            con = 1;
59
            timer = 0;
60
        }
61
    }
62
    if (con == 1)
63
    {
64
        var angle = irandom(360);
65
        repeat (4)
66
        {
67
            inst = instance_create(x, y, obj_incense_bullet_fire);
68
            inst.image_angle = angle;
69
            inst.direction = angle;
70
            inst.image_speed = 0.5;
71
            inst.image_xscale = 0.5;
72
            inst.image_yscale = 0.5;
73
            inst.speed = 1;
74
            inst.friction = -0.1;
75
            inst.chainreaction = chainreaction;
76
            angle += 45;
77
        }
78
        con = 2;
79
    }
80
    draw_sprite_ext(sprite_index, image_index, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
81
}
82
if (type == 0)
83
{
84
    if (con == 0)
85
    {
86
        timer++;
87
        if (timer == 5)
88
        {
89
            con = 1;
90
            timer = 0;
91
        }
92
    }
93
    if (con > 0)
94
        DissolveAmount -= 0.08;
95
    if (con == 1 && DissolveAmount < 0.8)
96
    {
97
        var angle = irandom(360);
98
        repeat (4)
99
        {
100
            inst = instance_create(x, y, obj_incense_bullet_fire);
101
            inst.image_angle = angle;
102
            inst.direction = angle;
103
            inst.image_speed = 0.5;
104
            inst.image_xscale = 0.5;
105
            inst.image_yscale = 0.5;
106
            inst.speed = 1;
107
            inst.friction = -0.1;
108
            inst.chainreaction = chainreaction;
109
            angle += 90;
110
        }
111
        con = 2;
112
    }
113
    if (DissolveAmount < 0)
114
        instance_destroy();
115
    DissolveShader(sprite_index, image_index, x, y, DissolveAmount);
116
}