Undertale script viewer

← back to main script listing

gml_Object_obj_encounterer_water1_Step_0

(view raw script w/o annotations or w/e)
1
if (global.encounter > steps)
2
{
3
    if (global.phasing == 0)
4
    {
5
        if (global.interact == 0)
6
        {
7
            script_execute(scr_steps, 340, 380, 18, 204);
8
            if (room == room_water6)
9
                script_execute(scr_steps, 1040, 380, 18, 204);
10
            global.encounter = 0;
11
            battlegroup = floor(random(15));
12
            if (battlegroup < 15)
13
                global.battlegroup = 43;
14
            if (battlegroup < 11)
15
                global.battlegroup = 53;
16
            if (battlegroup < 7)
17
                global.battlegroup = 40;
18
            if (battlegroup < 4)
19
                global.battlegroup = 54;
20
            if (global.flag[357 progress_water_battles] == 0)
21
                global.battlegroup = 40;
22
            if (global.flag[357 progress_water_battles] == 1)
23
                global.battlegroup = 43;
24
            if (global.flag[357 progress_water_battles] == 2)
25
                global.battlegroup = 53;
26
            global.flag[357 progress_water_battles] += 1;
27
            if (alldead == 2)
28
                global.battlegroup = 19;
29
            if (alldead == 1)
30
            {
31
                global.flag[223 genocide_water] = 1;
32
                global.battlegroup = 19;
33
                alldead = 2;
34
            }
35
            else
36
            {
37
                instance_create(0, 0, obj_battleblcon);
38
                if (desto == 1)
39
                    instance_destroy();
40
            }
41
        }
42
    }
43
    else
44
    {
45
        steps = 0;
46
    }
47
}