Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_singlescreen_shadowguy_laser_machine_Draw_0

(view raw script w/o annotations or w/e)
1
var shakeamt = 0;
2
if (drawshake == 4)
3
    shakeamt = 4;
4
if (drawshake == 3)
5
    shakeamt = -4;
6
if (drawshake == 2)
7
    shakeamt = 2;
8
if (drawshake == 1)
9
    shakeamt = -2;
10
drawshake--;
11
draw_set_alpha(0.5);
12
draw_set_color(c_black);
13
draw_sprite_ext(spr_susiezilla_shadow, 0, x + (shake * polarity), y, 4, 1, 0, image_blend, (0.25 * abs(fakeheight / 28)) + 0.25);
14
draw_set_color(c_white);
15
draw_set_alpha(1);
16
draw_sprite_ext(sprite_index, image_index, round(x) + shakeamt + (shake * polarity), round(y) + fakeheight + ropeheight, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
17
if (flash)
18
{
19
    d3d_set_fog(true, c_yellow, 0, 1);
20
    draw_sprite_ext(sprite_index, image_index, round(x) + shakeamt + (shake * polarity), round(y) + fakeheight + ropeheight, image_xscale, image_yscale, image_angle, image_blend, flash / 10);
21
    d3d_set_fog(false, c_white, 0, 0);
22
}
23
flash = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(flash, 0, 1);
24
draw_set_color(c_white);
25
draw_set_alpha(1);
26
if (state == states.charge)
27
{
28
    draw_set_halign(fa_center);
29
    draw_set_valign(fa_middle);
30
    draw_set_font(fnt_comicsans);
31
    draw_set_color(c_maroon);
32
    draw_text_transformed(x, (y - 200) + (offset_index[hurt_index] * 7), string_format((state_timer / max_charge) * 100, 3, 1) + "%", 3, 3, ra);
33
    draw_set_color(c_red);
34
    draw_text_transformed(x + 2 + rxo, (y - 200) + 2 + ryo + (offset_index[hurt_index] * 7), string_format((state_timer / max_charge) * 100, 3, 1) + "%", 3, 3, ra);
35
    draw_set_halign(fa_left);
36
    draw_set_valign(fa_top);
37
    draw_set_color(c_white);
38
}
39
if (state == states.fire)
40
    draw_sprite_ext(spr_susiezilla_laser_source, global.time, x + 116, (y - 44) + (laser_offset * 2), image_xscale, laser_wobble, 0, c_white, 1);
41
draw_sprite_ext(spr_susiezilla_censor_bar, hurt_index, round(x) + shakeamt + (!irandom(10) ? choose(-1, 1) : 0) + (shake * polarity), round(y) + fakeheight + ropeheight + (!irandom(10) ? choose(-1, 1) : 0), image_xscale, image_yscale, image_angle, image_blend, image_alpha);