Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_chaseenemy_Create_0

(view raw script w/o annotations or w/e)
1
image_xscale = 2;
2
image_yscale = 2;
3
facing = 0;
4
walk_index = 0;
5
state = 0;
6
alertcon = 0;
7
alerttimer = 0;
8
facetimer = 0;
9
chasetype = 0;
10
pacetype = 1;
11
pacecon = 0;
12
pacecon2 = 0;
13
pacetimer = 0;
14
targetx = 0;
15
targety = 0;
16
scr_depth
scr_depth

function
scr_depth()
{ depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
17
radius = 200;
18
moveradius = 160;
19
pacespeed = 1;
20
frozen = 0;
21
hadfrozen = 0;
22
offscreen_frozen = 1;
23
remspeed = 0;
24
myencounter = 4;
25
touchsprite = spr_diamondm_hurt;
26
cancelwalk = 0;
27
eraser = 0;
28
touchflag = 0;
29
ignoresolid = 0;
30
if (room == room_battletest)
31
    myencounter = 40;
32
if (room == room_field1)
33
    myencounter = 4;
34
if (room == room_field2)
35
{
36
    myencounter = 5;
37
    if (global.flag[501 triple_hathy_outcome] > 0)
38
        instance_destroy();
39
}
40
if (room == room_field_puzzle1)
41
{
42
    myencounter = 6;
43
    radius = 200;
44
    pacetype = 5;
45
}
46
if (room == room_field_getsusie)
47
{
48
    myencounter = 7;
49
    sprite_index = spr_smallchecker_front;
50
    touchsprite = sprite_index;
51
    pacetype = 6;
52
    image_speed = 0.2;
53
}
54
if (room == room_field4)
55
    myencounter = 33;
56
if (room == room_field_secret1)
57
{
58
    sprite_index = spr_jigsawry_idle;
59
    touchsprite = spr_jigsawry_idle;
60
    myencounter = 23;
61
    if (global.plot < 130)
62
        instance_destroy();
63
}
64
if (room == room_forest_area0)
65
{
66
    sprite_index = spr_rabbick_enemy_overworld;
67
    myencounter = 16;
68
    touchsprite = spr_rabbick_enemy_overworld;
69
    alertcon = -1;
70
    pacetype = 10;
71
}
72
if (room == room_forest_area1 || room == room_forest_area3 || room == room_forest_secret1)
73
{
74
    pacetype = 7;
75
    sprite_index = spr_rabbick_enemy_overworld;
76
    if (room == room_forest_area1)
77
        pacetype = 11;
78
    myencounter = 17;
79
    touchflag = 505;
80
    touchsprite = spr_rabbick_enemy_overworld;
81
    if (room == room_forest_area3)
82
        myencounter = 24;
83
    if (room == room_forest_secret1)
84
        myencounter = 32;
85
    alertcon = -1;
86
}
87
if (room == room_forest_maze1)
88
{
89
    touchflag = 505;
90
    sprite_index = spr_rabbick_enemy_overworld;
91
    myencounter = 17;
92
    touchsprite = spr_rabbick_enemy_overworld;
93
    pacetype = 1;
94
    if (global.flag[505 fought_rabbick] == 1)
95
        chasetype = 3;
96
}
97
if (room == room_forest_maze2)
98
{
99
    touchflag = 506;
100
    myencounter = 18;
101
    sprite_index = spr_blockguy_overworld;
102
    touchsprite = spr_blockguy_overworld;
103
    pacetype = 1;
104
    if (global.flag[506 fought_bloxer] == 1)
105
        chasetype = 3;
106
    else
107
        chasetype = 4;
108
}
109
if (room == room_forest_beforeclover)
110
{
111
    myencounter = 18;
112
    sprite_index = spr_blockguy_overworld;
113
    touchsprite = spr_blockguy_overworld;
114
    pacetype = 7;
115
    alertcon = -1;
116
}
117
if (room == room_forest_area4)
118
{
119
    myencounter = 19;
120
    sprite_index = spr_blockguy_overworld;
121
    touchsprite = spr_blockguy_overworld;
122
    pacetype = 7;
123
    if (x < (room_width / 2))
124
        pacetype = 7.5;
125
    eraser = 1;
126
    touchflag = 506;
127
    chasetype = 4;
128
    radius = 90;
129
    ignoresolid = 1;
130
    offscreen_frozen = 0;
131
    if (global.flag[506 fought_bloxer] >= 1)
132
        alertcon = -1;
133
}
134
if (room == room_cc_1f)
135
{
136
    pacetype = 9;
137
    chasetype = 4;
138
    moveradius = 160;
139
    sprite_index = spr_daimond_knight_idle;
140
    myencounter = 28;
141
    touchsprite = spr_daimond_knight_idle;
142
    touchflag = 507;
143
    if (global.flag[507 fought_rudinn_ranger] == 1)
144
        alertcon = -1;
145
}
146
if (room == room_cc_3f)
147
{
148
    eraser = 1;
149
    ignoresolid = 1;
150
    chasetype = 4;
151
    pacetype = 9;
152
    radius = 165;
153
    moveradius = 160;
154
    if (x >= (room_width / 2))
155
        moveradius = -160;
156
    sprite_index = spr_hathyx_overworld;
157
    myencounter = 30;
158
    touchsprite = spr_hathyx_overworld;
159
    offscreen_frozen = 0;
160
    touchflag = 508;
161
    if (global.flag[508 fought_hathyx] == 1)
162
        alertcon = -1;
163
}