Deltarune (Chapter 1) 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
        wp = snd_play(snd_impact);
20
        snd_volume(wp, 0.7, 0);
21
        wp2 = snd_play(snd_weaponpull_fast);
22
        snd_volume(wp2, 0.8, 0);
23
        for (i = 0; i < (count + 1); i += 1)
24
        {
25
            c[i].speed = 0;
26
            c[i].image_index = 0;
27
            if (global.char[i] == 1)
28
                c[i].sprite_index = spr_krisb_attack;
29
            if (global.char[i] == 2)
30
            {
31
                c[i].sprite_index = spr_susieb_attack;
32
                if (global.charweapon[global.char[i]] == 0)
33
                    c[i].sprite_index = spr_susieb_attack_unarmed;
34
            }
35
            if (global.char[i] == 3)
36
                c[i].sprite_index = spr_ralseib_battleintro;
37
            c[i].image_speed = 0.5;
38
        }
39
        fightcon = 2;
40
        counttimer = 0;
41
    }
42
}
43
if (fightcon == 2)
44
{
45
    counttimer += 1;
46
    if (counttimer >= 15)
47
    {
48
        counttimer = 0;
49
        fightcon = 3;
50
        for (i = 0; i < (count + 1); i += 1)
51
        {
52
            with (c[i])
53
                instance_destroy();
54
        }
55
        instance_create(0, 0, obj_battlecontroller);
56
        instance_destroy();
57
    }
58
}