Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_swatchling_platter_old_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    
scr_bullet_inherit
scr_bullet_inherit

function
scr_bullet_inherit(arg0)
{ if (i_ex(arg0)) { if (damage != -1) arg0.damage = damage; if (grazepoints != -1) arg0.grazepoints = grazepoints; if (timepoints != -1) arg0.timepoints = timepoints; if (inv != -1) arg0.inv = inv; if (target != -1) arg0.target = target; if (grazed != -1) arg0.grazed = 0; if (grazetimer != -1) arg0.grazetimer = 0; arg0.element = element; } }
(platterLid);
4
    
scr_bullet_inherit
scr_bullet_inherit

function
scr_bullet_inherit(arg0)
{ if (i_ex(arg0)) { if (damage != -1) arg0.damage = damage; if (grazepoints != -1) arg0.grazepoints = grazepoints; if (timepoints != -1) arg0.timepoints = timepoints; if (inv != -1) arg0.inv = inv; if (target != -1) arg0.target = target; if (grazed != -1) arg0.grazed = 0; if (grazetimer != -1) arg0.grazetimer = 0; arg0.element = element; } }
(platterPlate);
5
    targetColor = startColor;
6
    platterPlate.image_blend = startColor;
7
    platterLid.image_blend = startColor;
8
    init = 1;
9
}
10
if (hasCandy == 1)
11
{
12
    d = instance_create(x, y - 20, obj_swatchling_candy);
13
    d.sourcePlatter = self;
14
    d.target = target;
15
    hasCandy = 0;
16
}
17
if (swatchbc.red_count > swatchbc.blue_count && lidOff)
18
{
19
    if (lidOff)
20
    {
21
        platterLid.y += lidSpeed;
22
        lidSpeed += 0.685;
23
        if (platterLid.y >= ystart)
24
        {
25
            lidOff = false;
26
            platterLid.y = y;
27
            timer = -20;
28
        }
29
    }
30
    platterPlate.y = y;
31
}
32
else if (!lidOff)
33
{
34
    if (timer >= 0)
35
    {
36
        if (!opened)
37
            opened = true;
38
        lidLerp = 1 - (abs(timer - 20) / 20);
39
        lidOffset = -1 * lidLerp * (lidLerp - 2);
40
        platterPlate.y = y + (lidOffset * 10);
41
        platterLid.y = y - (lidOffset * 60);
42
    }
43
    else if (timer < -10 && opened)
44
    {
45
        lidLerp = 1 - (abs(timer + 15) / 5);
46
        lidOffset = -1 * lidLerp * (lidLerp - 2);
47
        platterPlate.y = y + (lidOffset * 20);
48
        platterLid.y = y + (lidOffset * 20);
49
    }
50
    else
51
    {
52
        platterPlate.y = y;
53
        platterLid.y = y;
54
    }
55
}
56
platterPlate.x = x;
57
platterLid.x = x;
58
if ((swatchbc.red_count <= swatchbc.blue_count || timer < -1) && (swatchbc.blue_count == 0 || timer != -1))
59
    timer++;
60
if (timer >= 40)
61
    timer = -20;