Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_singlescreen_karatenna_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
var bobbl = 0;
11
if (state != states.dead)
12
    bobbl = sin(bobble * 0.1) * 3;
13
if (state == states.dead && hitstop < 0 && !gameover)
14
{
15
    speed *= 0.925;
16
    if ((abs(speed) < 6 || y > (cameray() + 420)) && state_timer < 9999)
17
    {
18
        sprite_index = s_hurt;
19
        image_index = 0;
20
        image_speed = 0;
21
        
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("ropeheight", ropeheight, ropeheight + 32, 8, 1, "out");
22
        
scr_script_delayed
scr_script_delayed

function
scr_script_delayed()
{ var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; }
(scr_lerpvar, 8, "ropeheight", ropeheight + 32, -720, 24, 1, "in");
23
        
scr_script_delayed
scr_script_delayed

function
scr_script_delayed()
{ var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; }
(instance_destroy, 60);
24
        state_timer = 9999;
25
    }
26
}
27
drawshake--;
28
draw_set_alpha(0.5);
29
draw_set_color(c_black);
30
if (fakeheight < -3)
31
    draw_sprite_ext(spr_susiezilla_shadow, 0, x, y, min(0.25 + abs(fakeheight / 40), 1), 1, 0, image_blend, (0.25 * abs(fakeheight / 28)) + 0.25);
32
draw_set_color(c_white);
33
draw_set_alpha(1);
34
draw_set_color(#5F3417);
35
if (ropeheight != -1)
36
    draw_line_width(x, 0, x, ((y + ropeheight) - 48) + bobbl, 4);
37
if (facing == 1)
38
    draw_sprite_ext(sprite_index, image_index, round(x) + shakeamt, round(y) + fakeheight + ropeheight + bobbl, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
39
else
40
    draw_sprite_ext(sprite_index, image_index, (round(x) - 6) + shakeamt, round(y) + fakeheight + ropeheight + bobbl, -image_xscale, image_yscale, image_angle, image_blend, image_alpha);
41
if (flash)
42
{
43
    d3d_set_fog(true, c_white, 0, 0);
44
    if (facing == 1)
45
        draw_sprite_ext(sprite_index, image_index, round(x) + shakeamt, round(y) + fakeheight + ropeheight + bobbl, image_xscale, image_yscale, image_angle, image_blend, flash / 10);
46
    else
47
        draw_sprite_ext(sprite_index, image_index, (round(x) - 6) + shakeamt, round(y) + fakeheight + ropeheight + bobbl, -image_xscale, image_yscale, image_angle, image_blend, flash / 10);
48
    d3d_set_fog(false, c_white, 0, 0);
49
}
50
draw_set_color(c_white);
51
draw_set_alpha(1);