Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_orangeheart_Draw_0

related scripts: CleanUp_0Create_0Destroy_0Draw_0 Step_0Step_2

(view raw script w/o annotations or w/e)
1
siner++;
2
var camspeed = 0;
3
with (obj_debug_orangeheartcontroller)
4
    camspeed = min((fakecamxspeedbase * 0.25) + (fakecamxspeedadditional * 2), 0);
5
if (!hitstop)
6
{
7
    for (var a = 9; a > 0; a--)
8
        prev_coord[a] = [prev_coord[a - 1][0] + camspeed, prev_coord[a - 1][1]];
9
    prev_coord[0] = [x + camspeed, y - height];
10
}
11
if (height_val != -3.141592653589793)
12
{
13
    height_val = 
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; }
(height_val, pi, pi / height_frames);
14
    if (height_val == pi)
15
    {
16
        height_val = -3.141592653589793;
17
        height_frames += floor((37 - height_frames) * 0.5);
18
        with (obj_debug_orangeheartcontroller)
19
            fakecamxspeedadditional = 0;
20
        chargecon = 3;
21
        snd_play(snd_splash, 0.5);
22
        repeat (5 + irandom(5))
23
        {
24
            with (instance_create_depth(x + 20 + random_range(-48, 0), y + 20 + random_range(-12, 12), depth - 1, obj_particle_generic))
25
            {
26
                sprite_index = spr_bellsparkle;
27
                image_blend = merge_color(c_aqua, c_blue, 0.5);
28
                direction = 45 + random_range(-20, 20);
29
                speed = 16 + random(12);
30
                gravity_direction = 270;
31
                gravity = 0.5 + random(0.5);
32
                acceleration_type = 1;
33
                shrink_rate = 0.05 + random(0.05);
34
                acceleration_rate = 0.9 - random(0.1);
35
                orangeheartControlled = true;
36
            }
37
        }
38
        for (var a = 0; a < 2; a++)
39
        {
40
            with (instance_create(x + 20, y + 20, obj_marker))
41
            {
42
                orangeheartControlled = true;
43
                sprite_index = spr_rouxls_ripple;
44
                image_index = 0;
45
                image_speed = 0;
46
                image_blend = merge_color(c_aqua, c_blue, 0.5);
47
                image_xscale = 0;
48
                image_yscale = 0;
49
                image_speed = 0;
50
                
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; 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_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("image_xscale", 0, 2 + (a * 2), 16);
51
                
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; 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_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("image_yscale", 0, 2 + (a * 2), 16);
52
                
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; 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_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("image_alpha", 1, 0, 16);
53
                
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ var _doom = instance_create_depth(0, 0, 0, obj_doom); with (_doom) { alarm[0] = arg1; target = arg0; } return _doom; }
(id, 16);
54
            }
55
        }
56
    }
57
}
58
height = sin(height_val) * 105;
59
if (height > 0)
60
    draw_sprite_ext(spr_seth_shadow, 0, x + 10, y + 10, 3 - (sin(height_val) * 1), 1.5 - (sin(height_val) * 0.5), 0, #593320, 1);
61
if (drawafterimages)
62
{
63
    for (var a = 9; a >= 0; a--)
64
    {
65
        if (a > 0)
66
        {
67
            if (!(abs(prev_coord[a][0] - prev_coord[a - 1][0]) < 1))
68
                draw_sprite_ext(sprite_index, image_index, prev_coord[a][0], prev_coord[a][1], image_xscale, image_yscale, image_angle, image_blend, 0.55 - (a * 0.05));
69
        }
70
        else
71
        {
72
            draw_sprite_ext(sprite_index, image_index, prev_coord[a][0], prev_coord[a][1], image_xscale, image_yscale, image_angle, image_blend, 0.55 - (a * 0.05));
73
        }
74
    }
75
}
76
if (dashstate == 1 && chargetimer < 16)
77
{
78
    var z_charge = (chargetimer * 2) % 35;
79
    for (var i = 0; i < 4; i += 1)
80
    {
81
        var alf = (chargetimer / 10) - 0.2;
82
        var rotx = (i * 90) + (z_charge * 5);
83
        var xx = sin(degtorad(rotx)) * (35 - z_charge);
84
        var yy = cos(degtorad(rotx)) * (35 - z_charge);
85
        draw_sprite_ext(spr_yheart_charge, 0, (x + 9) - xx, (y + 10) - yy - height, 4 - ((z_charge * 2) / 35), 4 - ((z_charge * 2) / 35), 0, c_white, 0.25 + (alf * 0.75));
86
    }
87
}
88
if (shakeheart)
89
    shakeheart--;
90
var controller = -1;
91
with (obj_debug_orangeheartcontroller)
92
    controller = id;
93
var chs = choose(-1, 0, 1);
94
var chs2 = choose(-1, 0, 1);
95
if (height == 0)
96
    _angle = 0;
97
else
98
    _angle = 30 - (sin(height_val * 0.5) * 60);
99
var _angle = 0;
100
if (sprite_index == spr_orangeheart_white)
101
{
102
    draw_sprite_ext(spr_orangeheart_outline, 0, (x - 10) + (chs * sign(shakeheart)) + 10, ((y - 10) + (chs2 * sign(shakeheart)) + 10) - height, image_xscale, image_yscale, _angle, image_blend, image_alpha);
103
    if (chargecon != 5)
104
    {
105
        if (controller.fakecamxspeedadditional < 0)
106
            draw_sprite_part_ext(spr_orangeheart_outline, 1, 0, 0, min(20, abs(controller.fakecamxspeedadditional * 1.11)), 20, x, y - height, image_xscale, image_yscale, merge_color(c_yellow, c_orange, 0.5), 1);
107
        else if (controller.fakecamxspeedadditional > 0)
108
            draw_sprite_part_ext(spr_orangeheart_outline, 1, 0, 0, min(20, abs(chargetimer * 1.25)), 20, x, y - height, image_xscale, image_yscale, merge_color(c_yellow, c_orange, 0.5), 1);
109
    }
110
    else
111
    {
112
        draw_sprite_part_ext(spr_orangeheart_outline, 1, 0, 0, cos(height_val * 0.5) * 20, 20, x, y - height, image_xscale, image_yscale, merge_color(c_yellow, c_orange, 0.5), 1);
113
    }
114
}
115
if (!obj_debug_orangeheartcontroller.scrolling)
116
    draw_sprite_ext(sprite_index, image_index, x + (chs * sign(shakeheart)) + 10, (y + (chs2 * sign(shakeheart)) + 10) - height, image_xscale, image_yscale, _angle, image_blend, image_alpha);
117
else
118
    draw_sprite_ext(sprite_index, image_index, x + (chs * sign(shakeheart)), (y + (chs2 * sign(shakeheart))) - height, image_xscale, image_yscale, _angle, image_blend, image_alpha);
119
if (dashstate == 1 && chargetimer == 16)
120
{
121
    glowtimer += 0.5;
122
    draw_sprite_ext(spr_orangeheart_outline, 1, x, y - height, image_xscale, image_yscale, _angle, c_white, 0.5 + (sin(glowtimer) * 0.5));
123
}
124
if (dashstate == 2)
125
{
126
    if (chargecon != 5)
127
        draw_sprite_ext(spr_orangeheart_dash, global.time, x - 2, y - height, (image_xscale * 1.25) - (0.45 + (sin(global.time * 1.5) * 0.2)), image_yscale, _angle, image_blend, 0.45 + (sin(global.time * 1.5) * 0.2));
128
    gpu_set_fog(true, c_yellow, 0, 0);
129
    if (chargecon != 5)
130
        draw_sprite_ext(spr_orangeheart_dash, global.time, x - 2, y - height, (image_xscale * 1.25) - (0.225 + (sin(global.time * 1.5) * 0.1)), image_yscale, _angle, image_blend, 0.225 + (sin(global.time * 1.5) * 0.1));
131
    draw_sprite_ext(spr_orangeheart_white, 0, x, y - height, image_xscale, image_yscale, _angle, c_white, 0.45 + (sin(global.time * 1.5) * 0.2));
132
    gpu_set_fog(false, c_white, 0, 0);
133
}
134
if (chargetimer > 0)
135
{
136
}