Deltarune script viewer

← back to main script listing

gml_Object_obj_sneo_phonehand_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    if (i_ex(boss))
4
    {
5
        if (orientation == "top")
6
        {
7
            jointx = boss.x - 10;
8
            jointy = y - 30;
9
        }
10
        if (orientation == "bottom")
11
        {
12
            image_yscale = -1;
13
            jointx = boss.x - 10;
14
            jointy = y + 30;
15
        }
16
        remjointy = jointy;
17
        init = 1;
18
    }
19
}
20
if (btimer == 13)
21
{
22
    if (image_yscale > 0)
23
        image_yscale = 2;
24
    if (image_yscale < 0)
25
        image_yscale = -2;
26
}
27
if (image_yscale > 1)
28
    image_yscale -= 0.2;
29
if (image_yscale < -1)
30
    image_yscale += 0.2;
31
movingcheck = 0;
32
if (alt == 0)
33
{
34
    crawlsiner++;
35
    if (orientation == "top")
36
    {
37
        if (sin(crawlsiner / period) < 0)
38
        {
39
            wasmoving = 1;
40
            movingcheck = 1;
41
            y += (cos(crawlsiner / period) * amplitude * 2);
42
            x += (sin(crawlsiner / period) * amplitude);
43
        }
44
    }
45
    if (orientation == "bottom")
46
    {
47
        if (cos((crawlsiner / period) + 1.5707963267948966) < 0)
48
        {
49
            wasmoving = 1;
50
            movingcheck = 1;
51
            y += (sin((crawlsiner / period) + 1.5707963267948966) * amplitude * 2);
52
            x += (cos((crawlsiner / period) + 1.5707963267948966) * amplitude);
53
        }
54
    }
55
    if (i_ex(boss))
56
    {
57
        jointx = (x + boss.x) / 2;
58
        jointy = (remjointy + y) / 2;
59
    }
60
}
61
if (alt == 1 && i_ex(boss))
62
{
63
    if (orientation == "top")
64
        crawlsiner++;
65
    else
66
        crawlsiner--;
67
    xx = camerax() + 200;
68
    endx = boss.x - 20;
69
    x = xx + ((endx - xx) / 2) + (sin(crawlsiner / 12) * ((endx - xx) / 2));
70
    btimer++;
71
    threshold = 18;
72
    if (orientation == "top")
73
        threshold = 28;
74
    if (btimer >= threshold)
75
    {
76
        shot = instance_create(x, y, obj_basicbullet_sneo);
77
        if (orientation == "top")
78
            shot.direction = 270 + random_range(-2, 2);
79
        if (orientation == "bottom")
80
            shot.direction = 90 + random_range(-2, 2);
81
        shot.speed = 3;
82
        shot.sprite_index = spr_sneo_soundbullet;
83
        shot.image_angle = shot.direction;
84
        shot.grazepoints = 3;
85
        shot.target = target;
86
        btimer = 0;
87
        if (orientation == "top")
88
            btimer = 10;
89
        else
90
            btimer = 0;
91
    }
92
    if (i_ex(boss))
93
    {
94
        jointx = (x + boss.x) / 2;
95
        jointy = (remjointy + y) / 2;
96
    }
97
}
98
if (difficulty == 99)
99
{
100
    if (movingcheck == 0 && wasmoving == 1)
101
    {
102
        wasmoving = 0;
103
        repeat (3)
104
        {
105
            shot = instance_create(x, y, obj_basicbullet_sneo);
106
            if (orientation == "top")
107
                shot.direction = 270 + random_range(-10, 10);
108
            if (orientation == "bottom")
109
                shot.direction = 90 + random_range(-10, 10);
110
            shot.speed = 8;
111
            shot.sprite_index = spr_sneo_soundbullet;
112
            shot.image_angle = shot.direction;
113
            shot.target = target;
114
            shot.grazepoints = 3;
115
        }
116
    }
117
}
118
if (difficulty == 99)
119
{
120
    if (btimer >= 6)
121
    {
122
        shot = instance_create(x, y, obj_basicbullet_sneo);
123
        if (orientation == "top")
124
            shot.direction = 270 + random_range(-4, 4);
125
        if (orientation == "bottom")
126
            shot.direction = 90 + random_range(-4, 4);
127
        shot.speed = 4;
128
        shot.sprite_index = spr_sneo_soundbullet;
129
        shot.image_angle = shot.direction;
130
        shot.target = target;
131
        shot.grazepoints = 3;
132
        btimer = 0;
133
    }
134
}