Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shadowman_sharpshoot_cursor_Step_0

(view raw script w/o annotations or w/e)
1
if (up_h())
2
    y -= 12;
3
if (down_h())
4
    y += 12;
5
if (right_h())
6
    x += 12;
7
if (left_h())
8
    x -= 12;
9
if (y < cameray())
10
    y = cameray();
11
if (y > (cameray() + 300))
12
    y = cameray() + 300;
13
if (x < (camerax() + 320))
14
    x = camerax() + 320;
15
if (x > (camerax() + 600))
16
    x = camerax() + 600;
17
if (con == 0)
18
{
19
    var timermax = 12;
20
    timer++;
21
    image_alpha = lerp(0, 1, timer / timermax);
22
    image_xscale = lerp(image_xscale, 1, timer / timermax);
23
    image_yscale = lerp(image_yscale, 1, timer / timermax);
24
    image_angle = lerp(image_angle, 394, 0.08);
25
    var xx = lerp(300, 0, timer / timermax);
26
    x = lerp(xstart, xstart + 280 + xx, timer / timermax);
27
    if (timer >= timermax)
28
    {
29
        image_angle = 360;
30
        timer = 0;
31
        con = 1;
32
        savey = y;
33
    }
34
}
35
if (con == 1)
36
{
37
    shoottimer++;
38
    if (button3_h() == 1 && shoottimer > 0 && ammo > 0 && stopshooting == false)
39
    {
40
        shoottimer = -3;
41
        instance_create(obj_herokris.x + 27 + 34, obj_herokris.y + 33 + 12, obj_shadowman_sharpshoot_heart);
42
        ammo -= 1;
43
        if (i_ex(obj_herosusie))
44
        {
45
            instance_create(obj_herosusie.x + 27 + 49, obj_herosusie.y + 42, obj_shadowman_sharpshoot_heart);
46
            ammo -= 1;
47
        }
48
        if (i_ex(obj_heroralsei))
49
        {
50
            instance_create(obj_heroralsei.x + 47 + 32, (obj_heroralsei.y + 50) - 3, obj_shadowman_sharpshoot_heart);
51
            ammo -= 1;
52
        }
53
        snd_play_x(snd_noise, 0.8, 1.2);
54
    }
55
    if (ammo < 1 || !i_ex(obj_shadowman_sharpshoot_target))
56
    {
57
        ammo = 0;
58
        image_alpha -= 0.1;
59
        if (image_alpha <= 0)
60
            instance_destroy();
61
    }
62
}