Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shadowman_sharpshoot_target_Step_2

(view raw script w/o annotations or w/e)
1
if (hittable == 0)
2
{
3
    image_angle -= 4;
4
    exit;
5
}
6
if (type == 0 || type == 1)
7
{
8
    x = parentid.x;
9
    y = parentid.y;
10
    image_index = parentid.image_index + 0.25;
11
}
12
if (type == 2)
13
{
14
    sinerx += sinerrate;
15
    sinery += sinerrate;
16
    hspeed = sin(sinerx / 12) * 2;
17
    vspeed = cos(sinerx / 12) * 2;
18
    y += (parentid.y - parentid.yprevious);
19
}
20
if (type == 3)
21
{
22
    sinerx++;
23
    if (sinerx == 1)
24
    {
25
        x = obj_tenna_board4_enemy.tenna_actor.x + 20;
26
        y = obj_tenna_board4_enemy.tenna_actor.y - 186;
27
    }
28
}
29
if (type == 4)
30
{
31
    if (i_ex(obj_actor_tenna))
32
    {
33
        var lightemuptimer = obj_actor_tenna.lightemuptimer;
34
        var lightemupcon = obj_actor_tenna.lightemupcon;
35
        if (lightemupcon == 0 || lightemupcon == 1 || lightemupcon == 2)
36
        {
37
            mask_index = spr_tenna_battle_face;
38
            x = obj_actor_tenna.x;
39
            y = obj_actor_tenna.y;
40
        }
41
        if (lightemupcon == 3 && lightemuptimer < 20)
42
        {
43
            mask_index = spr_tenna_attack_hitbox;
44
            x = obj_actor_tenna.x - 4;
45
            y = obj_actor_tenna.y + 30;
46
        }
47
        if (lightemupcon == 3 && lightemuptimer >= 20)
48
        {
49
            mask_index = spr_tenna_attack_hitbox2;
50
            x = obj_actor_tenna.x - 4;
51
            y = obj_actor_tenna.y + 30;
52
        }
53
        if (lightemupcon == 4)
54
        {
55
            mask_index = spr_tenna_grasp_hitbox;
56
            x = obj_actor_tenna.x;
57
            y = obj_actor_tenna.y;
58
        }
59
        sprite_index = mask_index;
60
    }
61
}
62
if (type == 5)
63
{
64
    bullet_timer++;
65
    var hardmode = 0;
66
    if (obj_tenna_enemy.alreadydidsharpshoot)
67
        hardmode = 1;
68
    x = camerax() + 700;
69
    mask_index = spr_nothing;
70
    if (init == 0 && i_ex(obj_tenna_zoom) && obj_tenna_zoom.minigameinsanity == true)
71
    {
72
        init = 1;
73
        if (obj_tenna_zoom.minigameinsanitytimermax <= 40)
74
        {
75
            var _ra = choose(-80, 80);
76
            if (i_ex(obj_lightemup_controller))
77
            {
78
                if (_ra == -80)
79
                    obj_lightemup_controller.extravar = -1;
80
                if (_ra == 80)
81
                    obj_lightemup_controller.extravar = 7;
82
            }
83
            bul = instance_create(x - 100, cameray() + 180 + _ra, obj_tenna_lightemup_bullet);
84
            bul.mysprite = 1561;
85
            bul.hspeed = -15;
86
            bul.friction = -0.1;
87
            bul.image_xscale = 1;
88
            bul.image_yscale = 1;
89
            bul.auto = 1;
90
            bul.hp = 2;
91
        }
92
        else
93
        {
94
            repeat (2)
95
            {
96
                bul = instance_create((x - 140) + irandom(50) + 70, cameray() + 180 + random_range(-80, 80), obj_tenna_lightemup_bullet);
97
                bul.mysprite = 1561;
98
                bul.hspeed = -8;
99
                bul.friction = -0.1;
100
                bul.vspeed = choose(-4, -6, -8);
101
                bul.auto = 1;
102
                bul.bounce = 1;
103
                bul.image_xscale = 1.5;
104
                bul.image_yscale = 1.5;
105
                bul.hp = 3;
106
            }
107
        }
108
    }
109
    if (bullet_timer == 20)
110
    {
111
        y = cameray() + 180 + random_range(-100, 60);
112
        vspeed = random_range(-3, 3);
113
        if (hardmode)
114
            myspeed = random_range(-10, -4);
115
        else
116
            myspeed = random_range(-8, -2);
117
        rem1 = choose(3, 4, 6, 8);
118
        if (hardmode == 0)
119
            reml = choose(4, 6, 8);
120
    }
121
    if (i_ex(obj_tenna_zoom) && obj_tenna_zoom.minigameinsanity == true)
122
    {
123
    }
124
    else if (bullet_timer >= 20)
125
    {
126
        if ((bullet_timer % rem1) == 0)
127
        {
128
            bul = instance_create(x, y, obj_tenna_lightemup_bullet);
129
            bul.mysprite = 1561;
130
            bul.hspeed = myspeed;
131
            bul.friction = -0.1;
132
            bul.image_xscale = 1;
133
            bul.image_yscale = 1;
134
            bul.auto = 1;
135
            bul.hp = 2;
136
            if (rem1 == 8)
137
            {
138
                bul.vspeed = choose(-4, -6, -8);
139
                bul.hspeed += 1;
140
                bul.bounce = 1;
141
                bul.image_xscale = 1.5;
142
                bul.image_yscale = 1.5;
143
                bul.hp = 4;
144
            }
145
            if (firstbullet == 0 && obj_tenna_enemy.alreadydidsharpshoot == false)
146
            {
147
                bul.firstbullet = 1;
148
                bul.friction = 0.1;
149
                bul.hspeed = -8;
150
                bul.x = camerax() + camerawidth() + 40;
151
                bul.y = cameray() + 160;
152
                firstbullet++;
153
            }
154
            if (bullet_timer >= 28)
155
                bullet_timer = floor(random(8)) + 4;
156
        }
157
    }
158
}
159
if (type == 6)
160
{
161
    x = parentid.x;
162
    y = parentid.y;
163
    image_index += 0.25;
164
    image_speed = 0;
165
    depth = parentid.depth;
166
    mask_index = spr_zapper_sharpshoot2;
167
    if (sprite_index == spr_zapper_spare_sharpshoot)
168
        mask_index = spr_zapper_spare_sharpshoot;
169
    if ((global.mercymod[parentid.myself] + parentid.sharpshootmercy) >= 100 && spare == false)
170
        mask_index = spr_nothing;
171
    if (changecolorcon == 1)
172
    {
173
        colortarget2 = make_color_hsv(irandom(255), 250, 255);
174
        if (changecolorcount == 5)
175
            colortarget2 = 16777215;
176
        changecolorcon = 2;
177
    }
178
    if (changecolorcon == 2)
179
    {
180
        changecolortimer++;
181
        buttonblend = merge_color(colortarget, colortarget2, changecolortimer / 3);
182
        if (changecolortimer == 3)
183
        {
184
            colortarget = colortarget2;
185
            changecolorcount++;
186
            changecolorcon = 1;
187
            changecolortimer = 0;
188
        }
189
    }
190
    if (changecolorcount == 5)
191
    {
192
        buttonblend = 16777215;
193
        changecolorcon = 0;
194
        changecolorcount = 0;
195
        changecolortimer = 0;
196
    }
197
}
198
if (type == 7)
199
{
200
    x = parentid.x;
201
    y = parentid.y;
202
    image_speed = 0;
203
    depth = parentid.depth;
204
    mask_index = spr_pippins_sharpshoot;
205
    if ((global.mercymod[parentid.myself] + parentid.sharpshootmercy) >= 100 && spare == false)
206
        mask_index = spr_nothing;
207
    if (sprite_index == spr_pippins_sharpshoot2)
208
    {
209
        image_index += 0.5;
210
        if (image_index >= 5)
211
        {
212
            image_index = 0;
213
            sprite_index = spr_pippins_sharpshoot;
214
        }
215
    }
216
}
217
if (type == 8)
218
{
219
    x = parentid.x;
220
    y = parentid.y;
221
    image_speed = 0;
222
    depth = parentid.depth;
223
    mask_index = spr_shutta_sharpshoot2;
224
    image_index += 0.16666666666666666;
225
    if (image_index >= 5)
226
        image_index = 0;
227
    if ((global.mercymod[parentid.myself] + parentid.sharpshootmercy) >= 100 && spare == false)
228
        mask_index = spr_nothing;
229
}