Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_titan_heal_orb_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 2)
2
{
3
    gravity = 0;
4
}
5
else
6
{
7
    gravity_direction = point_direction(x, y, targetx, targety);
8
    gravity = 0.3;
9
}
10
timer++;
11
if (con == 0 && distance_to_point(targetx, targety) < 80)
12
    con = 1;
13
if (con == 2)
14
{
15
    var _lifeD = 10;
16
    var _t = 
scr_ease_out
scr_ease_out

function
scr_ease_out(arg0, arg1)
{ if (arg1 < -3 || arg1 > 7) return arg0; switch (arg1) { case -3: return ease_out_bounce(arg0, 0, 1, 1); case -2: return ease_out_elastic(arg0, 0, 1, 1); case -1: return ease_out_back(arg0, 0, 1, 1); case 0: return arg0; case 1: return sin(arg0 * 1.5707963267948966); case 2: return -arg0 * (arg0 - 2); case 6: return -power(2, -10 * arg0) + 1; case 7: arg0--; return sqrt(1 - (arg0 * arg0)); default: arg0--; if (arg1 == 4) { return -1 * (power(arg0, arg1) - 1); break; } return power(arg0, arg1) + 1; } }
(timer / _lifeD, 2);
17
    sprite_index = spr_gradient_ring;
18
    image_xscale = (_t * 0.8) + 0.2;
19
    image_yscale = (_t * 0.8) + 0.2;
20
    image_blend = c_black;
21
    image_alpha = 1 - _t;
22
    speed = 0;
23
    if (timer >= _lifeD)
24
        instance_destroy();
25
    exit;
26
}
27
if (!init)
28
{
29
    init = true;
30
    start_distance = distance_to_point(targetx, targety);
31
}
32
if (sprite_index == spr_sneo_bigcircle)
33
{
34
    image_blend = c_black;
35
    image_xscale = distance_to_point(targetx, targety) / 400;
36
    image_yscale = distance_to_point(targetx, targety) / 400;
37
    if (strongerheal)
38
    {
39
        image_xscale = distance_to_point(targetx, targety) / 350;
40
        image_yscale = distance_to_point(targetx, targety) / 350;
41
    }
42
}
43
else
44
{
45
    var _progress = clamp01((start_distance - distance_to_point(targetx, targety)) / start_distance);
46
    image_index = _progress * image_number;
47
    image_xscale = (1 - _progress) + 1;
48
    image_yscale = (1 - _progress) + 1;
49
    if (strongerheal)
50
    {
51
        image_xscale = (1 - _progress) + 1;
52
        image_yscale = (1 - _progress) + 1;
53
        image_index = _progress * image_number;
54
    }
55
}
56
if (con == 0)
57
{
58
    if (image_alpha < 1)
59
        image_alpha += 0.1;
60
}
61
if (con == 1)
62
{
63
    if (image_alpha > 0)
64
        image_alpha -= 0.2;
65
    else
66
        instance_destroy();
67
}