Undertale script viewer

← back to main script listing

gml_Object_obj_encount_core1_Step_0

(view raw script w/o annotations or w/e)
1
global.flag[15 in_battle] = 1;
2
if (global.encounter > steps)
3
{
4
    if (global.phasing == 0)
5
    {
6
        if (global.interact == 0)
7
        {
8
            script_execute(scr_steps, 340, 380, 40, 205);
9
            if (room == room_fire5)
10
                script_execute(scr_steps, 1040, 680, 40, 205);
11
            if (scr_murderlv
scr_murderlv

mrd = 0; if (global.flag[202 kills_ruins] >= 20) mrd = 1; if (mrd == 1 && global.flag[45 status_toriel] == 4) mrd = 2; if (mrd == 2 && global.flag[52 status_doggo] == 1) mrd = 3; if (mrd == 3 && global.flag[53 status_dogcouple] == 1) mrd = 4; if (mrd == 4 && global.flag[54 status_greaterdog] == 1) mrd = 5; if (mrd == 5 && global.flag[57 status_snowdrake] == 2) mrd = 6; if (mrd == 6 && global.flag[203 kills_tundra] >= 16) mrd = 7; if (mrd == 7 && global.flag[67 status_papyrus] == 1) mrd = 8; if (mrd == 8 && global.flag[81 status_shyren] == 1) mrd = 9; if (mrd == 9 && global.flag[252 killed_glad_dummy] == 1) mrd = 10; if (mrd == 10 && global.flag[204 kills_water] >= 18) mrd = 11; if (mrd == 11 && global.flag[251 killed_undyne_ex] == 1 && global.flag[350 status_undyne] == 1) mrd = 12; if (mrd == 12 && global.flag[402 killed_rg] == 1) mrd = 13; if (mrd == 13 && global.flag[397 killed_muffet] == 1) mrd = 14; if (mrd == 14 && global.flag[205 kills_hotland] >= 40) mrd = 15; if (mrd == 15 && global.flag[425 killed_mettaton] == 1 && global.flag[27 spared_specific] == 0) mrd = 16; murderboy = mrd; if (global.flag[26 murderlevel_override] > 0) mrd = global.flag[26 murderlevel_override]; return mrd;
() >= 12)
12
                script_execute(scr_steps, 70, 120, 40, 205);
13
            global.encounter = 0;
14
            battlegroup = floor(random(15));
15
            if (battlegroup <= 15)
16
                global.battlegroup = 66;
17
            if (battlegroup <= 12)
18
                global.battlegroup = 64;
19
            if (battlegroup <= 9)
20
                global.battlegroup = 65;
21
            if (battlegroup == 4 || battlegroup == 5 || battlegroup == 6)
22
                global.battlegroup = 68;
23
            if (battlegroup == 3 || battlegroup == 2)
24
                global.battlegroup = 67;
25
            if (battlegroup == 1)
26
                global.battlegroup = 60;
27
            if (battlegroup == 0)
28
                global.battlegroup = 59;
29
            if (global.flag[8 disable_random_encounters] == 1 || global.flag[7 true_pacifist] == 1)
30
                instance_destroy();
31
            if (global.flag[426 progress_core_battles2] == 0)
32
                global.battlegroup = 62;
33
            if (global.flag[426 progress_core_battles2] == 1)
34
                global.battlegroup = 64;
35
            if (global.flag[426 progress_core_battles2] == 2)
36
                global.battlegroup = 65;
37
            if (global.flag[426 progress_core_battles2] == 3)
38
                global.battlegroup = 66;
39
            if (global.flag[426 progress_core_battles2] == 4)
40
                global.battlegroup = 68;
41
            global.flag[426 progress_core_battles2] += 1;
42
            if (alldead == 2)
43
                global.battlegroup = 19;
44
            if (alldead == 1)
45
            {
46
                global.battlegroup = 19;
47
                alldead = 2;
48
                global.flag[225 genocide_core] = 1;
49
            }
50
            else
51
            {
52
                instance_create(0, 0, obj_battleblcon);
53
                if (desto == 1)
54
                    instance_destroy();
55
            }
56
        }
57
    }
58
    else
59
    {
60
        steps = 0;
61
    }
62
}