Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_encounterbasic_Step_0

(view raw script w/o annotations or w/e)
1
if (fightcon == 1)
2
{
3
    if (global.flag[9 battle_music] == 1)
4
        snd_pause(global.currentsong[1]);
5
    counttimer += 1;
6
    if (counttimer < 10)
7
    {
8
        for (i = 0; i < (count + 1); i += 1)
9
        {
10
            with (c[i])
11
            {
12
                af = scr_afterimage
scr_afterimage

function scr_afterimage() { afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
13
                af.image_alpha = 0.5;
14
            }
15
        }
16
    }
17
    if (counttimer >= 10)
18
    {
19
        if (global.encounterno != 84)
20
        {
21
            wp = snd_play(snd_impact);
22
            snd_volume(wp, 0.7, 0);
23
            wp2 = snd_play(snd_weaponpull_fast);
24
            snd_volume(wp2, 0.8, 0);
25
        }
26
        for (i = 0; i < (count + 1); i += 1)
27
        {
28
            c[i].speed = 0;
29
            if (global.char[i] != 4)
30
                c[i].image_index = 0;
31
            if (global.char[i] == 1)
32
                c[i].sprite_index = spr_krisb_attack;
33
            if (global.char[i] == 2)
34
            {
35
                c[i].sprite_index = spr_susieb_attack;
36
                if (global.charweapon[global.char[i]] == 0)
37
                    c[i].sprite_index = spr_susieb_attack_unarmed;
38
            }
39
            if (global.char[i] == 3)
40
                c[i].sprite_index = spr_ralsei_battleintro;
41
            c[i].image_speed = 0.5;
42
        }
43
        fightcon = 2;
44
        counttimer = 0;
45
    }
46
}
47
if (fightcon == 2)
48
{
49
    counttimer += 1;
50
    if (counttimer >= 15)
51
    {
52
        counttimer = 0;
53
        fightcon = 3;
54
        for (i = 0; i < (count + 1); i += 1)
55
        {
56
            with (c[i])
57
                instance_destroy();
58
        }
59
        instance_create(0, 0, obj_battlecontroller);
60
        instance_destroy();
61
    }
62
}