Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_centerscythe_Step_0

(view raw script w/o annotations or w/e)
1
if (chasecon == 1)
2
{
3
    image_alpha += 0.04;
4
    if (image_alpha >= 1)
5
    {
6
        image_alpha = 1;
7
        chasecon = 2;
8
        active = 1;
9
    }
10
}
11
if (chasecon == 2)
12
{
13
    if (un == 0)
14
    {
15
        if (rotspeed <= 10)
16
            rotspeed += 1;
17
    }
18
    if (un == 1)
19
    {
20
        if (rotspeed >= -10)
21
            rotspeed -= 1;
22
    }
23
    sine += sinespeed;
24
    dir += dirspeed;
25
    if (insanity == 1)
26
    {
27
        if (dirspeed > 0 && dirspeed < 3)
28
            dirspeed += 0.01;
29
        if (dirspeed < 0 && dirspeed > -3)
30
            dirspeed -= 0.01;
31
    }
32
    length = cos(sine / 18) * radius;
33
    x = centerx - lengthdir_x(length, dir);
34
    y = centery - lengthdir_y(length, dir);
35
    if (king == 1)
36
    {
37
        noisebuffer -= 1;
38
        if (abs(length) <= 8 && noisebuffer < 0)
39
        {
40
            snd_play(snd_swing);
41
            noisebuffer = 10;
42
        }
43
    }
44
}
45
if (king == 1)
46
{
47
    if (type == 1)
48
    {
49
        scythetimer += 1;
50
        if (scythetimer == 60)
51
        {
52
            snd_play(snd_spearappear);
53
            sbul = instance_create(centerx + (radius * scythesidex), centery + (60 * scythesidex), obj_collidebullet);
54
            sbul.image_xscale = 2;
55
            sbul.image_yscale = 2;
56
            sbul.image_alpha = 0;
57
            sbul.sprite_index = spr_joker_scythebody;
58
            sbul.mask_index = spr_joker_scythebody_mask;
59
            sbul.image_blend = c_red;
60
            sbul.active = 1;
61
            scr_bullet_inherit
scr_bullet_inherit

function scr_bullet_inherit(arg0) { if (instance_exists(arg0)) { arg0.damage = damage; arg0.grazepoints = grazepoints; arg0.timepoints = timepoints; arg0.inv = inv; arg0.target = target; arg0.grazed = 0; arg0.grazetimer = 0; } }
(sbul);
62
        }
63
        if (scythetimer >= 60 && scythetimer < 70)
64
        {
65
            sbul.image_angle += 10 * scythesidex;
66
            sbul.image_alpha += 0.1;
67
        }
68
        if (scythetimer >= 85 && scythetimer < 90)
69
        {
70
            if (instance_exists(sbul))
71
                sbul.hspeed -= 3 * scythesidex;
72
        }
73
        if (scythetimer >= 100 && scythetimer < 105)
74
        {
75
            with (sbul)
76
                image_alpha -= 0.2;
77
        }
78
        if (scythetimer >= 105)
79
        {
80
            with (sbul)
81
                instance_destroy();
82
            if (scythesidex == -1)
83
                scythesidex = 1;
84
            else
85
                scythesidex = -1;
86
            scythetimer = 59;
87
        }
88
    }
89
}
90
image_angle += rotspeed;
91
if (grazed == 1)
92
{
93
    grazetimer += 1;
94
    if (grazetimer >= 30)
95
    {
96
        grazed = 0;
97
        grazetimer = 0;
98
    }
99
}