Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_titan_heal_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    timer++;
4
    if (strongerheal)
5
    {
6
        if (timer == 1)
7
        {
8
            x = camerax() + 500;
9
            y = cameray() + 210;
10
            with (obj_writer)
11
                instance_destroy();
12
            snd_play(snd_titan_absorb);
13
            with (obj_titan_enemy)
14
                darktimer = 1;
15
        }
16
        if (timer > 0 && timer < 90)
17
        {
18
            var dir = random(360);
19
            var dist = 140 + irandom(90);
20
            var _depth = obj_titan_enemy.depth - (irandom(4) * 6) - 3;
21
            ball = instance_create_depth(x + lengthdir_x(dist, dir), y + lengthdir_y(dist, dir), _depth, obj_titan_heal_orb);
22
            ball.strongerheal = true;
23
            ball = instance_create_depth(x + lengthdir_x(dist, dir), y + lengthdir_y(dist, dir), _depth, obj_titan_heal_orb);
24
        }
25
        if (timer == 130)
26
        {
27
            snd_play(snd_titan_cure);
28
            timer = 0;
29
            con = 1;
30
        }
31
    }
32
    else
33
    {
34
        if (timer == 1)
35
        {
36
            x = camerax() + 500;
37
            y = cameray() + 210;
38
            with (obj_writer)
39
                instance_destroy();
40
            snd_loop(snd_titan_absorb);
41
            with (obj_titan_enemy)
42
                darktimer = 1;
43
        }
44
        if (timer > 0 && timer < 60)
45
        {
46
            var dir = random(360);
47
            var dist = 140 + irandom(50);
48
            var _depth = obj_titan_enemy.depth - (irandom(4) * 6) - 3;
49
            ball = instance_create_depth(x + lengthdir_x(dist, dir), y + lengthdir_y(dist, dir), _depth, obj_titan_heal_orb);
50
        }
51
        if (timer == 85)
52
        {
53
            snd_stop(snd_titan_absorb);
54
            snd_play_pitch(snd_titan_cure, 0.8);
55
            timer = 0;
56
            con = 1;
57
        }
58
    }
59
}
60
if (con == 1)
61
{
62
    timer += 1;
63
    if (timer == 1)
64
    {
65
        with (obj_titan_enemy)
66
        {
67
            greenflashtimer = 9;
68
            global.monsterhp[myself] += other.healamt;
69
            if (global.monsterhp[myself] > global.monstermaxhp[myself])
70
                global.monsterhp[myself] = global.monstermaxhp[myself];
71
            healamt = instance_create(global.monsterx[myself], global.monstery[myself], obj_dmgwriter);
72
            with (healamt)
73
            {
74
                delay = 8;
75
                type = 3;
76
            }
77
            if (i_ex(healamt))
78
            {
79
                healamt.damage = other.healamt;
80
                healamt.depth -= 20;
81
            }
82
            var _index = 0;
83
            repeat (40)
84
            {
85
                star = instance_create(camerax() + 400 + random(200), cameray() + 40 + random(300), obj_marker);
86
                with (star)
87
                {
88
                    image_angle = random(360);
89
                    depth = -10;
90
                    image_xscale = 2;
91
                    image_yscale = 2;
92
                    image_alpha = 2;
93
                    image_speed = 0.25;
94
                    hspeed = 2 - random(2);
95
                    vspeed = -3 - random(2);
96
                    friction = 0.2;
97
                    if ((_index % 4) == 3)
98
                    {
99
                        sprite_index = spr_darkshape_transform;
100
                        image_blend = c_black;
101
                        friction = 0.4;
102
                    }
103
                    else
104
                    {
105
                        sprite_index = spr_sparestar_anim;
106
                        image_blend = c_lime;
107
                    }
108
                }
109
                _index++;
110
            }
111
        }
112
    }
113
    if (timer >= 15)
114
    {
115
        con = 2;
116
        timer = 0;
117
    }
118
}
119
if (con == 2)
120
{
121
    with (obj_marker)
122
    {
123
        if (sprite_index == spr_sparestar_anim || sprite_index == spr_darkshape_transform)
124
        {
125
            image_angle -= 10;
126
            image_alpha -= 0.1;
127
            if (image_alpha <= 0)
128
                instance_destroy();
129
        }
130
    }
131
}
132
if (con == 2)
133
{
134
    with (obj_titan_fg_draw)
135
    {
136
        if (alpha2 > 0)
137
            alpha2 -= 0.1;
138
        if (alpha2 < 0)
139
            alpha2 = 0;
140
    }
141
    timer += 1;
142
    if (timer >= 30)
143
    {
144
        with (obj_writer)
145
            instance_destroy();
146
        con = 3;
147
        if (notext == false)
148
        {
149
        }
150
    }
151
}
152
if (con == 3)
153
{
154
    global.turntimer = 999;
155
    if (!instance_exists(obj_writer))
156
    {
157
        global.fc = 0;
158
        con = 0;
159
        timer = 0;
160
        global.turntimer = 2;
161
        instance_destroy();
162
        with (obj_darkener)
163
            darken = 0;
164
    }
165
}