Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_chaseenemy_board_spawner_Step_0

(view raw script w/o annotations or w/e)
1
if (variablelocation == true)
2
{
3
    if (spawn_up == 0)
4
    {
5
        with (obj_board_enemySpawnLocation)
6
        {
7
            if (extflag == other.extflag)
8
            {
9
                if (dir == "up")
10
                    other.spawn_up = id;
11
            }
12
        }
13
    }
14
    if (spawn_down == 0)
15
    {
16
        with (obj_board_enemySpawnLocation)
17
        {
18
            if (extflag == other.extflag)
19
            {
20
                if (dir == "down")
21
                    other.spawn_down = id;
22
            }
23
        }
24
    }
25
    if (spawn_left == 0)
26
    {
27
        with (obj_board_enemySpawnLocation)
28
        {
29
            if (extflag == other.extflag)
30
            {
31
                if (dir == "left")
32
                    other.spawn_left = id;
33
            }
34
        }
35
    }
36
    if (spawn_right == 0)
37
    {
38
        with (obj_board_enemySpawnLocation)
39
        {
40
            if (extflag == other.extflag)
41
            {
42
                if (dir == "right")
43
                    other.spawn_right = id;
44
            }
45
        }
46
    }
47
}
48
if (active)
49
{
50
    if (!made && (global.flag[1022 tenna_board_absent] == 0 || tennareq == 0))
51
    {
52
        if (!variablelocation)
53
        {
54
            chaser = instance_create(x, y, obj_chaseenemy_board);
55
        }
56
        else
57
        {
58
            var targetLoc = 0;
59
            if (obj_board_camera.shift == "up")
60
                targetLoc = spawn_down;
61
            if (obj_board_camera.shift == "down")
62
                targetLoc = spawn_up;
63
            if (obj_board_camera.shift == "left")
64
                targetLoc = spawn_right;
65
            if (obj_board_camera.shift == "right")
66
                targetLoc = spawn_left;
67
            if (i_ex(targetLoc))
68
            {
69
                chaser = instance_create(targetLoc.x, targetLoc.y, obj_chaseenemy_board);
70
            }
71
            else
72
            {
73
                chaser = instance_create(x, y, obj_chaseenemy_board);
74
                debug_message("targetloc not found");
75
            }
76
        }
77
        chaser.encounterno = encounterno;
78
        chaser.chaseflag = chaseflag;
79
        chaser.encounterflag = encounterflag;
80
        chaser.daddy = id;
81
        chaser.tennareq = tennareq;
82
        made = true;
83
    }
84
}
85
else if (made)
86
{
87
    safe_delete(chaser);
88
    made = false;
89
}