Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_controller_dw_mansion_east_1f_d_Step_0

(view raw script w/o annotations or w/e)
1
if (instance_exists(obj_mainchara) && obj_mainchara.x >= 320 && global.flag[354 bagels_purchased] == 0 && spawnedGates == 0 && spawnedViro == 0)
2
{
3
    spawnedGates = 1;
4
    spawnedViro = 1;
5
    leftgate = instance_create(200, 240, obj_forcefield);
6
    leftgate.image_xscale = 2;
7
    leftgate.image_yscale = 8;
8
    rightgate = instance_create(2080, 240, obj_forcefield);
9
    rightgate.image_xscale = 2;
10
    rightgate.image_yscale = 8;
11
    viro = instance_create(380, -128, obj_ow_virokun_mansion_east_1f_d);
12
}
13
if (global.flag[354 bagels_purchased] == 1 && spawnedViro == 0)
14
{
15
    if (startside == "Left")
16
        viro = instance_create(380, -128, obj_ow_virokun_mansion_east_1f_d);
17
    if (startside == "Right")
18
        viro = instance_create(room_width - 380 - (sprite_width * 2), -128, obj_ow_virokun_mansion_east_1f_d);
19
    spawnedViro = 1;
20
}
21
if (instance_exists(obj_mainchara))
22
{
23
    if (obj_mainchara.x > 200 && i_ex(viro))
24
        obj_mainchara.battlemode = 1;
25
}
26
if (instance_exists(obj_mainchara))
27
{
28
    if (obj_mainchara.battlemode == 1)
29
    {
30
        if (instance_exists(obj_overworld_bulletarea))
31
        {
32
            with (obj_overworld_bulletarea)
33
                visible = true;
34
        }
35
    }
36
}
37
if (spawnedViro == 1 && !i_ex(viro))
38
{
39
    obj_mainchara.battlemode = 0;
40
    if (instance_exists(obj_overworld_bulletarea))
41
    {
42
        with (obj_overworld_bulletarea)
43
            instance_destroy();
44
    }
45
}
46
if (global.flag[354 bagels_purchased] == 1)
47
{
48
    if (instance_exists(obj_forcefield))
49
    {
50
        with (obj_forcefield)
51
            instance_destroy();
52
    }
53
}