Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_purify_event_Draw_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    init = 1;
4
    if (!faster)
5
        snd_play_x(snd_great_shine, 1, 1.2);
6
    if (faster)
7
        snd_play_x(snd_great_shine, 1, 1.2);
8
}
9
siner += 1.5;
10
t++;
11
if (t >= 400 && faster)
12
    t++;
13
if (faster)
14
    siner += 1.5;
15
if (t == 400)
16
    snd_play(snd_revival, 1, 1);
17
if (t >= 400 && t < 450)
18
{
19
    rs += 0.5;
20
    if (faster)
21
        rs += 0.5;
22
    draw_set_color(c_white);
23
    for (i = 1; i < 20; i += 1)
24
    {
25
        draw_set_alpha((rs / 16) - (i / 20));
26
        ossafe_fill_rectangle(xstart - (i * i) - (rs * i), cameray() + 0, xstart + (i * i) + (rs * i), cameray() + 500, 0);
27
    }
28
    draw_set_alpha(1);
29
}
30
if (t == 450)
31
{
32
    with (obj_titan_spawn_enemy)
33
        x += 300;
34
}
35
if (t >= 450)
36
{
37
    ds2 -= 0.01;
38
    if (faster)
39
        ds2 -= 0.01;
40
    draw_set_alpha(ds2);
41
    draw_set_color(c_white);
42
    ossafe_fill_rectangle(camerax() - 10, cameray() - 10, camerax() + 999, cameray() + 999, false);
43
    draw_set_alpha(1);
44
}
45
if (t == 500)
46
{
47
    if (i_ex(obj_titan_spawn_enemy))
48
    {
49
        if (global.monsterhp[0] > 0)
50
        {
51
            _recruitanim = instance_create(camerax() + 500, cameray() + 84, obj_recruitanim);
52
            _recruitanim.image_index = 15;
53
        }
54
        if (global.monsterhp[1] > 0)
55
        {
56
            _recruitanim = instance_create(camerax() + 500, cameray() + 224, obj_recruitanim);
57
            _recruitanim.image_index = 15;
58
        }
59
    }
60
    with (obj_titan_spawn_enemy)
61
    {
62
        
scr_spareanim
scr_spareanim

function
scr_spareanim()
{ spareanim = instance_create(x, y, obj_spareanim); spareanim.sprite_index = sprite_index; spareanim.sprite_index = sparedsprite; spareanim.image_index = 0; spareanim.image_xscale = image_xscale; spareanim.image_yscale = image_yscale; }
();
63
        
scr_monsterdefeat
scr_monsterdefeat

function
scr_monsterdefeat()
{ if (global.monster[myself] == 1) { debug_message("=====Encounter Results====="); global.monstergold[3] += global.monstergold[myself]; global.monsterexp[3] += global.monsterexp[myself]; global.monster[myself] = 0; if (global.flag[51 + myself] == 0) { global.flag[51 + myself] = 2; if (global.monsterhp[myself] <= 0) global.flag[51 + myself] = 1; } if (global.flag[51 + myself] == 1) { global.flag[40 violences] += 1; if (fatal == 1) global.flag[44 kills]++; } if (global.flag[51 + myself] == 2) global.flag[41 spares] += 1; if (global.flag[51 + myself] == 3) global.flag[42 pacifies] += 1; if (global.flag[51 + myself] == 5) global.flag[43 autosusie_violences] += 1; if (global.flag[51 + myself] == 6) { global.flag[45 freezes] += 1; global.monstergold[3] += 24; } if (
scr_monsterpop() == 0)
{ _amt_add = 0; _frozened = 0; _violenced = 0; _spared = 0; _pacified = 0; for (d_i = 0; d_i < 3; d_i += 1) { if (global.flag[51 + d_i] != 0) _amt_add += 1; if (global.flag[51 + d_i] == 1) _violenced += 1; if (global.flag[51 + d_i] == 2) _spared += 1; if (global.flag[51 + d_i] == 3) _pacified += 1; if (global.flag[51 + d_i] == 6) _frozened += 1; } if (_frozened > 0) global.flag[50 last_encounter_end] = 6; if (_pacified > 0) global.flag[50 last_encounter_end] = 3; if (_spared > 0) global.flag[50 last_encounter_end] = 2; if (_violenced > 0) global.flag[50 last_encounter_end] = 1; if (global.flag[50 last_encounter_end] == 6) global.flag[926 iceshocked_encounters]++; if (global.flag[54 encounter_pointer] != 0) { global.flag[global.flag[54 encounter_pointer]] = global.flag[50 last_encounter_end]; debug_message("=====Encounter Results====="); debug_message("encounter flag: global.flag[" + string(global.flag[54 encounter_pointer]) + "]=" + string(global.flag[50 last_encounter_end])); debug_message("======="); global.flag[54 encounter_pointer] = 0; } } event_user(11); debug_message("======="); } }
();
64
        instance_destroy();
65
    }
66
}
67
if (t == 460)
68
{
69
    with (obj_titan_enemy)
70
        starshootcon = 1;
71
}
72
if (t >= 540)
73
    image_alpha -= 0.1;
74
if (t >= 550 || (faster && t >= 550))
75
    instance_destroy();
76
if (t >= 540)
77
{
78
    draw_sprite_ext(sprite_index, image_index, x, y, 1, 1, 0, c_white, image_alpha);
79
}
80
else
81
{
82
    draw_sprite_ext(sprite_index, image_index, x, y, 1, 1, 0, c_white, siner / 8);
83
    draw_sprite_ext(sprite_index, image_index, x, y, siner / 4, siner / 4, 0, c_white, 1.6 - (siner / 16));
84
    draw_sprite_ext(sprite_index, image_index, x, y, siner / 8, siner / 8, 0, c_white, 1.6 - (siner / 24));
85
    if (t >= 430)
86
    {
87
        if (t >= 430 && t <= 440)
88
        {
89
            if (!faster)
90
                timer += 10;
91
            if (faster)
92
                timer += 20;
93
        }
94
        if (t >= 450)
95
        {
96
            if (!faster)
97
                timer -= 1;
98
            if (faster)
99
                timer -= 2;
100
        }
101
        d3d_set_fog(true, c_white, 0, 1);
102
        draw_sprite_ext(sprite_index, image_index, x, y, 1, 1, 0, c_white, timer / 100);
103
        d3d_set_fog(false, c_black, 0, 0);
104
    }
105
}