Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_ow_viroring_Step_0

(view raw script w/o annotations or w/e)
1
with (obj_ow_viroringTrig)
2
{
3
    if (trigNum == other.trigNum)
4
    {
5
        if (place_meeting(x, y, obj_mainchara))
6
            other.active = true;
7
        else
8
            other.active = false;
9
    }
10
}
11
if (con == 0)
12
{
13
    if (active == true)
14
    {
15
        timer = 0;
16
        con = 1;
17
    }
18
}
19
if (con == 1)
20
{
21
    if ((startingX + (abs(sprite_width) / 2)) < charaX())
22
    {
23
        image_xscale = -2;
24
        x = startingX - sprite_width;
25
    }
26
    else
27
    {
28
        image_xscale = 2;
29
        x = startingX;
30
    }
31
    if (active == true)
32
        cooldown = cooldownAmount;
33
    if (active == false)
34
        cooldown -= 1;
35
    if (cooldown == 0)
36
        con = 0;
37
    timer++;
38
    if (timer == shotSpeed)
39
    {
40
        if (
scr_onscreen
scr_onscreen

function
scr_onscreen(arg0)
{ obj = arg0; spacer = 0; if ((obj.x + obj.sprite_width + spacer) < camerax() || (obj.x - spacer) > (camerax() + 640) || (obj.y + obj.sprite_height + spacer) < cameray() || (obj.y - spacer) > (cameray() + 480)) return false; else return true; }
(id))
41
        {
42
            snd_play_pitch(snd_heartshot_dr_b, 0.6);
43
            spear = instance_create(x + (sprite_width / 2), y + 65, obj_virospear);
44
            spear.depth = depth - 20;
45
            shotSpeed = irandom(20) + 20;
46
        }
47
        timer = 0;
48
    }
49
}
50
if (con == 99)
51
{
52
    direction = point_direction(x, y, obj_mainchara.x, obj_mainchara.y) + 180;
53
    speed = 8;
54
    x += sin(timer / 4);
55
    if (!
scr_onscreen
scr_onscreen

function
scr_onscreen(arg0)
{ obj = arg0; spacer = 0; if ((obj.x + obj.sprite_width + spacer) < camerax() || (obj.x - spacer) > (camerax() + 640) || (obj.y + obj.sprite_height + spacer) < cameray() || (obj.y - spacer) > (cameray() + 480)) return false; else return true; }
(id))
56
        instance_destroy();
57
}