Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gerson_swing_down_Draw_0

(view raw script w/o annotations or w/e)
1
draw_self();
2
if (eye_con == 1)
3
{
4
    if (eye_index == 0)
5
    {
6
        afterimage = instance_create(x, y, obj_afterimage_gerson);
7
        afterimage.sprite_index = sprite_index;
8
        afterimage.image_index = image_index;
9
        afterimage.image_blend = image_blend;
10
        afterimage.image_speed = 0;
11
        afterimage.depth = depth;
12
        afterimage.image_xscale = image_xscale;
13
        afterimage.image_yscale = image_yscale;
14
        afterimage.image_angle = image_angle;
15
        afterimage.parentid = id;
16
        afterimage.vspeed = 2.5;
17
        afterimage.image_alpha = 0.6;
18
        afterimage = instance_create(x, y, obj_afterimage_gerson);
19
        afterimage.sprite_index = sprite_index;
20
        afterimage.image_index = image_index;
21
        afterimage.image_blend = image_blend;
22
        afterimage.image_speed = 0;
23
        afterimage.depth = depth;
24
        afterimage.image_xscale = image_xscale;
25
        afterimage.image_yscale = image_yscale;
26
        afterimage.image_angle = image_angle;
27
        afterimage.parentid = id;
28
        afterimage.vspeed = -2.5;
29
        afterimage.image_alpha = 0.6;
30
        afterimage = instance_create(x, y, obj_afterimage_gerson);
31
        afterimage.sprite_index = sprite_index;
32
        afterimage.image_index = image_index;
33
        afterimage.image_blend = image_blend;
34
        afterimage.image_speed = 0;
35
        afterimage.depth = depth;
36
        afterimage.image_xscale = image_xscale;
37
        afterimage.image_yscale = image_yscale;
38
        afterimage.image_angle = image_angle;
39
        afterimage.parentid = id;
40
        afterimage.hspeed = 2.5;
41
        afterimage.image_alpha = 0.6;
42
        afterimage = instance_create(x, y, obj_afterimage_gerson);
43
        afterimage.sprite_index = sprite_index;
44
        afterimage.image_index = image_index;
45
        afterimage.image_blend = image_blend;
46
        afterimage.image_speed = 0;
47
        afterimage.depth = depth;
48
        afterimage.image_xscale = image_xscale;
49
        afterimage.image_yscale = image_yscale;
50
        afterimage.image_angle = image_angle;
51
        afterimage.parentid = id;
52
        afterimage.hspeed = -2.5;
53
        afterimage.image_alpha = 0.6;
54
        snd_stop(snd_eye_telegraph);
55
        snd_play_pitch(snd_eye_telegraph, 1);
56
        if (obj_hammer_of_justice_enemy.swingdown_multitelegraph != 0)
57
        {
58
            if (obj_hammer_of_justice_enemy.swingdown_multitelegraph == 1)
59
            {
60
                inst = instance_create((obj_growtangle.x - 75) + 5, obj_growtangle.y - 13, obj_gerson_growtangle_telegraph);
61
                inst.image_xscale = 51;
62
                inst.image_yscale = 72;
63
                if (i_ex(obj_heart))
64
                    inst.depth = obj_heart.depth + 1;
65
                inst = instance_create(obj_growtangle.x - 18, (obj_growtangle.y - 75) + 5, obj_gerson_growtangle_telegraph);
66
                inst.image_xscale = 72;
67
                inst.image_yscale = 142;
68
                if (i_ex(obj_heart))
69
                    inst.depth = obj_heart.depth + 1;
70
            }
71
            if (obj_hammer_of_justice_enemy.swingdown_multitelegraph == 2)
72
            {
73
                inst = instance_create((obj_growtangle.x - 75) + 5, (obj_growtangle.y - 75) + 5, obj_gerson_growtangle_telegraph);
74
                inst.image_xscale = 142;
75
                inst.image_yscale = 72;
76
                if (i_ex(obj_heart))
77
                    inst.depth = obj_heart.depth + 1;
78
                inst = instance_create((obj_growtangle.x - 75) + 5, obj_growtangle.y + 3, obj_gerson_growtangle_telegraph);
79
                inst.image_xscale = 90;
80
                inst.image_yscale = 69;
81
                if (i_ex(obj_heart))
82
                    inst.depth = obj_heart.depth + 1;
83
            }
84
            if (obj_hammer_of_justice_enemy.swingdown_multitelegraph == 3)
85
            {
86
                inst = instance_create((obj_growtangle.x - 75) + 5, (obj_growtangle.y - 75) + 5, obj_gerson_growtangle_telegraph);
87
                inst.image_xscale = 142;
88
                inst.image_yscale = 142;
89
                if (i_ex(obj_heart))
90
                    inst.depth = obj_heart.depth + 1;
91
            }
92
            obj_hammer_of_justice_enemy.swingdown_multitelegraph = -1;
93
        }
94
        else if (swingdowntype == 10)
95
        {
96
            var ylocation = y + 16;
97
            if (ylocation < (obj_growtangle.y - 70))
98
                ylocation = obj_growtangle.y - 70;
99
            if (ylocation > obj_growtangle.y)
100
                ylocation = obj_growtangle.y;
101
            inst = instance_create((obj_growtangle.x - 75) + 5, ylocation, obj_gerson_growtangle_telegraph);
102
            inst.image_xscale = 142;
103
            inst.image_yscale = 72;
104
            if (i_ex(obj_heart))
105
                inst.depth = obj_heart.depth + 1;
106
        }
107
        else if (swingdowntype == 11)
108
        {
109
            var ylocation = obj_growtangle.y;
110
            inst = instance_create((obj_growtangle.x - 75) + 5, ylocation, obj_gerson_growtangle_telegraph);
111
            inst.image_xscale = 142;
112
            inst.image_yscale = 72;
113
            if (i_ex(obj_heart))
114
                inst.depth = obj_heart.depth + 1;
115
        }
116
        else if (swingdowntype == 12)
117
        {
118
            var ylocation = obj_growtangle.y - 70;
119
            inst = instance_create((obj_growtangle.x - 75) + 5, ylocation, obj_gerson_growtangle_telegraph);
120
            inst.image_xscale = 142;
121
            inst.image_yscale = 72;
122
            if (i_ex(obj_heart))
123
                inst.depth = obj_heart.depth + 1;
124
        }
125
        else if (swingdowntype == 13)
126
        {
127
            var ylocation = obj_growtangle.y - 13;
128
            inst = instance_create((obj_growtangle.x - 75) + 5, ylocation, obj_gerson_growtangle_telegraph);
129
            inst.image_xscale = 142;
130
            inst.image_yscale = 72;
131
            if (i_ex(obj_heart))
132
                inst.depth = obj_heart.depth + 1;
133
        }
134
        else if (swingdowntype == 14)
135
        {
136
            var ylocation = (obj_growtangle.y - 70) + 13;
137
            inst = instance_create((obj_growtangle.x - 75) + 5, ylocation, obj_gerson_growtangle_telegraph);
138
            inst.image_xscale = 142;
139
            inst.image_yscale = 72;
140
            if (i_ex(obj_heart))
141
                inst.depth = obj_heart.depth + 1;
142
        }
143
        else if (swingdowntype == 15)
144
        {
145
            var ylocation = obj_growtangle.y - 13;
146
            inst = instance_create((obj_growtangle.x - 75) + 5, ylocation, obj_gerson_growtangle_telegraph);
147
            inst.image_xscale = 142;
148
            inst.image_yscale = 72;
149
            if (i_ex(obj_heart))
150
                inst.depth = obj_heart.depth + 1;
151
        }
152
        else if (swingdowntype == 16)
153
        {
154
            var ylocation = (obj_growtangle.y - 70) + 13;
155
            inst = instance_create((obj_growtangle.x - 75) + 5, ylocation, obj_gerson_growtangle_telegraph);
156
            inst.image_xscale = 142;
157
            inst.image_yscale = 72;
158
            if (i_ex(obj_heart))
159
                inst.depth = obj_heart.depth + 1;
160
        }
161
        else if (swingdowntype == 17)
162
        {
163
            inst = instance_create(obj_growtangle.x - 53, (obj_growtangle.y - 75) + 5, obj_gerson_growtangle_telegraph);
164
            inst.image_xscale = 70;
165
            inst.image_yscale = 142;
166
            if (i_ex(obj_heart))
167
                inst.depth = obj_heart.depth + 1;
168
        }
169
        else if (swingdowntype == 18)
170
        {
171
            inst = instance_create(obj_growtangle.x - 18, (obj_growtangle.y - 75) + 5, obj_gerson_growtangle_telegraph);
172
            inst.image_xscale = 72;
173
            inst.image_yscale = 142;
174
            if (i_ex(obj_heart))
175
                inst.depth = obj_heart.depth + 1;
176
        }
177
        else if (swingdowntype == 19)
178
        {
179
            var xlocation;
180
            if (image_xscale < 0)
181
                xlocation = x + 52;
182
            else
183
                xlocation = x + 18;
184
            if (xlocation < (obj_growtangle.x - 70))
185
                xlocation = obj_growtangle.x - 70;
186
            if (xlocation > obj_growtangle.x)
187
                xlocation = obj_growtangle.x;
188
            inst = instance_create(xlocation, (obj_growtangle.y - 75) + 5, obj_gerson_growtangle_telegraph);
189
            inst.image_xscale = 72;
190
            inst.image_yscale = 142;
191
            if (i_ex(obj_heart))
192
                inst.depth = obj_heart.depth + 1;
193
        }
194
        else if (swingdowntype == -3)
195
        {
196
        }
197
        else if (x == (camerax() + 344))
198
        {
199
            inst = instance_create((obj_growtangle.x - 75) + 5, (obj_growtangle.y - 75) + 5, obj_gerson_growtangle_telegraph);
200
            inst.image_xscale = 88;
201
            inst.image_yscale = 142;
202
            if (i_ex(obj_heart))
203
                inst.depth = obj_heart.depth + 1;
204
        }
205
        else if (x == (camerax() + 268 + 62))
206
        {
207
            inst = instance_create((obj_growtangle.x - 75) + 5, (obj_growtangle.y - 75) + 5, obj_gerson_growtangle_telegraph);
208
            inst.image_xscale = 70;
209
            inst.image_yscale = 142;
210
            if (i_ex(obj_heart))
211
                inst.depth = obj_heart.depth + 1;
212
        }
213
        else if (x == (camerax() + 302))
214
        {
215
            inst = instance_create(obj_growtangle.x - 18, (obj_growtangle.y - 75) + 5, obj_gerson_growtangle_telegraph);
216
            inst.image_xscale = 90;
217
            inst.image_yscale = 142;
218
            if (i_ex(obj_heart))
219
                inst.depth = obj_heart.depth + 1;
220
        }
221
        else if (x == ((camerax() + 378) - 62))
222
        {
223
            inst = instance_create(obj_growtangle.x, (obj_growtangle.y - 75) + 5, obj_gerson_growtangle_telegraph);
224
            inst.image_xscale = 72;
225
            inst.image_yscale = 142;
226
            if (i_ex(obj_heart))
227
                inst.depth = obj_heart.depth + 1;
228
        }
229
        else
230
        {
231
            var xlocation;
232
            if (obj_growtangle.maxxscale == 2)
233
            {
234
                if (image_xscale < 0)
235
                    xlocation = x - 90;
236
                else
237
                    xlocation = x + 18;
238
            }
239
            else
240
            {
241
                if (image_xscale < 0)
242
                    xlocation = x + 52;
243
                else
244
                    xlocation = x + 18;
245
                if (xlocation < (obj_growtangle.x - 70))
246
                    xlocation = obj_growtangle.x - 70;
247
                if (xlocation > obj_growtangle.x)
248
                    xlocation = obj_growtangle.x;
249
            }
250
            inst = instance_create(xlocation, (obj_growtangle.y - 75) + 5, obj_gerson_growtangle_telegraph);
251
            inst.image_xscale = 72;
252
            inst.image_yscale = 142;
253
            if (i_ex(obj_heart))
254
                inst.depth = obj_heart.depth + 1;
255
        }
256
        if (special != 0)
257
            inst.special = special;
258
    }
259
    if (alphacon == 0)
260
    {
261
        alpha += 0.2;
262
        if (alpha == 1.2)
263
            alphacon = 1;
264
    }
265
    else
266
    {
267
        alpha -= 0.2;
268
    }
269
    d3d_set_fog(true, c_white, 0, 1);
270
    draw_sprite_ext(sprite_index, image_index, x, y, image_xscale, image_yscale, image_angle, image_blend, alpha);
271
    d3d_set_fog(false, c_black, 0, 0);
272
    eye_index += 0.4;
273
    if (swingdowntype == 1)
274
        eye_index += 0.6;
275
    if (eye_index >= 5)
276
        eye_con = 0;
277
}