Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_bullet_dice_Other_10

(view raw script w/o annotations or w/e)
1
image_index = floor(image_index);
2
var pips = image_index / 4;
3
if (sprite_index == spr_bullet_dice_all4s)
4
    pips = 3;
5
if (pips == 0)
6
{
7
    bullet = 
scr_fire_bullet
scr_fire_bullet

function
scr_fire_bullet(arg0, arg1, arg2, arg3, arg4, arg5 = -4, arg6 = 0, arg7 = false, arg8 = 87135)
{ var bullet; if (arg8 != 87135) bullet = instance_create_depth(arg0, arg1, arg8, arg2); else bullet = instance_create(arg0, arg1, arg2); with (bullet) { direction = arg3; speed = arg4; if (arg5 != -4) sprite_index = arg5; updateimageangle = arg6; if (arg6) image_angle = arg3; if (arg7) { with (other)
scr_bullet_inherit(other.id);
} } return bullet; } function scr_fire_bullet_colorize(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 = 0) { var bullet = instance_create(arg0, arg1, arg2); with (bullet) { direction = arg3; speed = arg4; sprite_index = arg5; image_blend = arg6; updateimageangle = arg7; if (arg7) image_angle = arg3; } return bullet; }
(x, y, obj_regularbullet,
scr_at_player
scr_at_player

function
scr_at_player(arg0 = x, arg1 = y)
{ return point_direction(arg0, arg1, obj_heart.x + (obj_heart.sprite_width / 2), obj_heart.y + (obj_heart.sprite_height / 2)); }
(x, y), 4, spr_smallbullet, false, id);
8
    bullet.target = target;
9
    bullet.damage = 40;
10
    bullet.grazepoints = 4;
11
    snd_stop(snd_gunshot_b);
12
    snd_play_x(snd_gunshot_b, 0.8, 1.3);
13
}
14
else
15
{
16
    snd_stop(snd_bomb);
17
    snd_play(snd_bomb);
18
    var basedir = 180 - (45 * pips);
19
    var rotate = 180 / (1 + ((pips - 1) / 2));
20
    for (var dir = basedir; dir < 360; dir += rotate)
21
    {
22
        if (image_index == 4 && sprite_index == spr_bullet_dice4pip)
23
        {
24
            if (dir == 135)
25
                dir += 12;
26
            if (dir == 333)
27
                dir -= 12;
28
        }
29
        if ((image_index == 12 && sprite_index == spr_bullet_dice4pip) || sprite_index == spr_bullet_dice_all4s)
30
        {
31
        }
32
        var dox = x + lengthdir_x(20, dir + image_angle);
33
        var doy = y + lengthdir_y(20, dir + image_angle);
34
        bullet = instance_create(dox, doy, obj_bullet_dice_shockwave);
35
        bullet.target = target;
36
        bullet.damage = 40;
37
        bullet.grazepoints = 4;
38
        bullet.direction = dir + image_angle;
39
        if (pips >= 3 || (sprite_index == spr_bullet_dice && image_index >= 8) || (sprite_index == spr_bullet_dice4pip && image_index >= 8))
40
        {
41
            bullet.image_xscale = 2;
42
            bullet.image_yscale = 2;
43
        }
44
    }
45
}
46
instance_destroy();