Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_frozennpc_Draw_0

(view raw script w/o annotations or w/e)
1
if (fresh == 0)
2
{
3
    image_alpha = 1;
4
    if (skipsound == 0)
5
        snd_play(snd_petrify);
6
    if (global.flag[55 enemy_x] != 0 && global.flag[56 enemy_y] != 0)
7
        returntoxy = 1;
8
    fresh = 2;
9
}
10
if (fresh == 1)
11
{
12
    image_alpha = 0;
13
    
scr_lerpvar_instance
scr_lerpvar_instance

function
scr_lerpvar_instance()
{ __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; } function scr_lerp_var_instance() { if (argument_count >= 6) return
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7) return
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else return
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
} function scr_lerp_instance_var() { if (argument_count >= 6) return
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7) return
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else return
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
}
(id, "image_alpha", 0, 1, 2);
14
    timer = 1;
15
    fresh = 2;
16
    if (depth < 1000)
17
        
scr_depth_alt
scr_depth_alt

function
scr_depth_alt(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + ((sprite_height - sprite_yoffset) * 10) + (arg1 * 10)); }
();
18
    if (skipsolid == 0)
19
        mysolid = 
scr_create_hitbox_solid
scr_create_hitbox_solid

function
scr_create_hitbox_solid()
{ var _hitboxwidth = bbox_right - bbox_left; var _hitboxheight = bbox_bottom - bbox_top; ___createdsolid = instance_create(bbox_left, bbox_top, obj_soliddark); ___createdsolid.image_xscale = 0.025 * _hitboxwidth; ___createdsolid.image_yscale = 0.025 * _hitboxheight; return ___createdsolid; }
();
20
}
21
if (global.fighting == 0 && fresh == 2)
22
{
23
    fresh = 3;
24
    if (returntoxy == 1)
25
    {
26
        fresh = 5;
27
        remx = global.flag[55 enemy_x];
28
        remy = global.flag[56 enemy_y];
29
        if (global.chapter == 2)
30
        {
31
            if (sprite_index == spr_virovirokun_hurt && room == room_dw_city_big_1)
32
            {
33
                remx = 224;
34
                remy = 72;
35
            }
36
            if (sprite_index == spr_virovirokun_hurt && room == room_dw_city_roadblock)
37
            {
38
                remx = 1000;
39
                remy = 588;
40
            }
41
        }
42
        global.flag[55 enemy_x] = 0;
43
        global.flag[56 enemy_y] = 0;
44
        if (remx == 0)
45
            instance_destroy();
46
    }
47
}
48
if (fresh == 5)
49
{
50
    image_alpha -= 0.2;
51
    if (image_alpha < 0)
52
        fresh = 6;
53
}
54
if (fresh == 6)
55
{
56
    x = remx;
57
    y = remy;
58
    if (depth < 1000)
59
        
scr_depth_alt
scr_depth_alt

function
scr_depth_alt(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + ((sprite_height - sprite_yoffset) * 10) + (arg1 * 10)); }
();
60
    if (image_alpha < 1)
61
        image_alpha += 0.2;
62
}
63
draw_self();
64
if (timer < 1)
65
    timer += 0.05;
66
var t = (sprite_height / 2) - (timer * (sprite_height / 2));
67
d3d_set_fog(true, specialcolor, 0, 0);
68
yoffset = -(sprite_get_yoffset(sprite_index) * image_yscale);
69
xoffset = -(sprite_get_xoffset(sprite_index) * image_xscale);
70
draw_sprite_part_ext(sprite_index, image_index, 0, t, sprite_width, sprite_height - t, (x - 2) + xoffset, (y - 2) + (t * 2) + yoffset, image_xscale, image_yscale, c_blue, image_alpha * 0.8);
71
draw_sprite_part_ext(sprite_index, image_index, 0, t, sprite_width, sprite_height - t, x + 2 + xoffset, (y - 2) + (t * 2) + yoffset, image_xscale, image_yscale, c_blue, image_alpha * 0.4);
72
draw_sprite_part_ext(sprite_index, image_index, 0, t, sprite_width, sprite_height - t, (x - 2) + xoffset, y + 2 + (t * 2) + yoffset, image_xscale, image_yscale, c_blue, image_alpha * 0.4);
73
draw_sprite_part_ext(sprite_index, image_index, 0, t, sprite_width, sprite_height - t, x + 2 + xoffset, y + 2 + (t * 2) + yoffset, image_xscale, image_yscale, c_blue, image_alpha * 0.8);
74
d3d_set_fog(false, c_white, 0, 0);
75
draw_set_blend_mode(bm_add);
76
draw_sprite_part_ext(sprite_index, image_index, 0, t, sprite_width, sprite_height - t, x + xoffset, y + (t * 2) + yoffset, image_xscale, image_yscale, specialcolor, image_alpha * 0.4);
77
draw_set_blend_mode(bm_normal);
78
if (global.chapter == 2)
79
{
80
    if (room == room_dw_city_berdly)
81
    {
82
        timer++;
83
        if (timer > 60)
84
            image_alpha = lerp(image_alpha, 0, 0.1);
85
        if (image_alpha == 0)
86
            instance_destroy();
87
    }
88
}