Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_hammer_of_justice_enemy_Draw_0

(view raw script w/o annotations or w/e)
1
if (state == 0 && endcon < 5)
2
    movesiner += (1/3);
3
if (state != 13)
4
    x = xstart + (sin(movesiner / 5) * 10);
5
if (rudebusterflashcon == 1)
6
{
7
    rudebusterflashtimer++;
8
    if (rudebusterflashtimer > 4 && sin(rudebusterflashtimer / 3) < 0)
9
    {
10
        rudebusterflashtimer = 0;
11
        rudebusterflashcon = 0;
12
    }
13
}
14
if (state == 0 || state == 3)
15
{
16
    var hair_x = 0;
17
    var hair_y = 0;
18
    var _index = siner % 14;
19
    if (_index < 1)
20
    {
21
        hair_x = 18;
22
        hair_y = 5;
23
    }
24
    else if (_index < 2)
25
    {
26
        hair_x = 18;
27
        hair_y = 4;
28
    }
29
    else if (_index < 3)
30
    {
31
        hair_x = 18;
32
        hair_y = 3;
33
    }
34
    else if (_index < 4)
35
    {
36
        hair_x = 18;
37
        hair_y = 4;
38
    }
39
    else if (_index < 5)
40
    {
41
        hair_x = 18;
42
        hair_y = 5;
43
    }
44
    else if (_index < 6)
45
    {
46
        hair_x = 18;
47
        hair_y = 6;
48
    }
49
    else if (_index < 7)
50
    {
51
        hair_x = 18;
52
        hair_y = 7;
53
    }
54
    else if (_index < 8)
55
    {
56
        hair_x = 18;
57
        hair_y = 5;
58
    }
59
    else if (_index < 9)
60
    {
61
        hair_x = 18;
62
        hair_y = 4;
63
    }
64
    else if (_index < 10)
65
    {
66
        hair_x = 18;
67
        hair_y = 3;
68
    }
69
    else if (_index < 11)
70
    {
71
        hair_x = 18;
72
        hair_y = 3;
73
    }
74
    else if (_index < 12)
75
    {
76
        hair_x = 18;
77
        hair_y = 4;
78
    }
79
    else if (_index < 13)
80
    {
81
        hair_x = 18;
82
        hair_y = 6;
83
    }
84
    else if (_index < 14)
85
    {
86
        hair_x = 18;
87
        hair_y = 7;
88
    }
89
    else if (_index < 15)
90
    {
91
        hair_x = 18;
92
        hair_y = 5;
93
    }
94
    draw_sprite_ext(spr_gerson_hair, hairindex, x + ((0 + hair_x) * 2), y + ((0 + hair_y) * 2), 2, 2, image_angle, image_blend, image_alpha);
95
    if (flash == 1)
96
        draw_sprite_ext_flash(spr_gerson_hair, hairindex, x + ((0 + hair_x) * 2), y + ((0 + hair_y) * 2), 2, 2, image_angle, image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
97
    if (state == 0)
98
        hairindex += 0.2;
99
    else
100
        hairindex += 0.1;
101
    d3d_set_fog(true, c_white, 0, 1);
102
    draw_sprite_ext(spr_gerson_hair, hairindex, x + ((0 + hair_x) * 2), y + ((0 + hair_y) * 2), 2, 2, image_angle, image_blend, sin(rudebusterflashtimer / 3));
103
    d3d_set_fog(false, c_black, 0, 0);
104
}
105
scr_enemy_drawhurt_generic
scr_enemy_drawhurt_generic

function
scr_enemy_drawhurt_generic()
{ if (state == 3 && hurttimer >= 0) draw_sprite_ext(hurtsprite, 0, x + shakex + hurtspriteoffx, y + hurtspriteoffy, 2, 2, 0, image_blend, 1); }
();
106
if (endcon > 4)
107
{
108
    siner += (1/3);
109
    if (siner > 3)
110
        siner = 3;
111
    if (endcon == 5 && endtimer >= 25)
112
    {
113
        if (nohairsprite == true)
114
        {
115
            endshaketimer++;
116
            if (endshaketimer == 1)
117
                x += 7;
118
            if (endshaketimer == 2)
119
                x -= 6;
120
            if (endshaketimer == 3)
121
                x += 5;
122
            if (endshaketimer == 4)
123
                x -= 4;
124
            if (endshaketimer == 5)
125
                x += 3;
126
            if (endshaketimer == 6)
127
                x -= 2;
128
            if (endshaketimer == 7)
129
                x += 1;
130
            draw_monster_body_part(spr_gerson_headtilt_nohair, siner, x, y);
131
        }
132
        else
133
        {
134
            draw_monster_body_part(spr_gerson_headtilt, siner, x, y);
135
        }
136
    }
137
    else
138
    {
139
        draw_monster_body_part(thissprite, siner, x, y);
140
    }
141
}
142
else if (state == 0)
143
{
144
    fsiner += 1;
145
    siner += (1/3);
146
    if (siner > 14)
147
        siner -= 14;
148
    thissprite = idlesprite;
149
    if (global.mercymod[myself] >= global.mercymax[myself])
150
        thissprite = sparedsprite;
151
    draw_monster_body_part(thissprite, siner, x, y);
152
}
153
if (state == 0 || state == 3)
154
{
155
    d3d_set_fog(true, c_white, 0, 1);
156
    draw_sprite_ext(hurtsprite, 0, x + shakex + hurtspriteoffx, y + hurtspriteoffy, image_xscale, image_yscale, image_angle, image_blend, sin(rudebusterflashtimer / 3));
157
    d3d_set_fog(false, c_black, 0, 0);
158
}
159
if (goldcon == 1 && global.turntimer >= 1)
160
{
161
    d3d_set_fog(true, c_yellow, 0, 1);
162
    if (goldalpha < 0.3)
163
        goldalpha += 0.01;
164
    image_alpha = goldalpha;
165
    
scr_enemy_drawidle_generic
scr_enemy_drawidle_generic

function
scr_enemy_drawidle_generic(arg0)
{ if (state == 0) { fsiner += 1; siner += arg0; thissprite = idlesprite; if (global.mercymod[myself] >= global.mercymax[myself]) thissprite = sparedsprite; draw_monster_body_part(thissprite, siner, x, y); } }
(0.16666666666666666);
166
    image_alpha = 1;
167
    d3d_set_fog(false, c_black, 0, 0);
168
}
169
if (goldcon == 1 && global.turntimer < 1)
170
{
171
    d3d_set_fog(true, c_yellow, 0, 1);
172
    if (goldalpha > 0)
173
        goldalpha -= 0.01;
174
    image_alpha = goldalpha;
175
    
scr_enemy_drawidle_generic
scr_enemy_drawidle_generic

function
scr_enemy_drawidle_generic(arg0)
{ if (state == 0) { fsiner += 1; siner += arg0; thissprite = idlesprite; if (global.mercymod[myself] >= global.mercymax[myself]) thissprite = sparedsprite; draw_monster_body_part(thissprite, siner, x, y); } }
(0.16666666666666666);
176
    image_alpha = 1;
177
    d3d_set_fog(false, c_black, 0, 0);
178
}
179
if (state == 10)
180
{
181
    image_speed = 0;
182
    image_index += 0.5;
183
    draw_self();
184
    if (image_index >= 3)
185
    {
186
        state = 11;
187
        swingtimer = 0;
188
        
scr_shakeobj
scr_shakeobj

function
scr_shakeobj()
{ var _shakeobj = instance_create(x, y, obj_shakeobj); _shakeobj.target = id; if (argument_count >= 1) { if (i_ex(argument0)) _shakeobj.target = argument0; } if (argument_count >= 2) { if (argument1 != -1) _shakeobj.shakeamt = argument1; } if (argument_count >= 3) { if (argument2 != -1) _shakeobj.shakereduct = argument2; } with (_shakeobj) event_user(0); }
();
189
        instance_create(x, y, obj_shake);
190
        with (obj_rudebuster_bolt)
191
            instance_destroy();
192
        snd_play(snd_criticalswing);
193
        with (obj_afterimage)
194
            instance_destroy();
195
        inst = instance_create((x - 70) + 10, (y - 15) + 20, obj_animation);
196
        inst.sprite_index = spr_susie_gerson_hitbback_fx_2;
197
        inst.image_speed = 1;
198
        inst.image_angle = 40;
199
        inst.image_xscale = 3;
200
        inst.image_yscale = 3;
201
        inst = instance_create((x - 46) + 10, (y - 12) + 20, obj_animation);
202
        inst.sprite_index = spr_gerson_hit_fx3;
203
        inst.image_index = 1;
204
        inst.image_speed = 0.5;
205
        inst.image_angle = 14;
206
        inst.image_xscale = 2;
207
        inst.image_yscale = 2;
208
    }
209
}
210
if (state == 11)
211
{
212
    swingtimer++;
213
    if (swingtimer < 12)
214
    {
215
        var scale = sin((swingtimer + 1) / 0.68) * 0.2;
216
        draw_sprite_ext(spr_gerson_rude_orb1, 0, (x - 48) + 10, (y - 15) + 20, 0.6 + scale, 1 - (scale * 0.5), 22, c_white, image_alpha);
217
    }
218
    if (swingtimer == 3)
219
        x -= 2;
220
    if (swingtimer == 4)
221
        x += 2;
222
    if (swingtimer == 5)
223
        x -= 2;
224
    if (swingtimer == 6)
225
        x += 2;
226
    if (swingtimer == 7)
227
        x -= 2;
228
    if (swingtimer == 8)
229
        x += 2;
230
    if (swingtimer == 9)
231
        x -= 2;
232
    if (swingtimer == 10)
233
        x += 2;
234
    draw_self();
235
    if (swingtimer == 11)
236
        image_index = 10;
237
    if (swingtimer == 12)
238
    {
239
        blast = instance_create(x - 40, y + 20, obj_gerson_rudebuster);
240
        blast.battlemode = 0;
241
        blast.target = 1280;
242
        blast.image_alpha = 1;
243
        snd_play(snd_rudebuster_swing);
244
        obj_hammer_of_justice_enemy.rudebusterhitcount++;
245
        instance_create(x, y, obj_shake);
246
        inst = instance_create(x - 40, y + 20, obj_animation);
247
        inst.sprite_index = spr_susie_gerson_hitbback_fx_2;
248
        inst.image_speed = 1;
249
        inst.image_angle = 0;
250
        inst.image_xscale = 3;
251
        inst.image_yscale = 3;
252
        inst = instance_create(x - 40, y + 20, obj_animation);
253
        inst.sprite_index = spr_susie_gerson_hitbback_fx_2;
254
        inst.image_speed = 1;
255
        inst.image_angle = 30;
256
        inst.image_xscale = 3;
257
        inst.image_yscale = 3;
258
    }
259
    if (swingtimer >= 0)
260
    {
261
        if (image_index < 13)
262
        {
263
            image_index += 0.5;
264
            if (image_index >= 11 && swingtimer < 11)
265
                image_index = 4;
266
        }
267
        if (swingtimer == 25)
268
        {
269
            state = 0;
270
            swingtimer = 0;
271
            image_speed = 0.16666666666666666;
272
            sprite_index = spr_gerson_idle;
273
        }
274
    }
275
}
276
if (state == 12)
277
{
278
    if (i_ex(obj_growtangle))
279
        depth = obj_growtangle.depth;
280
    image_index += 0.23333333333333334;
281
    draw_self();
282
    laughtimer++;
283
    if (laughtimer == 1)
284
        snd_play(snd_gerlaugh);
285
    if (laughtimer == 62)
286
    {
287
        laughtimer = 0;
288
        state = 0;
289
        if (attackpattern == 19)
290
            global.turntimer = 2;
291
    }
292
}
293
if (state == 13)
294
{
295
    draw_self();
296
    dodgetimer++;
297
    if (dodgetimer == 2)
298
    {
299
        attack = instance_create((global.monsterx[global.chartarget[myself]] + random(6)) - 20, global.monstery[global.chartarget[myself]] + random(6), obj_basicattack);
300
        attack.sprite_index = spr_attack_mash2;
301
        attack.image_speed = 0.5;
302
        attack.maxindex = 4;
303
        progress += 4;
304
        
scr_tensionheal
scr_tensionheal

function
scr_tensionheal(arg0)
{ if (i_ex(obj_jackenstein_enemy) && global.tempflag[89] >= 3) global.tension += ceil(arg0 * 1.5); else global.tension += arg0; if (global.tension > global.maxtension) global.tension = global.maxtension; }
(60);
305
        snd_stop(motor_swing_down);
306
        image_alpha = 0;
307
        if (global.justice_attacked_twice < 2)
308
            global.justice_attacked_twice++;
309
        snd_play(snd_mercyadd);
310
        var xx = x + 88;
311
        var yy = y - 88;
312
        star = instance_create(xx - 20, yy - 10, obj_gerson_progress_star);
313
        star = instance_create(xx, yy, obj_gerson_progress_star);
314
        star.delay = 2;
315
        star = instance_create(xx + 18, yy + 18, obj_gerson_progress_star);
316
        star.delay = 4;
317
        star = instance_create(xx + 36, yy + 36, obj_gerson_progress_star);
318
        star.delay = 6;
319
    }
320
    if (dodgetimer == 3)
321
    {
322
        image_speed = 0.16666666666666666;
323
        image_alpha = 1;
324
        sprite_index = spr_gerson_dodge;
325
        image_xscale = 2;
326
        image_yscale = 2;
327
        x -= 40;
328
        y -= 30;
329
        speed = 16;
330
        friction = 4;
331
    }
332
    if (dodgetimer == 38)
333
    {
334
        dodgetimer = 0;
335
        state = 0;
336
        sprite_index = spr_gerson_idle;
337
        x -= 80;
338
    }
339
}
340
if (state == 14)
341
{
342
    spintimer++;
343
    if (spintimer < 10)
344
    {
345
        spinindex += (2/3);
346
        draw_sprite_ext(spr_gerson_spin_smear, spinindex, x + 55, y + 68, 2, image_yscale, image_angle, image_blend, image_alpha);
347
    }
348
    if (spintimer == 10)
349
    {
350
        spinindex = 0;
351
        snd_play(snd_mercyadd);
352
    }
353
    if (spintimer >= 10)
354
    {
355
        if (spinindex < 11)
356
            spinindex += 0.5;
357
        if (spinindex >= 11)
358
            spinindex += 0.25;
359
        if (spinindex > 13)
360
            spinindex = 13;
361
        draw_sprite_ext(spr_gerson_spin, spinindex, x + 48, y + 72, 2, image_yscale, image_angle, image_blend, image_alpha);
362
        if (saverudebusterstarcount > 0 && spintimer > 20 && (spintimer % 2) == 0)
363
        {
364
            saverudebusterstarcount--;
365
            progress++;
366
            instance_create(x + 10 + irandom(80), (y - 60) + irandom(40), obj_gerson_progress_star);
367
        }
368
    }
369
    if (spintimer == 50)
370
    {
371
        spintimer = 0;
372
        state = 0;
373
    }
374
}
375
if (becomeflash == 0)
376
    flash = 0;
377
becomeflash = 0;
378
draw_set_color(c_white);
379
draw_set_halign(fa_right);
380
draw_set_halign(fa_left);