Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_sneo_phonehand_master_Step_0

(view raw script w/o annotations or w/e)
1
siner++;
2
bluesiner++;
3
image_blend = merge_color(#00A2E8, c_aqua, 0.25 + (sin(bluesiner / 3) * 0.25));
4
if (x >= (camerax() + 480))
5
    x = camerax() + 480;
6
if (grazed == 1)
7
{
8
    grazetimer += 1;
9
    if (grazetimer >= 3)
10
    {
11
        grazetimer = 0;
12
        grazed = 0;
13
    }
14
}
15
if (instance_exists(obj_heart))
16
{
17
    if (obj_heart.x > (obj_sneo_phonehand_master.x - 36))
18
        obj_heart.x = obj_sneo_phonehand_master.x - 36;
19
}
20
if (init == 0)
21
{
22
    if (difficulty == 2)
23
    {
24
        with (obj_sneo_phonehand)
25
            alt = 1;
26
    }
27
    phonehand_top.target = target;
28
    phonehand_bottom.target = target;
29
    init = 1;
30
}
31
if (difficulty == 0)
32
    y = ystart + (sin(siner / 8) * 40);
33
if (difficulty == 1 || difficulty == 2)
34
    y = ystart + (sin(siner / 10) * 60);
35
if (i_ex(phonehand_top))
36
{
37
    if (difficulty < 2)
38
        x = lerp(x, phonehand_top.x + xdist, 0.2);
39
    else
40
        x -= 1;
41
}
42
if (difficulty == 0 || difficulty == 1 || difficulty == 2)
43
{
44
    btimer++;
45
    threshold = 20;
46
    if (difficulty == 1)
47
        threshold = 15;
48
    if (difficulty == 2)
49
        threshold = 30;
50
    if (btimer >= threshold && image_alpha >= 1)
51
    {
52
        btimer = 0;
53
        if (difficulty < 2)
54
            shot = instance_create(x, y, obj_sneo_mmx_spreadshot);
55
        else
56
            shot = instance_create(x, y, obj_basicbullet_sneo);
57
        shot.speed = 12;
58
        shot.image_xscale = 3;
59
        shot.image_yscale = 3;
60
        if (difficulty < 2)
61
            shot.friction = 1;
62
        else
63
            shot.speed = 10;
64
        shot.alarm[0] = 25;
65
        shot.direction = 180 + random_range(-5, 5);
66
        shot.depth = depth - 1;
67
        shot.target = target;
68
        sprite_index = spr_sneo_head_open;
69
        alarm[0]
 = 10;
gml_Object_obj_sneo_phonehand_master_Alarm_0.gml

sprite_index = spr_sneo_head;
70
    }
71
}